From 88a15defc17acd4c6146bc6276e3ec7884d74afa Mon Sep 17 00:00:00 2001 From: 0auBSQ <58159635+0auBSQ@users.noreply.github.com> Date: Fri, 26 Jul 2024 01:07:31 +0900 Subject: [PATCH] Squashed commit of the following: commit c99443a7d3692106e54d427c50a9c631cf743be0 Author: Ashiro12138 Date: Fri Jul 26 01:29:15 2024 +1000 Chore/add editor config (#656) * Create .editorconfig * format ENTIRE project * Remove unnecessary import or usings Sort Imports or usings Apply file header preferences * Fix build error by adding import --- .editorconfig | 189 + FDK/src/00.Common/CActivity.cs | 77 +- FDK/src/00.Common/CConversion.cs | 302 +- FDK/src/00.Common/CCounter.cs | 512 +- FDK/src/00.Common/CFPS.cs | 34 +- FDK/src/00.Common/CIniFile.cs | 111 +- FDK/src/00.Common/CIntervalProcessing.cs | 29 +- FDK/src/00.Common/CJudgeTextEncoding.cs | 32 +- FDK/src/00.Common/CTimer.cs | 52 +- FDK/src/00.Common/CTimerBase.cs | 153 +- FDK/src/00.Common/CTraceLogListener.cs | 150 +- FDK/src/00.Common/CUtility.cs | 146 +- FDK/src/00.Common/Color4.cs | 48 +- .../ExtensionMethods/DoubleExtensions.cs | 19 +- .../ExtensionMethods/Int32Extensions.cs | 17 +- FDK/src/01.Framework/Core/Game.cs | 700 +- FDK/src/01.Framework/Core/GameWindowSize.cs | 8 +- .../Rendering/Angle/AngleContext.cs | 243 +- FDK/src/01.Framework/Rendering/Angle/Egl.cs | 657 +- FDK/src/01.Framework/Rendering/BlendHelper.cs | 68 +- .../01.Framework/Rendering/ImGUIManager.cs | 31 +- .../01.Framework/Rendering/ShaderHelper.cs | 76 +- FDK/src/02.Input/CInputGamepad.cs | 111 +- FDK/src/02.Input/CInputJoystick.cs | 121 +- FDK/src/02.Input/CInputKeyboard.cs | 89 +- FDK/src/02.Input/CInputMIDI.cs | 47 +- FDK/src/02.Input/CInputManager.cs | 168 +- FDK/src/02.Input/CInputMouse.cs | 98 +- FDK/src/02.Input/DeviceConstantConverter.cs | 14 +- FDK/src/02.Input/IInputDevice.cs | 44 +- FDK/src/02.Input/InputDeviceType.cs | 10 +- FDK/src/02.Input/STInputEvent.cs | 13 +- FDK/src/02.Input/SlimDXKeys.cs | 17 +- FDK/src/03.Sound/CSound.cs | 866 +- FDK/src/03.Sound/CSoundDeviceASIO.cs | 281 +- FDK/src/03.Sound/CSoundDeviceBASS.cs | 108 +- FDK/src/03.Sound/CSoundDeviceWASAPI.cs | 268 +- FDK/src/03.Sound/CSoundTimer.cs | 87 +- FDK/src/03.Sound/ESoundDeviceType.cs | 10 +- FDK/src/03.Sound/ESoundGroup.cs | 18 +- .../ExtensionMethods/BassMixExtensions.cs | 36 +- FDK/src/03.Sound/ISoundDevice.cs | 15 +- FDK/src/03.Sound/LoudnessMetadata.cs | 37 +- FDK/src/03.Sound/LoudnessMetadataScanner.cs | 543 +- FDK/src/03.Sound/Lufs.cs | 68 +- FDK/src/03.Sound/SongGainController.cs | 52 +- FDK/src/03.Sound/SoundGroupLevelController.cs | 201 +- FDK/src/03.Sound/SoundManager.cs | 217 +- FDK/src/04.Graphics/BitmapUtil.cs | 50 +- FDK/src/04.Graphics/CDecodedFrame.cs | 39 +- FDK/src/04.Graphics/CFrameConverter.cs | 118 +- FDK/src/04.Graphics/CTexture.cs | 2 +- FDK/src/04.Graphics/CTextureAutofold.cs | 138 +- .../CTextureCreateFailedException.cs | 29 +- FDK/src/04.Graphics/CVideoDecoder.cs | 169 +- .../TextRenderer/CCachedFontRenderer.cs | 135 +- .../04.Graphics/TextRenderer/CFontRenderer.cs | 159 +- .../TextRenderer/CSkiaSharpTextRenderer.cs | 523 +- .../04.Graphics/TextRenderer/ITextRenderer.cs | 13 +- FDK/src/06.Tempo/CBeatDetect.cs | 2 +- OpenTaiko/src/Animations/Animator.cs | 199 +- OpenTaiko/src/Animations/EaseIn.cs | 61 +- OpenTaiko/src/Animations/EaseInOut.cs | 74 +- OpenTaiko/src/Animations/EaseOut.cs | 63 +- OpenTaiko/src/Animations/FadeIn.cs | 53 +- OpenTaiko/src/Animations/FadeOut.cs | 53 +- OpenTaiko/src/Animations/IAnimatable.cs | 61 +- OpenTaiko/src/Animations/Linear.cs | 61 +- OpenTaiko/src/Character/CMenuCharacter.cs | 571 +- OpenTaiko/src/Character/CResultCharacter.cs | 461 +- OpenTaiko/src/Character/PuchiChara.cs | 183 +- OpenTaiko/src/Common/BestPlayRecords.cs | 385 +- OpenTaiko/src/Common/CConfigIni.cs | 3585 ++- OpenTaiko/src/Common/CCrypto.cs | 47 +- OpenTaiko/src/Common/CDTXVersion.cs | 141 +- OpenTaiko/src/Common/CHitSounds.cs | 100 +- OpenTaiko/src/Common/CPad.cs | 178 +- OpenTaiko/src/Common/CSavableT.cs | 56 +- OpenTaiko/src/Common/CSkin.cs | 19947 +++++++--------- OpenTaiko/src/Common/CSongDict.cs | 576 +- OpenTaiko/src/Common/CTextConsole.cs | 88 +- OpenTaiko/src/Common/CVersionList.cs | 66 +- .../ConfigIniToSongGainControllerBinder.cs | 65 +- ...figIniToSoundGroupLevelControllerBinder.cs | 118 +- OpenTaiko/src/Common/ConfigManager.cs | 98 +- OpenTaiko/src/Common/C定数.cs | 482 +- OpenTaiko/src/Common/Easing.cs | 380 +- OpenTaiko/src/Common/Favorites.cs | 79 +- .../KeyboardSoundGroupLevelControlHandler.cs | 94 +- OpenTaiko/src/Common/LogNotification.cs | 95 +- OpenTaiko/src/Common/Modal.cs | 434 +- OpenTaiko/src/Common/ModalQueue.cs | 130 +- OpenTaiko/src/Common/NamePlateConfig.cs | 332 +- OpenTaiko/src/Common/Program.cs | 134 +- OpenTaiko/src/Common/RecentlyPlayedSongs.cs | 72 +- OpenTaiko/src/Common/SaveFile.cs | 634 +- OpenTaiko/src/Common/TJAPlayer3.cs | 4346 ++-- OpenTaiko/src/Components/CGimmickValue.cs | 14 +- OpenTaiko/src/Components/CLocalizationData.cs | 52 +- OpenTaiko/src/Components/CSongReplay.cs | 718 +- OpenTaiko/src/Components/CVisualLogManager.cs | 90 +- OpenTaiko/src/Databases/DBCDN.cs | 102 +- OpenTaiko/src/Databases/DBCharacter.cs | 158 +- .../src/Databases/DBEncyclopediaMenus.cs | 42 +- .../src/Databases/DBNameplateUnlockables.cs | 157 +- OpenTaiko/src/Databases/DBPuchichara.cs | 151 +- OpenTaiko/src/Databases/DBSaves.cs | 644 +- OpenTaiko/src/Databases/DBSkinPreset.cs | 95 +- OpenTaiko/src/Databases/DBSongUnlockables.cs | 199 +- OpenTaiko/src/Databases/DBUnlockables.cs | 912 +- OpenTaiko/src/Databases/Databases.cs | 34 +- OpenTaiko/src/Helpers/HDatabaseHelpers.cs | 48 +- OpenTaiko/src/Helpers/HEasingMethods.cs | 250 +- OpenTaiko/src/Helpers/HGaugeMethods.cs | 1584 +- OpenTaiko/src/Helpers/HGenreBar.cs | 45 +- OpenTaiko/src/Helpers/HLocalizedPath.cs | 50 +- OpenTaiko/src/Helpers/HPrivateFastFont.cs | 66 +- OpenTaiko/src/Helpers/HRarity.cs | 143 +- OpenTaiko/src/Helpers/HScenePreset.cs | 140 +- OpenTaiko/src/Helpers/HSongTraverse.cs | 45 +- .../src/Helpers/LocalizedStringConverter.cs | 47 +- OpenTaiko/src/Helpers/ObjectExtensions.cs | 396 +- OpenTaiko/src/Helpers/SevenZipHelper.cs | 347 +- OpenTaiko/src/I18N/CLang.cs | 236 +- OpenTaiko/src/I18N/ILang.cs | 235 +- OpenTaiko/src/Items/CItemBase.cs | 60 +- OpenTaiko/src/Items/CItemInteger.cs | 65 +- OpenTaiko/src/Items/CItemList.cs | 107 +- OpenTaiko/src/Items/CItemThreeState.cs | 96 +- OpenTaiko/src/Items/CItemToggle.cs | 60 +- OpenTaiko/src/Plugins/CPluginHost.cs | 56 +- OpenTaiko/src/Plugins/IPluginActivity.cs | 20 +- OpenTaiko/src/Plugins/IPluginHost.cs | 12 +- OpenTaiko/src/Songs/CBoxDef.cs | 149 +- OpenTaiko/src/Songs/CCourse.cs | 71 +- OpenTaiko/src/Songs/CDTX.cs | 17178 ++++++------- .../src/Songs/CDTXCompanionFileFinder.cs | 372 +- OpenTaiko/src/Songs/CDTXStyleExtractor.cs | 845 +- OpenTaiko/src/Songs/CScoreIni.cs | 28 +- OpenTaiko/src/Songs/CScoreIni_Importer.cs | 439 +- OpenTaiko/src/Songs/CSongListNode.cs | 82 +- OpenTaiko/src/Songs/CSongUniqueID.cs | 93 +- OpenTaiko/src/Songs/CSong管理.cs | 1146 +- OpenTaiko/src/Songs/CStrジャンルtoNum.cs | 114 +- OpenTaiko/src/Songs/Cスコア.cs | 170 +- .../C曲リストノードComparers/ComparerChain.cs | 49 +- .../C曲リストノードComparerAC15.cs | 19 +- .../C曲リストノードComparerAC8_14.cs | 19 +- .../C曲リストノードComparerLevel.cs | 46 +- .../C曲リストノードComparerLevelIcon.cs | 46 +- .../C曲リストノードComparerSubtitle.cs | 28 +- .../C曲リストノードComparerタイトル.cs | 28 +- .../C曲リストノードComparerノード種別.cs | 54 +- .../C曲リストノードComparer絶対パス.cs | 58 +- OpenTaiko/src/Songs/Dan-C.cs | 683 +- OpenTaiko/src/Songs/Extended/CSongObject.cs | 166 +- OpenTaiko/src/Songs/GaugeIncreaseMode.cs | 54 +- OpenTaiko/src/Songs/VTTParser.cs | 902 +- OpenTaiko/src/Stages/01.StartUp/CCharacter.cs | 124 +- .../src/Stages/01.StartUp/CPuchichara.cs | 148 +- OpenTaiko/src/Stages/01.StartUp/CStage起動.cs | 209 +- .../src/Stages/01.StartUp/TextureLoader.cs | 5531 +++-- .../src/Stages/02.Title/CActEnumSongs.cs | 118 +- .../Stages/02.Title/CActScanningLoudness.cs | 43 +- OpenTaiko/src/Stages/02.Title/CEnumSongs.cs | 346 +- OpenTaiko/src/Stages/02.Title/CMainMenuTab.cs | 305 +- .../src/Stages/02.Title/CStageタイトル.cs | 444 +- .../Stages/04.Config/CActCalibrationMode.cs | 364 +- .../Stages/04.Config/CActConfigKeyAssign.cs | 396 +- .../src/Stages/04.Config/CActConfigList.cs | 1582 +- .../src/Stages/04.Config/CStageコンフィグ.cs | 499 +- .../05.DaniSelect/CActSelect段位リスト.cs | 1621 +- .../CActSelect段位挑戦選択画面.cs | 181 +- .../Stages/05.DaniSelect/CStage段位選択.cs | 542 +- OpenTaiko/src/Stages/05.SongSelect/AnimeBG.cs | 54 +- .../Stages/05.SongSelect/CActPlayOption.cs | 1350 +- .../05.SongSelect/CActSelectArtistComment.cs | 55 +- .../Stages/05.SongSelect/CActSelectDanInfo.cs | 306 +- .../CActSelectExExtraTransAnime.cs | 214 +- .../05.SongSelect/CActSelectInformation.cs | 130 +- .../05.SongSelect/CActSelectPopupMenu.cs | 437 +- .../05.SongSelect/CActSelectPreimageパネル.cs | 242 +- .../05.SongSelect/CActSelectPresound.cs | 230 +- .../05.SongSelect/CActSelectQuickConfig.cs | 206 +- .../CActSelectShowCurrentPosition.cs | 70 +- .../05.SongSelect/CActSelectSongInfo.cs | 148 +- .../05.SongSelect/CActSelectTowerInfo.cs | 106 +- .../CActSelectステータスパネル.cs | 37 +- .../05.SongSelect/CActSelect曲リスト.cs | 2432 +- .../05.SongSelect/CActSelect演奏履歴パネル.cs | 272 +- .../05.SongSelect/CActSelect難易度選択画面.cs | 937 +- .../src/Stages/05.SongSelect/CActSortSongs.cs | 104 +- .../src/Stages/05.SongSelect/CStage選曲.cs | 3180 ++- .../Stages/06.SongLoading/CStage曲読み込み.cs | 555 +- .../src/Stages/06.SongLoading/FastRender.cs | 47 +- OpenTaiko/src/Stages/07.Game/CAct演奏AVI.cs | 73 +- .../src/Stages/07.Game/CAct演奏Combo共通.cs | 524 +- .../src/Stages/07.Game/CAct演奏Combo音声.cs | 281 +- .../src/Stages/07.Game/CAct演奏PauseMenu.cs | 154 +- .../src/Stages/07.Game/CAct演奏ゲージ共通.cs | 817 +- .../Stages/07.Game/CAct演奏スクロール速度.cs | 78 +- .../src/Stages/07.Game/CAct演奏スコア共通.cs | 615 +- .../Stages/07.Game/CAct演奏ステージ失敗.cs | 160 +- .../Stages/07.Game/CAct演奏パネル文字列.cs | 482 +- .../src/Stages/07.Game/CAct演奏演奏情報.cs | 87 +- .../src/Stages/07.Game/CFloorManagement.cs | 106 +- .../src/Stages/07.Game/CInvisibleChip.cs | 130 +- OpenTaiko/src/Stages/07.Game/CLagLogger.cs | 159 +- .../src/Stages/07.Game/CStage演奏画面共通.cs | 8099 +++---- .../src/Stages/07.Game/Taiko/AIBattle.cs | 331 +- .../07.Game/Taiko/CActImplBackground.cs | 1025 +- .../Stages/07.Game/Taiko/CActImplBalloon.cs | 434 +- .../Stages/07.Game/Taiko/CActImplCharacter.cs | 1867 +- .../07.Game/Taiko/CActImplChipEffects.cs | 234 +- .../07.Game/Taiko/CActImplClearAnimation.cs | 1160 +- .../src/Stages/07.Game/Taiko/CActImplCombo.cs | 17 +- .../07.Game/Taiko/CActImplComboBalloon.cs | 274 +- .../Stages/07.Game/Taiko/CActImplDancer.cs | 584 +- .../Stages/07.Game/Taiko/CActImplFireworks.cs | 711 +- .../Stages/07.Game/Taiko/CActImplFooter.cs | 110 +- .../src/Stages/07.Game/Taiko/CActImplGauge.cs | 748 +- .../Stages/07.Game/Taiko/CActImplJudgeText.cs | 100 +- .../src/Stages/07.Game/Taiko/CActImplLane.cs | 354 +- .../Stages/07.Game/Taiko/CActImplLaneTaiko.cs | 1683 +- .../src/Stages/07.Game/Taiko/CActImplMob.cs | 125 +- .../Stages/07.Game/Taiko/CActImplMtaiko.cs | 1017 +- .../src/Stages/07.Game/Taiko/CActImplPad.cs | 96 +- .../src/Stages/07.Game/Taiko/CActImplRoll.cs | 275 +- .../07.Game/Taiko/CActImplRollEffect.cs | 287 +- .../Stages/07.Game/Taiko/CActImplRunner.cs | 447 +- .../src/Stages/07.Game/Taiko/CActImplScore.cs | 403 +- .../Stages/07.Game/Taiko/CActImplScoreRank.cs | 339 +- .../07.Game/Taiko/CActImplTrainingMode.cs | 288 +- .../Taiko/CAct演奏Drumsゲームモード.cs | 1540 +- .../07.Game/Taiko/CStage演奏ドラム画面.cs | 3647 ++- .../src/Stages/07.Game/Taiko/Dan_Cert.cs | 1966 +- .../Stages/07.Game/Taiko/EndAnimeScript.cs | 118 +- .../src/Stages/07.Game/Taiko/FireWorks.cs | 179 +- .../src/Stages/07.Game/Taiko/FlyingNotes.cs | 318 +- .../src/Stages/07.Game/Taiko/GoGoSplash.cs | 130 +- .../Stages/07.Game/Taiko/KusudamaScript.cs | 102 +- .../src/Stages/07.Game/Taiko/LaneFlash.cs | 116 +- .../src/Stages/07.Game/Taiko/ModIcons.cs | 305 +- .../src/Stages/07.Game/Taiko/NotesManager.cs | 962 +- OpenTaiko/src/Stages/07.Game/Taiko/Rainbow.cs | 216 +- .../src/Stages/07.Game/Taiko/ScriptBG.cs | 586 +- .../Stages/07.Game/Taiko/TaikoLaneFlash.cs | 141 +- .../src/Stages/08.Result/CActResultImage.cs | 73 +- .../08.Result/CActResultParameterPanel.cs | 515 +- .../src/Stages/08.Result/CActResultRank.cs | 44 +- .../src/Stages/08.Result/CActResultSongBar.cs | 103 +- OpenTaiko/src/Stages/08.Result/CStage結果.cs | 772 +- OpenTaiko/src/Stages/08.Result/ResultBG.cs | 57 +- OpenTaiko/src/Stages/09.Ending/CStage終了.cs | 98 +- .../Stages/10.ChangeSkin/CStageChangeSkin.cs | 77 +- .../11.Heya/CHeyaDisplayAssetInformations.cs | 182 +- OpenTaiko/src/Stages/11.Heya/CStageHeya.cs | 42 +- OpenTaiko/src/Stages/12.OnlineLounge/API.cs | 213 +- .../12.OnlineLounge/CStageOnlineLounge.cs | 1367 +- .../13.TowerSelect/CStageTowerSelect.cs | 634 +- .../CEncyclopediaControler.cs | 390 +- .../15.OpenEncyclopedia/COpenEncyclopedia.cs | 295 +- OpenTaiko/src/Stages/CActDFPFont.cs | 1052 +- OpenTaiko/src/Stages/CActFIFOBlack.cs | 54 +- OpenTaiko/src/Stages/CActFIFOResult.cs | 67 +- OpenTaiko/src/Stages/CActFIFOStart.cs | 137 +- OpenTaiko/src/Stages/CActFIFOWhite.cs | 56 +- OpenTaiko/src/Stages/CActLVLNFont.cs | 56 +- OpenTaiko/src/Stages/CActNewHeya.cs | 66 +- OpenTaiko/src/Stages/CActオプションパネル.cs | 51 +- OpenTaiko/src/Stages/CDTXVmode.cs | 352 +- OpenTaiko/src/Stages/CNamePlate.cs | 2 +- OpenTaiko/src/Stages/CStage.cs | 33 +- .../src/Stages/XX.Templates/CStageTemplate.cs | 108 +- 274 files changed, 62002 insertions(+), 76846 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..c5fc1081 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,189 @@ +# editorconfig.org + +# top-most EditorConfig file +root = true + +# Default settings: +# A newline ending every file +# Use 4 spaces as indentation +[*] +insert_final_newline = true +indent_style = tab +indent_size = 4 +trim_trailing_whitespace = true + +[project.json] +indent_size = 2 + +# Generated code +[*{_AssemblyInfo.cs,.notsupported.cs}] +generated_code = true + +# C# files +[*.cs] +# New line preferences +csharp_new_line_before_open_brace = none +csharp_new_line_before_else = false +csharp_new_line_before_catch = false +csharp_new_line_before_finally = false +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = true +csharp_indent_switch_labels = true +csharp_indent_labels = one_less_than_current + +# Modifier preferences +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion + +# avoid this. unless absolutely necessary +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_event = false:suggestion + +# Types: use keywords instead of BCL types, and permit var only when the type is clear +csharp_style_var_for_built_in_types = false:suggestion +csharp_style_var_when_type_is_apparent = false:none +csharp_style_var_elsewhere = false:suggestion +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion + +# name all constant fields using PascalCase +dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields +dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style +dotnet_naming_symbols.constant_fields.applicable_kinds = field +dotnet_naming_symbols.constant_fields.required_modifiers = const +dotnet_naming_style.pascal_case_style.capitalization = pascal_case + +# static fields should have s_ prefix +dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion +dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields +dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style +dotnet_naming_symbols.static_fields.applicable_kinds = field +dotnet_naming_symbols.static_fields.required_modifiers = static +dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected +dotnet_naming_style.static_prefix_style.required_prefix = s_ +dotnet_naming_style.static_prefix_style.capitalization = camel_case + +# internal and private fields should be _camelCase +dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion +dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields +dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style +dotnet_naming_symbols.private_internal_fields.applicable_kinds = field +dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal +dotnet_naming_style.camel_case_underscore_style.required_prefix = _ +dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case + +# Code style defaults +csharp_using_directive_placement = outside_namespace:suggestion +dotnet_sort_system_directives_first = true +csharp_prefer_braces = true:silent +csharp_preserve_single_line_blocks = true:none +csharp_preserve_single_line_statements = false:none +csharp_prefer_static_local_function = true:suggestion +csharp_prefer_simple_using_statement = false:none +csharp_style_prefer_switch_expression = true:suggestion +dotnet_style_readonly_field = true:suggestion + +# Expression-level preferences +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_auto_properties = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +csharp_prefer_simple_default_expression = true:suggestion + +# Expression-bodied members +csharp_style_expression_bodied_methods = true:silent +csharp_style_expression_bodied_constructors = true:silent +csharp_style_expression_bodied_operators = true:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = true:silent + +# Pattern matching +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion + +# Null checking preferences +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion + +# Other features +csharp_style_prefer_index_operator = false:none +csharp_style_prefer_range_operator = false:none +csharp_style_pattern_local_over_anonymous_function = false:none + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = do_not_ignore +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# C++ Files +[*.{cpp,h,in}] +curly_bracket_next_line = true +indent_brace_style = Allman + +# Xml project files +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}] +indent_size = 2 + +[*.{csproj,vbproj,proj,nativeproj,locproj}] +charset = utf-8 + +# Xml build files +[*.builds] +indent_size = 2 + +# Xml files +[*.{xml,stylecop,resx,ruleset}] +indent_size = 2 + +# Xml config files +[*.{props,targets,config,nuspec}] +indent_size = 2 + +# YAML config files +[*.{yml,yaml}] +indent_size = 2 + +# Shell scripts +[*.sh] +end_of_line = lf +[*.{cmd,bat}] +end_of_line = crlf \ No newline at end of file diff --git a/FDK/src/00.Common/CActivity.cs b/FDK/src/00.Common/CActivity.cs index d026ec6b..f7bd93f1 100644 --- a/FDK/src/00.Common/CActivity.cs +++ b/FDK/src/00.Common/CActivity.cs @@ -1,22 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace FDK -{ - public class CActivity - { +namespace FDK { + public class CActivity { // プロパティ public bool IsActivated { get; private set; } - public bool IsDeActivated - { - get - { + public bool IsDeActivated { + get { return !this.IsActivated; } - set - { + set { this.IsActivated = !value; } } @@ -29,11 +20,10 @@ namespace FDK /// protected bool IsFirstDraw = true; - + // コンストラクタ - public CActivity() - { + public CActivity() { this.IsDeActivated = true; this.ChildActivities = new List(); } @@ -44,29 +34,27 @@ namespace FDK #region [ 子クラスで必要なもののみ override すること。] //----------------- - public virtual void Activate() - { + public virtual void Activate() { // すでに活性化してるなら何もしない。 - if( this.IsActivated ) + if (this.IsActivated) return; - this.IsActivated = true; // このフラグは、以下の処理をする前にセットする。 + this.IsActivated = true; // このフラグは、以下の処理をする前にセットする。 // 自身のリソースを作成する。 //this.CreateManagedResource(); //this.CreateUnmanagedResource(); // すべての子 Activity を活性化する。 - foreach( CActivity activity in this.ChildActivities ) + foreach (CActivity activity in this.ChildActivities) activity.Activate(); // その他の初期化 this.IsFirstDraw = true; } - public virtual void DeActivate() - { + public virtual void DeActivate() { // 活性化してないなら何もしない。 - if( this.IsDeActivated ) + if (this.IsDeActivated) return; // 自身のリソースを解放する。 @@ -74,10 +62,10 @@ namespace FDK //this.ReleaseManagedResource(); // すべての 子Activity を非活性化する。 - foreach( CActivity activity in this.ChildActivities ) + foreach (CActivity activity in this.ChildActivities) activity.DeActivate(); - this.IsDeActivated = true; // このフラグは、以上のメソッドを呼び出した後にセットする。 + this.IsDeActivated = true; // このフラグは、以上のメソッドを呼び出した後にセットする。 } /// @@ -87,10 +75,9 @@ namespace FDK /// いつどのタイミングで呼び出されるか(いつDirect3Dが再作成されるか)分からないので、 /// いつ何時呼び出されても問題無いようにコーディングしておくこと。 /// - public virtual void CreateManagedResource() - { + public virtual void CreateManagedResource() { // すべての 子Activity の Managed リソースを作成する。 - foreach( CActivity activity in this.ChildActivities ) + foreach (CActivity activity in this.ChildActivities) activity.CreateManagedResource(); } @@ -101,27 +88,25 @@ namespace FDK /// いつどのタイミングで呼び出されるか(いつDirect3Dが再作成またはリセットされるか)分からないので、 /// いつ何時呼び出されても問題無いようにコーディングしておくこと。 /// - public virtual void CreateUnmanagedResource() - { + public virtual void CreateUnmanagedResource() { // すべての 子Activity の Unmanaged リソースを作成する。 - foreach( CActivity activity in this.ChildActivities ) + foreach (CActivity activity in this.ChildActivities) activity.CreateUnmanagedResource(); } - + /// /// Unmanaged リソースの解放を行う。 /// Direct3D デバイスの解放直前またはリセット直前に呼び出される。 /// いつどのタイミングで呼び出されるか(いつDirect3Dが解放またはリセットされるか)分からないので、 /// いつ何時呼び出されても問題無いようにコーディングしておくこと。 /// - public virtual void ReleaseUnmanagedResource() - { + public virtual void ReleaseUnmanagedResource() { // 活性化してないなら何もしない。 - if( this.IsDeActivated ) + if (this.IsDeActivated) return; // すべての 子Activity の Unmanaged リソースを解放する。 - foreach( CActivity activity in this.ChildActivities ) + foreach (CActivity activity in this.ChildActivities) activity.ReleaseUnmanagedResource(); } @@ -132,14 +117,13 @@ namespace FDK /// いつどのタイミングで呼び出されるか(いつDirect3Dが解放されるか)分からないので、 /// いつ何時呼び出されても問題無いようにコーディングしておくこと。 /// - public virtual void ReleaseManagedResource() - { + public virtual void ReleaseManagedResource() { // 活性化してないなら何もしない。 - if( this.IsDeActivated ) + if (this.IsDeActivated) return; // すべての 子Activity の Managed リソースを解放する。 - foreach( CActivity activity in this.ChildActivities ) + foreach (CActivity activity in this.ChildActivities) activity.ReleaseManagedResource(); } @@ -148,10 +132,9 @@ namespace FDK /// このメソッドは BeginScene() の後に呼び出されるので、メソッド内でいきなり描画を行ってかまわない。 /// /// 任意の整数。呼び出し元との整合性を合わせておくこと。 - public virtual int Draw() - { + public virtual int Draw() { // 活性化してないなら何もしない。 - if( this.IsDeActivated ) + if (this.IsDeActivated) return 0; @@ -161,8 +144,8 @@ namespace FDK // 戻り値とその意味は子クラスで自由に決めていい。 return 0; } - + //----------------- #endregion } -} \ No newline at end of file +} diff --git a/FDK/src/00.Common/CConversion.cs b/FDK/src/00.Common/CConversion.cs index 4ecb7f05..6e73f17a 100644 --- a/FDK/src/00.Common/CConversion.cs +++ b/FDK/src/00.Common/CConversion.cs @@ -1,254 +1,223 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace FDK -{ - public class CConversion - { +namespace FDK { + public class CConversion { // プロパティ public static readonly string str16進数文字 = "0123456789ABCDEFabcdef"; public static readonly string str36進数文字 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - + // メソッド - public static bool bONorOFF( char c ) - { - return ( c != '0' ); + public static bool bONorOFF(char c) { + return (c != '0'); } - public static double DegreeToRadian( double angle ) - { - return ( ( Math.PI * angle ) / 180.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 double RadianToDegree(double angle) { + return (angle * 180.0 / Math.PI); } - public static float DegreeToRadian( float angle ) - { - return (float) DegreeToRadian( (double) angle ); + public static float DegreeToRadian(float angle) { + return (float)DegreeToRadian((double)angle); } - public static float RadianToDegree( float angle ) - { - return (float) RadianToDegree( (double) angle ); + public static float RadianToDegree(float angle) { + return (float)RadianToDegree((double)angle); } - public static int n値を範囲内に丸めて返す( int value, int min, int max ) - { - if( value < min ) + public static int n値を範囲内に丸めて返す(int value, int min, int max) { + if (value < min) return min; - if( value > max ) + if (value > max) return max; return value; } - public static int n値を文字列から取得して範囲内に丸めて返す( string text, int min, int max, int defaultValue ) - { + public static int n値を文字列から取得して範囲内に丸めて返す(string text, int min, int max, int defaultValue) { int num; - if( ( int.TryParse( text, out num ) && ( num >= min ) ) && ( num <= max ) ) + if ((int.TryParse(text, out num) && (num >= min)) && (num <= max)) return num; return defaultValue; - } + } - public static double db値を文字列から取得して範囲内に丸めて返す( string text, double min, double max, double defaultValue ) - { - double num; - if( ( double.TryParse( text, out num ) && ( num >= min ) ) && ( num <= max ) ) - return num; + public static double db値を文字列から取得して範囲内に丸めて返す(string text, double min, double max, double defaultValue) { + double num; + if ((double.TryParse(text, out num) && (num >= min)) && (num <= max)) + return num; - return defaultValue; - } + return defaultValue; + } - // #23568 2010.11.04 ikanick add - public static int n値を文字列から取得して範囲内にちゃんと丸めて返す(string text, int min, int max, int defaultValue) - { - // 1 と違って範囲外の場合ちゃんと丸めて返します。 - 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 ) - { + // #23568 2010.11.04 ikanick add + public static int n値を文字列から取得して範囲内にちゃんと丸めて返す(string text, int min, int max, int defaultValue) { + // 1 と違って範囲外の場合ちゃんと丸めて返します。 int num; - if( !int.TryParse( text, out 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 n16進数2桁の文字列を数値に変換して返す( string strNum ) - { - if( strNum.Length < 2 ) + + public static int n16進数2桁の文字列を数値に変換して返す(string strNum) { + if (strNum.Length < 2) return -1; - int digit2 = str16進数文字.IndexOf( strNum[ 0 ] ); - if( digit2 < 0 ) + int digit2 = str16進数文字.IndexOf(strNum[0]); + if (digit2 < 0) return -1; - if( digit2 >= 16 ) - digit2 -= (16 - 10); // A,B,C... -> 1,2,3... + if (digit2 >= 16) + digit2 -= (16 - 10); // A,B,C... -> 1,2,3... - int digit1 = str16進数文字.IndexOf( strNum[ 1 ] ); - if( digit1 < 0 ) + int digit1 = str16進数文字.IndexOf(strNum[1]); + if (digit1 < 0) return -1; - if( digit1 >= 16 ) + if (digit1 >= 16) digit1 -= (16 - 10); return digit2 * 16 + digit1; } - public static int n36進数2桁の文字列を数値に変換して返す( string strNum ) - { - if( strNum.Length < 2 ) + public static int n36進数2桁の文字列を数値に変換して返す(string strNum) { + if (strNum.Length < 2) return -1; - int digit2 = str36進数文字.IndexOf( strNum[ 0 ] ); - if( digit2 < 0 ) + int digit2 = str36進数文字.IndexOf(strNum[0]); + if (digit2 < 0) return -1; - if( digit2 >= 36 ) - digit2 -= (36 - 10); // A,B,C... -> 1,2,3... + if (digit2 >= 36) + digit2 -= (36 - 10); // A,B,C... -> 1,2,3... - int digit1 = str36進数文字.IndexOf( strNum[ 1 ] ); - if( digit1 < 0 ) + int digit1 = str36進数文字.IndexOf(strNum[1]); + if (digit1 < 0) return -1; - if( digit1 >= 36 ) + if (digit1 >= 36) digit1 -= (36 - 10); return digit2 * 36 + digit1; } - public static int n小節番号の文字列3桁を数値に変換して返す( string strNum ) - { - if( strNum.Length >= 3 ) - { - int digit3 = str36進数文字.IndexOf( strNum[ 0 ] ); - if( digit3 < 0 ) + public static int n小節番号の文字列3桁を数値に変換して返す(string strNum) { + if (strNum.Length >= 3) { + int digit3 = str36進数文字.IndexOf(strNum[0]); + if (digit3 < 0) return -1; - if( digit3 >= 36 ) // 3桁目は36進数 + if (digit3 >= 36) // 3桁目は36進数 digit3 -= (36 - 10); - int digit2 = str16進数文字.IndexOf( strNum[ 1 ] ); // 2桁目は10進数 - if( ( digit2 < 0 ) || ( digit2 > 9 ) ) + int digit2 = str16進数文字.IndexOf(strNum[1]); // 2桁目は10進数 + if ((digit2 < 0) || (digit2 > 9)) return -1; - int digit1 = str16進数文字.IndexOf( strNum[ 2 ] ); // 1桁目も10進数 - if( ( digit1 >= 0 ) && ( digit1 <= 9 ) ) + int digit1 = str16進数文字.IndexOf(strNum[2]); // 1桁目も10進数 + if ((digit1 >= 0) && (digit1 <= 9)) return digit3 * 100 + digit2 * 10 + digit1; } return -1; } - - public static string str小節番号を文字列3桁に変換して返す( int num ) - { - if( ( num < 0 ) || ( num >= 3600 ) ) // 3600 == Z99 + 1 + + public static string str小節番号を文字列3桁に変換して返す(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 = str36進数文字[ digit4 ]; - char ch2 = str16進数文字[ digit2 ]; - char ch1 = str16進数文字[ digit1 ]; - return ( ch3.ToString() + ch2.ToString() + ch1.ToString() ); + int digit2 = (num % 100) / 10; + int digit1 = (num % 100) % 10; + char ch3 = str36進数文字[digit4]; + char ch2 = str16進数文字[digit2]; + char ch1 = str16進数文字[digit1]; + return (ch3.ToString() + ch2.ToString() + ch1.ToString()); } - public static string str数値を16進数2桁に変換して返す( int num ) - { - if( ( num < 0 ) || ( num >= 0x100 ) ) + public static string str数値を16進数2桁に変換して返す(int num) { + if ((num < 0) || (num >= 0x100)) return "00"; - char ch2 = str16進数文字[ num / 0x10 ]; - char ch1 = str16進数文字[ num % 0x10 ]; - return ( ch2.ToString() + ch1.ToString() ); + char ch2 = str16進数文字[num / 0x10]; + char ch1 = str16進数文字[num % 0x10]; + return (ch2.ToString() + ch1.ToString()); } - public static string str数値を36進数2桁に変換して返す( int num ) - { - if( ( num < 0 ) || ( num >= 36 * 36 ) ) + public static string str数値を36進数2桁に変換して返す(int num) { + if ((num < 0) || (num >= 36 * 36)) return "00"; - char ch2 = str36進数文字[ num / 36 ]; - char ch1 = str36進数文字[ num % 36 ]; - return ( ch2.ToString() + ch1.ToString() ); + char ch2 = str36進数文字[num / 36]; + char ch1 = str36進数文字[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; + 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(); + 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(); + 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; - } + return nArray; + } - /// - /// 百分率数値を255段階数値に変換するメソッド。透明度用。 - /// - /// - /// - public static int nParsentTo255( double num ) - { - return (int)(255.0 * num); - } + /// + /// 百分率数値を255段階数値に変換するメソッド。透明度用。 + /// + /// + /// + public static int nParsentTo255(double num) { + return (int)(255.0 * num); + } - /// - /// 255段階数値を百分率に変換するメソッド。 - /// - /// - /// - public static int n255ToParsent( int num ) - { - return (int)(100.0 / num); - } + /// + /// 255段階数値を百分率に変換するメソッド。 + /// + /// + /// + public static int n255ToParsent(int num) { + return (int)(100.0 / num); + } - public static Color4 n255ToColor4( int nR, int nG, int nB ) - { - float fR = n255ToParsent( nR ); - float fG = n255ToParsent( nG ); - float fB = n255ToParsent( nB ); + public static Color4 n255ToColor4(int nR, int nG, int nB) { + float fR = n255ToParsent(nR); + float fG = n255ToParsent(nG); + float fB = n255ToParsent(nB); - return new Color4( fR, fG, fB, 1f ); - } + return new Color4(fR, fG, fB, 1f); + } - public static Color4 ColorToColor4(System.Drawing.Color col) - { + 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) - { + public static int[] SeparateDigits(int num) { int[] digits = new int[num.ToString().Length]; - for (int i = 0; i < digits.Length; i++) - { + for (int i = 0; i < digits.Length; i++) { digits[i] = num % 10; num /= 10; } @@ -259,10 +228,9 @@ namespace FDK //----------------- // private コンストラクタでインスタンス生成を禁止する。 - private CConversion() - { + private CConversion() { } //----------------- #endregion - } + } } diff --git a/FDK/src/00.Common/CCounter.cs b/FDK/src/00.Common/CCounter.cs index 5f1dcbd0..8a98f679 100644 --- a/FDK/src/00.Common/CCounter.cs +++ b/FDK/src/00.Common/CCounter.cs @@ -1,315 +1,271 @@ -using System; -using System.Collections.Generic; -using System.Text; +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 -{ - /// - /// 一定間隔で単純増加する整数(カウント値)を扱う。 - /// - /// - /// ○使い方 - /// 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 _Interval - { - get - { - return this.Interval; - } - set - { - this.Interval = value >= 0 ? value : value * -1; - } - } + public double NowTime { + get; + set; + } + // 状態プロパティ - 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; } + } - 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; } - } + // コンストラクタ - // コンストラクタ + public CCounter() { + this.NormalTimer = null; + this.BeginValue = 0; + this.EndValue = 0; + this.CurrentValue = 0; + this.CurrentValue = 0; + this.NowTime = CSoundTimer.UnusedNum; + } - 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); + } - /// 生成と同時に開始する。 - 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); - } + /// 生成と同時に開始する。(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; - } + /// + /// カウントを開始する。 + /// + /// 最初のカウント値。 + /// 最後のカウント値。 + /// カウント値を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; - } + /// + /// カウントを開始する。(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; + /// + /// 前回の 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; + while ((num - this.NowTime) >= this.Interval) { + if (++this.CurrentValue > this.EndValue) + this.CurrentValue = (int)this.EndValue; - this.NowTime += this.Interval; - } - } - } + 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; + /// + /// 前回の 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; + while ((num - this.NowTime) >= this.Interval) { + if (++this.CurrentValue > this.EndValue) + this.CurrentValue = (int)this.EndValue; - this.NowTime += this.Interval; - } - } - } + 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; + /// + /// 前回の 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; + while ((num - this.NowTime) >= this.Interval) { + if (++this.CurrentValue > this.EndValue) + this.CurrentValue = (int)this.BeginValue; - this.NowTime += this.Interval; - } - } - } + 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; + /// + /// 前回の 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; + while ((num - this.NowTime) >= this.Interval) { + if (++this.CurrentValue > this.EndValue) + this.CurrentValue = (int)this.BeginValue; - this.NowTime += this.Interval; - } - } - } + this.NowTime += this.Interval; + } + } + } - /// - /// カウントを停止する。 - /// これ以降に t進行() や t進行Loop() を呼び出しても何も処理されない。 - /// - public void Stop() - { - this.NowTime = CTimer.UnusedNum; - } + /// + /// カウントを停止する。 + /// これ以降に t進行() や t進行Loop() を呼び出しても何も処理されない。 + /// + public void Stop() { + this.NowTime = CTimer.UnusedNum; + } - public void ChangeInterval(double Value) - { - this._Interval = Value; - } + public void ChangeInterval(double Value) { + this._Interval = Value; + } - // その他 + // その他 - #region [ 応用:キーの反復入力をエミュレーションする ] - //----------------- + #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; + /// + /// 「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: + if (pressFlag) { + switch (this.CurrentValue) { + case first: - keyProcess(); - this.CurrentValue = second; - this.NowTime = this.NormalTimer.NowTime; - return; + keyProcess(); + this.CurrentValue = second; + this.NowTime = this.NormalTimer.NowTime; + return; - case second: + case second: - if ((this.NormalTimer.NowTime - this.NowTime) > 200) - { - keyProcess(); - this.NowTime = this.NormalTimer.NowTime; - this.CurrentValue = later; - } - return; + if ((this.NormalTimer.NowTime - this.NowTime) > 200) { + keyProcess(); + this.NowTime = this.NormalTimer.NowTime; + this.CurrentValue = later; + } + return; - case later: + case later: - if ((this.NormalTimer.NowTime - this.NowTime) > 30) - { - keyProcess(); - this.NowTime = this.NormalTimer.NowTime; - } - return; - } - } - else - { - this.CurrentValue = first; - } - } - public delegate void KeyProcess(); + if ((this.NormalTimer.NowTime - this.NowTime) > 30) { + keyProcess(); + this.NowTime = this.NormalTimer.NowTime; + } + return; + } + } else { + this.CurrentValue = first; + } + } + public delegate void KeyProcess(); - //----------------- - #endregion + //----------------- + #endregion - #region [ private ] - //----------------- - private CTimer NormalTimer; - private CSoundTimer TimerDB; - private double Interval; - //----------------- - #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 d934c747..4f69f480 100644 --- a/FDK/src/00.Common/CFPS.cs +++ b/FDK/src/00.Common/CFPS.cs @@ -1,25 +1,16 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace FDK -{ - public class CFPS - { +namespace FDK { + public class CFPS { // プロパティ - public int NowFPS - { + public int NowFPS { get; private set; } - public double DeltaTime - { + public double DeltaTime { get; private set; } - public bool ChangedFPS - { + public bool ChangedFPS { get; private set; } @@ -27,11 +18,10 @@ namespace FDK // コンストラクタ - public CFPS() - { + public CFPS() { this.NowFPS = 0; this.DeltaTime = 0; - this.FPSTimer = new CTimer( CTimer.TimerType.MultiMedia ); + this.FPSTimer = new CTimer(CTimer.TimerType.MultiMedia); this.BeginTime = this.FPSTimer.NowTime; this.CoreFPS = 0; this.ChangedFPS = false; @@ -40,16 +30,14 @@ namespace FDK // メソッド - public void Update() - { + 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 ) - { + while ((this.FPSTimer.NowTime - this.BeginTime) >= INTERVAL) { this.NowFPS = this.CoreFPS; this.CoreFPS = 0; this.ChangedFPS = true; @@ -63,10 +51,10 @@ namespace FDK #region [ private ] //----------------- - private CTimer FPSTimer; + private CTimer FPSTimer; private long BeginTime; private long PrevFrameTime; - private int CoreFPS; + private int CoreFPS; //----------------- #endregion } diff --git a/FDK/src/00.Common/CIniFile.cs b/FDK/src/00.Common/CIniFile.cs index 53bb8f1f..85578ce5 100644 --- a/FDK/src/00.Common/CIniFile.cs +++ b/FDK/src/00.Common/CIniFile.cs @@ -1,81 +1,66 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.IO; -using System.Diagnostics; +using System.Text; -namespace FDK -{ +namespace FDK { /// /// 汎用的な .iniファイルを扱う。 /// - public class CIniFile - { + public class CIniFile { // プロパティ - public string FileName - { + public string FileName { get; private set; } - public List Sections - { + public List Sections { get; - set; + set; } - public class CSection - { + public class CSection { public string SectionName = ""; - public List> Parameters = new List>(); + public List> Parameters = new List>(); } // コンストラクタ - public CIniFile() - { + public CIniFile() { this.FileName = ""; this.Sections = new List(); } - public CIniFile( string fileName ) - :this() - { - this.tRead( fileName ); + public CIniFile(string fileName) + : this() { + this.tRead(fileName); } // メソッド - public void tRead( string 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") ); // ファイルが存在しない場合は例外発生。 + 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 ] == ';' ) // ';'以降はコメントとして無視 + while ((line = sr.ReadLine()) != null) { + line = line.Replace('\t', ' ').TrimStart(new char[] { '\t', ' ' }); + if (string.IsNullOrEmpty(line) || line[0] == ';') // ';'以降はコメントとして無視 continue; - if( line[ 0 ] == '[' ) - { + if (line[0] == '[') { #region [ セクションの変更 ] //----------------------------- - var builder = new StringBuilder( 32 ); + var builder = new StringBuilder(32); int num = 1; - while( ( num < line.Length ) && ( line[ num ] != ']' ) ) - builder.Append( line[ num++ ] ); + while ((num < line.Length) && (line[num] != ']')) + builder.Append(line[num++]); // 変数 section が使用中の場合は、List に追加して新しい section を作成する。 - if( section != null ) - this.Sections.Add( section ); + if (section != null) + this.Sections.Add(section); section = new CSection(); section.SectionName = builder.ToString(); @@ -85,49 +70,41 @@ namespace FDK continue; } - string[] strArray = line.Split( new char[] { '=' } ); - if( strArray.Length != 2 ) + string[] strArray = line.Split(new char[] { '=' }); + if (strArray.Length != 2) continue; - string key = strArray[ 0 ].Trim(); - string value = strArray[ 1 ].Trim(); + 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 ) ); + 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 ) + if (section != null) + this.Sections.Add(section); + } finally { + if (sr != null) sr.Close(); } } - public void tWrite( string fileName ) - { + public void tWrite(string fileName) { this.FileName = fileName; this.tWrite(); } - public void tWrite() - { + public void tWrite() { StreamWriter sw = null; - try - { - sw = new StreamWriter( this.FileName, false, Encoding.GetEncoding( "Shift_JIS" ) ); // オープン失敗の場合は例外発生。 + try { + sw = new StreamWriter(this.FileName, false, Encoding.GetEncoding("Shift_JIS")); // オープン失敗の場合は例外発生。 - foreach( CSection section in this.Sections ) - { - sw.WriteLine( "[{0}]", section.SectionName ); + 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 ); + foreach (KeyValuePair kvp in section.Parameters) + sw.WriteLine("{0}={1}", kvp.Key, kvp.Value); } - } - finally - { - if( sw != null ) + } finally { + if (sw != null) sw.Close(); } } diff --git a/FDK/src/00.Common/CIntervalProcessing.cs b/FDK/src/00.Common/CIntervalProcessing.cs index 5c915599..2681119e 100644 --- a/FDK/src/00.Common/CIntervalProcessing.cs +++ b/FDK/src/00.Common/CIntervalProcessing.cs @@ -1,41 +1,33 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace FDK -{ +namespace FDK { /// /// 一定の間隔で処理を行うテンプレートパターンの定義。 /// たとえば、t進行() で 5ms ごとに行う処理を前回のt進行()の呼び出しから 15ms 後に呼び出した場合は、処理が 3回 実行される。 /// - public class CIntervalProcessing : IDisposable - { + public class CIntervalProcessing : IDisposable { public delegate void dgProc(); - public void Tick( long interval, dgProc proc ) - { + public void Tick(long interval, dgProc proc) { // タイマ更新 - if( this.timer == null ) + if (this.timer == null) return; this.timer.Update(); // 初めての進行処理 - if( this.PrevTime == CTimer.UnusedNum ) + if (this.PrevTime == CTimer.UnusedNum) this.PrevTime = this.timer.NowTimeMs; // タイマが一回りしてしまった時のため…… - if( this.timer.NowTimeMs < this.PrevTime ) + if (this.timer.NowTimeMs < this.PrevTime) this.PrevTime = this.timer.NowTimeMs; - + // 時間内の処理を実行。 - while( ( this.timer.NowTimeMs - this.PrevTime ) >= interval ) - { + while ((this.timer.NowTimeMs - this.PrevTime) >= interval) { proc(); this.PrevTime += interval; @@ -44,8 +36,7 @@ namespace FDK #region [ IDisposable 実装 ] //----------------- - public void Dispose() - { + public void Dispose() { timer.Dispose(); } //----------------- @@ -53,7 +44,7 @@ namespace FDK #region [ protected ] //----------------- - protected CTimer timer = new CTimer( CTimer.TimerType.MultiMedia ); + 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 9d2952e5..5d8e9ab4 100644 --- a/FDK/src/00.Common/CJudgeTextEncoding.cs +++ b/FDK/src/00.Common/CJudgeTextEncoding.cs @@ -1,25 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using System.Diagnostics; using System.Text; -using System.IO; -using System.Diagnostics; -namespace TJAPlayer3 -{ - public class CJudgeTextEncoding - { +namespace TJAPlayer3 { + public class CJudgeTextEncoding { /// /// Hnc8様のReadJEncを使用して文字コードの判別をする。 /// - public static Encoding JudgeFileEncoding(string path) - { + public static Encoding JudgeFileEncoding(string path) { if (!File.Exists(path)) return null; Encoding enc; FileInfo file = new FileInfo(path); - using (Hnx8.ReadJEnc.FileReader reader = new Hnx8.ReadJEnc.FileReader(file)) - { + using (Hnx8.ReadJEnc.FileReader reader = new Hnx8.ReadJEnc.FileReader(file)) { // 判別読み出し実行。判別結果はReadメソッドの戻り値で把握できます Hnx8.ReadJEnc.CharCode c = reader.Read(file); // 戻り値のNameプロパティから文字コード名を取得できます @@ -30,8 +22,7 @@ namespace TJAPlayer3 } Debug.Print(path + " Encoding=" + enc.CodePage); - if (enc == null) - { + if (enc == null) { enc = Encoding.GetEncoding(932); } return enc; @@ -42,14 +33,12 @@ namespace TJAPlayer3 /// /// /// - public static string ReadTextFile(string path) - { + 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)) - { + using (Hnx8.ReadJEnc.FileReader reader = new Hnx8.ReadJEnc.FileReader(file)) { reader.Read(file); str = reader.Text; } @@ -66,8 +55,7 @@ namespace TJAPlayer3 /// /// /// - public static string JudgeNewLine(string str) - { + public static string JudgeNewLine(string str) { if (str.Contains("\r\n")) return ("\r\n"); @@ -78,4 +66,4 @@ namespace TJAPlayer3 } } -} \ No newline at end of file +} diff --git a/FDK/src/00.Common/CTimer.cs b/FDK/src/00.Common/CTimer.cs index a582e182..d630afee 100644 --- a/FDK/src/00.Common/CTimer.cs +++ b/FDK/src/00.Common/CTimer.cs @@ -1,31 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; -using System.Diagnostics; - -namespace FDK -{ - public class CTimer : CTimerBase - { - public enum TimerType - { +namespace FDK { + public class CTimer : CTimerBase { + public enum TimerType { Unknown = -1, PerformanceCounter = 0, MultiMedia = 1, GetTickCount = 2, } - public TimerType CurrentTimerType - { + public TimerType CurrentTimerType { get; protected set; } - public override long SystemTimeMs - { - get - { + public override long SystemTimeMs { + get { /* switch( this.eタイマ種別 ) { @@ -52,9 +40,8 @@ namespace FDK } } - public CTimer( TimerType timerType ) - :base() - { + public CTimer(TimerType timerType) + : base() { this.CurrentTimerType = timerType; /* @@ -81,23 +68,21 @@ namespace FDK } } */ - + base.Reset(); - ReferenceCount[ (int) this.CurrentTimerType ]++; + ReferenceCount[(int)this.CurrentTimerType]++; } - - public override void Dispose() - { - if( this.CurrentTimerType == TimerType.Unknown ) + + public override void Dispose() { + if (this.CurrentTimerType == TimerType.Unknown) return; - int type = (int) this.CurrentTimerType; + int type = (int)this.CurrentTimerType; - ReferenceCount[ type ] = Math.Max( ReferenceCount[ type ] - 1, 0 ); + ReferenceCount[type] = Math.Max(ReferenceCount[type] - 1, 0); - if( ReferenceCount[ type ] == 0 ) - { + if (ReferenceCount[type] == 0) { /* if( this.eタイマ種別 == E種別.MultiMedia ) timeEndPeriod( this.timeCaps.wPeriodMin ); @@ -110,11 +95,10 @@ namespace FDK #region [ protected ] //----------------- protected long CurrentFrequency; - protected static int[] ReferenceCount = new int[ 3 ]; + protected static int[] ReferenceCount = new int[3]; //protected TimeCaps timeCaps; - protected bool GetSetTickCount() - { + protected bool GetSetTickCount() { this.CurrentTimerType = TimerType.GetTickCount; return true; } diff --git a/FDK/src/00.Common/CTimerBase.cs b/FDK/src/00.Common/CTimerBase.cs index 22402381..6b17aee9 100644 --- a/FDK/src/00.Common/CTimerBase.cs +++ b/FDK/src/00.Common/CTimerBase.cs @@ -1,177 +1,142 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace FDK -{ +namespace FDK { /// /// タイマの抽象クラス。 /// このクラスを継承し、override したクラスを作成することで、任意のクロックを持つタイマを作成できる。 /// - public abstract class CTimerBase : IDisposable - { + public abstract class CTimerBase : IDisposable { public const long UnusedNum = -1; // この2つを override する。 - public abstract long SystemTimeMs - { + public abstract long SystemTimeMs { get; } - public double SystemTimeMs_Double - { - get; - set; - } + public double SystemTimeMs_Double { + get; + set; + } public abstract void Dispose(); #region [ DTXMania用に、語尾にmsのつかない宣言を追加 ] - public long SystemTime - { + public long SystemTime { get { return SystemTimeMs; } } - public long NowTime - { + public long NowTime { get { return NowTimeMs; } set { NowTimeMs = value; } } - public long PrevResetTime - { + public long PrevResetTime { get { return PrevResetTimeMs; } } - //double - public double SystemTime_Double - { + //double + public double SystemTime_Double { get { return SystemTimeMs_Double; } } - public double NowTime_Double - { + public double NowTime_Double { get { return NowTimeMs_Double; } set { NowTimeMs_Double = value; } } - public double PrevResetTime_Double - { + public double PrevResetTime_Double { get { return PrevResetTimeMs_Double; } } #endregion - public long NowTimeMs - { - get - { - if( this.StopCount > 0 ) - return ( this.PauseSystemTimeMs - this.PrevResetTimeMs ); + public long NowTimeMs { + get { + if (this.StopCount > 0) + return (this.PauseSystemTimeMs - this.PrevResetTimeMs); - return ( this.UpdateSystemTime - this.PrevResetTimeMs ); + return (this.UpdateSystemTime - this.PrevResetTimeMs); } - set - { - if( this.StopCount > 0 ) + 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 ); + public long RealNowTimeMs { + get { + if (this.StopCount > 0) + return (this.PauseSystemTimeMs - this.PrevResetTimeMs); - return ( this.SystemTimeMs - this.PrevResetTimeMs ); + return (this.SystemTimeMs - this.PrevResetTimeMs); } } - public long PrevResetTimeMs - { + public long PrevResetTimeMs { get; protected set; } - public double NowTimeMs_Double - { - get - { - if( this.StopCount > 0 ) - return ( this.PauseSystemTimeMs_Double - this.PrevResetTimeMs_Double ); + public double NowTimeMs_Double { + get { + if (this.StopCount > 0) + return (this.PauseSystemTimeMs_Double - this.PrevResetTimeMs_Double); - return ( this.UpdateSystemTime_Double - this.PrevResetTimeMs_Double ); + return (this.UpdateSystemTime_Double - this.PrevResetTimeMs_Double); } - set - { - if( this.StopCount > 0 ) + 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 ); + public double RealNowTimeMs_Double { + get { + if (this.StopCount > 0) + return (this.PauseSystemTimeMs_Double - this.PrevResetTimeMs_Double); - return ( this.SystemTimeMs_Double - this.PrevResetTimeMs_Double ); + return (this.SystemTimeMs_Double - this.PrevResetTimeMs_Double); } } - public double PrevResetTimeMs_Double - { + public double PrevResetTimeMs_Double { get; protected set; } - public bool IsUnStoped - { - get - { - return ( this.StopCount == 0 ); - } - } + public bool IsUnStoped { + get { + return (this.StopCount == 0); + } + } - public void Reset() - { + public void Reset() { this.Update(); this.PrevResetTimeMs = this.UpdateSystemTime; this.PauseSystemTimeMs = this.UpdateSystemTime; this.StopCount = 0; } - public void Pause() - { - if( this.StopCount == 0 ) - { + public void Pause() { + if (this.StopCount == 0) { this.PauseSystemTimeMs = this.UpdateSystemTime; - this.PauseSystemTimeMs_Double = this.UpdateSystemTime_Double; - } + this.PauseSystemTimeMs_Double = this.UpdateSystemTime_Double; + } this.StopCount++; } - public void Update() - { + public void Update() { this.UpdateSystemTime = this.SystemTimeMs; - this.UpdateSystemTime_Double = this.SystemTimeMs_Double; + this.UpdateSystemTime_Double = this.SystemTimeMs_Double; } - public void Resume() - { - if( this.StopCount > 0 ) - { + public void Resume() { + if (this.StopCount > 0) { this.StopCount--; - if( this.StopCount == 0 ) - { + if (this.StopCount == 0) { this.Update(); this.PrevResetTimeMs += this.UpdateSystemTime - this.PauseSystemTimeMs; - this.PrevResetTimeMs_Double += this.UpdateSystemTime_Double - this.PauseSystemTimeMs_Double; + 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 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 8beee55c..227b7c50 100644 --- a/FDK/src/00.Common/CTraceLogListener.cs +++ b/FDK/src/00.Common/CTraceLogListener.cs @@ -1,127 +1,86 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.IO; -using System.Diagnostics; +using System.Diagnostics; -namespace FDK -{ - public class CTraceLogListener : TraceListener - { - public CTraceLogListener( StreamWriter stream ) - { +namespace FDK { + public class CTraceLogListener : TraceListener { + public CTraceLogListener(StreamWriter stream) { this.LogStreamWriter = stream; } - public override void Flush() - { - if( this.LogStreamWriter != null ) - { - try - { + public override void Flush() { + if (this.LogStreamWriter != null) { + try { this.LogStreamWriter.Flush(); - } - catch( ObjectDisposedException ) - { + } catch (ObjectDisposedException) { } } } - public override void TraceEvent( TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message ) - { - if( this.LogStreamWriter != null ) - { - try - { - this.LogEventType( eventType ); + 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 ) - { + 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 ); + 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 ) - { + 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 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 ) - { + 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 - { + protected override void Dispose(bool disposing) { + if (this.LogStreamWriter != null) { + try { this.LogStreamWriter.Close(); - } - catch - { + } catch { } this.LogStreamWriter = null; } - base.Dispose( disposing ); + base.Dispose(disposing); } #region [ private ] //----------------- private StreamWriter LogStreamWriter; - private void LogEventType( TraceEventType eventType ) - { - if( this.LogStreamWriter != null ) - { - try - { + 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 ) - { + 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] " ); + this.LogStreamWriter.Write("[ERROR] "); return; - case ( TraceEventType.Error | TraceEventType.Critical ): + case (TraceEventType.Error | TraceEventType.Critical): return; case TraceEventType.Warning: - this.LogStreamWriter.Write( "[WARNING] " ); + this.LogStreamWriter.Write("[WARNING] "); return; case TraceEventType.Information: @@ -130,24 +89,17 @@ namespace FDK default: return; } - this.LogStreamWriter.Write( "[INFO] " ); - } - catch( ObjectDisposedException ) - { + 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 ) - { + private void LogIndent() { + if ((this.LogStreamWriter != null) && (base.IndentLevel > 0)) { + try { + for (int i = 0; i < base.IndentLevel; i++) + this.LogStreamWriter.Write(" "); + } catch (ObjectDisposedException) { } } } diff --git a/FDK/src/00.Common/CUtility.cs b/FDK/src/00.Common/CUtility.cs index 89675374..d311b541 100644 --- a/FDK/src/00.Common/CUtility.cs +++ b/FDK/src/00.Common/CUtility.cs @@ -1,20 +1,13 @@ -using System; -using System.Collections.Generic; +using System.Diagnostics; using System.Text; -using System.Diagnostics; -using System.IO; -using System.Runtime.InteropServices; -namespace FDK -{ - public class CUtility - { +namespace FDK { + public class CUtility { - public static void RunCompleteGC() - { - GC.Collect(); // アクセス不可能なオブジェクトを除去し、ファイナライぜーション実施。 - GC.WaitForPendingFinalizers(); // ファイナライゼーションが終わるまでスレッドを待機。 - GC.Collect(); // ファイナライズされたばかりのオブジェクトに関連するメモリを開放。 + public static void RunCompleteGC() { + GC.Collect(); // アクセス不可能なオブジェクトを除去し、ファイナライぜーション実施。 + GC.WaitForPendingFinalizers(); // ファイナライゼーションが終わるまでスレッドを待機。 + GC.Collect(); // ファイナライズされたばかりのオブジェクトに関連するメモリを開放。 // 出展: http://msdn.microsoft.com/ja-jp/library/ms998547.aspx#scalenetchapt05_topic10 } @@ -22,116 +15,95 @@ namespace FDK // ログ - public static void LogBlock( string name, Action method ) - { - Trace.TraceInformation( "--------------------" ); - Trace.TraceInformation( "開始 - " + name ); + public static void LogBlock(string name, Action method) { + Trace.TraceInformation("--------------------"); + Trace.TraceInformation("開始 - " + name); Trace.Indent(); - try - { + try { method(); - } - finally - { + } finally { Trace.Unindent(); - Trace.TraceInformation( "終了 - " + name ); - Trace.TraceInformation( "--------------------" ); + Trace.TraceInformation("終了 - " + name); + Trace.TraceInformation("--------------------"); } } - public static void LogException( Exception e ) - { - Trace.WriteLine( "---例外ここから----" ); - Trace.WriteLine( e.ToString() ); - Trace.WriteLine( "---例外ここまで----" ); + 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() は完全パスを返す。 + 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 ); + foreach (string ext in extensions) { + foreach (string file in files) { + string fileExt = Path.GetExtension(file); - if( fileExt.Equals( ext, StringComparison.OrdinalIgnoreCase ) ) - return file; // あった + if (fileExt.Equals(ext, StringComparison.OrdinalIgnoreCase)) + return file; // あった } } - return null; // なかった + return null; // なかった } - public static void ReadXML( string fileName, out T xmlObject ) - { - xmlObject = default( T ); + 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()される + 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 ) - { + 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()される + 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 DegreeToRadian(double angle) { + return ((Math.PI * angle) / 180.0); } - public static double RadianToDegree( double angle ) - { - return ( angle * 180.0 / Math.PI ); + 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 DegreeToRadian(float angle) { + return (float)DegreeToRadian((double)angle); } - public static float RadianToDegree( float angle ) - { - return (float) RadianToDegree( (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; + public static bool ToggleBoolian(ref bool bFlag) { + if (bFlag == true) bFlag = false; + else if (bFlag == false) bFlag = true; - return true; - } - } + return true; + } + } } diff --git a/FDK/src/00.Common/Color4.cs b/FDK/src/00.Common/Color4.cs index 7c244192..5ddf24e4 100644 --- a/FDK/src/00.Common/Color4.cs +++ b/FDK/src/00.Common/Color4.cs @@ -1,32 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +namespace FDK { + public class Color4 { + public float Red; + public float Green; + public float Blue; + public float Alpha; -namespace FDK -{ - public class Color4 - { - public float Red; - public float Green; - public float Blue; - public float Alpha; + public Color4(float r, float g, float b, float a) { + Red = r; + Green = g; + Blue = b; + Alpha = a; + } - 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; - } - } + 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 d7e94c11..64358c68 100644 --- a/FDK/src/00.Common/ExtensionMethods/DoubleExtensions.cs +++ b/FDK/src/00.Common/ExtensionMethods/DoubleExtensions.cs @@ -1,12 +1,7 @@ -using System; - -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); - } - } -} \ No newline at end of file +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 019d3f5d..7530e63c 100644 --- a/FDK/src/00.Common/ExtensionMethods/Int32Extensions.cs +++ b/FDK/src/00.Common/ExtensionMethods/Int32Extensions.cs @@ -1,12 +1,7 @@ -using System; - -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 a71eef74..e4fd227e 100644 --- a/FDK/src/01.Framework/Core/Game.cs +++ b/FDK/src/01.Framework/Core/Game.cs @@ -1,16 +1,16 @@ /* * Copyright (c) 2007-2009 SlimDX Group -* +* * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: -* +* * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. -* +* * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -19,318 +19,265 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -using System; -using System.ComponentModel; -using System.Threading; -using System.Collections.ObjectModel; -using Silk.NET.Windowing; +using FDK; +using Silk.NET.Core; +using Silk.NET.GLFW; using Silk.NET.Maths; using Silk.NET.OpenGLES; +using Silk.NET.Windowing; using SkiaSharp; -using FDK; -using Silk.NET.GLFW; -using System.Runtime.InteropServices; -using Silk.NET.Core; -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 { + /// + /// 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; } - public static List AsyncActions { get; private set; } = new(); + public static List AsyncActions { get; private set; } = new(); - private string strIconFileName; + private string strIconFileName; - protected string _Text = ""; - protected string Text - { - get - { - return _Text; - } - set - { - _Text = value; - if (Window_ != null) - { - Window_.Title = value; - } - } - } + 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 static AnglePlatformType GraphicsDeviceType_ = AnglePlatformType.OpenGL; - public IWindow Window_; + public IWindow Window_; - private Vector2D _WindowSize; - public Vector2D WindowSize - { - get - { - return _WindowSize; - } - set - { - _WindowSize = value; - if (Window_ != null) - { - Window_.Size = value; - } - } - } + 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 Vector2D _WindowPosition; + public Vector2D WindowPosition { + get { + return _WindowPosition; + } + set { + _WindowPosition = value; + if (Window_ != null) { + Window_.Position = value; + } + } + } - private int _Framerate; + private int _Framerate; - public int Framerate - { - get - { - return _Framerate; - } - set - { - _Framerate = value; - if (Window_ != null) - { - UpdateWindowFramerate(VSync, value); - } - } - } + 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 _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; - } - } - } + 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 static int MainThreadID { get; private set; } - 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); + private Vector2D ViewPortSize = new Vector2D(); + private Vector2D ViewPortOffset = new Vector2D(); - 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 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); - 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); - } + 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; + } + } - 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); - action(sKBitmap); - } - }); - } + using SKBitmap sKBitmap = new(ViewportWidth, ViewportHeight - 1); + sKBitmap.SetPixels((IntPtr)pixels2); + return sKBitmap.Copy(); + } + } + } - public static long TimeMs; + 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); + } - public static Matrix4X4 Camera; + 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; + } + } - public static float ScreenAspect - { - get - { - return (float)GameWindowSize.Width / GameWindowSize.Height; - } - } + using SKBitmap sKBitmap = new(ViewportWidth, ViewportHeight - 1); + sKBitmap.SetPixels((IntPtr)pixels2); + action(sKBitmap); + } + }); + } - //[DllImportAttribute("libEGL", EntryPoint = "eglGetError")] - //public static extern Silk.NET.OpenGLES.ErrorCode GetError(); + public static long TimeMs; - /// - /// Initializes the class. - /// - static Game() - { - //GlfwProvider.UninitializedGLFW.Value.InitHint(InitHint.AnglePlatformType, (int)AnglePlatformType.OpenGL); - //GlfwProvider.UninitializedGLFW.Value.Init(); - //GetError(); - } + public static Matrix4X4 Camera; - 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()); - } + public static float ScreenAspect { + get { + return (float)GameWindowSize.Width / GameWindowSize.Height; + } + } - /// - /// Initializes a new instance of the class. - /// - protected Game(string iconFileName) - { - strIconFileName = iconFileName; + //[DllImportAttribute("libEGL", EntryPoint = "eglGetError")] + //public static extern Silk.NET.OpenGLES.ErrorCode GetError(); - MainThreadID = Thread.CurrentThread.ManagedThreadId; - Configuration(); + /// + /// Initializes the class. + /// + static Game() { + //GlfwProvider.UninitializedGLFW.Value.InitHint(InitHint.AnglePlatformType, (int)AnglePlatformType.OpenGL); + //GlfwProvider.UninitializedGLFW.Value.Init(); + //GetError(); + } - //GlfwProvider.GLFW.Value.WindowHint(WindowHintContextApi.ContextCreationApi, ContextApi.EglContextApi); - - WindowOptions options = WindowOptions.Default; + 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()); + } - 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; + /// + /// 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(); + Silk.NET.Windowing.Glfw.GlfwWindowing.Use(); + //Silk.NET.Windowing.Sdl.SdlWindowing.Use(); - Window_ = Window.Create(options); + Window_ = Window.Create(options); - ViewPortSize.X = Window_.Size.X; - ViewPortSize.Y = Window_.Size.Y; - ViewPortOffset.X = 0; - ViewPortOffset.Y = 0; + 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; - } + 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); - } - } + 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(); - } + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// + public void Dispose() { + Window_.Dispose(); + } - public void Exit() - { - Window_.Close(); - } + public void Exit() { + Window_.Close(); + } - protected void ToggleWindowMode() - { - /* + protected void ToggleWindowMode() { + /* DeviceSettings settings = base.GraphicsDeviceManager.CurrentSettings.Clone(); if ( ( ConfigIni != null ) && ( ConfigIni.bウィンドウモード != settings.Windowed ) ) { @@ -353,153 +300,132 @@ namespace SampleFramework } */ - FullScreen = !FullScreen; - } + FullScreen = !FullScreen; + } - /// - /// Runs the game. - /// - public void Run() - { - Window_.Run(); - } + /// + /// Runs the game. + /// + public void Run() { + Window_.Run(); + } - protected virtual void Configuration() - { + protected virtual void Configuration() { - } + } - protected virtual void Initialize() - { + protected virtual void Initialize() { - } + } - protected virtual void LoadContent() - { + protected virtual void LoadContent() { - } + } - protected virtual void UnloadContent() - { + protected virtual void UnloadContent() { - } + } - protected virtual void OnExiting() - { + protected virtual void OnExiting() { - } + } - protected virtual void Update() - { + protected virtual void Update() { - } + } - protected virtual void Draw() - { + 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) - { + /// + /// 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))); + public void Window_Load() { + Window_.SetWindowIcon(new ReadOnlySpan(GetIconData(strIconFileName))); - Context = new AngleContext(GraphicsDeviceType_, Window_); - Context.MakeCurrent(); + 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 = 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.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); + Gl.Viewport(0, 0, (uint)Window_.Size.X, (uint)Window_.Size.Y); + Context.SwapInterval(VSync ? 1 : 0); - Initialize(); - LoadContent(); - } + Initialize(); + LoadContent(); + } - public void Window_Closing() - { - CTexture.Terminate(); - - UnloadContent(); - OnExiting(); + public void Window_Closing() { + CTexture.Terminate(); - Context.Dispose(); - } + UnloadContent(); + OnExiting(); - public void Window_Update(double deltaTime) - { - double fps = 1.0f / deltaTime; - TimeMs = (long)(Window_.Time * 1000); + Context.Dispose(); + } - Update(); - } + public void Window_Update(double deltaTime) { + double fps = 1.0f / deltaTime; + TimeMs = (long)(Window_.Time * 1000); - 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); + Update(); + } - Draw(); + public void Window_Render(double deltaTime) { + Camera = Matrix4X4.Identity; - double fps = 1.0f / deltaTime; + if (AsyncActions.Count > 0) { + AsyncActions[0]?.Invoke(); + AsyncActions.Remove(AsyncActions[0]); + } + Gl.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); - Context.SwapBuffers(); - } + Draw(); - 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); - } - } + double fps = 1.0f / deltaTime; - ViewPortOffset.X = (size.X - ViewPortSize.X) / 2; - ViewPortOffset.Y = (size.Y - ViewPortSize.Y) / 2; + Context.SwapBuffers(); + } - WindowSize = size; - Gl.Viewport(ViewPortOffset.X, ViewPortOffset.Y, (uint)ViewPortSize.X, (uint)ViewPortSize.Y); - } + 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); + } + } - public void Window_Move(Vector2D size) - { - WindowPosition = size; - } + ViewPortOffset.X = (size.X - ViewPortSize.X) / 2; + ViewPortOffset.Y = (size.Y - ViewPortSize.Y) / 2; - public void Window_FramebufferResize(Vector2D size) - { - } - } + WindowSize = size; + Gl.Viewport(ViewPortOffset.X, ViewPortOffset.Y, (uint)ViewPortSize.X, (uint)ViewPortSize.Y); + } + + public void Window_Move(Vector2D size) { + WindowPosition = 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 6f06826a..deae733a 100644 --- a/FDK/src/01.Framework/Core/GameWindowSize.cs +++ b/FDK/src/01.Framework/Core/GameWindowSize.cs @@ -1,9 +1,5 @@ -using System; - -namespace SampleFramework -{ - public static class GameWindowSize - { +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/AngleContext.cs b/FDK/src/01.Framework/Rendering/Angle/AngleContext.cs index 4b20461d..c820cb70 100644 --- a/FDK/src/01.Framework/Rendering/Angle/AngleContext.cs +++ b/FDK/src/01.Framework/Rendering/Angle/AngleContext.cs @@ -1,157 +1,136 @@ +using OpenTK.Graphics.Egl; //OpenTKさん ありがとう! using Silk.NET.Core.Contexts; using Silk.NET.GLFW; -using OpenTK.Graphics.Egl; //OpenTKさん ありがとう! using Silk.NET.Windowing; -using Silk.NET.OpenGLES; namespace SampleFramework; -public class AngleContext : IGLContext -{ - private nint Display; - private nint Context; - private nint Surface; +public class AngleContext : IGLContext { + private nint Display; + private nint Context; + private nint Surface; - public AngleContext(AnglePlatformType anglePlatformType, IWindow window) - { - nint windowHandle; - nint display; - if (window.Native.Kind.HasFlag(NativeWindowFlags.Win32)) - { - windowHandle = window.Native.Win32.Value.Hwnd; - display = window.Native.Win32.Value.HDC; - } - else if (window.Native.Kind.HasFlag(NativeWindowFlags.X11)) - { - windowHandle = (nint)window.Native.X11.Value.Window; - // Temporary fix for the segfaults - // Note than X11 Display number is NOT always 0, it can be 1, 2 and so on for example in cases of user switching - display = 0;// Egl.GetDisplay(window.Native.X11.Value.Display); - } - else if (window.Native.Kind.HasFlag(NativeWindowFlags.Cocoa)) - { - windowHandle = window.Native.Cocoa.Value; - display = 0; - } - else if (window.Native.Kind.HasFlag(NativeWindowFlags.Wayland)) - { - windowHandle = window.Native.Wayland.Value.Surface; - display = window.Native.Wayland.Value.Display; - } - else - { - throw new Exception("Window not found"); - } - - Source = window; + public AngleContext(AnglePlatformType anglePlatformType, IWindow window) { + nint windowHandle; + nint display; + if (window.Native.Kind.HasFlag(NativeWindowFlags.Win32)) { + windowHandle = window.Native.Win32.Value.Hwnd; + display = window.Native.Win32.Value.HDC; + } else if (window.Native.Kind.HasFlag(NativeWindowFlags.X11)) { + windowHandle = (nint)window.Native.X11.Value.Window; + // Temporary fix for the segfaults + // Note than X11 Display number is NOT always 0, it can be 1, 2 and so on for example in cases of user switching + display = 0;// Egl.GetDisplay(window.Native.X11.Value.Display); + } else if (window.Native.Kind.HasFlag(NativeWindowFlags.Cocoa)) { + windowHandle = window.Native.Cocoa.Value; + display = 0; + } else if (window.Native.Kind.HasFlag(NativeWindowFlags.Wayland)) { + windowHandle = window.Native.Wayland.Value.Surface; + display = window.Native.Wayland.Value.Display; + } else { + throw new Exception("Window not found"); + } - int platform = 0; - switch(anglePlatformType) - { - case AnglePlatformType.OpenGL: - platform = Egl.PLATFORM_ANGLE_TYPE_OPENGL_ANGLE; - break; - case AnglePlatformType.OpenGLES: - platform = Egl.PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE; - break; - case AnglePlatformType.D3D9: - platform = Egl.PLATFORM_ANGLE_TYPE_D3D9_ANGLE; - break; - case AnglePlatformType.D3D11: - platform = Egl.PLATFORM_ANGLE_TYPE_D3D11_ANGLE; - break; - case AnglePlatformType.Vulkan: - platform = Egl.PLATFORM_ANGLE_TYPE_VULKAN_ANGLE; - break; - case AnglePlatformType.Metal: - platform = Egl.PLATFORM_ANGLE_TYPE_METAL_ANGLE; - break; - } - int[] platformAttributes = new int[] - { - Egl.PLATFORM_ANGLE_TYPE_ANGLE, platform, - Egl.NONE - }; + Source = window; - //getEGLNativeDisplay - Display = Egl.GetPlatformDisplayEXT(Egl.PLATFORM_ANGLE_ANGLE, display, platformAttributes); + int platform = 0; + switch (anglePlatformType) { + case AnglePlatformType.OpenGL: + platform = Egl.PLATFORM_ANGLE_TYPE_OPENGL_ANGLE; + break; + case AnglePlatformType.OpenGLES: + platform = Egl.PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE; + break; + case AnglePlatformType.D3D9: + platform = Egl.PLATFORM_ANGLE_TYPE_D3D9_ANGLE; + break; + case AnglePlatformType.D3D11: + platform = Egl.PLATFORM_ANGLE_TYPE_D3D11_ANGLE; + break; + case AnglePlatformType.Vulkan: + platform = Egl.PLATFORM_ANGLE_TYPE_VULKAN_ANGLE; + break; + case AnglePlatformType.Metal: + platform = Egl.PLATFORM_ANGLE_TYPE_METAL_ANGLE; + break; + } + int[] platformAttributes = new int[] + { + Egl.PLATFORM_ANGLE_TYPE_ANGLE, platform, + Egl.NONE + }; - Egl.Initialize(Display, out int major, out int minor); - Egl.BindAPI(RenderApi.ES); - - IntPtr[] configs = new IntPtr[1]; - int[] configAttributes = new int[] - { - Egl.RENDERABLE_TYPE, Egl.OPENGL_ES2_BIT, - Egl.BUFFER_SIZE, 0, - Egl.NONE - }; - unsafe - { - Egl.ChooseConfig(Display, configAttributes, configs, configs.Length, out int num_config); - } + //getEGLNativeDisplay + Display = Egl.GetPlatformDisplayEXT(Egl.PLATFORM_ANGLE_ANGLE, display, platformAttributes); - int[] contextAttributes = new int[] - { + Egl.Initialize(Display, out int major, out int minor); + Egl.BindAPI(RenderApi.ES); + + IntPtr[] configs = new IntPtr[1]; + int[] configAttributes = new int[] + { + Egl.RENDERABLE_TYPE, Egl.OPENGL_ES2_BIT, + Egl.BUFFER_SIZE, 0, + Egl.NONE + }; + unsafe { + Egl.ChooseConfig(Display, configAttributes, configs, configs.Length, out int num_config); + } + + int[] contextAttributes = new int[] + { //Egl.CONTEXT_CLIENT_VERSION, 2, Egl.CONTEXT_MAJOR_VERSION, 2, - Egl.CONTEXT_MINOR_VERSION, 0, - Egl.NONE - }; - Context = Egl.CreateContext(Display, configs[0], 0, contextAttributes); - - int[] surfaceAttributes = new int[] - { - Egl.NONE - }; + Egl.CONTEXT_MINOR_VERSION, 0, + Egl.NONE + }; + Context = Egl.CreateContext(Display, configs[0], 0, contextAttributes); - //Surface = Egl.CreatePlatformWindowSurfaceEXT(Display, configs[0], windowHandle, null); - Surface = Egl.CreateWindowSurface(Display, configs[0], windowHandle, 0); + int[] surfaceAttributes = new int[] + { + Egl.NONE + }; - var error1 = Egl.GetError(); - } + //Surface = Egl.CreatePlatformWindowSurfaceEXT(Display, configs[0], windowHandle, null); + Surface = Egl.CreateWindowSurface(Display, configs[0], windowHandle, 0); - public nint Handle { get; set; } + var error1 = Egl.GetError(); + } - public IGLContextSource? Source { get; set; } + public nint Handle { get; set; } - public bool IsCurrent { get; set; } = true; + public IGLContextSource? Source { get; set; } - public nint GetProcAddress(string proc, int? slot = null) - { - nint addr = Egl.GetProcAddress(proc); - return addr; - } + public bool IsCurrent { get; set; } = true; - public bool TryGetProcAddress(string proc, out nint addr, int? slot = null) - { - addr = Egl.GetProcAddress(proc); - return addr != 0; - } + public nint GetProcAddress(string proc, int? slot = null) { + nint addr = Egl.GetProcAddress(proc); + return addr; + } - public void SwapInterval(int interval) - { - Egl.SwapInterval(Display, interval); - } + public bool TryGetProcAddress(string proc, out nint addr, int? slot = null) { + addr = Egl.GetProcAddress(proc); + return addr != 0; + } - public void SwapBuffers() - { - Egl.SwapBuffers(Display, Surface); - } + public void SwapInterval(int interval) { + Egl.SwapInterval(Display, interval); + } - public void MakeCurrent() - { - Egl.MakeCurrent(Display, Surface, Surface, Context); - } + public void SwapBuffers() { + Egl.SwapBuffers(Display, Surface); + } - public void Clear() - { - } + public void MakeCurrent() { + Egl.MakeCurrent(Display, Surface, Surface, Context); + } - public void Dispose() - { - Egl.DestroyContext(Display, Context); - Egl.DestroySurface(Display, Surface); - Egl.Terminate(Display); - } -} \ No newline at end of file + public void Clear() { + } + + public void Dispose() { + Egl.DestroyContext(Display, Context); + Egl.DestroySurface(Display, Surface); + Egl.Terminate(Display); + } +} diff --git a/FDK/src/01.Framework/Rendering/Angle/Egl.cs b/FDK/src/01.Framework/Rendering/Angle/Egl.cs index c86ecb5b..cbe91664 100644 --- a/FDK/src/01.Framework/Rendering/Angle/Egl.cs +++ b/FDK/src/01.Framework/Rendering/Angle/Egl.cs @@ -23,7 +23,6 @@ // OTHER DEALINGS IN THE SOFTWARE. // -using System; using System.Runtime.InteropServices; // ReSharper disable InconsistentNaming @@ -31,390 +30,376 @@ using System.Runtime.InteropServices; #pragma warning disable 1591 // Missing XML comments -namespace OpenTK.Graphics.Egl -{ - using EGLNativeDisplayType = IntPtr; - using EGLNativeWindowType = IntPtr; - using EGLNativePixmapType = IntPtr; - using EGLConfig = IntPtr; - using EGLContext = IntPtr; - using EGLDisplay = IntPtr; - using EGLSurface = IntPtr; - using EGLClientBuffer = IntPtr; +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; - public enum RenderApi - { - ES = Egl.OPENGL_ES_API, - GL = Egl.OPENGL_API, - VG = Egl.OPENVG_API - } + public enum RenderApi { + ES = Egl.OPENGL_ES_API, + GL = Egl.OPENGL_API, + VG = Egl.OPENVG_API + } - [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, - } + [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 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 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 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 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 class EglException : Exception - { - public EglException() : base() - { } + public class EglException : Exception { + public EglException() : base() { } - public EglException(string message) : base(message) - { } - } + public EglException(string message) : base(message) { } + } - public static partial class Egl - { - public const int CONTEXT_MAJOR_VERSION = 0x3098; - public const int CONTEXT_MINOR_VERSION = 0x30FB; + public static partial class Egl { + public const int CONTEXT_MAJOR_VERSION = 0x3098; + public const int CONTEXT_MINOR_VERSION = 0x30FB; - 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 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; - // 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_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); - [DllImport("libEGL", EntryPoint = "eglGetPlatformDisplayEXT")] - public static extern EGLDisplay GetPlatformDisplay(int platform, EGLNativeDisplayType displayId, int[] attribList); + [DllImport("libEGL", EntryPoint = "eglGetPlatformDisplayEXT")] + public static extern EGLDisplay GetPlatformDisplay(int platform, EGLNativeDisplayType displayId, int[] attribList); - // 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; + // 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 = "eglGetError")] - public static extern ErrorCode GetError(); + [DllImportAttribute("libEGL", EntryPoint = "eglGetError")] + public static extern ErrorCode GetError(); - [DllImportAttribute("libEGL", EntryPoint = "eglGetDisplay")] - public static extern EGLDisplay GetDisplay(EGLNativeDisplayType display_id); + [DllImportAttribute("libEGL", EntryPoint = "eglGetDisplay")] + public static extern EGLDisplay GetDisplay(EGLNativeDisplayType display_id); - [DllImportAttribute("libEGL", EntryPoint = "eglInitialize")] - //[return: MarshalAs(UnmanagedType.I1)] - public static extern bool Initialize(EGLDisplay dpy, out int major, out int minor); + [DllImportAttribute("libEGL", EntryPoint = "eglInitialize")] + //[return: MarshalAs(UnmanagedType.I1)] + public static extern bool Initialize(EGLDisplay dpy, out int major, out int minor); - [DllImportAttribute("libEGL", EntryPoint = "eglTerminate")] - //[return: MarshalAs(UnmanagedType.I1)] - public static extern bool Terminate(EGLDisplay dpy); + [DllImportAttribute("libEGL", EntryPoint = "eglTerminate")] + //[return: MarshalAs(UnmanagedType.I1)] + public static extern bool Terminate(EGLDisplay dpy); - [DllImportAttribute("libEGL", EntryPoint = "eglQueryString")] - public static extern IntPtr QueryString(EGLDisplay dpy, int name); + [DllImportAttribute("libEGL", EntryPoint = "eglQueryString")] + public static extern IntPtr QueryString(EGLDisplay dpy, int name); - [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 = "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 static extern bool ChooseConfig(EGLDisplay dpy, int[] attrib_list, [In, Out] 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 = "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 unsafe static extern bool ChooseConfig(EGLDisplay dpy, int[] attrib_list, 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 = "eglGetConfigAttrib")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool GetConfigAttrib(EGLDisplay dpy, EGLConfig config, int attribute, out int value); - [DllImportAttribute("libEGL", EntryPoint = "eglCreateWindowSurface")] - public static extern EGLSurface CreateWindowSurface(EGLDisplay dpy, EGLConfig config, IntPtr win, IntPtr attrib_list); + [DllImportAttribute("libEGL", EntryPoint = "eglCreateWindowSurface")] + public static extern EGLSurface CreateWindowSurface(EGLDisplay dpy, EGLConfig config, IntPtr win, IntPtr attrib_list); - [DllImportAttribute("libEGL", EntryPoint = "eglCreatePbufferSurface")] - public static extern EGLSurface CreatePbufferSurface(EGLDisplay dpy, EGLConfig config, int[] attrib_list); + [DllImportAttribute("libEGL", EntryPoint = "eglCreatePbufferSurface")] + public static extern EGLSurface CreatePbufferSurface(EGLDisplay dpy, EGLConfig config, int[] attrib_list); - [DllImportAttribute("libEGL", EntryPoint = "eglCreatePixmapSurface")] - public static extern EGLSurface CreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, int[] attrib_list); + [DllImportAttribute("libEGL", EntryPoint = "eglCreatePixmapSurface")] + public static extern EGLSurface CreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, int[] attrib_list); - [DllImportAttribute("libEGL", EntryPoint = "eglDestroySurface")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool DestroySurface(EGLDisplay dpy, EGLSurface surface); + [DllImportAttribute("libEGL", EntryPoint = "eglDestroySurface")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool DestroySurface(EGLDisplay dpy, EGLSurface surface); - [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 = "eglQuerySurface")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool QuerySurface(EGLDisplay dpy, EGLSurface surface, int attribute, out int value); - [DllImportAttribute("libEGL", EntryPoint = "eglBindAPI")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool BindAPI(RenderApi api); + [DllImportAttribute("libEGL", EntryPoint = "eglBindAPI")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool BindAPI(RenderApi api); - [DllImportAttribute("libEGL", EntryPoint = "eglQueryAPI")] - public static extern int QueryAPI(); + [DllImportAttribute("libEGL", EntryPoint = "eglQueryAPI")] + public static extern int QueryAPI(); - [DllImportAttribute("libEGL", EntryPoint = "eglWaitClient")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool WaitClient(); + [DllImportAttribute("libEGL", EntryPoint = "eglWaitClient")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool WaitClient(); - [DllImportAttribute("libEGL", EntryPoint = "eglReleaseThread")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool ReleaseThread(); + [DllImportAttribute("libEGL", EntryPoint = "eglReleaseThread")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool ReleaseThread(); - [DllImportAttribute("libEGL", EntryPoint = "eglCreatePbufferFromClientBuffer")] - public static extern EGLSurface CreatePbufferFromClientBuffer(EGLDisplay dpy, int buftype, EGLClientBuffer buffer, EGLConfig config, int[] attrib_list); + [DllImportAttribute("libEGL", EntryPoint = "eglCreatePbufferFromClientBuffer")] + public static extern EGLSurface CreatePbufferFromClientBuffer(EGLDisplay dpy, int buftype, EGLClientBuffer buffer, EGLConfig config, int[] attrib_list); - [DllImportAttribute("libEGL", EntryPoint = "eglSurfaceAttrib")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool SurfaceAttrib(EGLDisplay dpy, EGLSurface surface, int attribute, int value); + [DllImportAttribute("libEGL", EntryPoint = "eglSurfaceAttrib")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool SurfaceAttrib(EGLDisplay dpy, EGLSurface surface, int attribute, int value); - [DllImportAttribute("libEGL", EntryPoint = "eglBindTexImage")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool BindTexImage(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 = "eglReleaseTexImage")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool ReleaseTexImage(EGLDisplay dpy, EGLSurface surface, int buffer); + [DllImportAttribute("libEGL", EntryPoint = "eglReleaseTexImage")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool ReleaseTexImage(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 = "eglSwapInterval")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool SwapInterval(EGLDisplay dpy, int interval); - [DllImportAttribute("libEGL", EntryPoint = "eglCreateContext")] - private static extern IntPtr eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, int[] attrib_list); + [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; - } + 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; - } - } - } -} \ No newline at end of file + // 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/01.Framework/Rendering/BlendHelper.cs b/FDK/src/01.Framework/Rendering/BlendHelper.cs index 739b7e34..f15910ae 100644 --- a/FDK/src/01.Framework/Rendering/BlendHelper.cs +++ b/FDK/src/01.Framework/Rendering/BlendHelper.cs @@ -2,41 +2,37 @@ using Silk.NET.OpenGLES; namespace SampleFramework; -public enum BlendType -{ - Normal, - Add, - Screen, - Multi, - Sub +public enum BlendType { + Normal, + Add, + Screen, + Multi, + Sub } -public static class BlendHelper -{ - public static void SetBlend(BlendType blendType) - { - switch(blendType) - { - case BlendType.Normal: - Game.Gl.BlendEquation(BlendEquationModeEXT.FuncAdd); - Game.Gl.BlendFunc(GLEnum.SrcAlpha, GLEnum.OneMinusSrcAlpha); - break; - case BlendType.Add: - Game.Gl.BlendEquation(BlendEquationModeEXT.FuncAdd); - Game.Gl.BlendFunc(GLEnum.SrcAlpha, GLEnum.One); - break; - case BlendType.Screen: - Game.Gl.BlendEquation(BlendEquationModeEXT.FuncAdd); - Game.Gl.BlendFunc(GLEnum.One, GLEnum.OneMinusSrcColor); - break; - case BlendType.Multi: - Game.Gl.BlendEquation(BlendEquationModeEXT.FuncAdd); - Game.Gl.BlendFunc(GLEnum.DstColor, GLEnum.OneMinusSrcAlpha); - break; - case BlendType.Sub: - Game.Gl.BlendEquation(BlendEquationModeEXT.FuncReverseSubtract); - Game.Gl.BlendFunc(GLEnum.SrcAlpha, GLEnum.One); - break; - } - } -} \ No newline at end of file +public static class BlendHelper { + public static void SetBlend(BlendType blendType) { + switch (blendType) { + case BlendType.Normal: + Game.Gl.BlendEquation(BlendEquationModeEXT.FuncAdd); + Game.Gl.BlendFunc(GLEnum.SrcAlpha, GLEnum.OneMinusSrcAlpha); + break; + case BlendType.Add: + Game.Gl.BlendEquation(BlendEquationModeEXT.FuncAdd); + Game.Gl.BlendFunc(GLEnum.SrcAlpha, GLEnum.One); + break; + case BlendType.Screen: + Game.Gl.BlendEquation(BlendEquationModeEXT.FuncAdd); + Game.Gl.BlendFunc(GLEnum.One, GLEnum.OneMinusSrcColor); + break; + case BlendType.Multi: + Game.Gl.BlendEquation(BlendEquationModeEXT.FuncAdd); + Game.Gl.BlendFunc(GLEnum.DstColor, GLEnum.OneMinusSrcAlpha); + break; + case BlendType.Sub: + Game.Gl.BlendEquation(BlendEquationModeEXT.FuncReverseSubtract); + Game.Gl.BlendFunc(GLEnum.SrcAlpha, GLEnum.One); + break; + } + } +} diff --git a/FDK/src/01.Framework/Rendering/ImGUIManager.cs b/FDK/src/01.Framework/Rendering/ImGUIManager.cs index dfb207e2..c7a053b9 100644 --- a/FDK/src/01.Framework/Rendering/ImGUIManager.cs +++ b/FDK/src/01.Framework/Rendering/ImGUIManager.cs @@ -2,25 +2,22 @@ using ImGuiNET; namespace LWGFW.Graphics; -public class ImGUIManager : IDisposable -{ - private nint Context; +public class ImGUIManager : IDisposable { + private nint Context; - public ImGUIManager() - { - Context = ImGui.CreateContext(); - ImGui.SetCurrentContext(Context); + public ImGUIManager() { + Context = ImGui.CreateContext(); + ImGui.SetCurrentContext(Context); - ImGuiIOPtr imguiIO = ImGui.GetIO(); + ImGuiIOPtr imguiIO = ImGui.GetIO(); - imguiIO.ConfigFlags |= ImGuiConfigFlags.NavEnableKeyboard; - imguiIO.ConfigFlags |= ImGuiConfigFlags.NavEnableGamepad; + imguiIO.ConfigFlags |= ImGuiConfigFlags.NavEnableKeyboard; + imguiIO.ConfigFlags |= ImGuiConfigFlags.NavEnableGamepad; - ImGui.StyleColorsDark(); - } + ImGui.StyleColorsDark(); + } - public void Dispose() - { - ImGui.DestroyContext(Context); - } -} \ No newline at end of file + public void Dispose() { + ImGui.DestroyContext(Context); + } +} diff --git a/FDK/src/01.Framework/Rendering/ShaderHelper.cs b/FDK/src/01.Framework/Rendering/ShaderHelper.cs index 2f16674f..0d35d220 100644 --- a/FDK/src/01.Framework/Rendering/ShaderHelper.cs +++ b/FDK/src/01.Framework/Rendering/ShaderHelper.cs @@ -2,54 +2,50 @@ using Silk.NET.OpenGLES; namespace SampleFramework; -public static class ShaderHelper -{ - public static uint CreateShader(string code, ShaderType shaderType) - { - uint vertexShader = Game.Gl.CreateShader(shaderType); +public static class ShaderHelper { + public static uint CreateShader(string code, ShaderType shaderType) { + uint vertexShader = Game.Gl.CreateShader(shaderType); - Game.Gl.ShaderSource(vertexShader, code); - - Game.Gl.CompileShader(vertexShader); + Game.Gl.ShaderSource(vertexShader, code); - Game.Gl.GetShader(vertexShader, ShaderParameterName.CompileStatus, out int status); + Game.Gl.CompileShader(vertexShader); - if (status != (int)GLEnum.True) - throw new Exception($"{shaderType} failed to compile:{Game.Gl.GetShaderInfoLog(vertexShader)}"); + Game.Gl.GetShader(vertexShader, ShaderParameterName.CompileStatus, out int status); - return vertexShader; - } + if (status != (int)GLEnum.True) + throw new Exception($"{shaderType} failed to compile:{Game.Gl.GetShaderInfoLog(vertexShader)}"); - public static uint CreateShaderProgram(uint vertexShader, uint fragmentShader) - { - uint program = Game.Gl.CreateProgram(); - - Game.Gl.AttachShader(program, vertexShader); - Game.Gl.AttachShader(program, fragmentShader); + return vertexShader; + } - Game.Gl.LinkProgram(program); + public static uint CreateShaderProgram(uint vertexShader, uint fragmentShader) { + uint program = Game.Gl.CreateProgram(); - Game.Gl.GetProgram(program, ProgramPropertyARB.LinkStatus, out int linkStatus); - - if (linkStatus != (int)GLEnum.True) - throw new Exception($"Program failed to link:{Game.Gl.GetProgramInfoLog(program)}"); + Game.Gl.AttachShader(program, vertexShader); + Game.Gl.AttachShader(program, fragmentShader); - Game.Gl.DetachShader(program, vertexShader); - Game.Gl.DetachShader(program, fragmentShader); + Game.Gl.LinkProgram(program); - return program; - } + Game.Gl.GetProgram(program, ProgramPropertyARB.LinkStatus, out int linkStatus); - public static uint CreateShaderProgramFromSource(string vertexCode, string fragmentCode) - { - uint vertexShader = CreateShader(vertexCode, ShaderType.VertexShader); - uint fragmentShader = CreateShader(fragmentCode, ShaderType.FragmentShader); - - uint program = CreateShaderProgram(vertexShader, fragmentShader); - - Game.Gl.DeleteShader(vertexShader); - Game.Gl.DeleteShader(fragmentShader); + if (linkStatus != (int)GLEnum.True) + throw new Exception($"Program failed to link:{Game.Gl.GetProgramInfoLog(program)}"); - return program; - } -} \ No newline at end of file + Game.Gl.DetachShader(program, vertexShader); + Game.Gl.DetachShader(program, fragmentShader); + + return program; + } + + public static uint CreateShaderProgramFromSource(string vertexCode, string fragmentCode) { + uint vertexShader = CreateShader(vertexCode, ShaderType.VertexShader); + uint fragmentShader = CreateShader(fragmentCode, ShaderType.FragmentShader); + + uint program = CreateShaderProgram(vertexShader, fragmentShader); + + Game.Gl.DeleteShader(vertexShader); + Game.Gl.DeleteShader(fragmentShader); + + return program; + } +} diff --git a/FDK/src/02.Input/CInputGamepad.cs b/FDK/src/02.Input/CInputGamepad.cs index 1d9556b0..c64c66af 100644 --- a/FDK/src/02.Input/CInputGamepad.cs +++ b/FDK/src/02.Input/CInputGamepad.cs @@ -1,17 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; using Silk.NET.Input; -namespace FDK -{ - public class CInputGamepad : IInputDevice, IDisposable - { +namespace FDK { + public class CInputGamepad : IInputDevice, IDisposable { // コンストラクタ - public CInputGamepad(IGamepad gamepad) - { + public CInputGamepad(IGamepad gamepad) { this.CurrentType = InputDeviceType.Gamepad; this.GUID = gamepad.Index.ToString(); this.ID = gamepad.Index; @@ -21,62 +14,49 @@ namespace FDK gamepad.ButtonDown += Joystick_ButtonDown; gamepad.ButtonUp += Joystick_ButtonUp; } - - + + // メソッド - - public void SetID( int nID ) - { + + public void SetID(int nID) { this.ID = nID; } #region [ IInputDevice 実装 ] //----------------- - public InputDeviceType CurrentType - { + public InputDeviceType CurrentType { get; private set; } - public string GUID - { + public string GUID { get; private set; } - public int ID - { - get; - private set; - } - public List InputEvents - { + public int ID { get; private set; } - public string strDeviceName - { + public List InputEvents { + get; + private set; + } + public string strDeviceName { get; set; } - public void Polling(bool useBufferInput) - { + public void Polling(bool useBufferInput) { InputEvents.Clear(); - - for (int i = 0; i < ButtonStates.Length; i++) - { - if (ButtonStates[i].Item1) - { - if (ButtonStates[i].Item2 >= 1) - { + + for (int i = 0; i < ButtonStates.Length; i++) { + if (ButtonStates[i].Item1) { + if (ButtonStates[i].Item2 >= 1) { ButtonStates[i].Item2 = 2; - } - else - { + } else { ButtonStates[i].Item2 = 1; InputEvents.Add( - new STInputEvent() - { + new STInputEvent() { nKey = i, Pressed = true, Released = false, @@ -85,20 +65,14 @@ namespace FDK } ); } - } - else - { - if (ButtonStates[i].Item2 <= -1) - { + } else { + if (ButtonStates[i].Item2 <= -1) { ButtonStates[i].Item2 = -2; - } - else - { + } else { ButtonStates[i].Item2 = -1; InputEvents.Add( - new STInputEvent() - { + new STInputEvent() { nKey = i, Pressed = false, Released = true, @@ -111,20 +85,16 @@ namespace FDK } } - public bool KeyPressed(int nButton) - { + public bool KeyPressed(int nButton) { return ButtonStates[nButton].Item2 == 1; } - public bool KeyPressing(int nButton) - { + public bool KeyPressing(int nButton) { return ButtonStates[nButton].Item2 >= 1; } - public bool KeyReleased(int nButton) - { + public bool KeyReleased(int nButton) { return ButtonStates[nButton].Item2 == -1; } - public bool KeyReleasing(int nButton) - { + public bool KeyReleasing(int nButton) { return ButtonStates[nButton].Item2 <= -1; } //----------------- @@ -132,12 +102,9 @@ namespace FDK #region [ IDisposable 実装 ] //----------------- - public void Dispose() - { - if(!this.IsDisposed) - { - if (this.InputEvents != null) - { + public void Dispose() { + if (!this.IsDisposed) { + if (this.InputEvents != null) { this.InputEvents = null; } this.IsDisposed = true; @@ -154,18 +121,14 @@ namespace FDK private (bool, int)[] ButtonStates = new (bool, int)[15]; private bool IsDisposed; - private void Joystick_ButtonDown(IGamepad joystick, Button button) - { - if (button.Name != ButtonName.Unknown) - { + 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) - { + private void Joystick_ButtonUp(IGamepad joystick, Button button) { + if (button.Name != ButtonName.Unknown) { ButtonStates[(int)button.Name].Item1 = false; } } diff --git a/FDK/src/02.Input/CInputJoystick.cs b/FDK/src/02.Input/CInputJoystick.cs index af5916a6..2f181d8a 100644 --- a/FDK/src/02.Input/CInputJoystick.cs +++ b/FDK/src/02.Input/CInputJoystick.cs @@ -1,19 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; -using Silk.NET.Input; +using Silk.NET.Input; -namespace FDK -{ - public class CInputJoystick : IInputDevice, IDisposable - { +namespace FDK { + public class CInputJoystick : IInputDevice, IDisposable { // コンストラクタ - private IJoystick Joystick {get; set;} + private IJoystick Joystick { get; set; } - public CInputJoystick(IJoystick joystick) - { + public CInputJoystick(IJoystick joystick) { Joystick = joystick; this.CurrentType = InputDeviceType.Joystick; this.GUID = joystick.Index.ToString(); @@ -26,47 +19,40 @@ namespace FDK joystick.AxisMoved += Joystick_AxisMoved; joystick.HatMoved += Joystick_HatMoved; } - - + + // メソッド - - public void SetID( int nID ) - { + + public void SetID(int nID) { this.ID = nID; } #region [ IInputDevice 実装 ] //----------------- - public InputDeviceType CurrentType - { + public InputDeviceType CurrentType { get; private set; } - public string GUID - { + public string GUID { get; private set; } - public int ID - { - get; - private set; - } - public List InputEvents - { + public int ID { get; private set; } - public string strDeviceName - { + public List InputEvents { + get; + private set; + } + public string strDeviceName { get; set; } - public void Polling(bool useBufferInput) - { + 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 @@ -75,21 +61,15 @@ namespace FDK ButtonStates[button.Index].Item1 = button.Pressed; } - for (int i = 0; i < ButtonStates.Length; i++) - { - if (ButtonStates[i].Item1) - { - if (ButtonStates[i].Item2 >= 1) - { + for (int i = 0; i < ButtonStates.Length; i++) { + if (ButtonStates[i].Item1) { + if (ButtonStates[i].Item2 >= 1) { ButtonStates[i].Item2 = 2; - } - else - { + } else { ButtonStates[i].Item2 = 1; InputEvents.Add( - new STInputEvent() - { + new STInputEvent() { nKey = i, Pressed = true, Released = false, @@ -98,20 +78,14 @@ namespace FDK } ); } - } - else - { - if (ButtonStates[i].Item2 <= -1) - { + } else { + if (ButtonStates[i].Item2 <= -1) { ButtonStates[i].Item2 = -2; - } - else - { + } else { ButtonStates[i].Item2 = -1; InputEvents.Add( - new STInputEvent() - { + new STInputEvent() { nKey = i, Pressed = false, Released = true, @@ -124,20 +98,16 @@ namespace FDK } } - public bool KeyPressed(int nButton) - { + public bool KeyPressed(int nButton) { return ButtonStates[nButton].Item2 == 1; } - public bool KeyPressing(int nButton) - { + public bool KeyPressing(int nButton) { return ButtonStates[nButton].Item2 >= 1; } - public bool KeyReleased(int nButton) - { + public bool KeyReleased(int nButton) { return ButtonStates[nButton].Item2 == -1; } - public bool KeyReleasing(int nButton) - { + public bool KeyReleasing(int nButton) { return ButtonStates[nButton].Item2 <= -1; } //----------------- @@ -145,12 +115,9 @@ namespace FDK #region [ IDisposable 実装 ] //----------------- - public void Dispose() - { - if(!this.IsDisposed) - { - if (this.InputEvents != null) - { + public void Dispose() { + if (!this.IsDisposed) { + if (this.InputEvents != null) { this.InputEvents = null; } this.IsDisposed = true; @@ -167,29 +134,23 @@ namespace FDK private (bool, int)[] ButtonStates = new (bool, int)[18]; private bool IsDisposed; - private void Joystick_ButtonDown(IJoystick joystick, Button button) - { - if (button.Name != ButtonName.Unknown) - { + 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) - { + private void Joystick_ButtonUp(IJoystick joystick, Button button) { + if (button.Name != ButtonName.Unknown) { ButtonStates[(int)button.Name].Item1 = false; } } - private void Joystick_AxisMoved(IJoystick joystick, Axis axis) - { + private void Joystick_AxisMoved(IJoystick joystick, Axis axis) { } - private void Joystick_HatMoved(IJoystick joystick, Hat hat) - { + private void Joystick_HatMoved(IJoystick joystick, Hat hat) { } //----------------- diff --git a/FDK/src/02.Input/CInputKeyboard.cs b/FDK/src/02.Input/CInputKeyboard.cs index ad5d047a..d366e13f 100644 --- a/FDK/src/02.Input/CInputKeyboard.cs +++ b/FDK/src/02.Input/CInputKeyboard.cs @@ -1,23 +1,15 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; -using Silk.NET.Input; +using Silk.NET.Input; -namespace FDK -{ - public class CInputKeyboard : IInputDevice, IDisposable - { +namespace FDK { + public class CInputKeyboard : IInputDevice, IDisposable { // コンストラクタ - public CInputKeyboard(IReadOnlyList keyboards) - { + public CInputKeyboard(IReadOnlyList keyboards) { this.CurrentType = InputDeviceType.Keyboard; this.GUID = ""; this.ID = 0; - foreach (var keyboard in keyboards) - { + foreach (var keyboard in keyboards) { keyboard.KeyDown += KeyDown; keyboard.KeyUp += KeyUp; keyboard.KeyChar += KeyChar; @@ -39,24 +31,17 @@ namespace FDK public List InputEvents { get; private set; } public string strDeviceName { get; set; } - public void Polling(bool useBufferInput) - { + public void Polling(bool useBufferInput) { InputEvents.Clear(); - - for (int i = 0; i < KeyStates.Length; i++) - { - if (KeyStates[i].Item1) - { - if (KeyStates[i].Item2 >= 1) - { + + for (int i = 0; i < KeyStates.Length; i++) { + if (KeyStates[i].Item1) { + if (KeyStates[i].Item2 >= 1) { KeyStates[i].Item2 = 2; - } - else - { + } else { KeyStates[i].Item2 = 1; InputEvents.Add( - new STInputEvent() - { + new STInputEvent() { nKey = i, Pressed = true, Released = false, @@ -65,19 +50,13 @@ namespace FDK } ); } - } - else - { - if (KeyStates[i].Item2 <= -1) - { + } else { + if (KeyStates[i].Item2 <= -1) { KeyStates[i].Item2 = -2; - } - else - { + } else { KeyStates[i].Item2 = -1; InputEvents.Add( - new STInputEvent() - { + new STInputEvent() { nKey = i, Pressed = false, Released = true, @@ -92,29 +71,25 @@ namespace FDK /// /// 調べる SlimDX.DirectInput.Key を int にキャストした値。(SharpDX.DirectInput.Key ではないので注意。) /// - public bool KeyPressed(int nKey) - { + public bool KeyPressed(int nKey) { return KeyStates[nKey].Item2 == 1; } /// /// 調べる SlimDX.DirectInput.Key を int にキャストした値。(SharpDX.DirectInput.Key ではないので注意。) /// - public bool KeyPressing(int nKey) - { + public bool KeyPressing(int nKey) { return KeyStates[nKey].Item2 >= 1; } /// /// 調べる SlimDX.DirectInput.Key を int にキャストした値。(SharpDX.DirectInput.Key ではないので注意。) /// - public bool KeyReleased(int nKey) - { + public bool KeyReleased(int nKey) { return KeyStates[nKey].Item2 == -1; } /// /// 調べる SlimDX.DirectInput.Key を int にキャストした値。(SharpDX.DirectInput.Key ではないので注意。) /// - public bool KeyReleasing(int nKey) - { + public bool KeyReleasing(int nKey) { return KeyStates[nKey].Item2 <= -1; } //----------------- @@ -122,12 +97,9 @@ namespace FDK #region [ IDisposable 実装 ] //----------------- - public void Dispose() - { - if(!this.IsDisposed) - { - if (this.InputEvents != null) - { + public void Dispose() { + if (!this.IsDisposed) { + if (this.InputEvents != null) { this.InputEvents = null; } this.IsDisposed = true; @@ -147,26 +119,21 @@ namespace FDK //private CTimer ct; - private void KeyDown(IKeyboard keyboard, Key key, int keyCode) - { - if (key != Key.Unknown) - { + 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) - { + 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) - { + private void KeyChar(IKeyboard keyboard, char ch) { } //----------------- diff --git a/FDK/src/02.Input/CInputMIDI.cs b/FDK/src/02.Input/CInputMIDI.cs index f9ddf524..d1c76ab8 100644 --- a/FDK/src/02.Input/CInputMIDI.cs +++ b/FDK/src/02.Input/CInputMIDI.cs @@ -1,12 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; - -namespace FDK -{ - public class CInputMIDI : IInputDevice, IDisposable - { +namespace FDK { + public class CInputMIDI : IInputDevice, IDisposable { // プロパティ public IntPtr MidiInPtr; @@ -14,8 +7,7 @@ namespace FDK // コンストラクタ - public CInputMIDI(uint nID) - { + public CInputMIDI(uint nID) { this.MidiInPtr = IntPtr.Zero; this.EventBuffers = new List(32); this.InputEvents = new List(32); @@ -28,8 +20,7 @@ namespace FDK // メソッド - public void tメッセージからMIDI信号のみ受信(uint wMsg, IntPtr dwInstance, IntPtr dwParam1, IntPtr dwParam2, long n受信システム時刻) - { + public void tメッセージからMIDI信号のみ受信(uint wMsg, IntPtr dwInstance, IntPtr dwParam1, IntPtr dwParam2, long n受信システム時刻) { /* if (wMsg == CWin32.MIM_DATA) { @@ -71,8 +62,7 @@ namespace FDK public List InputEvents { get; private set; } public string strDeviceName { get; set; } - public void Polling(bool bWindowがアクティブ中) - { + public void Polling(bool bWindowがアクティブ中) { // this.list入力イベント = new List( 32 ); this.InputEvents.Clear(); // #xxxxx 2012.6.11 yyagi; To optimize, I removed new(); @@ -81,27 +71,21 @@ namespace FDK this.EventBuffers.Clear(); } - public bool KeyPressed(int nKey) - { - foreach (STInputEvent event2 in this.InputEvents) - { - if ((event2.nKey == nKey) && event2.Pressed) - { + 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) - { + public bool KeyPressing(int nKey) { return false; } - public bool KeyReleased(int nKey) - { + public bool KeyReleased(int nKey) { return false; } - public bool KeyReleasing(int nKey) - { + public bool KeyReleasing(int nKey) { return false; } //----------------- @@ -109,14 +93,11 @@ namespace FDK #region [ IDisposable 実装 ] //----------------- - public void Dispose() - { - if (this.EventBuffers != null) - { + public void Dispose() { + if (this.EventBuffers != null) { this.EventBuffers = null; } - if (this.InputEvents != null) - { + if (this.InputEvents != null) { this.InputEvents = null; } } diff --git a/FDK/src/02.Input/CInputManager.cs b/FDK/src/02.Input/CInputManager.cs index 37f35230..dbd19f9c 100644 --- a/FDK/src/02.Input/CInputManager.cs +++ b/FDK/src/02.Input/CInputManager.cs @@ -1,15 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; -using System.Runtime.InteropServices; -using Silk.NET.Windowing; +using System.Diagnostics; using Silk.NET.Input; +using Silk.NET.Windowing; -namespace FDK -{ - public class CInputManager : IDisposable - { +namespace FDK { + public class CInputManager : IDisposable { // 定数 public static int DefaultVolume = 110; @@ -17,23 +11,17 @@ namespace FDK // プロパティ - public List InputDevices - { + public List InputDevices { get; private set; } - public IInputDevice Keyboard - { - get - { - if (this._Keyboard != null) - { + public IInputDevice Keyboard { + get { + if (this._Keyboard != null) { return this._Keyboard; } - foreach (IInputDevice device in this.InputDevices) - { - if (device.CurrentType == InputDeviceType.Keyboard) - { + foreach (IInputDevice device in this.InputDevices) { + if (device.CurrentType == InputDeviceType.Keyboard) { this._Keyboard = device; return device; } @@ -41,18 +29,13 @@ namespace FDK return null; } } - public IInputDevice Mouse - { - get - { - if (this._Mouse != null) - { + public IInputDevice Mouse { + get { + if (this._Mouse != null) { return this._Mouse; } - foreach (IInputDevice device in this.InputDevices) - { - if (device.CurrentType == InputDeviceType.Mouse) - { + foreach (IInputDevice device in this.InputDevices) { + if (device.CurrentType == InputDeviceType.Mouse) { this._Mouse = device; return device; } @@ -63,130 +46,98 @@ namespace FDK // コンストラクタ - public CInputManager(IWindow window, bool bUseMidiIn = true) - { + public CInputManager(IWindow window, bool bUseMidiIn = true) { Initialize(window, bUseMidiIn); } - public void Initialize(IWindow window, bool 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 - { + try { cinputkeyboard = new CInputKeyboard(Context.Keyboards); cinputmouse = new CInputMouse(Context.Mice[0]); + } catch { } - - catch - { - } - if (cinputkeyboard != null) - { + if (cinputkeyboard != null) { this.InputDevices.Add(cinputkeyboard); } - if (cinputmouse != null) - { + if (cinputmouse != null) { this.InputDevices.Add(cinputmouse); } #endregion #region [ Enumerate joypad ] - foreach (var joysticks in Context.Joysticks) - { + foreach (var joysticks in Context.Joysticks) { this.InputDevices.Add(new CInputJoystick(joysticks)); } - foreach (var gamepad in Context.Gamepads) - { + 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 - { + for (int i = 0; i < InputDevices.Count; i++) { + try { Trace.TraceInformation("Input Device #" + i + " (" + InputDevices[i].CurrentType.ToString() + ")"); - } - catch { } + } catch { } } } // メソッド - public IInputDevice Joystick(int ID) - { - foreach (IInputDevice device in this.InputDevices) - { - if ((device.CurrentType == InputDeviceType.Joystick) && (device.ID == ID)) - { + 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)) - { + 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)) - { + 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)) - { + 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)) - { + 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排他用) - { + 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 - { + 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. - { + } 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しました。"); @@ -197,30 +148,22 @@ namespace FDK #region [ IDisposable+α ] //----------------- - public void Dispose() - { + public void Dispose() { this.Dispose(true); } - public void Dispose(bool disposeManagedObjects) - { - if (!this.bDisposed済み) - { - if (disposeManagedObjects) - { - foreach (IInputDevice device in this.InputDevices) - { + public void Dispose(bool disposeManagedObjects) { + if (!this.bDisposed済み) { + if (disposeManagedObjects) { + foreach (IInputDevice device in this.InputDevices) { CInputMIDI tmidi = device as CInputMIDI; - if (tmidi != null) - { + if (tmidi != null) { Trace.TraceInformation("MIDI In: [{0}] を停止しました。", new object[] { tmidi.ID }); } } - foreach (IInputDevice device2 in this.InputDevices) - { + foreach (IInputDevice device2 in this.InputDevices) { device2.Dispose(); } - lock (this.objMidiIn排他用) - { + lock (this.objMidiIn排他用) { this.InputDevices.Clear(); } @@ -229,8 +172,7 @@ namespace FDK this.bDisposed済み = true; } } - ~CInputManager() - { + ~CInputManager() { this.Dispose(false); GC.KeepAlive(this); } diff --git a/FDK/src/02.Input/CInputMouse.cs b/FDK/src/02.Input/CInputMouse.cs index df3a58b0..5280e043 100644 --- a/FDK/src/02.Input/CInputMouse.cs +++ b/FDK/src/02.Input/CInputMouse.cs @@ -1,14 +1,9 @@ -using System; +using System.Diagnostics; using System.Numerics; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; using Silk.NET.Input; -namespace FDK -{ - public class CInputMouse : IInputDevice, IDisposable - { +namespace FDK { + public class CInputMouse : IInputDevice, IDisposable { // 定数 public const int MouseButtonCount = 8; @@ -16,18 +11,14 @@ namespace FDK // コンストラクタ - public CInputMouse(IMouse mouse) - { + public CInputMouse(IMouse mouse) { this.CurrentType = InputDeviceType.Mouse; this.GUID = ""; this.ID = 0; - try - { + try { Trace.TraceInformation(mouse.Name + " を生成しました。"); // なぜか0x00のゴミが出るので削除 this.strDeviceName = mouse.Name; - } - catch - { + } catch { Trace.TraceWarning("Mouse デバイスの生成に失敗しました。"); throw; } @@ -52,24 +43,17 @@ namespace FDK public List InputEvents { get; private set; } public string strDeviceName { get; set; } - public void Polling(bool useBufferInput) - { + public void Polling(bool useBufferInput) { InputEvents.Clear(); - - for (int i = 0; i < MouseStates.Length; i++) - { - if (MouseStates[i].Item1) - { - if (MouseStates[i].Item2 >= 1) - { + + for (int i = 0; i < MouseStates.Length; i++) { + if (MouseStates[i].Item1) { + if (MouseStates[i].Item2 >= 1) { MouseStates[i].Item2 = 2; - } - else - { + } else { MouseStates[i].Item2 = 1; InputEvents.Add( - new STInputEvent() - { + new STInputEvent() { nKey = i, Pressed = true, Released = false, @@ -78,19 +62,13 @@ namespace FDK } ); } - } - else - { - if (MouseStates[i].Item2 <= -1) - { + } else { + if (MouseStates[i].Item2 <= -1) { MouseStates[i].Item2 = -2; - } - else - { + } else { MouseStates[i].Item2 = -1; InputEvents.Add( - new STInputEvent() - { + new STInputEvent() { nKey = i, Pressed = false, Released = true, @@ -102,20 +80,16 @@ namespace FDK } } } - public bool KeyPressed(int nButton) - { + public bool KeyPressed(int nButton) { return MouseStates[nButton].Item2 == 1; } - public bool KeyPressing(int nButton) - { + public bool KeyPressing(int nButton) { return MouseStates[nButton].Item2 >= 1; } - public bool KeyReleased(int nButton) - { + public bool KeyReleased(int nButton) { return MouseStates[nButton].Item2 == -1; } - public bool KeyReleasing(int nButton) - { + public bool KeyReleasing(int nButton) { return MouseStates[nButton].Item2 <= -1; } //----------------- @@ -123,12 +97,9 @@ namespace FDK #region [ IDisposable 実装 ] //----------------- - public void Dispose() - { - if(!this.IsDisposed) - { - if (this.InputEvents != null) - { + public void Dispose() { + if (!this.IsDisposed) { + if (this.InputEvents != null) { this.InputEvents = null; } this.IsDisposed = true; @@ -145,34 +116,27 @@ namespace FDK private (bool, int)[] MouseStates = new (bool, int)[12]; private bool IsDisposed; - private void Mouse_Click(IMouse mouse, MouseButton mouseButton, Vector2 vector2) - { + private void Mouse_Click(IMouse mouse, MouseButton mouseButton, Vector2 vector2) { } - private void Mouse_DoubleClick(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) - { + 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) - { + 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) - { + private void Mouse_MouseMove(IMouse mouse, Vector2 vector2) { } //----------------- diff --git a/FDK/src/02.Input/DeviceConstantConverter.cs b/FDK/src/02.Input/DeviceConstantConverter.cs index 10f82d1b..f88a2221 100644 --- a/FDK/src/02.Input/DeviceConstantConverter.cs +++ b/FDK/src/02.Input/DeviceConstantConverter.cs @@ -1,18 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Text; -using SlimDXKeys; +using SlimDXKeys; using SlimDXKey = SlimDXKeys.Key; -namespace FDK -{ - public static class DeviceConstantConverter - { +namespace FDK { + public static class DeviceConstantConverter { // メソッド - public static Key DIKtoKey( Silk.NET.Input.Key key ) - { + public static Key DIKtoKey(Silk.NET.Input.Key key) { return _DIKtoKey[key]; } diff --git a/FDK/src/02.Input/IInputDevice.cs b/FDK/src/02.Input/IInputDevice.cs index 2f067771..ea8b87b2 100644 --- a/FDK/src/02.Input/IInputDevice.cs +++ b/FDK/src/02.Input/IInputDevice.cs @@ -1,41 +1,31 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace FDK -{ - public interface IInputDevice : IDisposable - { +namespace FDK { + public interface IInputDevice : IDisposable { // プロパティ - InputDeviceType CurrentType - { + InputDeviceType CurrentType { get; } - string GUID - { - get; - } - int ID - { + string GUID { get; } - List InputEvents - { + int ID { + 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)); } + 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 92ce3eb4..54667c9b 100644 --- a/FDK/src/02.Input/InputDeviceType.cs +++ b/FDK/src/02.Input/InputDeviceType.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace FDK -{ +namespace FDK { // 定数 - public enum InputDeviceType - { + public enum InputDeviceType { Keyboard, Mouse, Joystick, diff --git a/FDK/src/02.Input/STInputEvent.cs b/FDK/src/02.Input/STInputEvent.cs index bb2bbf31..904b7858 100644 --- a/FDK/src/02.Input/STInputEvent.cs +++ b/FDK/src/02.Input/STInputEvent.cs @@ -1,15 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; -namespace FDK -{ +namespace FDK { // 構造体 - [StructLayout( LayoutKind.Sequential )] - public struct STInputEvent - { + [StructLayout(LayoutKind.Sequential)] + public struct STInputEvent { public int nKey { get; set; } public bool Pressed { get; set; } public bool Released { get; set; } diff --git a/FDK/src/02.Input/SlimDXKeys.cs b/FDK/src/02.Input/SlimDXKeys.cs index 3a876285..1d8796d2 100644 --- a/FDK/src/02.Input/SlimDXKeys.cs +++ b/FDK/src/02.Input/SlimDXKeys.cs @@ -1,13 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SlimDXKeys -{ - public enum Key - { +namespace SlimDXKeys { + public enum Key { D0 = 0, D1 = 1, D2 = 2, @@ -154,8 +146,7 @@ namespace SlimDXKeys Yen = 143, Unknown = 144 } - public enum MouseObject - { + public enum MouseObject { Button1 = 0, Button2 = 1, Button3 = 2, @@ -168,4 +159,4 @@ namespace SlimDXKeys YAxis = 9, ZAxis = 10 } -} \ No newline at end of file +} diff --git a/FDK/src/03.Sound/CSound.cs b/FDK/src/03.Sound/CSound.cs index d985d435..609d09be 100644 --- a/FDK/src/03.Sound/CSound.cs +++ b/FDK/src/03.Sound/CSound.cs @@ -1,118 +1,93 @@ -using System; -using System.Collections.ObjectModel; +using System.Collections.ObjectModel; using System.Diagnostics; using System.Runtime.InteropServices; -using System.IO; -using System.Linq; -using System.Threading; +using FDK.BassMixExtension; using FDK.ExtensionMethods; using ManagedBass; -using ManagedBass.Asio; -using ManagedBass.Wasapi; -using ManagedBass.Mix; using ManagedBass.Fx; -using Silk.NET.Windowing; -using FDK.BassMixExtension; +using ManagedBass.Mix; -namespace FDK -{ +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用拡張 ] - public int TotalPlayTime - { + public int TotalPlayTime { get; private set; } - public int SoundBufferSize // 取りあえず0固定★★★★★★★★★★★★★★★★★★★★ + public int SoundBufferSize // 取りあえず0固定★★★★★★★★★★★★★★★★★★★★ { get { return 0; } } - public bool IsStreamPlay // 取りあえずfalse固定★★★★★★★★★★★★★★★★★★★★ - // trueにすると同一チップ音の多重再生で問題が出る(4POLY音源として動かない) + public bool IsStreamPlay // 取りあえずfalse固定★★★★★★★★★★★★★★★★★★★★ + // trueにすると同一チップ音の多重再生で問題が出る(4POLY音源として動かない) { get { return false; } } - public double Frequency - { - get - { + public double Frequency { + get { return _Frequency; } - set - { - if ( _Frequency != value ) - { + set { + if (_Frequency != value) { _Frequency = value; - if ( IsBassSound ) - { - Bass.ChannelSetAttribute( this.hBassStream, ChannelAttribute.Frequency, ( float ) ( _Frequency * _PlaySpeed * nオリジナルの周波数 ) ); + if (IsBassSound) { + Bass.ChannelSetAttribute(this.hBassStream, ChannelAttribute.Frequency, (float)(_Frequency * _PlaySpeed * nオリジナルの周波数)); } } } } - public double PlaySpeed - { - get - { + public double PlaySpeed { + get { return _PlaySpeed; } - set - { - if ( _PlaySpeed != value ) - { + set { + if (_PlaySpeed != value) { _PlaySpeed = value; - IsNormalSpeed = ( _PlaySpeed == 1.000f ); - if ( IsBassSound ) - { - if ( _hTempoStream != 0 && !this.IsNormalSpeed ) // 再生速度がx1.000のときは、TempoStreamを用いないようにして高速化する - { + IsNormalSpeed = (_PlaySpeed == 1.000f); + if (IsBassSound) { + if (_hTempoStream != 0 && !this.IsNormalSpeed) // 再生速度がx1.000のときは、TempoStreamを用いないようにして高速化する + { this.hBassStream = _hTempoStream; - } - else - { + } else { this.hBassStream = _hBassStream; - } + } - if ( SoundManager.bIsTimeStretch ) - { - Bass.ChannelSetAttribute( this.hBassStream, ChannelAttribute.Tempo, (float) ( PlaySpeed * 100 - 100 ) ); + 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オリジナルの周波数 ) ); + } else { + Bass.ChannelSetAttribute(this.hBassStream, ChannelAttribute.Frequency, (float)(_Frequency * _PlaySpeed * nオリジナルの周波数)); } } } @@ -121,182 +96,159 @@ namespace FDK #endregion public bool b速度上げすぎ問題 = false; - public bool b演奏終了後も再生が続くチップである = false; // これがtrueなら、本サウンドの再生終了のコールバック時に自動でミキサーから削除する + public bool b演奏終了後も再生が続くチップである = false; // これがtrueなら、本サウンドの再生終了のコールバック時に自動でミキサーから削除する 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)); - } + 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; - } + /// + /// 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; + } - _gain = gain; - _truePeak = truePeak; + _gain = gain; + _truePeak = truePeak; - if (SoundGroup == ESoundGroup.SongPlayback) - { - Trace.TraceInformation($"{nameof(CSound)}.{nameof(SetGain)}: Gain: {_gain}. True Peak: {_truePeak}"); - } + if (SoundGroup == ESoundGroup.SongPlayback) { + Trace.TraceInformation($"{nameof(CSound)}.{nameof(SetGain)}: Gain: {_gain}. True Peak: {_truePeak}"); + } - SetVolume(); - } + 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 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; + _automationLevel = value; - if (SoundGroup == ESoundGroup.SongPlayback) - { - Trace.TraceInformation($"{nameof(CSound)}.{nameof(AutomationLevel)} set: {AutomationLevel}"); - } + if (SoundGroup == ESoundGroup.SongPlayback) { + Trace.TraceInformation($"{nameof(CSound)}.{nameof(AutomationLevel)} set: {AutomationLevel}"); + } - SetVolume(); - } - } + 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; + _groupLevel = value; - if (SoundGroup == ESoundGroup.SongPlayback) - { - Trace.TraceInformation($"{nameof(CSound)}.{nameof(GroupLevel)} set: {GroupLevel}"); - } + if (SoundGroup == ESoundGroup.SongPlayback) { + Trace.TraceInformation($"{nameof(CSound)}.{nameof(GroupLevel)} set: {GroupLevel}"); + } - SetVolume(); - } - } + SetVolume(); + } + } - private void SetVolume() - { - var automationLevel = LinearIntegerPercentToLufs(AutomationLevel); - var groupLevel = LinearIntegerPercentToLufs(GroupLevel); + private void SetVolume() { + var automationLevel = LinearIntegerPercentToLufs(AutomationLevel); + var groupLevel = LinearIntegerPercentToLufs(GroupLevel); - var gain = - _gain + - automationLevel + - groupLevel; + var gain = + _gain + + automationLevel + + groupLevel; - var safeTruePeakGain = _truePeak?.Negate() ?? new Lufs(0); - var finalGain = gain.Min(safeTruePeakGain); + 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}."); - } + 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}."); + } - lufs音量 = finalGain; - } + 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音量); - } - } - } + 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 ) - { + public int SoundPosition { + get { + if (this.IsBassSound) { float f位置 = 0.0f; - if ( !Bass.ChannelGetAttribute( this.hBassStream, ChannelAttribute.Pan, out f位置 ) ) + 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 (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位置 ); + 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位置); } } } @@ -307,112 +259,89 @@ namespace FDK /// public static readonly ObservableCollection SoundInstances = new ObservableCollection(); - public static void ShowAllCSoundFiles() - { + public static void ShowAllCSoundFiles() { int i = 0; - foreach ( CSound cs in SoundInstances ) - { - Debug.WriteLine( i++.ToString( "d3" ) + ": " + Path.GetFileName( cs.FileName ) ); + foreach (CSound cs in SoundInstances) { + Debug.WriteLine(i++.ToString("d3") + ": " + Path.GetFileName(cs.FileName)); } } - public CSound(ESoundGroup soundGroup) - { - SoundGroup = soundGroup; + public CSound(ESoundGroup soundGroup) { + SoundGroup = soundGroup; this.SoundPosition = 0; this._Frequency = 1.0; this._PlaySpeed = 1.0; -// this._cbRemoveMixerChannel = new WaitCallback( RemoveMixerChannelLater ); + // 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 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 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 ); + 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 ) - { + public void DisposeSound(CSound cs) { cs.tDispose(); } - public void PlayStart() - { + 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 ); + 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 ); + tPlaySound(looped); } - public void Stop() - { + public void Stop() { tStopSound(); tSetPositonToBegin(); } - public void Pause() - { + public void Pause() { tStopSound(true); this.PauseCount++; } - public void Resume( long t ) // ★★★★★★★★★★★★★★★★★★★★★★★★★★★★ + public void Resume(long t) // ★★★★★★★★★★★★★★★★★★★★★★★★★★★★ { - Debug.WriteLine( "t再生を再開する(long " + t + ")" ); - tSetPositonToBegin( 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 ); + 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 ); + } else { + return (this.PauseCount > 0); } } } - public bool IsPlaying - { - get - { + public bool IsPlaying { + get { // 基本的にはBASS_ACTIVE_PLAYINGなら再生中だが、最後まで再生しきったchannelも // BASS_ACTIVE_PLAYINGのままになっているので、小細工が必要。 bool ret = (BassMixExtensions.ChannelIsPlaying(this.hBassStream)); - if (BassMix.ChannelGetPosition(this.hBassStream) >= nBytes) - { + if (BassMix.ChannelGetPosition(this.hBassStream) >= nBytes) { ret = false; } return ret; @@ -426,118 +355,89 @@ namespace FDK #endregion - public void tDispose() - { - tDispose( false ); + public void tDispose() { + tDispose(false); } - public void tDispose( bool deleteInstance ) - { - if ( this.IsBassSound ) // stream数の削減用 + 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ファイル名 ) ); + this.Dispose(disposeWithManaged, deleteInstance); + //Debug.WriteLine( "Disposed: " + _bインスタンス削除 + " : " + Path.GetFileName( this.strファイル名 ) ); } - public void tPlaySound() - { - tPlaySound( false ); + public void tPlaySound() { + tPlaySound(false); } - private void tPlaySound( bool bループする ) - { - if ( this.IsBassSound ) // BASSサウンド時のループ処理は、t再生を開始する()側に実装。ここでは「bループする」は未使用。 + 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() ); + //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() ); + 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 ); + 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ファイル名)); - } - } - else - { -//Debug.WriteLine( "再生成功: " + Path.GetFileName( this.strファイル名 ) + " (" + hBassStream + ")" ); + } else { + //Debug.WriteLine( "再生成功: " + Path.GetFileName( this.strファイル名 ) + " (" + hBassStream + ")" ); } } } - public void tStopSoundAndRemoveSoundFromMixer() - { - tStopSound( false ); - if ( IsBassSound ) - { + public void tStopSoundAndRemoveSoundFromMixer() { + tStopSound(false); + if (IsBassSound) { tRemoveSoundFromMixer(); } } - public void tStopSound() - { - tStopSound( false ); + 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と再生停止を区別できるようにすること!! + 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 ); + + public void tSetPositonToBegin() { + if (this.IsBassSound) { + BassMix.ChannelSetPosition(this.hBassStream, 0); //pos = 0; } } - public void tSetPositonToBegin( long positionMs ) - { - if( this.IsBassSound ) - { + 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 ) - { + 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" ); + Trace.TraceInformation(Path.GetFileName(this.FileName) + ": Seek error: " + be.ToString() + ": " + positionMs + "MS"); } } //if ( this.n総演奏時間ms > 5000 ) @@ -551,31 +451,24 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.FileName) + ", /// /// /// - public void tGetPlayPositon( out long positionByte, out double positionMs ) - { - if ( this.IsBassSound ) - { - positionByte = BassMix.ChannelGetPosition( this.hBassStream ); - positionMs = Bass.ChannelBytes2Seconds( this.hBassStream, positionByte ); - } - else - { + 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 ); + public static void tResetAllSound() { + foreach (var sound in CSound.SoundInstances) { + sound.tDispose(false); } } - internal static void tReloadSound( ISoundDevice device ) - { - if( CSound.SoundInstances.Count == 0 ) + internal static void tReloadSound(ISoundDevice device) { + if (CSound.SoundInstances.Count == 0) return; @@ -583,45 +476,39 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.FileName) + ", var sounds = CSound.SoundInstances.ToArray(); CSound.SoundInstances.Clear(); - + // 配列に基づいて個々のサウンドを作成する。 - for( int i = 0; i < sounds.Length; i++ ) - { - switch( sounds[ i ].CurrnetCreateType ) - { + 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 ] ); + string strファイル名 = sounds[i].FileName; + sounds[i].Dispose(true, false); + device.tCreateSound(strファイル名, sounds[i]); break; - #endregion + #endregion } } } #region [ Dispose-Finalizeパターン実装 ] //----------------- - public void Dispose() - { - this.Dispose( true, true ); - GC.SuppressFinalize( this ); + public void Dispose() { + this.Dispose(true, true); + GC.SuppressFinalize(this); } - private void Dispose( bool deleteWithManaged, bool deleteInstance ) - { - if( this.IsBassSound ) - { + private void Dispose(bool deleteWithManaged, bool deleteInstance) { + if (this.IsBassSound) { #region [ ASIO, WASAPI の解放 ] //----------------- - if ( _hTempoStream != 0 ) - { - BassMix.MixerRemoveChannel( this._hTempoStream ); - Bass.StreamFree( this._hTempoStream ); + if (_hTempoStream != 0) { + BassMix.MixerRemoveChannel(this._hTempoStream); + Bass.StreamFree(this._hTempoStream); } - BassMix.MixerRemoveChannel( this._hBassStream ); - Bass.StreamFree( this._hBassStream ); + BassMix.MixerRemoveChannel(this._hBassStream); + Bass.StreamFree(this._hBassStream); this.hBassStream = -1; this._hBassStream = -1; this._hTempoStream = 0; @@ -629,8 +516,7 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.FileName) + ", #endregion } - if( deleteWithManaged ) - { + if (deleteWithManaged) { //int freeIndex = -1; //if ( CSound.listインスタンス != null ) @@ -642,10 +528,9 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.FileName) + ", // } //} - this.CurrentSoundDeviceType = ESoundDeviceType.Unknown; + this.CurrentSoundDeviceType = ESoundDeviceType.Unknown; - if ( deleteInstance ) - { + if (deleteInstance) { //try //{ // CSound.listインスタンス.RemoveAt( freeIndex ); @@ -654,18 +539,16 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.FileName) + ", //{ // 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 ) ); + 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 ); + ~CSound() { + this.Dispose(false, true); } //----------------- #endregion @@ -678,49 +561,47 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.FileName) + ", 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; プロパティとして実装すると動作が低速になったため、 + 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に後で登録するときに使う - //----------------- + //{ + // 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 - { + private bool IsBassSound { + get { return ( this.CurrentSoundDeviceType == ESoundDeviceType.Bass || this.CurrentSoundDeviceType == ESoundDeviceType.ASIO || this.CurrentSoundDeviceType == ESoundDeviceType.ExclusiveWASAPI || - this.CurrentSoundDeviceType == ESoundDeviceType.SharedWASAPI ); + this.CurrentSoundDeviceType == ESoundDeviceType.SharedWASAPI); } } private int _n位置 = 0; private int _n位置db; private Lufs _gain = DefaultGain; - private Lufs? _truePeak = null; + private Lufs? _truePeak = null; private int _automationLevel = DefaultAutomationLevel; private int _groupLevel = DefaultGroupLevel; private long nBytes = 0; @@ -730,72 +611,64 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.FileName) + ", private double _PlaySpeed = 1.0; private bool IsNormalSpeed = true; - public void CreateBassSound( string strファイル名, int hMixer, BassFlags flags ) - { + 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 ); + 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 ) - { + private void tBASSサウンドを作成する_ストリーム生成後の共通処理(int hMixer) { SoundManager.nStreams++; // 個々のストリームの出力をテンポ変更のストリームに入力する。テンポ変更ストリームの出力を、Mixerに出力する。 -// if ( CSound管理.bIsTimeStretch ) // TimeStretchのON/OFFに関わりなく、テンポ変更のストリームを生成する。後からON/OFF切り替え可能とするため。 + // if ( CSound管理.bIsTimeStretch ) // TimeStretchのON/OFFに関わりなく、テンポ変更のストリームを生成する。後からON/OFF切り替え可能とするため。 { - this._hTempoStream = BassFx.TempoCreate( this._hBassStream, BassFlags.Decode | BassFlags.FxFreeSource ); - if ( this._hTempoStream == 0 ) - { + 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 ); // 高速化(音の品質は少し落ちる) + 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を用いないようにして高速化する + if (_hTempoStream != 0 && !this.IsNormalSpeed) // 再生速度がx1.000のときは、TempoStreamを用いないようにして高速化する { this.hBassStream = _hTempoStream; - } - else - { + } else { this.hBassStream = _hBassStream; } // #32248 再生終了時に発火するcallbackを登録する (演奏終了後に再生終了するチップを非同期的にミキサーから削除するため。) - _cbEndofStream = new SyncProcedure( CallbackEndofStream ); - Bass.ChannelSetSync( hBassStream, SyncFlags.End | SyncFlags.Mixtime, 0, _cbEndofStream, IntPtr.Zero ); + _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 ); + 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 ) ) - { + if (!Bass.ChannelGetAttribute(this._hBassStream, ChannelAttribute.Frequency, out freq)) { hGC.Free(); - throw new Exception( string.Format( "サウンドストリームの周波数取得に失敗しました。(BASS_ChannelGetAttribute)[{0}]", Bass.LastError.ToString() ) ); + throw new Exception(string.Format("サウンドストリームの周波数取得に失敗しました。(BASS_ChannelGetAttribute)[{0}]", Bass.LastError.ToString())); } - this.nオリジナルの周波数 = (int) freq; + this.nオリジナルの周波数 = (int)freq; - // インスタンスリストに登録。 + // インスタンスリストに登録。 - CSound.SoundInstances.Add( this ); + CSound.SoundInstances.Add(this); } //----------------- @@ -820,51 +693,46 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.FileName) + ", /// /// /// - private void CallbackEndofStream( int handle, int channel, int data, IntPtr user ) // #32248 2013.10.14 yyagi + 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 ); + // Trace.TraceInformation( "Callback!(remove): " + Path.GetFileName( this.strファイル名 ) ); + if (b演奏終了後も再生が続くチップである) // 演奏終了後に再生終了するチップ音のミキサー削除は、再生終了のコールバックに引っ掛けて、自前で行う。 + { // そうでないものは、ミキサー削除予定時刻に削除する。 + RemoveBassSoundFromMixer(channel); } } -// mixerからの削除 + // mixerからの削除 - public bool tRemoveSoundFromMixer() - { - return RemoveBassSoundFromMixer( this.hBassStream ); + 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 ); + 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 ) - { + // mixer への追加 + + public bool AddBassSoundFromMixer() { + if (BassMix.ChannelGetMixer(hBassStream) == 0) { BassFlags bf = BassFlags.SpeakerFront | BassFlags.MixerChanNoRampin | BassFlags.MixerChanPause; - Interlocked.Increment( ref SoundManager.nMixing ); + 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 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; + 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; } diff --git a/FDK/src/03.Sound/CSoundDeviceASIO.cs b/FDK/src/03.Sound/CSoundDeviceASIO.cs index bbe2bfa1..796e1998 100644 --- a/FDK/src/03.Sound/CSoundDeviceASIO.cs +++ b/FDK/src/03.Sound/CSoundDeviceASIO.cs @@ -1,33 +1,23 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; -using FDK.ExtensionMethods; +using System.Diagnostics; using ManagedBass; using ManagedBass.Asio; using ManagedBass.Mix; -namespace FDK -{ +namespace FDK { /// /// 全ASIOデバイスを列挙する静的クラス。 /// BASS_Init()やBASS_ASIO_Init()の状態とは無関係に使用可能。 /// - public static class CEnumerateAllAsioDevices - { - public static string[] GetAllASIODevices() - { - try - { + public static class CEnumerateAllAsioDevices { + public static string[] GetAllASIODevices() { + try { string[] bassAsioDevName = new string[BassAsio.DeviceCount]; - for(int i = 0; i < bassAsioDevName.Length; i++) + for (int i = 0; i < bassAsioDevName.Length; i++) bassAsioDevName[i] = BassAsio.GetDeviceInfo(i).Name; - if(bassAsioDevName.Length != 0) + if (bassAsioDevName.Length != 0) return bassAsioDevName; - } - catch(Exception e) - { + } catch (Exception e) { Trace.TraceWarning($"Exception occured in GetAllASIODevices ({e})"); } @@ -35,79 +25,62 @@ namespace FDK } } - internal class CSoundDeviceASIO : ISoundDevice - { + internal class CSoundDeviceASIO : ISoundDevice { // プロパティ - public ESoundDeviceType SoundDeviceType - { + public ESoundDeviceType SoundDeviceType { get; protected set; } - public long OutputDelay - { + public long OutputDelay { get; protected set; } - public long BufferSize - { + public long BufferSize { get; protected set; } - public int ASIODevice - { + public int ASIODevice { get; set; } // CSoundTimer 用に公開しているプロパティ - public long ElapsedTimeMs - { + public long ElapsedTimeMs { get; protected set; } - public long UpdateSystemTimeMs - { + public long UpdateSystemTimeMs { get; protected set; } - public CTimer SystemTimer - { + public CTimer SystemTimer { get; protected set; } // マスターボリュームの制御コードは、WASAPI/ASIOで全く同じ。 - public int nMasterVolume - { - get - { + public int nMasterVolume { + get { float f音量 = 0.0f; - bool b = Bass.ChannelGetAttribute( this.hMixer, ChannelAttribute.Volume, out f音量 ); - if ( !b ) - { + 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 Error: " + be.ToString()); + } else { //Trace.TraceInformation( "ASIO Master Volume Get Success: " + (f音量 * 100) ); } - return (int) ( f音量 * 100 ); + return (int)(f音量 * 100); } - set - { - bool b = Bass.ChannelSetAttribute( this.hMixer, ChannelAttribute.Volume, (float) ( value / 100.0 ) ); - if ( !b ) - { + 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 - { + Trace.TraceInformation("ASIO Master Volume Set Error: " + be.ToString()); + } else { // int n = this.nMasterVolume; // Trace.TraceInformation( "ASIO Master Volume Set Success: " + value ); } @@ -116,56 +89,55 @@ namespace FDK // メソッド - public CSoundDeviceASIO( long bufferSize, int deviceIndex ) - { + public CSoundDeviceASIO(long bufferSize, int deviceIndex) { // 初期化。 - Trace.TraceInformation( "BASS (ASIO) の初期化を開始します。" ); + 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.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()}]"); - } - + 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() ) ); + 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); + Bass.Configure(Configuration.LogarithmicVolumeCurve, true); -//Debug.WriteLine( "BASS_Init()完了。" ); + //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 -// } + // 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 ) ) // 専用スレッドにて起動 + if (BassAsio.Init(ASIODevice, AsioInitFlags.Thread)) // 専用スレッドにて起動 { #region [ ASIO の初期化に成功。] //----------------- @@ -173,13 +145,13 @@ namespace FDK BassAsio.GetInfo(out asioInfo); this.n出力チャンネル数 = asioInfo.Outputs; this.db周波数 = BassAsio.Rate; - this.fmtASIOデバイスフォーマット = BassAsio.ChannelGetFormat( false, 0 ); + this.fmtASIOデバイスフォーマット = BassAsio.ChannelGetFormat(false, 0); - Trace.TraceInformation( "BASS を初期化しました。(ASIO, デバイス:\"{0}\", 入力{1}, 出力{2}, {3}Hz, バッファ{4}~{6}sample ({5:0.###}~{7:0.###}ms), デバイスフォーマット:{8})", + 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.###" ), + this.db周波数.ToString("0.###"), asioInfo.MinBufferLength, asioInfo.MinBufferLength * 1000 / this.db周波数, asioInfo.MaxBufferLength, asioInfo.MaxBufferLength * 1000 / this.db周波数, this.fmtASIOデバイスフォーマット.ToString() @@ -198,20 +170,17 @@ namespace FDK #endregion //----------------- #endregion - } - else - { + } else { #region [ ASIO の初期化に失敗。] //----------------- Errors errcode = Bass.LastError; string errmes = errcode.ToString(); - if ( errcode == Errors.OK ) - { + 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 ) ); + throw new Exception(string.Format("BASS (ASIO) の初期化に失敗しました。(BASS_ASIO_Init)[{0}]", errmes)); //----------------- #endregion } @@ -219,66 +188,63 @@ namespace FDK // ASIO 出力チャンネルの初期化。 - this.tAsioProc = new AsioProcedure( this.tAsio処理 ); // アンマネージに渡す delegate は、フィールドとして保持しておかないとGCでアドレスが変わってしまう。 - if ( !BassAsio.ChannelEnable( false, 0, this.tAsioProc, IntPtr.Zero ) ) // 出力チャンネル0 の有効化。 + 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() ) ); + 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 ) ) - { + 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 ) ); + throw new Exception(string.Format("Failed BASS_ASIO_ChannelJoin({1}) [{0}]", BassAsio.LastError, i)); //----------------- #endregion } } - if ( !BassAsio.ChannelSetFormat( false, 0, this.fmtASIOチャンネルフォーマット ) ) // 出力チャンネル0のフォーマット + 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() ) ); + 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 ) + 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 ); + this.hMixer = BassMix.CreateMixerStream((int)this.db周波数, this.n出力チャンネル数, flag); - if ( this.hMixer == 0 ) - { - Errors err = Bass.LastError; + if (this.hMixer == 0) { + Errors err = Bass.LastError; BassAsio.Free(); Bass.Free(); this.bIsBASSFree = true; - throw new Exception( string.Format( "BASSミキサ(mixing)の作成に失敗しました。[{0}]", err ) ); + throw new Exception(string.Format("BASSミキサ(mixing)の作成に失敗しました。[{0}]", err)); } // BASS ミキサーの1秒あたりのバイト数を算出。 - var mixerInfo = Bass.ChannelGetInfo( this.hMixer ); + var mixerInfo = Bass.ChannelGetInfo(this.hMixer); int nサンプルサイズbyte = 0; - switch( this.fmtASIOチャンネルフォーマット ) - { + switch (this.fmtASIOチャンネルフォーマット) { case AsioSampleFormat.Bit16: nサンプルサイズbyte = 2; break; case AsioSampleFormat.Bit24: nサンプルサイズbyte = 3; break; case AsioSampleFormat.Bit32: nサンプルサイズbyte = 4; break; @@ -294,124 +260,111 @@ namespace FDK // そのため、もう一段mixerを噛ませて、一段先のmixerからChannelGetData()することで、 // hMixerの音量制御を反映させる。 this.hMixer_DeviceOut = BassMix.CreateMixerStream( - (int) this.db周波数, this.n出力チャンネル数, flag ); - if ( this.hMixer_DeviceOut == 0 ) - { + (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 ) ); + throw new Exception(string.Format("BASSミキサ(最終段)の作成に失敗しました。[{0}]", errcode)); } { - bool b1 = BassMix.MixerAddChannel( this.hMixer_DeviceOut, this.hMixer, BassFlags.Default ); - if ( !b1 ) - { + 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 ) ); + throw new Exception(string.Format("BASSミキサ(最終段とmixing)の接続に失敗しました。[{0}]", errcode)); }; } // 出力を開始。 - this.nバッファサイズsample = (int) ( bufferSize * this.db周波数 / 1000.0 ); + this.nバッファサイズsample = (int)(bufferSize * this.db周波数 / 1000.0); //this.nバッファサイズsample = (int) nバッファサイズbyte; - if ( !BassAsio.Start( this.nバッファサイズsample ) ) // 範囲外の値を指定した場合は自動的にデフォルト値に設定される。 + 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 ); + 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 ) - { + public CSound tCreateSound(string strファイル名, ESoundGroup soundGroup) { var sound = new CSound(soundGroup); - sound.CreateASIOSound( strファイル名, this.hMixer ); + sound.CreateASIOSound(strファイル名, this.hMixer); return sound; } - public void tCreateSound( string strファイル名, CSound sound ) - { - sound.CreateASIOSound( strファイル名, this.hMixer ); + 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 ); + public void Dispose() { + this.Dispose(true); + GC.SuppressFinalize(this); } - protected void Dispose( bool bManagedDispose ) - { - SoundDeviceType = ESoundDeviceType.Unknown; // まず出力停止する(Dispose中にクラス内にアクセスされることを防ぐ) - if ( hMixer != -1 ) - { - Bass.StreamFree( hMixer ); + protected void Dispose(bool bManagedDispose) { + SoundDeviceType = ESoundDeviceType.Unknown; // まず出力停止する(Dispose中にクラス内にアクセスされることを防ぐ) + if (hMixer != -1) { + Bass.StreamFree(hMixer); } - if ( !bIsBASSFree ) - { - BassAsio.Free(); // システムタイマより先に呼び出すこと。(tAsio処理() の中でシステムタイマを参照してるため) + if (!bIsBASSFree) { + BassAsio.Free(); // システムタイマより先に呼び出すこと。(tAsio処理() の中でシステムタイマを参照してるため) Bass.Free(); } - if( bManagedDispose ) - { + if (bManagedDispose) { SystemTimer.Dispose(); SystemTimer = null; } } - ~CSoundDeviceASIO() - { - this.Dispose( false ); + ~CSoundDeviceASIO() { + this.Dispose(false); } //----------------- #endregion protected int hMixer = -1; - protected int hMixer_DeviceOut = -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 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; + 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 = 実際に転送した長さ + int num = Bass.ChannelGetData(this.hMixer_DeviceOut, buffer, length); // num = 実際に転送した長さ - if ( num == -1 ) num = 0; + if (num == -1) num = 0; // 経過時間を更新。 // データの転送差分ではなく累積転送バイト数から算出する。 - this.ElapsedTimeMs = ( this.n累積転送バイト数 * 1000 / this.nミキサーの1秒あたりのバイト数 ) - this.OutputDelay; + this.ElapsedTimeMs = (this.n累積転送バイト数 * 1000 / this.nミキサーの1秒あたりのバイト数) - this.OutputDelay; this.UpdateSystemTimeMs = this.SystemTimer.SystemTimeMs; diff --git a/FDK/src/03.Sound/CSoundDeviceBASS.cs b/FDK/src/03.Sound/CSoundDeviceBASS.cs index 1acac5d5..5d676ebd 100644 --- a/FDK/src/03.Sound/CSoundDeviceBASS.cs +++ b/FDK/src/03.Sound/CSoundDeviceBASS.cs @@ -1,48 +1,35 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; -using System.Reflection; -using System.IO; +using System.Diagnostics; using ManagedBass; using ManagedBass.Mix; -namespace FDK -{ - public class CSoundDeviceBASS : ISoundDevice - { +namespace FDK { + public class CSoundDeviceBASS : ISoundDevice { // プロパティ - public ESoundDeviceType SoundDeviceType - { + public ESoundDeviceType SoundDeviceType { get; protected set; } - public long OutputDelay - { + public long OutputDelay { get; protected set; } - public long BufferSize - { + public long BufferSize { get; protected set; } // CSoundTimer 用に公開しているプロパティ - public long ElapsedTimeMs - { + public long ElapsedTimeMs { get; protected set; } - public long UpdateSystemTimeMs - { + public long UpdateSystemTimeMs { get; protected set; } - public CTimer SystemTimer - { + public CTimer SystemTimer { get; protected set; } @@ -50,32 +37,26 @@ namespace FDK public float CPUUsage => (float)Bass.CPUUsage; // マスターボリュームの制御コードは、WASAPI/ASIOで全く同じ。 - public int nMasterVolume - { - get - { + public int nMasterVolume { + get { float fVolume = 0.0f; bool b = Bass.ChannelGetAttribute(this.MixerHandle, ChannelAttribute.Volume, out fVolume); - if (!b) - { + if (!b) { Errors be = Bass.LastError; Trace.TraceInformation("BASS Master Volume Get Error: " + be.ToString()); } return (int)(fVolume * 100); } - set - { + set { bool b = Bass.ChannelSetAttribute(this.MixerHandle, ChannelAttribute.Volume, (float)(value / 100.0)); - if (!b) - { + if (!b) { Errors be = Bass.LastError; Trace.TraceInformation("BASS Master Volume Set Error: " + be.ToString()); } } } - public CSoundDeviceBASS(int updatePeriod, int bufferSize) - { + public CSoundDeviceBASS(int updatePeriod, int bufferSize) { Trace.TraceInformation("Start initialization of BASS"); this.SoundDeviceType = ESoundDeviceType.Unknown; this.OutputDelay = 0; @@ -88,30 +69,27 @@ namespace FDK // 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)) - { + + if (!Bass.Configure(Configuration.UpdatePeriod, updatePeriod)) { Trace.TraceWarning($"BASS_SetConfig({nameof(Configuration.UpdatePeriod)}) に失敗しました。[{Bass.LastError}]"); } - if (!Bass.Configure(Configuration.UpdateThreads, 1)) - { + 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; // デコードのみ=発声しない。 + var flag = BassFlags.MixerNonStop | BassFlags.Decode; // デコードのみ=発声しない。 this.MixerHandle = BassMix.CreateMixerStream(freq, 2, flag); - if (this.MixerHandle == 0) - { + if (this.MixerHandle == 0) { Errors err = Bass.LastError; Bass.Free(); this.IsBASSSoundFree = true; @@ -133,8 +111,7 @@ namespace FDK // hMixerの音量制御を反映させる。 Mixer_DeviceOut = BassMix.CreateMixerStream( freq, 2, flag); - if (this.Mixer_DeviceOut == 0) - { + if (this.Mixer_DeviceOut == 0) { Errors errcode = Bass.LastError; Bass.Free(); this.IsBASSSoundFree = true; @@ -142,8 +119,7 @@ namespace FDK } { bool b1 = BassMix.MixerAddChannel(this.Mixer_DeviceOut, this.MixerHandle, BassFlags.Default); - if (!b1) - { + if (!b1) { Errors errcode = Bass.LastError; Bass.Free(); this.IsBASSSoundFree = true; @@ -161,9 +137,7 @@ namespace FDK Bass.Free(); this.IsBASSSoundFree = true; throw new Exception("BASS デバイス出力開始に失敗しました。" + err.ToString()); - } - else - { + } else { Bass.GetInfo(out var info); this.BufferSize = this.OutputDelay = info.Latency + bufferSize;//求め方があっているのだろうか… @@ -176,15 +150,13 @@ namespace FDK } #region [ tCreateSound() ] - public CSound tCreateSound(string strFilename, ESoundGroup soundGroup) - { + 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) - { + public void tCreateSound(string strFilename, CSound sound) { sound.CreateBassSound(strFilename, this.MixerHandle); } #endregion @@ -192,43 +164,35 @@ namespace FDK #region [ Dispose-Finallizeパターン実装 ] //----------------- - public void Dispose() - { + public void Dispose() { this.Dispose(true); GC.SuppressFinalize(this); } - protected void Dispose(bool bManagedDispose) - { + protected void Dispose(bool bManagedDispose) { this.SoundDeviceType = ESoundDeviceType.Unknown; // まず出力停止する(Dispose中にクラス内にアクセスされることを防ぐ) - if (MainStreamHandle != -1) - { + if (MainStreamHandle != -1) { Bass.StreamFree(this.MainStreamHandle); } - if (MixerHandle != -1) - { + if (MixerHandle != -1) { Bass.StreamFree(this.MixerHandle); } - if (!this.IsBASSSoundFree) - { + if (!this.IsBASSSoundFree) { Bass.Stop(); Bass.Free();// システムタイマより先に呼び出すこと。(Stream処理() の中でシステムタイマを参照してるため) } - if (bManagedDispose) - { + if (bManagedDispose) { SystemTimer.Dispose(); this.SystemTimer = null; } } - ~CSoundDeviceBASS() - { + ~CSoundDeviceBASS() { this.Dispose(false); } //----------------- #endregion - public int StreamProc(int handle, IntPtr buffer, int length, IntPtr user) - { + public int StreamProc(int handle, IntPtr buffer, int length, IntPtr user) { // BASSミキサからの出力データをそのまま ASIO buffer へ丸投げ。 int num = Bass.ChannelGetData(this.Mixer_DeviceOut, buffer, length); // num = 実際に転送した長さ @@ -258,4 +222,4 @@ namespace FDK //WASAPIとASIOはLinuxでは使えないので、ここだけで良し } -} \ No newline at end of file +} diff --git a/FDK/src/03.Sound/CSoundDeviceWASAPI.cs b/FDK/src/03.Sound/CSoundDeviceWASAPI.cs index 9165782b..54dfab18 100644 --- a/FDK/src/03.Sound/CSoundDeviceWASAPI.cs +++ b/FDK/src/03.Sound/CSoundDeviceWASAPI.cs @@ -1,82 +1,65 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; +using System.Diagnostics; using ManagedBass; -using ManagedBass.Wasapi; using ManagedBass.Mix; +using ManagedBass.Wasapi; -namespace FDK -{ - internal class CSoundDeviceWASAPI : ISoundDevice - { +namespace FDK { + internal class CSoundDeviceWASAPI : ISoundDevice { // プロパティ - public ESoundDeviceType SoundDeviceType - { + public ESoundDeviceType SoundDeviceType { get; protected set; } - public long OutputDelay - { + public long OutputDelay { get; protected set; } - public long BufferSize - { + public long BufferSize { get; protected set; } // CSoundTimer 用に公開しているプロパティ - public long ElapsedTimeMs - { + public long ElapsedTimeMs { get; protected set; } - public long UpdateSystemTimeMs - { + public long UpdateSystemTimeMs { get; protected set; } - public CTimer SystemTimer - { + public CTimer SystemTimer { get; protected set; } public enum EWASAPIMode { Exclusion, Share } - public int nMasterVolume - { - get - { + 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 ) - { + 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) ); + Trace.TraceInformation("WASAPI Master Volume Get Error: " + be.ToString()); + } else { + Trace.TraceInformation("WASAPI Master Volume Get Success: " + (volume * 100)); } - return (int) ( volume * 100 ); + return (int)(volume * 100); } - set - { + 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 ) ); + // 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を変更: なぜか出力音量に反映されず @@ -88,13 +71,10 @@ namespace FDK //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 ) - { + if (!b) { Errors be = Bass.LastError; - Trace.TraceInformation( "WASAPI Master Volume Set Error: " + be.ToString() ); - } - else - { + Trace.TraceInformation("WASAPI Master Volume Set Error: " + be.ToString()); + } else { // int n = this.nMasterVolume; // Trace.TraceInformation( "WASAPI Master Volume Set Success: " + value ); @@ -109,40 +89,39 @@ namespace FDK /// /// (未使用; 本メソッド内で自動設定する) /// (未使用; 本メソッド内で自動設定する) - public CSoundDeviceWASAPI( EWASAPIMode mode, long bufferSize, long interval ) - { + public CSoundDeviceWASAPI(EWASAPIMode mode, long bufferSize, long interval) { // 初期化。 - Trace.TraceInformation( "BASS (WASAPI) の初期化を開始します。" ); + 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.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()}]"); - } + 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() ) ); + 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); + Bass.Configure(Configuration.LogarithmicVolumeCurve, true); #region [ デバッグ用: WASAPIデバイスのenumerateと、ログ出力 ] //(デバッグ用) @@ -150,12 +129,10 @@ namespace FDK int a; string strDefaultSoundDeviceName = null; DeviceInfo[] bassDevInfos = new DeviceInfo[Bass.DeviceCount]; - for(int j = 0; j < bassDevInfos.Length; j++) - { + for (int j = 0; j < bassDevInfos.Length; j++) { bassDevInfos[j] = Bass.GetDeviceInfo(j); - } - for (a = 0; a < bassDevInfos.GetLength(0); a++) - { + } + for (a = 0; a < bassDevInfos.GetLength(0); a++) { { Trace.TraceInformation("Sound Device #{0}: {1}: IsDefault={2}, isEnabled={3}", a, @@ -163,8 +140,7 @@ namespace FDK bassDevInfos[a].IsDefault, bassDevInfos[a].IsEnabled ); - if (bassDevInfos[a].IsDefault) - { + if (bassDevInfos[a].IsDefault) { // これはOS標準のdefault device。後でWASAPIのdefault deviceと比較する。 strDefaultSoundDeviceName = bassDevInfos[a].Name; } @@ -175,9 +151,9 @@ namespace FDK // 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でアドレスが変わってしまう。 + 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 の値を使えばよい。 @@ -185,8 +161,7 @@ namespace FDK #region [ 既定の出力デバイスと設定されているWASAPIデバイスを検索し、更新間隔msを設定できる最小値にする ] int nDevNo = -1; WasapiDeviceInfo deviceInfo; - for (int n = 0; BassWasapi.GetDeviceInfo(n, out deviceInfo); n++) - { + 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デバイスを使用する。 @@ -195,8 +170,7 @@ namespace FDK // (具体的には、defperiod, minperiod, mixchans, mixfreqがすべて0のデバイスは使用不可のため // これらが0でないものを選択する) //if ( deviceInfo.IsDefault ) - if (deviceInfo.Name == strDefaultSoundDeviceName && deviceInfo.MixFrequency > 0) - { + 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}", @@ -207,8 +181,7 @@ namespace FDK break; } } - if (nDevNo != -1) - { + 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())); @@ -224,30 +197,26 @@ namespace FDK //{ // n希望バッファサイズms = n更新間隔ms + 1; // 2013.4.25 #31237 yyagi; バッファサイズ設定の完全自動化。更新間隔=バッファサイズにするとBASS_ERROR_UNKNOWNになるので+1する。 //} - } - else - { + } 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 == 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 ) - { + + 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; nDevNo = BassWasapi.CurrentDevice; - deviceInfo = BassWasapi.GetDeviceInfo( nDevNo ); + deviceInfo = BassWasapi.GetDeviceInfo(nDevNo); BassWasapi.GetInfo(out var wasapiInfo); - int n1サンプルのバイト数 = 2 * wasapiInfo.Channels; // default; - switch( wasapiInfo.Format ) // BASS WASAPI で扱うサンプルはすべて 32bit float で固定されているが、デバイスはそうとは限らない。 + 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; @@ -257,33 +226,31 @@ namespace FDK 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)", + 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 ); + interval.ToString()); + Trace.TraceInformation("デバイスの最小更新時間={0}ms, 既定の更新時間={1}ms", deviceInfo.MinimumUpdatePeriod * 1000, deviceInfo.DefaultUpdatePeriod * 1000); this.bIsBASSFree = false; //----------------- #endregion - } - else - { + } 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 で固定されているが、デバイスはそうとは限らない。 - { + 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; @@ -291,12 +258,12 @@ namespace FDK 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秒のバイト数); + 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.OutputDelay = 0; // 初期値はゼロ + + Trace.TraceInformation("BASS を初期化しました。(WASAPI共有モード, {0}ms, 更新間隔{1}ms)", bufferSize, devInfo.DefaultUpdatePeriod * 1000.0f); this.bIsBASSFree = false; //----------------- #endregion @@ -315,14 +282,13 @@ namespace FDK // #endregion //} #endregion - else - { + else { #region [ それでも失敗したら例外発生。] //----------------- Errors errcode = Bass.LastError; Bass.Free(); this.bIsBASSFree = true; - throw new Exception( string.Format( "BASS (WASAPI) の初期化に失敗しました。(BASS_WASAPI_Init)[{0}]", errcode ) ); + throw new Exception(string.Format("BASS (WASAPI) の初期化に失敗しました。(BASS_WASAPI_Init)[{0}]", errcode)); //----------------- #endregion } @@ -334,21 +300,20 @@ namespace FDK this.hMixer = BassMix.CreateMixerStream( info.Frequency, info.Channels, - BassFlags.MixerNonStop | BassFlags.Float | BassFlags.Decode); // デコードのみ=発声しない。WASAPIに出力されるだけ。 - if ( this.hMixer == 0 ) - { + 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 ) ); + 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) + var mixerInfo = Bass.ChannelGetInfo(this.hMixer); + long nミキサーの1サンプルあたりのバイト数 = mixerInfo.Channels * 4; // 4 = sizeof(FLOAT) this.nミキサーの1秒あたりのバイト数 = nミキサーの1サンプルあたりのバイト数 * mixerInfo.Frequency; @@ -360,25 +325,23 @@ namespace FDK this.hMixer_DeviceOut = BassMix.CreateMixerStream( info.Frequency, info.Channels, - BassFlags.MixerNonStop | BassFlags.Float | BassFlags.Decode ); // デコードのみ=発声しない。WASAPIに出力されるだけ。 - if ( this.hMixer_DeviceOut == 0 ) - { + 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 ) ); + throw new Exception(string.Format("BASSミキサ(最終段)の作成に失敗しました。[{0}]", errcode)); } { - bool b1 = BassMix.MixerAddChannel( this.hMixer_DeviceOut, this.hMixer, BassFlags.Default ); - if ( !b1 ) - { + 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 ) ); + throw new Exception(string.Format("BASSミキサ(最終段とmixing)の接続に失敗しました。[{0}]", errcode)); }; } @@ -388,47 +351,39 @@ namespace FDK BassWasapi.Start(); } #region [ tサウンドを作成する() ] - public CSound tCreateSound( string strファイル名, ESoundGroup soundGroup ) - { + public CSound tCreateSound(string strファイル名, ESoundGroup soundGroup) { var sound = new CSound(soundGroup); - sound.CreateWASAPISound( strファイル名, this.hMixer, this.SoundDeviceType ); + sound.CreateWASAPISound(strファイル名, this.hMixer, this.SoundDeviceType); return sound; } - public void tCreateSound( string strファイル名, CSound sound ) - { - sound.CreateWASAPISound( strファイル名, this.hMixer, this.SoundDeviceType ); + 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 ); + public void Dispose() { + this.Dispose(true); + GC.SuppressFinalize(this); } - protected void Dispose( bool bManagedDispose ) - { - SoundDeviceType = ESoundDeviceType.Unknown; // まず出力停止する(Dispose中にクラス内にアクセスされることを防ぐ) - if ( hMixer != -1 ) - { - Bass.StreamFree( hMixer ); + protected void Dispose(bool bManagedDispose) { + SoundDeviceType = ESoundDeviceType.Unknown; // まず出力停止する(Dispose中にクラス内にアクセスされることを防ぐ) + if (hMixer != -1) { + Bass.StreamFree(hMixer); } - if ( !bIsBASSFree ) - { - BassWasapi.Free(); // システムタイマより先に呼び出すこと。(tWasapi処理() の中でシステムタイマを参照してるため) + if (!bIsBASSFree) { + BassWasapi.Free(); // システムタイマより先に呼び出すこと。(tWasapi処理() の中でシステムタイマを参照してるため) Bass.Free(); } - if( bManagedDispose ) - { + if (bManagedDispose) { SystemTimer.Dispose(); SystemTimer = null; } } - ~CSoundDeviceWASAPI() - { - this.Dispose( false ); + ~CSoundDeviceWASAPI() { + this.Dispose(false); } //----------------- #endregion @@ -437,31 +392,30 @@ namespace FDK protected int hMixer_DeviceOut = -1; protected WasapiProcedure tWasapiProc = null; - protected int tWASAPI処理( IntPtr buffer, int length, IntPtr user ) - { + 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 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秒あたりのバイト数; + 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.OutputDelay = (this.b最初の実出力遅延算出) ? n今回の遅延ms : (this.OutputDelay + n今回の遅延ms) / 2; this.b最初の実出力遅延算出 = false; - + // 経過時間を更新後に、今回分の累積転送バイト数を反映。 - + this.n累積転送バイト数 += num; return num; } diff --git a/FDK/src/03.Sound/CSoundTimer.cs b/FDK/src/03.Sound/CSoundTimer.cs index 98d3d73f..6251e8ce 100644 --- a/FDK/src/03.Sound/CSoundTimer.cs +++ b/FDK/src/03.Sound/CSoundTimer.cs @@ -1,23 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading; -using System.Runtime.InteropServices; -using System.Diagnostics; +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 || +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 ) - { + this.Device.SoundDeviceType == ESoundDeviceType.ASIO) { // BASS 系の ISoundDevice.n経過時間ms はオーディオバッファの更新間隔ずつでしか更新されないため、単にこれを返すだけではとびとびの値になる。 // そこで、更新間隔の最中に呼ばれた場合は、システムタイマを使って補間する。 // この場合の経過時間との誤差は更新間隔以内に収まるので問題ないと判断する。 @@ -25,7 +15,7 @@ namespace FDK // 動作がおかしくなる。(具体的には、ここで返すタイマー値の逆行が発生し、スクロールが巻き戻る) // この場合の対策は、ASIOのバッファ量を増やして、ASIOの音声合成処理の負荷を下げること。 - if ( this.Device.UpdateSystemTimeMs == CTimer.UnusedNum ) // #33890 2014.5.27 yyagi + if (this.Device.UpdateSystemTimeMs == CTimer.UnusedNum) // #33890 2014.5.27 yyagi { // 環境によっては、ASIOベースの演奏タイマーが動作する前(つまりASIOのサウンド転送が始まる前)に // DTXデータの演奏が始まる場合がある。 @@ -39,18 +29,14 @@ namespace FDK // 補正部分をゼロにして、n経過時間msだけを返すようにする。 // こうすることで、演奏タイマが動作を始めても、破綻しなくなる。 return this.Device.ElapsedTimeMs; - } - else - { - if ( FDK.SoundManager.bUseOSTimer ) + } else { + if (FDK.SoundManager.bUseOSTimer) //if ( true ) { - return ctDInputTimer.SystemTimeMs; // 仮にCSoundTimerをCTimer相当の動作にしてみた - } - else - { + return ctDInputTimer.SystemTimeMs; // 仮にCSoundTimerをCTimer相当の動作にしてみた + } else { return this.Device.ElapsedTimeMs - + ( this.Device.SystemTimer.SystemTimeMs - this.Device.UpdateSystemTimeMs ); + + (this.Device.SystemTimer.SystemTimeMs - this.Device.UpdateSystemTimeMs); } } } @@ -58,67 +44,60 @@ namespace FDK } } - internal CSoundTimer( ISoundDevice device ) - { + 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 - { + try { this.nDInputTimerCounter = this.ctDInputTimer.SystemTimeMs; this.nSoundTimerCounter = this.SystemTimeMs; //Debug.WriteLine( "BaseCounter: " + nDInputTimerCounter + ", " + nSoundTimerCounter ); - } - catch (Exception e) - // サウンド設定変更時に、timer.Dispose()した後、timerが実際に停止する前にここに来てしまう場合があり - // その際にNullReferenceExceptionが発生する - // timerが実際に停止したことを検出してから次の設定をすべきだが、実装が難しいため、 - // ここで単に例外破棄することで代替する - { + } 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 long nサウンドタイマーのシステム時刻msへの変換(long nDInputのタイムスタンプ) { + return nDInputのタイムスタンプ - this.nDInputTimerCounter + this.nSoundTimerCounter; // Timer違いによる時差を補正する } - public override void Dispose() - { + public override void Dispose() { // 特になし; ISoundDevice の解放は呼び出し元で行うこと。 //sendinputスレッド削除 - if ( timer != null ) - { - timer.Change( System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite ); + if (timer != null) { + timer.Change(System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite); // ここで、実際にtimerが停止したことを確認するコードを追加すべきだが、やり方わからず。 // 代替策として、SnapTimers()中で、例外発生を破棄している。 timer.Dispose(); timer = null; } - if ( ct != 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; + 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 + private CTimer ct = null; // TESTCODE } } diff --git a/FDK/src/03.Sound/ESoundDeviceType.cs b/FDK/src/03.Sound/ESoundDeviceType.cs index 06d155f5..7bb6eece 100644 --- a/FDK/src/03.Sound/ESoundDeviceType.cs +++ b/FDK/src/03.Sound/ESoundDeviceType.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace FDK -{ - public enum ESoundDeviceType - { +namespace FDK { + public enum ESoundDeviceType { Bass, ExclusiveWASAPI, SharedWASAPI, diff --git a/FDK/src/03.Sound/ESoundGroup.cs b/FDK/src/03.Sound/ESoundGroup.cs index 23d91f8d..b32fa18a 100644 --- a/FDK/src/03.Sound/ESoundGroup.cs +++ b/FDK/src/03.Sound/ESoundGroup.cs @@ -1,11 +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 586c0302..f558de39 100644 --- a/FDK/src/03.Sound/ExtensionMethods/BassMixExtensions.cs +++ b/FDK/src/03.Sound/ExtensionMethods/BassMixExtensions.cs @@ -1,26 +1,18 @@ -using System; -using System.Collections.Generic; -using System.Text; -using ManagedBass; +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 class BassMixExtensions { + public static bool ChannelPlay(int hHandle) { + return BassMix.ChannelRemoveFlag(hHandle, BassFlags.MixerChanPause); + } - public static bool ChannelPause(int hHandle) - { - return BassMix.ChannelAddFlag(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); - } - } -} \ No newline at end of file + 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 ee6f7e8d..434e2dec 100644 --- a/FDK/src/03.Sound/ISoundDevice.cs +++ b/FDK/src/03.Sound/ISoundDevice.cs @@ -1,12 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; - -namespace FDK -{ - internal interface ISoundDevice : IDisposable - { +namespace FDK { + internal interface ISoundDevice : IDisposable { ESoundDeviceType SoundDeviceType { get; } int nMasterVolume { get; set; } long OutputDelay { get; } @@ -15,7 +8,7 @@ namespace FDK long UpdateSystemTimeMs { get; } CTimer SystemTimer { get; } - CSound tCreateSound( string strファイル名, ESoundGroup soundGroup ); - void tCreateSound( string strファイル名, CSound sound ); + 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 8c0f6ee9..3d5ed629 100644 --- a/FDK/src/03.Sound/LoudnessMetadata.cs +++ b/FDK/src/03.Sound/LoudnessMetadata.cs @@ -1,22 +1,17 @@ -using System; +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 -{ - /// - /// 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; - } - } -} \ No newline at end of file + 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 f3d26467..96bd487d 100644 --- a/FDK/src/03.Sound/LoudnessMetadataScanner.cs +++ b/FDK/src/03.Sound/LoudnessMetadataScanner.cs @@ -1,357 +1,296 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; +using System.ComponentModel; using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Threading; 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 { + /// + /// 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 readonly Stack Jobs = new Stack(); - private static readonly object LockObject = new object(); - private static readonly Queue RecentFileScanDurations = new Queue(); + private static readonly Stack Jobs = new Stack(); + private static readonly object LockObject = new object(); + private static readonly Queue RecentFileScanDurations = new Queue(); - private static Thread ScanningThread; - private static Semaphore Semaphore; + private static Thread ScanningThread; + private static Semaphore Semaphore; - public static void StartBackgroundScanning() - { - var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(StartBackgroundScanning)}"; + public static void StartBackgroundScanning() { + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(StartBackgroundScanning)}"; - if (!IsBs1770GainAvailable()) - { - Trace.TraceInformation($"{tracePrefix}: BS1770GAIN is not available. A background scanning thread will not be started."); - return; - } + if (!IsBs1770GainAvailable()) { + Trace.TraceInformation($"{tracePrefix}: BS1770GAIN is not available. A background scanning thread will not be started."); + return; + } - Trace.TraceInformation($"{tracePrefix}: BS1770GAIN is available. Starting background scanning thread..."); + 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(); - } + 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."); - } + Trace.TraceInformation($"{tracePrefix}: Background scanning thread started."); + } - public static void StopBackgroundScanning(bool joinImmediately) - { - var scanningThread = ScanningThread; + public static void StopBackgroundScanning(bool joinImmediately) { + var scanningThread = ScanningThread; - if (scanningThread == null) - { - return; - } + if (scanningThread == null) { + return; + } - var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(StopBackgroundScanning)}"; + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(StopBackgroundScanning)}"; - Trace.TraceInformation($"{tracePrefix}: Stopping background scanning thread..."); + Trace.TraceInformation($"{tracePrefix}: Stopping background scanning thread..."); - lock (LockObject) - { - ScanningThread = null; - Semaphore.Release(); - Semaphore = null; - } + lock (LockObject) { + ScanningThread = null; + Semaphore.Release(); + Semaphore = null; + } - if (joinImmediately) - { - scanningThread.Join(); - } + if (joinImmediately) { + scanningThread.Join(); + } - Trace.TraceInformation($"{tracePrefix}: Background scanning thread stopped."); - } + Trace.TraceInformation($"{tracePrefix}: Background scanning thread stopped."); + } - public static LoudnessMetadata? LoadForAudioPath(string absoluteBgmPath) - { - try - { - var loudnessMetadataPath = GetLoudnessMetadataPath(absoluteBgmPath); + public static LoudnessMetadata? LoadForAudioPath(string absoluteBgmPath) { + try { + var loudnessMetadataPath = GetLoudnessMetadataPath(absoluteBgmPath); - if (File.Exists(loudnessMetadataPath)) - { - return LoadFromMetadataPath(loudnessMetadataPath); - } + 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()); - } + 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; - } + return null; + } - private static string GetLoudnessMetadataPath(string absoluteBgmPath) - { - return Path.Combine( - Path.GetDirectoryName(absoluteBgmPath), - Path.GetFileNameWithoutExtension(absoluteBgmPath) + ".bs1770gain.xml"); - } + 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 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 trackNavigator = xPathDocument.CreateNavigator() - .SelectSingleNode(@"//bs1770gain/track[@ToTal=""1"" and @Number=""1""]"); + 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"); + 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; - } + 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; + 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; - } + 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)); - } + 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 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); + private static void Scan() { + try { + while (true) { + RaiseScanningStateChanged(false); - Semaphore?.WaitOne(); + Semaphore?.WaitOne(); - if (ScanningThread == null) - { - return; - } + if (ScanningThread == null) { + return; + } - RaiseScanningStateChanged(true); + RaiseScanningStateChanged(true); - int jobCount; - string absoluteBgmPath; - lock (LockObject) - { - jobCount = Jobs.Count; - absoluteBgmPath = Jobs.Pop(); - } + int jobCount; + string absoluteBgmPath; + lock (LockObject) { + jobCount = Jobs.Count; + absoluteBgmPath = Jobs.Pop(); + } - var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(Scan)}"; + 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; - } + try { + if (!File.Exists(absoluteBgmPath)) { + Trace.TraceWarning($"{tracePrefix}: Scanning jobs outstanding: {jobCount - 1}. Missing audio file. Skipping {absoluteBgmPath}..."); + continue; + } - var loudnessMetadataPath = GetLoudnessMetadataPath(absoluteBgmPath); + var loudnessMetadataPath = GetLoudnessMetadataPath(absoluteBgmPath); - if (File.Exists(loudnessMetadataPath)) - { - Trace.TraceWarning($"{tracePrefix}: Scanning jobs outstanding: {jobCount - 1}. Pre-existing metadata. Skipping {absoluteBgmPath}..."); - continue; - } + 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(); + 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); + 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()); - } - } + 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(); - } + 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}"); - } + throw new Exception( + $"Execution of {processStartInfo.FileName} with arguments {processStartInfo.Arguments} failed with exit code {process.ExitCode}: {stderr}"); + } - return stdoutWriter.ToString(); - } - } + return stdoutWriter.ToString(); + } + } - private static void RaiseScanningStateChanged(bool isActivelyScanning) - { - ScanningStateChanged?.Invoke(null, new ScanningStateChangedEventArgs(isActivelyScanning)); - } + private static void RaiseScanningStateChanged(bool isActivelyScanning) { + ScanningStateChanged?.Invoke(null, new ScanningStateChangedEventArgs(isActivelyScanning)); + } - public class ScanningStateChangedEventArgs : EventArgs - { - public ScanningStateChangedEventArgs(bool isActivelyScanning) - { - IsActivelyScanning = isActivelyScanning; - } + public class ScanningStateChangedEventArgs : EventArgs { + public ScanningStateChangedEventArgs(bool isActivelyScanning) { + IsActivelyScanning = isActivelyScanning; + } - public bool IsActivelyScanning { get; private set; } - } + public bool IsActivelyScanning { get; private set; } + } - public static event EventHandler ScanningStateChanged; - } -} \ No newline at end of file + public static event EventHandler ScanningStateChanged; + } +} diff --git a/FDK/src/03.Sound/Lufs.cs b/FDK/src/03.Sound/Lufs.cs index aad1efd5..179167cb 100644 --- a/FDK/src/03.Sound/Lufs.cs +++ b/FDK/src/03.Sound/Lufs.cs @@ -1,47 +1,37 @@ -using System; +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 -{ - /// - /// 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 Lufs(double value) { + _value = value; + } - public Lufs(double value) - { - _value = value; - } + public double ToDouble() => _value; - public double ToDouble() => _value; + public Lufs Min(Lufs lufs) { + return new Lufs(Math.Min(_value, lufs._value)); + } - public Lufs Min(Lufs lufs) - { - return new Lufs(Math.Min(_value, lufs._value)); - } + public Lufs Negate() { + return new Lufs(-_value); + } - public Lufs Negate() - { - return new Lufs(-_value); - } + public override string ToString() { + return _value.ToString(); + } - 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); - } - } + 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 7020e323..c7a430bb 100644 --- a/FDK/src/03.Sound/SongGainController.cs +++ b/FDK/src/03.Sound/SongGainController.cs @@ -1,32 +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 { + /// + /// 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; } - public void Set(int songVol, LoudnessMetadata? songLoudnessMetadata, CSound sound) - { - if (ApplyLoudnessMetadata && songLoudnessMetadata.HasValue) - { - var gain = TargetLoudness - songLoudnessMetadata.Value.Integrated; + 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); - } - } - } + 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 1b3e9d6c..f2bf0aae 100644 --- a/FDK/src/03.Sound/SoundGroupLevelController.cs +++ b/FDK/src/03.Sound/SoundGroupLevelController.cs @@ -1,132 +1,113 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; +using System.Collections.ObjectModel; 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 { + /// + /// 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 readonly ObservableCollection _sounds; + private readonly ObservableCollection _sounds; - private int _keyboardSoundLevelIncrement; + private int _keyboardSoundLevelIncrement; - public SoundGroupLevelController(ObservableCollection sounds) - { - _sounds = sounds; + public SoundGroupLevelController(ObservableCollection sounds) { + _sounds = sounds; - _sounds.CollectionChanged += SoundsOnCollectionChanged; - } + _sounds.CollectionChanged += SoundsOnCollectionChanged; + } - public void SetLevel(ESoundGroup soundGroup, int level) - { - var clampedLevel = level.Clamp(CSound.MinimumGroupLevel, CSound.MaximumGroupLevel); + public void SetLevel(ESoundGroup soundGroup, int level) { + var clampedLevel = level.Clamp(CSound.MinimumGroupLevel, CSound.MaximumGroupLevel); - if (_levelBySoundGroup[soundGroup] == clampedLevel) - { - return; - } + if (_levelBySoundGroup[soundGroup] == clampedLevel) { + return; + } - _levelBySoundGroup[soundGroup] = clampedLevel; + _levelBySoundGroup[soundGroup] = clampedLevel; - foreach (var sound in _sounds) - { - if (sound.SoundGroup == soundGroup) - { - SetLevel(sound); - } - } + foreach (var sound in _sounds) { + if (sound.SoundGroup == soundGroup) { + SetLevel(sound); + } + } - RaiseLevelChanged(soundGroup, clampedLevel); - } + RaiseLevelChanged(soundGroup, clampedLevel); + } - public void SetKeyboardSoundLevelIncrement(int keyboardSoundLevelIncrement) - { - _keyboardSoundLevelIncrement = keyboardSoundLevelIncrement; - } + public void SetKeyboardSoundLevelIncrement(int keyboardSoundLevelIncrement) { + _keyboardSoundLevelIncrement = keyboardSoundLevelIncrement; + } - public void AdjustLevel(ESoundGroup soundGroup, bool isAdjustmentPositive) - { - var adjustmentIncrement = isAdjustmentPositive - ? _keyboardSoundLevelIncrement - : -_keyboardSoundLevelIncrement; + public void AdjustLevel(ESoundGroup soundGroup, bool isAdjustmentPositive) { + var adjustmentIncrement = isAdjustmentPositive + ? _keyboardSoundLevelIncrement + : -_keyboardSoundLevelIncrement; - SetLevel(soundGroup, _levelBySoundGroup[soundGroup] + adjustmentIncrement); - } + SetLevel(soundGroup, _levelBySoundGroup[soundGroup] + adjustmentIncrement); + } - private void SetLevel(CSound sound) - { - sound.GroupLevel = _levelBySoundGroup[sound.SoundGroup]; - } + 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 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)); - } + 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 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 ESoundGroup SoundGroup { get; private set; } + public int Level { get; private set; } + } - public event EventHandler LevelChanged; - } + public event EventHandler LevelChanged; + } } diff --git a/FDK/src/03.Sound/SoundManager.cs b/FDK/src/03.Sound/SoundManager.cs index bb89fc13..9ea1b82c 100644 --- a/FDK/src/03.Sound/SoundManager.cs +++ b/FDK/src/03.Sound/SoundManager.cs @@ -1,49 +1,32 @@ -using System; -using System.Collections.ObjectModel; using System.Diagnostics; -using System.Runtime.InteropServices; -using System.IO; -using System.Linq; -using System.Threading; -using FDK.ExtensionMethods; using ManagedBass; -using ManagedBass.Asio; -using ManagedBass.Wasapi; -using ManagedBass.Mix; -using ManagedBass.Fx; using Silk.NET.Windowing; -using FDK.BassMixExtension; -namespace FDK -{ - public class SoundManager // : CSound +namespace FDK { + public class SoundManager // : CSound { - private static ISoundDevice SoundDevice - { + private static ISoundDevice SoundDevice { get; set; } - private static ESoundDeviceType SoundDeviceType - { + private static ESoundDeviceType SoundDeviceType { get; set; } public static CSoundTimer PlayTimer = null; - public static bool bUseOSTimer = false; // OSのタイマーを使うか、CSoundTimerを使うか。DTXCではfalse, DTXManiaではtrue。 + public static bool bUseOSTimer = false; // OSのタイマーを使うか、CSoundTimerを使うか。DTXCではfalse, DTXManiaではtrue。 // DTXC(DirectSound)でCSoundTimerを使うと、内部で無音のループサウンドを再生するため // サウンドデバイスを占有してしまい、Viewerとして呼び出されるDTXManiaで、ASIOが使えなくなる。 - // DTXMania単体でこれをtrueにすると、WASAPI/ASIO時に演奏タイマーとしてFDKタイマーではなく - // システムのタイマーを使うようになる。こうするとスクロールは滑らかになるが、音ズレが出るかもしれない。 - + // DTXMania単体でこれをtrueにすると、WASAPI/ASIO時に演奏タイマーとしてFDKタイマーではなく + // システムのタイマーを使うようになる。こうするとスクロールは滑らかになるが、音ズレが出るかもしれない。 + public static bool bIsTimeStretch = false; private static IWindow Window_; private static int _nMasterVolume; - public int nMasterVolume - { - get - { + public int nMasterVolume { + get { return _nMasterVolume; } //get @@ -90,8 +73,7 @@ namespace FDK // BassMix.BASS_Mixer_ChannelSetEnvelope( SoundDevice.hMixer, BASSMIXEnvelope.BASS_MIXER_ENV_VOL, nodes ); // } //} - set - { + set { SoundDevice.nMasterVolume = value; _nMasterVolume = value; } @@ -105,13 +87,11 @@ namespace FDK //public static bool bIsMP3DecodeByWindowsCodec = false; public static int nMixing = 0; - public int GetMixingStreams() - { + public int GetMixingStreams() { return nMixing; } public static int nStreams = 0; - public int GetStreams() - { + public int GetStreams() { return nStreams; } #region [ WASAPI/ASIO/DirectSound設定値 ] @@ -119,13 +99,11 @@ namespace FDK /// WASAPI 排他モード出力における再生遅延[ms](の希望値)。最終的にはこの数値を基にドライバが決定する)。 /// 0以下の値を指定すると、この数値はWASAPI初期化時に自動設定する。正数を指定すると、その値を設定しようと試みる。 /// - public static int SoundDelayExclusiveWASAPI = 0; // SSTでは、50ms - public int GetSoundExclusiveWASAPI() - { + public static int SoundDelayExclusiveWASAPI = 0; // SSTでは、50ms + public int GetSoundExclusiveWASAPI() { return SoundDelayExclusiveWASAPI; } - public void SetSoundDelayExclusiveWASAPI( int value ) - { + public void SetSoundDelayExclusiveWASAPI(int value) { SoundDelayExclusiveWASAPI = value; } /// @@ -157,22 +135,18 @@ namespace FDK /// /// ASIO 出力におけるバッファサイズ。 /// - public static int SoundDelayASIO = 0; // 0にすると、デバイスの設定値をそのまま使う。 - public int GetSoundDelayASIO() - { + public static int SoundDelayASIO = 0; // 0にすると、デバイスの設定値をそのまま使う。 + public int GetSoundDelayASIO() { return SoundDelayASIO; } - public void SetSoundDelayASIO(int value) - { + public void SetSoundDelayASIO(int value) { SoundDelayASIO = value; } public static int ASIODevice = 0; - public int GetASIODevice() - { + public int GetASIODevice() { return ASIODevice; } - public void SetASIODevice(int value) - { + public void SetASIODevice(int value) { ASIODevice = value; } /// @@ -180,14 +154,10 @@ namespace FDK /// public static int SoundDelayDirectSound = 100; - public long GetSoundDelay() - { - if ( SoundDevice != null ) - { + public long GetSoundDelay() { + if (SoundDevice != null) { return SoundDevice.BufferSize; - } - else - { + } else { return -1; } } @@ -203,15 +173,13 @@ namespace FDK /// /// /// - public SoundManager( IWindow window, ESoundDeviceType soundDeviceType, int nSoundDelayBASS, int nSoundDelayExclusiveWASAPI, int nSoundDelayASIO, int nASIODevice, bool _bUseOSTimer ) - { + 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 ); + tInitialize(soundDeviceType, nSoundDelayBASS, nSoundDelayExclusiveWASAPI, nSoundDelayASIO, nASIODevice, _bUseOSTimer); } - public void Dispose() - { + public void Dispose() { t終了(); } @@ -220,29 +188,26 @@ namespace FDK // t初期化( ESoundDeviceType.DirectSound, 0, 0, 0 ); //} - public void tInitialize( ESoundDeviceType soundDeviceType, int _nSoundDelayBASS, int _nSoundDelayExclusiveWASAPI, int _nSoundDelayASIO, int _nASIODevice, IntPtr handle ) - { + public void tInitialize(ESoundDeviceType soundDeviceType, int _nSoundDelayBASS, int _nSoundDelayExclusiveWASAPI, int _nSoundDelayASIO, int _nASIODevice, IntPtr handle) { //if ( !bInitialized ) { - tInitialize( soundDeviceType, _nSoundDelayBASS, _nSoundDelayExclusiveWASAPI, _nSoundDelayASIO, _nASIODevice ); + 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) { + tInitialize(soundDeviceType, _nSoundDelayBASS, _nSoundDelayExclusiveWASAPI, _nSoundDelayASIO, _nASIODevice, false); } - public void tInitialize( ESoundDeviceType soundDeviceType, int _nSoundDelayBASS, int _nSoundDelayExclusiveWASAPI, int _nSoundDelayASIO, int _nASIODevice, bool _bUseOSTimer ) - { + public void tInitialize(ESoundDeviceType soundDeviceType, int _nSoundDelayBASS, int _nSoundDelayExclusiveWASAPI, int _nSoundDelayASIO, int _nASIODevice, bool _bUseOSTimer) { //SoundDevice = null; // 後で再初期化することがあるので、null初期化はコンストラクタに回す - PlayTimer = null; // Global.Bass 依存(つまりユーザ依存) + PlayTimer = null; // Global.Bass 依存(つまりユーザ依存) nMixing = 0; SoundDelayBASS = _nSoundDelayBASS; SoundDelayExclusiveWASAPI = _nSoundDelayExclusiveWASAPI; SoundDelaySharedWASAPI = _nSoundDelayExclusiveWASAPI; - SoundDelayASIO = _nSoundDelayASIO; + SoundDelayASIO = _nSoundDelayASIO; ASIODevice = _nASIODevice; bUseOSTimer = _bUseOSTimer; @@ -256,8 +221,7 @@ namespace FDK }; int initialDevice; - switch ( soundDeviceType ) - { + switch (soundDeviceType) { case ESoundDeviceType.Bass: initialDevice = 0; break; @@ -274,39 +238,32 @@ namespace FDK initialDevice = 4; break; } - for ( SoundDeviceType = ESoundDeviceTypes[ initialDevice ]; ; SoundDeviceType = ESoundDeviceTypes[ ++initialDevice ] ) - { - try - { + 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( "サウンドデバイスの初期化に失敗しました。" ) ); + } 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 + if (soundDeviceType == ESoundDeviceType.Bass || soundDeviceType == ESoundDeviceType.ExclusiveWASAPI || soundDeviceType == ESoundDeviceType.SharedWASAPI - || soundDeviceType == ESoundDeviceType.ASIO ) - { + || 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 ) ); + Trace.TraceInformation("BASS_CONFIG_UpdatePeriod=" + Bass.GetConfig(Configuration.UpdatePeriod)); + Trace.TraceInformation("BASS_CONFIG_UpdateThreads=" + Bass.GetConfig(Configuration.UpdateThreads)); } } - public void tDisableUpdateBufferAutomatically() - { + public void tDisableUpdateBufferAutomatically() { //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS, 0 ); //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0 ); @@ -315,93 +272,83 @@ namespace FDK } - public static void t終了() - { + public static void t終了() { SoundDevice.Dispose(); - PlayTimer.Dispose(); // Global.Bass を解放した後に解放すること。(Global.Bass で参照されているため) + PlayTimer.Dispose(); // Global.Bass を解放した後に解放すること。(Global.Bass で参照されているため) } - public static void tReloadSoundDeviceAndSound() - { + public static void tReloadSoundDeviceAndSound() { #region [ すでにサウンドデバイスと演奏タイマが構築されていれば解放する。] //----------------- - if ( SoundDevice != null ) - { + if (SoundDevice != null) { // すでに生成済みのサウンドがあれば初期状態に戻す。 - CSound.tResetAllSound(); // リソースは解放するが、CSoundのインスタンスは残す。 + CSound.tResetAllSound(); // リソースは解放するが、CSoundのインスタンスは残す。 // サウンドデバイスと演奏タイマを解放する。 SoundDevice.Dispose(); - PlayTimer?.Dispose(); // Global.SoundDevice を解放した後に解放すること。(Global.SoundDevice で参照されているため) + PlayTimer?.Dispose(); // Global.SoundDevice を解放した後に解放すること。(Global.SoundDevice で参照されているため) } //----------------- #endregion #region [ 新しいサウンドデバイスを構築する。] //----------------- - switch ( SoundDeviceType ) - { + switch (SoundDeviceType) { case ESoundDeviceType.Bass: - SoundDevice = new CSoundDeviceBASS( SoundDelayBASS, SoundUpdatePeriodBASS ); + SoundDevice = new CSoundDeviceBASS(SoundDelayBASS, SoundUpdatePeriodBASS); break; case ESoundDeviceType.ExclusiveWASAPI: - SoundDevice = new CSoundDeviceWASAPI( CSoundDeviceWASAPI.EWASAPIMode.Exclusion, SoundDelayExclusiveWASAPI, SoundUpdatePeriodExclusiveWASAPI ); + SoundDevice = new CSoundDeviceWASAPI(CSoundDeviceWASAPI.EWASAPIMode.Exclusion, SoundDelayExclusiveWASAPI, SoundUpdatePeriodExclusiveWASAPI); break; case ESoundDeviceType.SharedWASAPI: - SoundDevice = new CSoundDeviceWASAPI( CSoundDeviceWASAPI.EWASAPIMode.Share, SoundDelaySharedWASAPI, SoundUpdatePeriodSharedWASAPI ); + SoundDevice = new CSoundDeviceWASAPI(CSoundDeviceWASAPI.EWASAPIMode.Share, SoundDelaySharedWASAPI, SoundUpdatePeriodSharedWASAPI); break; case ESoundDeviceType.ASIO: - SoundDevice = new CSoundDeviceASIO( SoundDelayASIO, ASIODevice ); + SoundDevice = new CSoundDeviceASIO(SoundDelayASIO, ASIODevice); break; default: - throw new Exception( string.Format( "未対応の SoundDeviceType です。[{0}]", SoundDeviceType.ToString() ) ); + throw new Exception(string.Format("未対応の SoundDeviceType です。[{0}]", SoundDeviceType.ToString())); } //----------------- #endregion #region [ 新しい演奏タイマを構築する。] //----------------- - PlayTimer = new CSoundTimer( SoundDevice ); + PlayTimer = new CSoundTimer(SoundDevice); //----------------- #endregion - SoundDevice.nMasterVolume = _nMasterVolume; // サウンドデバイスに対して、マスターボリュームを再設定する + SoundDevice.nMasterVolume = _nMasterVolume; // サウンドデバイスに対して、マスターボリュームを再設定する - CSound.tReloadSound( SoundDevice ); // すでに生成済みのサウンドがあれば作り直す。 + 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() ) ); + public CSound tCreateSound(string filename, ESoundGroup soundGroup) { + if (!File.Exists(filename)) { + Trace.TraceWarning($"[i18n] File does not exist: {filename}"); + return null; } - return SoundDevice.tCreateSound( filename, soundGroup ); + + 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 void tDisposeSound(CSound csound) { + csound?.tDispose(true); // インスタンスは存続→破棄にする。 } - public string GetCurrentSoundDeviceType() - { - switch ( SoundDeviceType ) - { + public string GetCurrentSoundDeviceType() { + switch (SoundDeviceType) { case ESoundDeviceType.Bass: return "Bass"; case ESoundDeviceType.ExclusiveWASAPI: @@ -415,24 +362,20 @@ namespace FDK } } - public void AddMixer( CSound cs, double db再生速度, bool _b演奏終了後も再生が続くチップである ) - { + public void AddMixer(CSound cs, double db再生速度, bool _b演奏終了後も再生が続くチップである) { cs.b演奏終了後も再生が続くチップである = _b演奏終了後も再生が続くチップである; cs.PlaySpeed = db再生速度; cs.AddBassSoundFromMixer(); } - public void AddMixer( CSound cs, double db再生速度 ) - { + public void AddMixer(CSound cs, double db再生速度) { cs.PlaySpeed = db再生速度; cs.AddBassSoundFromMixer(); } - public void AddMixer( CSound cs ) - { + public void AddMixer(CSound cs) { cs.AddBassSoundFromMixer(); } - public void RemoveMixer( CSound cs ) - { + public void RemoveMixer(CSound cs) { cs.tRemoveSoundFromMixer(); } } -} \ No newline at end of file +} diff --git a/FDK/src/04.Graphics/BitmapUtil.cs b/FDK/src/04.Graphics/BitmapUtil.cs index 9e24bc78..0a22a32d 100644 --- a/FDK/src/04.Graphics/BitmapUtil.cs +++ b/FDK/src/04.Graphics/BitmapUtil.cs @@ -1,15 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; -using System.Drawing; -using System.IO; +using System.Runtime.InteropServices; using SkiaSharp; -namespace FDK -{ - public static class BitmapUtil - { +namespace FDK { + public static class BitmapUtil { // 定数 public const uint DIB_PAL_COLORS = 1; @@ -18,9 +11,8 @@ namespace FDK // 構造体 - [StructLayout( LayoutKind.Sequential, Pack = 1 )] - public struct BITMAPFILEHEADER - { + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct BITMAPFILEHEADER { public ushort bfType; public uint bfSize; public ushort bfReserved1; @@ -28,9 +20,8 @@ namespace FDK public uint bfOffBits; } - [StructLayout( LayoutKind.Sequential, Pack = 1 )] - public struct BITMAPINFOHEADER - { + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct BITMAPINFOHEADER { public const int BI_RGB = 0; public uint biSize構造体のサイズ; public int biWidthビットマップの幅dot; @@ -48,25 +39,24 @@ namespace FDK // メソッド - public static unsafe SKBitmap ToBitmap( IntPtr pBITMAPINFOHEADER ) - { + public static unsafe SKBitmap ToBitmap(IntPtr pBITMAPINFOHEADER) { BITMAPFILEHEADER bitmapfileheader; - BITMAPINFOHEADER* bitmapinfoheaderPtr = (BITMAPINFOHEADER*) pBITMAPINFOHEADER; + BITMAPINFOHEADER* bitmapinfoheaderPtr = (BITMAPINFOHEADER*)pBITMAPINFOHEADER; bitmapfileheader.bfType = 0x4d42; - bitmapfileheader.bfOffBits = (uint) ( sizeof( BITMAPFILEHEADER ) + sizeof( BITMAPINFOHEADER ) ); + 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画像イメージのサイズ ]; + 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 ); + Marshal.Copy((IntPtr)bitmapinfoheaderPtr, destination, 0, destination.Length); + writer.Write(destination); writer.Flush(); writer.BaseStream.Position = 0L; return null; diff --git a/FDK/src/04.Graphics/CDecodedFrame.cs b/FDK/src/04.Graphics/CDecodedFrame.cs index 94502f78..08b0b851 100644 --- a/FDK/src/04.Graphics/CDecodedFrame.cs +++ b/FDK/src/04.Graphics/CDecodedFrame.cs @@ -1,61 +1,46 @@ -using System; -using System.Drawing; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Drawing; using System.Runtime.InteropServices; using FFmpeg.AutoGen; -namespace FDK -{ - public class CDecodedFrame : IDisposable - { - public CDecodedFrame(Size texsize) - { +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); } - public bool Using - { + public bool Using { get; private set; } - public double Time - { + public double Time { get; private set; } - public IntPtr TexPointer - { + public IntPtr TexPointer { get; private set; } - public Size TexSize - { + public Size TexSize { get; private set; } - public unsafe CDecodedFrame UpdateFrame(double time, AVFrame* frame) - { + 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 RemoveFrame() - { + public void RemoveFrame() { this.Using = false; } - public void Dispose() - { + public void Dispose() { this.Using = false; Marshal.FreeHGlobal(this.TexPointer); } } -} \ No newline at end of file +} diff --git a/FDK/src/04.Graphics/CFrameConverter.cs b/FDK/src/04.Graphics/CFrameConverter.cs index 832dda55..514aa8cb 100644 --- a/FDK/src/04.Graphics/CFrameConverter.cs +++ b/FDK/src/04.Graphics/CFrameConverter.cs @@ -1,75 +1,63 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Text; +using System.Drawing; 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 { + 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)); - _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); - } + _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); + 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); + 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; - } - } + ffmpeg.av_frame_unref(framep); + return tmp; + } else { + return framep; + } + } - public void Dispose() - { - Marshal.FreeHGlobal(_convertedFrameBufferPtr); - ffmpeg.sws_freeContext(convert_context); - } + 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; - } -} \ No newline at end of file + 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 361611ed..8e6afc8b 100644 --- a/FDK/src/04.Graphics/CTexture.cs +++ b/FDK/src/04.Graphics/CTexture.cs @@ -1065,4 +1065,4 @@ namespace FDK //----------------- #endregion } -} \ No newline at end of file +} diff --git a/FDK/src/04.Graphics/CTextureAutofold.cs b/FDK/src/04.Graphics/CTextureAutofold.cs index 7d4848de..2e3ca900 100644 --- a/FDK/src/04.Graphics/CTextureAutofold.cs +++ b/FDK/src/04.Graphics/CTextureAutofold.cs @@ -1,18 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Drawing.Imaging; -using System.IO; -using System.Diagnostics; -using Silk.NET.Maths; +using Rectangle = System.Drawing.Rectangle; -using Rectangle = System.Drawing.Rectangle; -using Point = System.Drawing.Point; -using Color = System.Drawing.Color; - -namespace FDK -{ +namespace FDK { /// /// 縦長_横長の画像を自動で折りたたんでテクスチャ化するCTexture。 /// 例えば、768x30 のテクスチャファイルが入力されたら、 @@ -20,8 +8,7 @@ namespace FDK /// 必要に応じて、正方形テクスチャにもする。 /// また、t2D描画は、その折り返しを加味して実行する。 /// - public class CTextureAf : CTexture, IDisposable - { + public class CTextureAf : CTexture, IDisposable { /// /// 画像ファイルからテクスチャを生成する。 @@ -36,18 +23,16 @@ namespace FDK /// 画像の黒(0xFFFFFFFF)を透過させるなら true。 /// テクスチャの管理方法。 /// テクスチャの作成に失敗しました。 - public CTextureAf( string strファイル名, bool b黒を透過する ) - { - MakeTexture( strファイル名, b黒を透過する ); + 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ファイル名 ) ); + 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黒を透過する); } @@ -60,43 +45,39 @@ namespace FDK /// /// /// - private bool GetFoldedTextureSize( ref int width, ref int height, out int foldtimes ) - { + 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 ) - { + 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回折りたたむ。" ); + 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の処理に委ねる + if (pow <= orgHeight * 2) // 新width > 新heightを維持できなくなったなら + { // 最適化不可とみなし、baseの処理に委ねる return false; } } #endregion #region [ width > height ではなくなるまで、折りたたみ続ける ] width = pow; - height = orgHeight * 2; // 初期値=1回折りたたんだ状態 - do - { + height = orgHeight * 2; // 初期値=1回折りたたんだ状態 + do { width /= 2; - foldtimes = ( orgWidth / width ) + ( ( orgWidth % width > 0 ) ? 1 : 0 ) - 1; - height = orgHeight * ( foldtimes + 1 ); - } while ( width > height ); + foldtimes = (orgWidth / width) + ((orgWidth % width > 0) ? 1 : 0) - 1; + height = orgHeight * (foldtimes + 1); + } while (width > height); width *= 2; - foldtimes = ( orgWidth / width ) + ( ( orgWidth % width > 0 ) ? 1 : 0 ) - 1; - height = orgHeight * ( foldtimes + 1 ); + foldtimes = (orgWidth / width) + ((orgWidth % width > 0) ? 1 : 0) - 1; + height = orgHeight * (foldtimes + 1); #endregion return true; @@ -110,69 +91,58 @@ namespace FDK /// Direct3D9 デバイス。 /// 描画位置(テクスチャの左上位置の X 座標[dot])。 /// 描画位置(テクスチャの左上位置の Y 座標[dot])。 - public new void t2D描画( int x, int y ) - { + 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++ ) - { + for (int n = 0; n <= _foldtimes; n++) { Rectangle r; - if ( b横長のテクスチャである ) - { + 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 - { + 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 ); + 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 ) - { + public new void t2D描画(int x, int y, Rectangle rc) { Rectangle r; - if ( b横長のテクスチャである ) - { + 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 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; + 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 ); + 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 deltaX = (i == beginFold) ? (i + 1) * rc全画像.Width - rc.X : rc全画像.Width; int newWidth = rc.Width - deltaX; x += deltaX; rc.Width = newWidth; } - } - else - { + } 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 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; + 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 ); + 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 deltaY = (i == beginFold) ? (i + 1) * rc全画像.Height - rc.Y : rc全画像.Height; int newHeight = rc.Height - deltaY; y += deltaY; rc.Height = newHeight; @@ -180,13 +150,11 @@ namespace FDK } } - public new void t2D描画( float x, float y ) - { - t2D描画( (int) x, (int) y ); + 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 ); + public void t2D描画(float x, float y, Rectangle rc) { + t2D描画((int)x, (int)y, rc); } #region [ private ] diff --git a/FDK/src/04.Graphics/CTextureCreateFailedException.cs b/FDK/src/04.Graphics/CTextureCreateFailedException.cs index 1644e050..b5057150 100644 --- a/FDK/src/04.Graphics/CTextureCreateFailedException.cs +++ b/FDK/src/04.Graphics/CTextureCreateFailedException.cs @@ -1,29 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.Serialization; +using System.Runtime.Serialization; -namespace FDK -{ +namespace FDK { /// /// テクスチャの作成に失敗しました。 /// - public class CTextureCreateFailedException : Exception - { - public CTextureCreateFailedException() - { + public class CTextureCreateFailedException : Exception { + public CTextureCreateFailedException() { } - public CTextureCreateFailedException( string message ) - : base( message ) - { + public CTextureCreateFailedException(string message) + : base(message) { } - public CTextureCreateFailedException( SerializationInfo info, StreamingContext context ) - : base( info, context ) - { + public CTextureCreateFailedException(SerializationInfo info, StreamingContext context) + : base(info, context) { } - public CTextureCreateFailedException( string message, Exception innerException ) - : base( message, innerException ) - { + 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 6871c922..91bd3987 100644 --- a/FDK/src/04.Graphics/CVideoDecoder.cs +++ b/FDK/src/04.Graphics/CVideoDecoder.cs @@ -1,35 +1,21 @@ -using System; -using System.IO; +using System.Collections.Concurrent; using System.Diagnostics; -using System.Collections.Generic; -using System.Drawing; -using System.Runtime.InteropServices; -using System.Collections.Concurrent; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFmpeg.AutoGen; -using System.Threading; - using Size = System.Drawing.Size; -namespace FDK -{ +namespace FDK { /// /// ビデオのデコードをするクラス /// ファイル名・nullのCTextureをもらえれば、勝手に、CTextureに映像を格納して返す。 /// 演奏とは別のタイマーを使用しているので、ずれる可能性がある。 /// - public unsafe class CVideoDecoder : IDisposable - { - public CVideoDecoder(string filename) - { + public unsafe class CVideoDecoder : IDisposable { + public CVideoDecoder(string filename) { if (!File.Exists(filename)) throw new FileNotFoundException(filename + " not found..."); format_context = ffmpeg.avformat_alloc_context(); - fixed (AVFormatContext** format_contexttmp = &format_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"); @@ -37,10 +23,8 @@ namespace FDK 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) - { + 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; } @@ -76,10 +60,9 @@ namespace FDK } } - public void Dispose() - { + public void Dispose() { bDrawing = false; - close = true; + close = true; cts?.Cancel(); while (DS != DecodingState.Stopped) ; frameconv.Dispose(); @@ -88,8 +71,7 @@ namespace FDK if (ffmpeg.avcodec_close(codec_context) < 0) Trace.TraceError("codec context close error."); video_stream = null; - fixed (AVFormatContext** format_contexttmp = &format_context) - { + fixed (AVFormatContext** format_contexttmp = &format_context) { ffmpeg.avformat_close_input(format_contexttmp); } if (lastTexture != null) @@ -98,49 +80,39 @@ namespace FDK frame.Dispose(); } - public void Start() - { + public void Start() { CTimer.Reset(); CTimer.Resume(); this.bPlaying = true; - bDrawing = true; + bDrawing = true; - } + } - public void PauseControl() - { - if (this.bPlaying) - { + public void PauseControl() { + if (this.bPlaying) { CTimer.Pause(); this.bPlaying = false; - } - else - { + } else { CTimer.Resume(); this.bPlaying = true; } } - public void Stop() - { + public void Stop() { CTimer.Pause(); this.bPlaying = false; bDrawing = false; - } + } - public void InitRead() - { - if (!bqueueinitialized) - { + public void InitRead() { + if (!bqueueinitialized) { this.Seek(0); bqueueinitialized = true; - } - else + } else Trace.TraceError("The class has already been initialized.\n"); } - public void Seek(long timestampms) - { + 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) @@ -156,21 +128,16 @@ namespace FDK lastTexture = new CTexture(FrameSize.Width, FrameSize.Height); } - public void GetNowFrame(ref CTexture Texture) - { - if (this.bPlaying && decodedframes.Count != 0) - { + 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.TryPeek(out CDecodedFrame frame)) { + while (frame.Time <= (CTimer.NowTimeMs * _dbPlaySpeed)) { if (decodedframes.TryDequeue(out CDecodedFrame cdecodedframe)) { if (decodedframes.Count != 0) if (decodedframes.TryPeek(out frame)) - if (frame.Time <= (CTimer.NowTimeMs * _dbPlaySpeed)) - { + if (frame.Time <= (CTimer.NowTimeMs * _dbPlaySpeed)) { cdecodedframe.RemoveFrame(); continue; } @@ -197,24 +164,19 @@ namespace FDK } - private void EnqueueFrames() - { - if (DS != DecodingState.Running && !close) - { + private void EnqueueFrames() { + if (DS != DecodingState.Running && !close) { cts = new CancellationTokenSource(); Task.Factory.StartNew(() => EnqueueOneFrame()); } } - private void EnqueueOneFrame() - { + private void EnqueueOneFrame() { DS = DecodingState.Running; AVFrame* frame = ffmpeg.av_frame_alloc(); AVPacket* packet = ffmpeg.av_packet_alloc(); - try - { - while (true) - { + try { + while (true) { if (cts.IsCancellationRequested || close) return; @@ -223,14 +185,10 @@ namespace FDK { 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) - { + 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); @@ -246,26 +204,18 @@ namespace FDK //2020/10/27 Mr-Ojii packetが解放されない周回があった問題を修正。 ffmpeg.av_packet_unref(packet); - } - else if (error == ffmpeg.AVERROR_EOF) - { + } else if (error == ffmpeg.AVERROR_EOF) { return; } - } - else - { + } else { //ポーズ中に無限ループに入り、CPU使用率が異常に高くなってしまうため、1ms待つ。 //ネットを調べると、await Task.Delay()を使えというお話が出てくるが、unsafeなので、使えない Thread.Sleep(1); } } - } - catch (Exception e) - { + } catch (Exception e) { Trace.TraceError(e.ToString()); - } - finally - { + } finally { ffmpeg.av_packet_free(&packet); ffmpeg.av_frame_unref(frame); ffmpeg.av_free(frame); @@ -273,42 +223,32 @@ namespace FDK } } - public CDecodedFrame PickUnusedDcodedFrame() - { + public CDecodedFrame PickUnusedDcodedFrame() { for (int i = 0; i < framelist.Length; i++) { - if (framelist[i].Using == false) - { + if (framelist[i].Using == false) { return framelist[i]; - } + } } return null; } - public Size FrameSize - { + public Size FrameSize { get; private set; } - public double Duration - { + public double Duration { get; private set; } - public double dbPlaySpeed - { - get - { + public double dbPlaySpeed { + get { return this._dbPlaySpeed; } - set - { - if (value > 0) - { + set { + if (value > 0) { this._dbPlaySpeed = value; - } - else - { + } else { throw new ArgumentOutOfRangeException(); } } @@ -325,16 +265,15 @@ namespace FDK private CancellationTokenSource cts; private CDecodedFrame[] framelist = new CDecodedFrame[6]; private DecodingState DS = DecodingState.Stopped; - private enum DecodingState - { + private enum DecodingState { Stopped, Running } //for play public bool bPlaying { get; private set; } = false; - public bool bDrawing { get; private set; } = false; - private CTimer CTimer; + public bool bDrawing { get; private set; } = false; + private CTimer CTimer; private AVRational Framerate; private CTexture lastTexture; private bool bqueueinitialized = false; @@ -343,4 +282,4 @@ namespace FDK private CFrameConverter frameconv; #endregion } -} \ No newline at end of file +} diff --git a/FDK/src/04.Graphics/TextRenderer/CCachedFontRenderer.cs b/FDK/src/04.Graphics/TextRenderer/CCachedFontRenderer.cs index ab591647..ffb48b29 100644 --- a/FDK/src/04.Graphics/TextRenderer/CCachedFontRenderer.cs +++ b/FDK/src/04.Graphics/TextRenderer/CCachedFontRenderer.cs @@ -1,34 +1,27 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; +using System.Diagnostics; using SkiaSharp; using Color = System.Drawing.Color; -namespace FDK -{ +namespace FDK { /// /// 高速描画版のCFontRendererクラス。 /// といっても、一度レンダリングした結果をキャッシュして使いまわしているだけ。 /// - public class CCachedFontRenderer : 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, CFontRenderer.FontStyle style) { + Initialize(fontpath, pt, style); } - public CCachedFontRenderer( string fontpath, int pt ) - { - Initialize( fontpath, pt, CFontRenderer.FontStyle.Regular ); + 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 ) - { + protected new void Initialize(string fontpath, int pt, CFontRenderer.FontStyle style) { this.bDisposed_CCachedFontRenderer = false; this.listFontCache = new List(); - base.Initialize( fontpath, pt, style ); + base.Initialize(fontpath, pt, style); } #endregion @@ -41,9 +34,8 @@ namespace FDK /// 描画色 /// 縁取色 /// 描画済テクスチャ - 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 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); } /// @@ -53,9 +45,8 @@ namespace FDK /// 描画色 /// 縁取色 /// 描画済テクスチャ - 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 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); } /// @@ -67,9 +58,8 @@ namespace FDK /// グラデーション 上側の色 /// グラデーション 下側の色 /// 描画済テクスチャ - 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(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); } /// @@ -81,19 +71,16 @@ namespace FDK /// グラデーション 上側の色 /// グラデーション 下側の色 /// 描画済テクスチャ - public new SKBitmap DrawText_V( string drawstr, Color fontColor, Color edgeColor, Color? secondEdgeColor, int edge_Ratio, bool keepCenter = false ) - { + 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 ) - { + 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 ) - { + delegate (FontCache fontcache) { return ( drawstr == fontcache.drawstr && drawmode == fontcache.drawmode && @@ -108,12 +95,11 @@ namespace FDK } ); #endregion - if ( index < 0 ) - { + if (index < 0) { // キャッシュにヒットせず。 #region [ レンダリングして、キャッシュに登録 ] FontCache fc = new FontCache(); - fc.bmp = base.DrawText( drawstr, drawmode, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradationBottomColor, edge_Ratio, keepCenter); + fc.bmp = base.DrawText(drawstr, drawmode, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradationBottomColor, edge_Ratio, keepCenter); fc.drawstr = drawstr; fc.drawmode = drawmode; fc.fontColor = fontColor; @@ -123,40 +109,34 @@ namespace FDK fc.gradationBottomColor = gradationBottomColor; fc.Vertical = false; fc.KeepCenter = keepCenter; - listFontCache.Add( fc ); - Debug.WriteLine( drawstr + ": Cacheにヒットせず。(cachesize=" + listFontCache.Count + ")" ); + 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(); + if (listFontCache.Count > MAXCACHESIZE) { + Debug.WriteLine("Cache溢れ。" + listFontCache[0].drawstr + " を解放します。"); + if (listFontCache[0].bmp != null) { + listFontCache[0].bmp.Dispose(); } - listFontCache.RemoveAt( 0 ); + listFontCache.RemoveAt(0); } #endregion // 呼び出し元のDispose()でキャッシュもDispose()されないように、Clone()で返す。 - return listFontCache[ listFontCache.Count - 1 ].bmp.Copy(); - } - else - { - Debug.WriteLine( drawstr + ": Cacheにヒット!! index=" + index ); + return listFontCache[listFontCache.Count - 1].bmp.Copy(); + } else { + Debug.WriteLine(drawstr + ": Cacheにヒット!! index=" + index); #region [ キャッシュにヒット。レンダリングは行わず、キャッシュ内のデータを返して終了。] // 呼び出し元のDispose()でキャッシュもDispose()されないように、Clone()で返す。 - return listFontCache[ index ].bmp.Copy(); + 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) - { + 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) - { + delegate (FontCache fontcache) { return ( drawstr == fontcache.drawstr && drawmode == fontcache.drawmode && @@ -171,8 +151,7 @@ namespace FDK } ); #endregion - if ( index < 0 ) - { + if (index < 0) { // キャッシュにヒットせず。 #region [ レンダリングして、キャッシュに登録 ] FontCache fc = new FontCache(); @@ -185,48 +164,39 @@ namespace FDK fc.gradationBottomColor = gradationBottomColor; fc.Vertical = true; fc.KeepCenter = keepCenter; - listFontCache.Add( fc ); - Debug.WriteLine( drawstr + ": Cacheにヒットせず。(cachesize=" + listFontCache.Count + ")" ); + 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(); + if (listFontCache.Count > MAXCACHESIZE) { + Debug.WriteLine("Cache溢れ。" + listFontCache[0].drawstr + " を解放します。"); + if (listFontCache[0].bmp != null) { + listFontCache[0].bmp.Dispose(); } - listFontCache.RemoveAt( 0 ); + listFontCache.RemoveAt(0); } #endregion // 呼び出し元のDispose()でキャッシュもDispose()されないように、Clone()で返す。 - return listFontCache[ listFontCache.Count - 1 ].bmp.Copy(); - } - else - { - Debug.WriteLine( drawstr + ": Cacheにヒット!! index=" + index ); + return listFontCache[listFontCache.Count - 1].bmp.Copy(); + } else { + Debug.WriteLine(drawstr + ": Cacheにヒット!! index=" + index); #region [ キャッシュにヒット。レンダリングは行わず、キャッシュ内のデータを返して終了。] // 呼び出し元のDispose()でキャッシュもDispose()されないように、Clone()で返す。 - return listFontCache[ index ].bmp.Copy(); + return listFontCache[index].bmp.Copy(); #endregion } } #region [ IDisposable 実装 ] //----------------- - public new void Dispose() - { - if (!this.bDisposed_CCachedFontRenderer) - { - if (listFontCache != null) - { + 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) - { + foreach (FontCache bc in listFontCache) { + if (bc.bmp != null) { bc.bmp.Dispose(); } } @@ -248,8 +218,7 @@ namespace FDK /// private const int MAXCACHESIZE = 256; - private struct FontCache - { + private struct FontCache { // public Font font; public string drawstr; public DrawMode drawmode; @@ -268,4 +237,4 @@ namespace FDK //----------------- #endregion } -} \ No newline at end of file +} diff --git a/FDK/src/04.Graphics/TextRenderer/CFontRenderer.cs b/FDK/src/04.Graphics/TextRenderer/CFontRenderer.cs index 153faa22..e586c72a 100644 --- a/FDK/src/04.Graphics/TextRenderer/CFontRenderer.cs +++ b/FDK/src/04.Graphics/TextRenderer/CFontRenderer.cs @@ -1,40 +1,31 @@ -using System; using System.Diagnostics; -using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using SkiaSharp; using Color = System.Drawing.Color; -namespace FDK -{ +namespace FDK { - public class CFontRenderer : IDisposable - { + public class CFontRenderer : IDisposable { #region[static系] - public static void SetTextCorrectionX_Chara_List_Vertical(string[] list) - { + 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) - { + 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) - { + 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) - { + 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) - { + public static void SetRotate_Chara_List_Vertical(string[] list) { if (list != null) Rotate_Chara_List_Vertical = list.Where(c => c != null).ToArray(); } @@ -49,16 +40,14 @@ namespace FDK [Flags] - public enum DrawMode - { + public enum DrawMode { Normal = 0, Edge, Gradation } [Flags] - public enum FontStyle - { + public enum FontStyle { Regular = 0, Bold, Italic, @@ -66,10 +55,8 @@ namespace FDK Strikeout } - public static string DefaultFontName - { - get - { + public static string DefaultFontName { + get { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) return "MS UI Gothic"; else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) @@ -79,100 +66,78 @@ namespace FDK } } - public static bool FontExists(string fontpath) - { + public static bool FontExists(string fontpath) { return SKFontManager.Default.FontFamilies.Contains(fontpath) || File.Exists(fontpath); - } + } #region [ コンストラクタ ] - public CFontRenderer(string fontpath, int pt, FontStyle style) - { + public CFontRenderer(string fontpath, int pt, FontStyle style) { Initialize(fontpath, pt, style); } - public CFontRenderer(string fontpath, int pt) - { + public CFontRenderer(string fontpath, int pt) { Initialize(fontpath, pt, FontStyle.Regular); } - public CFontRenderer() - { + public CFontRenderer() { //throw new ArgumentException("CFontRenderer: 引数があるコンストラクタを使用してください。"); } #endregion - protected void Initialize(string fontpath, int pt, FontStyle style) - { - try - { + 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(); } - catch(Exception e) - { - Trace.TraceWarning("SkiaSharpでのフォント生成に失敗しました。" + e.ToString()); - this.textRenderer?.Dispose(); - } - try - { + try { this.textRenderer = new CSkiaSharpTextRenderer(Assembly.GetExecutingAssembly().GetManifestResourceStream(@"FDK.mplus-1p-medium.ttf"), pt, style); - } - catch (Exception e) - { + } catch (Exception e) { Trace.TraceWarning("ビルトインフォントを使用してのフォント生成に失敗しました。" + e.ToString()); this.textRenderer?.Dispose(); throw; } } - public SKBitmap DrawText(string drawstr, Color fontColor, bool keepCenter = false) - { + 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) - { + 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) - { + 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) - { + 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) - { + 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) - { + 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) - { + 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) - { + 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) - { + 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)) - { + 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); } @@ -187,15 +152,12 @@ namespace FDK //レンダリング,大きさ計測 int nWidth = 0; int nHeight = 0; - for (int i = 0; i < strImageList.Length; i++) - { + 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])) - { + 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); } @@ -212,44 +174,29 @@ namespace FDK //1文字ずつ描画したやつを全体キャンバスに描画していく int nowHeightPos = 0; - for (int i = 0; i < strImageList.Length; i++) - { + 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) - { + 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])) - { + 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])) - { + } 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 - { + } else { Correction_X = 0; } } } - if (CorrectionY_Chara_List_Vertical != null && CorrectionY_Chara_List_Value_Vertical != null) - { + 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])) - { + 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])) - { + } 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 - { + } else { Correction_Y = 0; } } @@ -259,22 +206,20 @@ namespace FDK } //1文字ずつ描画したやつの解放 - for (int i = 0; i < strImageList.Length; i++) - { + for (int i = 0; i < strImageList.Length; i++) { strImageList[i].Dispose(); } - + SKImage image = skSurface.Snapshot(); //返します return SKBitmap.FromImage(image); } - public void Dispose() - { + public void Dispose() { this.textRenderer.Dispose(); } private ITextRenderer textRenderer; } -} \ No newline at end of file +} diff --git a/FDK/src/04.Graphics/TextRenderer/CSkiaSharpTextRenderer.cs b/FDK/src/04.Graphics/TextRenderer/CSkiaSharpTextRenderer.cs index 59553a59..06606dd5 100644 --- a/FDK/src/04.Graphics/TextRenderer/CSkiaSharpTextRenderer.cs +++ b/FDK/src/04.Graphics/TextRenderer/CSkiaSharpTextRenderer.cs @@ -1,318 +1,268 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SkiaSharp; -using System.Text.RegularExpressions; - -using Color = System.Drawing.Color; -using Rectangle = System.Drawing.Rectangle; using System.Drawing; -using static FDK.CSkiaSharpTextRenderer; +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(string fontpath, int pt, CFontRenderer.FontStyle style) { + Initialize(fontpath, pt, style); + } - public CSkiaSharpTextRenderer(Stream fontstream, int pt, CFontRenderer.FontStyle style) - { - Initialize(fontstream, 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(); + protected void Initialize(Stream fontstream, int pt, CFontRenderer.FontStyle style) { + paint = new SKPaint(); - //stream・filepathから生成した場合に、style設定をどうすればいいのかがわからない - paint.Typeface = SKFontManager.Default.CreateTypeface(fontstream); + //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; + } - protected void Initialize(string fontpath, int pt, CFontRenderer.FontStyle style) - { - paint = new SKPaint(); + 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; + 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; - } + 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; + } - if (SKFontManager.Default.FontFamilies.Contains(fontpath)) - paint.Typeface = SKTypeface.FromFamilyName(fontpath, weight, width, slant); + if (SKFontManager.Default.FontFamilies.Contains(fontpath)) + paint.Typeface = SKTypeface.FromFamilyName(fontpath, weight, width, slant); - //stream・filepathから生成した場合に、style設定をどうすればいいのかがわからない - if (File.Exists(fontpath)) - paint.Typeface = SKTypeface.FromFile(fontpath, 0); + //stream・filepathから生成した場合に、style設定をどうすればいいのかがわからない + if (File.Exists(fontpath)) + paint.Typeface = SKTypeface.FromFile(fontpath, 0); - if (paint.Typeface == null) - throw new FileNotFoundException(fontpath); + if (paint.Typeface == null) + throw new FileNotFoundException(fontpath); - 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; - } + 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 + // Purify is equivalent to RemoveTags on ObjectExtensions.cs, update both if changing TagRegex - private const string TagRegex = @"<(/?)([gc](?:\.#[0-9a-fA-F]{6})*?)>"; + private const string TagRegex = @"<(/?)([gc](?:\.#[0-9a-fA-F]{6})*?)>"; - private string Purify(string input) - { - return Regex.Replace(input, TagRegex, ""); - } + private string Purify(string input) { + return Regex.Replace(input, TagRegex, ""); + } - private 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; + private 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); + 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); + 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); - } + // 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; + 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, - }; + 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("."); + 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; - } + 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); - } - } + tokenStack.Push(newToken); + } + } - // 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); - } + // 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); + } - return tokens; - } + 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); - } + 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]; + 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); - } + for (int i = 0; i < strs.Length; i++) { + tokens[i] = Tokenize(strs[i], fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradationBottomColor); + } - SKBitmap[] images = new SKBitmap[strs.Length]; + SKBitmap[] images = new SKBitmap[strs.Length]; - for (int i = 0; i < strs.Length; i++) { - SKRect bounds = new SKRect(); + 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; + 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); + //少し大きめにとる(定数じゃない方法を考えましょう) + SKBitmap bitmap = new SKBitmap(width, height, SKColorType.Rgba8888, SKAlphaType.Premul); + SKCanvas canvas = new SKCanvas(bitmap); - int x_offset = 0; + int x_offset = 0; - foreach (SStringToken tok in tokens[i]) - { - int token_width = (int)Math.Ceiling(paint.MeasureText(tok.s, ref bounds)); + 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) - { + if (drawMode.HasFlag(CFontRenderer.DrawMode.Edge) || tok.UseOutline) { - SKPath path = paint.GetTextPath(tok.s, 25 + x_offset, -paint.FontMetrics.Ascent + 25); + 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); - } + 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); - } + 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); - } + 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); + 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; + } - 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); @@ -321,33 +271,28 @@ namespace FDK - 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(); - } + 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(); - } + public void Dispose() { + paint.Dispose(); + } - private SKPaint paint = null; - } -} \ No newline at end of file + private SKPaint paint = null; + } +} diff --git a/FDK/src/04.Graphics/TextRenderer/ITextRenderer.cs b/FDK/src/04.Graphics/TextRenderer/ITextRenderer.cs index c182993d..4b0c1c39 100644 --- a/FDK/src/04.Graphics/TextRenderer/ITextRenderer.cs +++ b/FDK/src/04.Graphics/TextRenderer/ITextRenderer.cs @@ -1,11 +1,8 @@ -using System; using SkiaSharp; 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); - } -} \ No newline at end of file +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); + } +} diff --git a/FDK/src/06.Tempo/CBeatDetect.cs b/FDK/src/06.Tempo/CBeatDetect.cs index 11e6b4c7..ce2f79c4 100644 --- a/FDK/src/06.Tempo/CBeatDetect.cs +++ b/FDK/src/06.Tempo/CBeatDetect.cs @@ -192,4 +192,4 @@ namespace FDK private List listBeatPositions = null; } } -*/ \ No newline at end of file +*/ diff --git a/OpenTaiko/src/Animations/Animator.cs b/OpenTaiko/src/Animations/Animator.cs index 065cf872..e41c462a 100644 --- a/OpenTaiko/src/Animations/Animator.cs +++ b/OpenTaiko/src/Animations/Animator.cs @@ -1,119 +1,96 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using TJAPlayer3; -using FDK; +using FDK; -namespace TJAPlayer3.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, TJAPlayer3.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 TJAPlayer3.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, TJAPlayer3.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 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; - } - } + 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; + } + } - public virtual object GetAnimation() - { - throw new NotImplementedException(); - } + public virtual object GetAnimation() { + throw new NotImplementedException(); + } - // プロパティ - 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 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 - } + enum CounterType { + Normal, + Double + } } diff --git a/OpenTaiko/src/Animations/EaseIn.cs b/OpenTaiko/src/Animations/EaseIn.cs index b60dedc9..1be248f3 100644 --- a/OpenTaiko/src/Animations/EaseIn.cs +++ b/OpenTaiko/src/Animations/EaseIn.cs @@ -1,38 +1,29 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +namespace TJAPlayer3.Animations { + /// + /// イーズインを行うクラス。 + /// + class EaseIn : Animator { + /// + /// イーズインを初期化します。 + /// + /// 始点。 + /// 終点。 + /// イージングにかける時間。 + public EaseIn(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false) { + StartPoint = startPoint; + EndPoint = endPoint; + Sa = EndPoint - StartPoint; + TimeMs = timeMs; + } -namespace TJAPlayer3.Animations -{ - /// - /// イーズインを行うクラス。 - /// - class EaseIn : Animator - { - /// - /// イーズインを初期化します。 - /// - /// 始点。 - /// 終点。 - /// イージングにかける時間。 - 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 persent = Counter.CurrentValue / (double)TimeMs; + return ((double)Sa * persent * persent * persent) + StartPoint; + } - public override object GetAnimation() - { - var persent = Counter.CurrentValue / (double)TimeMs; - return ((double)Sa * persent * persent * persent) + StartPoint; - } - - private readonly int StartPoint; - private readonly int EndPoint; - private readonly int Sa; - private readonly int TimeMs; - } + 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 61ff2740..58479a1d 100644 --- a/OpenTaiko/src/Animations/EaseInOut.cs +++ b/OpenTaiko/src/Animations/EaseInOut.cs @@ -1,46 +1,34 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +namespace TJAPlayer3.Animations { + /// + /// イーズイン・アウトを行うクラス。 + /// + class EaseInOut : Animator { + /// + /// イーズイン・アウトを初期化します。 + /// + /// 始点。 + /// 終点。 + /// イージングにかける時間。 + public EaseInOut(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false) { + StartPoint = startPoint; + EndPoint = endPoint; + Sa = EndPoint - StartPoint; + TimeMs = timeMs; + } -namespace TJAPlayer3.Animations -{ - /// - /// イーズイン・アウトを行うクラス。 - /// - class EaseInOut : Animator - { - /// - /// イーズイン・アウトを初期化します。 - /// - /// 始点。 - /// 終点。 - /// イージングにかける時間。 - 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 persent = Counter.CurrentValue / (double)TimeMs * 2.0; + if (persent < 1) { + return ((double)Sa / 2.0 * persent * persent * persent) + StartPoint; + } else { + persent -= 2; + return ((double)Sa / 2.0 * ((persent * persent * persent) + 2)) + StartPoint; + } + } - public override object GetAnimation() - { - var persent = Counter.CurrentValue / (double)TimeMs * 2.0; - if (persent < 1) - { - return ((double)Sa / 2.0 * persent * persent * persent) + StartPoint; - } - else - { - persent -= 2; - return ((double)Sa / 2.0 * ((persent * persent * persent) + 2)) + StartPoint; - } - } - - private readonly int StartPoint; - private readonly int EndPoint; - private readonly int Sa; - private readonly int TimeMs; - } + 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 5ebc73ea..150dd619 100644 --- a/OpenTaiko/src/Animations/EaseOut.cs +++ b/OpenTaiko/src/Animations/EaseOut.cs @@ -1,39 +1,30 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +namespace TJAPlayer3.Animations { + /// + /// イーズアウトを行うクラス。 + /// + class EaseOut : Animator { + /// + /// イーズアウトを初期化します。 + /// + /// 始点。 + /// 終点。 + /// イージングにかける時間。 + public EaseOut(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false) { + StartPoint = startPoint; + EndPoint = endPoint; + Sa = EndPoint - StartPoint; + TimeMs = timeMs; + } -namespace TJAPlayer3.Animations -{ - /// - /// イーズアウトを行うクラス。 - /// - class EaseOut : Animator - { - /// - /// イーズアウトを初期化します。 - /// - /// 始点。 - /// 終点。 - /// イージングにかける時間。 - 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 persent = Counter.CurrentValue / (double)TimeMs; + persent -= 1; + return (double)Sa * (persent * persent * persent + 1) + StartPoint; + } - public override object GetAnimation() - { - var persent = Counter.CurrentValue / (double)TimeMs; - persent -= 1; - return (double)Sa * (persent * persent * persent + 1) + StartPoint; - } - - private readonly int StartPoint; - private readonly int EndPoint; - private readonly int Sa; - private readonly int TimeMs; - } + 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 6ed81490..51896e5a 100644 --- a/OpenTaiko/src/Animations/FadeIn.cs +++ b/OpenTaiko/src/Animations/FadeIn.cs @@ -1,34 +1,25 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +namespace TJAPlayer3.Animations { + /// + /// フェードインを行うクラス。 + /// + internal class FadeIn : Animator { + /// + /// フェードインを初期化します。 + /// + /// フェードインに掛ける秒数(ミリ秒) + public FadeIn(int timems) : base(0, timems - 1, 1, false) { + TimeMs = timems; + } -namespace TJAPlayer3.Animations -{ - /// - /// フェードインを行うクラス。 - /// - internal class FadeIn : Animator - { - /// - /// フェードインを初期化します。 - /// - /// フェードインに掛ける秒数(ミリ秒) - public FadeIn(int timems) : base(0, timems - 1, 1, false) - { - TimeMs = timems; - } + /// + /// フェードインの不透明度を255段階で返します。 + /// + /// 不透明度。 + public override object GetAnimation() { + var opacity = base.Counter.CurrentValue * 255 / TimeMs; + return opacity; + } - /// - /// フェードインの不透明度を255段階で返します。 - /// - /// 不透明度。 - public override object GetAnimation() - { - var opacity = base.Counter.CurrentValue * 255 / TimeMs; - return opacity; - } - - private readonly int TimeMs; - } + private readonly int TimeMs; + } } diff --git a/OpenTaiko/src/Animations/FadeOut.cs b/OpenTaiko/src/Animations/FadeOut.cs index d169d9a4..d6a649af 100644 --- a/OpenTaiko/src/Animations/FadeOut.cs +++ b/OpenTaiko/src/Animations/FadeOut.cs @@ -1,34 +1,25 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +namespace TJAPlayer3.Animations { + /// + /// フェードアウトを行うクラス。 + /// + internal class FadeOut : Animator { + /// + /// フェードアウトを初期化します。 + /// + /// フェードアウトに掛ける秒数(ミリ秒) + public FadeOut(int timems) : base(0, timems - 1, 1, false) { + TimeMs = timems; + } -namespace TJAPlayer3.Animations -{ - /// - /// フェードアウトを行うクラス。 - /// - internal class FadeOut : Animator - { - /// - /// フェードアウトを初期化します。 - /// - /// フェードアウトに掛ける秒数(ミリ秒) - public FadeOut(int timems) : base(0, timems - 1, 1, false) - { - TimeMs = timems; - } + /// + /// フェードアウトの不透明度を255段階で返します。 + /// + /// 不透明度。 + public override object GetAnimation() { + var opacity = (TimeMs - base.Counter.CurrentValue) * 255 / TimeMs; + return opacity; + } - /// - /// フェードアウトの不透明度を255段階で返します。 - /// - /// 不透明度。 - public override object GetAnimation() - { - var opacity = (TimeMs - base.Counter.CurrentValue) * 255 / TimeMs; - return opacity; - } - - private readonly int TimeMs; - } + private readonly int TimeMs; + } } diff --git a/OpenTaiko/src/Animations/IAnimatable.cs b/OpenTaiko/src/Animations/IAnimatable.cs index 4e09befa..d5a6b05c 100644 --- a/OpenTaiko/src/Animations/IAnimatable.cs +++ b/OpenTaiko/src/Animations/IAnimatable.cs @@ -1,35 +1,28 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace TJAPlayer3.Animations -{ - /// - /// アニメーション インターフェイス。 - /// - interface IAnimatable - { - /// - /// アニメーションを開始します。 - /// - void Start(); - /// - /// アニメーションを停止します。 - /// - void Stop(); - /// - /// アニメーションをリセットします。 - /// - void Reset(); - /// - /// アニメーションの進行を行います。 - /// - void Tick(); - /// - /// アニメーションのパラメータを返します。 - /// - /// アニメーションのパラメータを返します。 - object GetAnimation(); - } +namespace TJAPlayer3.Animations { + /// + /// アニメーション インターフェイス。 + /// + interface IAnimatable { + /// + /// アニメーションを開始します。 + /// + void Start(); + /// + /// アニメーションを停止します。 + /// + void Stop(); + /// + /// アニメーションをリセットします。 + /// + void Reset(); + /// + /// アニメーションの進行を行います。 + /// + void Tick(); + /// + /// アニメーションのパラメータを返します。 + /// + /// アニメーションのパラメータを返します。 + object GetAnimation(); + } } diff --git a/OpenTaiko/src/Animations/Linear.cs b/OpenTaiko/src/Animations/Linear.cs index d6de0d33..723c12c5 100644 --- a/OpenTaiko/src/Animations/Linear.cs +++ b/OpenTaiko/src/Animations/Linear.cs @@ -1,38 +1,29 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +namespace TJAPlayer3.Animations { + /// + /// リニア移動を行うクラス。 + /// + class Linear : Animator { + /// + /// リニア移動を初期化します。 + /// + /// 始点。 + /// 終点。 + /// 移動にかける時間。 + public Linear(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false) { + StartPoint = startPoint; + EndPoint = endPoint; + Sa = EndPoint - StartPoint; + TimeMs = timeMs; + } -namespace TJAPlayer3.Animations -{ - /// - /// リニア移動を行うクラス。 - /// - class Linear : Animator - { - /// - /// リニア移動を初期化します。 - /// - /// 始点。 - /// 終点。 - /// 移動にかける時間。 - 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 persent = Counter.CurrentValue / (double)TimeMs; + return (Sa * persent) + StartPoint; + } - public override object GetAnimation() - { - var persent = Counter.CurrentValue / (double)TimeMs; - return (Sa * persent) + StartPoint; - } - - private readonly int StartPoint; - private readonly int EndPoint; - private readonly int Sa; - private readonly int TimeMs; - } + 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 e440557a..f2c9b5e5 100644 --- a/OpenTaiko/src/Character/CMenuCharacter.cs +++ b/OpenTaiko/src/Character/CMenuCharacter.cs @@ -1,347 +1,288 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - 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 TJAPlayer3 { + 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, - } + public enum ECharacterAnimation { + // Song select + NORMAL, + START, + SELECT, + WAIT, + // Main menu + ENTRY, + ENTRY_NORMAL, + } - private static bool _usesSubstituteTexture(int player, ECharacterAnimation eca) - { - int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character; + private static bool _usesSubstituteTexture(int player, ECharacterAnimation eca) { + int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character; - if (_charaId >= 0 && _charaId < TJAPlayer3.Skin.Characters_Ptn) - { - switch (eca) - { - case (ECharacterAnimation.NORMAL): - { - if (TJAPlayer3.Tx.Characters_Menu_Loop[_charaId].Length > 0) - return false; - break; - } - case (ECharacterAnimation.START): - { - if (TJAPlayer3.Tx.Characters_Menu_Start[_charaId].Length > 0) - return false; - break; - } - case (ECharacterAnimation.SELECT): - { - if (TJAPlayer3.Tx.Characters_Menu_Select[_charaId].Length > 0) - return false; - break; - } - case (ECharacterAnimation.WAIT): - { - if (TJAPlayer3.Tx.Characters_Menu_Wait[_charaId].Length > 0) - return false; - break; - } - case (ECharacterAnimation.ENTRY): - { - if (TJAPlayer3.Tx.Characters_Title_Entry[_charaId].Length > 0) - return false; - break; - } - case (ECharacterAnimation.ENTRY_NORMAL): - { - if (TJAPlayer3.Tx.Characters_Title_Normal[_charaId].Length > 0) - return false; - break; - } - } - } + if (_charaId >= 0 && _charaId < TJAPlayer3.Skin.Characters_Ptn) { + switch (eca) { + case (ECharacterAnimation.NORMAL): { + if (TJAPlayer3.Tx.Characters_Menu_Loop[_charaId].Length > 0) + return false; + break; + } + case (ECharacterAnimation.START): { + if (TJAPlayer3.Tx.Characters_Menu_Start[_charaId].Length > 0) + return false; + break; + } + case (ECharacterAnimation.SELECT): { + if (TJAPlayer3.Tx.Characters_Menu_Select[_charaId].Length > 0) + return false; + break; + } + case (ECharacterAnimation.WAIT): { + if (TJAPlayer3.Tx.Characters_Menu_Wait[_charaId].Length > 0) + return false; + break; + } + case (ECharacterAnimation.ENTRY): { + if (TJAPlayer3.Tx.Characters_Title_Entry[_charaId].Length > 0) + return false; + break; + } + case (ECharacterAnimation.ENTRY_NORMAL): { + if (TJAPlayer3.Tx.Characters_Title_Normal[_charaId].Length > 0) + return false; + break; + } + } + } - return true; - } + return true; + } - public static CTexture[] _getReferenceArray(int player, ECharacterAnimation eca) - { - int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character; + public static CTexture[] _getReferenceArray(int player, ECharacterAnimation eca) { + int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character; - if (_charaId >= 0 && _charaId < TJAPlayer3.Skin.Characters_Ptn) - { - switch (eca) - { - case (ECharacterAnimation.NORMAL): - { - if (TJAPlayer3.Tx.Characters_Menu_Loop[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_Menu_Loop[_charaId]; - if (TJAPlayer3.Tx.Characters_Normal[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_Normal[_charaId]; - break; - } - case (ECharacterAnimation.START): - { - if (TJAPlayer3.Tx.Characters_Menu_Start[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_Menu_Start[_charaId]; - if (TJAPlayer3.Tx.Characters_10Combo[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_10Combo[_charaId]; - break; - } - case (ECharacterAnimation.SELECT): - { - if (TJAPlayer3.Tx.Characters_Menu_Select[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_Menu_Select[_charaId]; - if (TJAPlayer3.Tx.Characters_10Combo[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_10Combo[_charaId]; - break; - } - case (ECharacterAnimation.WAIT): - { - if (TJAPlayer3.Tx.Characters_Menu_Wait[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_Menu_Wait[_charaId]; - if (TJAPlayer3.Tx.Characters_Menu_Loop[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_Menu_Loop[_charaId]; - if (TJAPlayer3.Tx.Characters_GoGoTime[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_GoGoTime[_charaId]; - break; - } - case (ECharacterAnimation.ENTRY): - { - if (TJAPlayer3.Tx.Characters_Title_Entry[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_Title_Entry[_charaId]; - if (TJAPlayer3.Tx.Characters_10Combo[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_10Combo[_charaId]; - break; - } - case (ECharacterAnimation.ENTRY_NORMAL): - { - if (TJAPlayer3.Tx.Characters_Title_Normal[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_Title_Normal[_charaId]; - if (TJAPlayer3.Tx.Characters_Normal[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_Normal[_charaId]; - break; - } - } - } - - - return null; - } - - 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; - } - - public static int _getReferenceAnimationDuration(int player, ECharacterAnimation eca) - { - int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character; - - switch (eca) - { - case (ECharacterAnimation.NORMAL): - { - return TJAPlayer3.Skin.Characters_Menu_Loop_AnimationDuration[_charaId]; - } - case (ECharacterAnimation.START): - { - return TJAPlayer3.Skin.Characters_Menu_Start_AnimationDuration[_charaId]; - } - case (ECharacterAnimation.SELECT): - { - return TJAPlayer3.Skin.Characters_Menu_Select_AnimationDuration[_charaId]; - } - case (ECharacterAnimation.WAIT): - { - return TJAPlayer3.Skin.Characters_Menu_Wait_AnimationDuration[_charaId]; - } - case (ECharacterAnimation.ENTRY): - { - return TJAPlayer3.Skin.Characters_Title_Entry_AnimationDuration[_charaId]; - } - case (ECharacterAnimation.ENTRY_NORMAL): - { - return TJAPlayer3.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; - } - } - - } + if (_charaId >= 0 && _charaId < TJAPlayer3.Skin.Characters_Ptn) { + switch (eca) { + case (ECharacterAnimation.NORMAL): { + if (TJAPlayer3.Tx.Characters_Menu_Loop[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_Menu_Loop[_charaId]; + if (TJAPlayer3.Tx.Characters_Normal[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_Normal[_charaId]; + break; + } + case (ECharacterAnimation.START): { + if (TJAPlayer3.Tx.Characters_Menu_Start[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_Menu_Start[_charaId]; + if (TJAPlayer3.Tx.Characters_10Combo[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_10Combo[_charaId]; + break; + } + case (ECharacterAnimation.SELECT): { + if (TJAPlayer3.Tx.Characters_Menu_Select[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_Menu_Select[_charaId]; + if (TJAPlayer3.Tx.Characters_10Combo[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_10Combo[_charaId]; + break; + } + case (ECharacterAnimation.WAIT): { + if (TJAPlayer3.Tx.Characters_Menu_Wait[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_Menu_Wait[_charaId]; + if (TJAPlayer3.Tx.Characters_Menu_Loop[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_Menu_Loop[_charaId]; + if (TJAPlayer3.Tx.Characters_GoGoTime[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_GoGoTime[_charaId]; + break; + } + case (ECharacterAnimation.ENTRY): { + if (TJAPlayer3.Tx.Characters_Title_Entry[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_Title_Entry[_charaId]; + if (TJAPlayer3.Tx.Characters_10Combo[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_10Combo[_charaId]; + break; + } + case (ECharacterAnimation.ENTRY_NORMAL): { + if (TJAPlayer3.Tx.Characters_Title_Normal[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_Title_Normal[_charaId]; + if (TJAPlayer3.Tx.Characters_Normal[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_Normal[_charaId]; + break; + } + } + } - public static void tMenuResetTimer(int player, ECharacterAnimation eca) - { - CTexture[] _ref = _getReferenceArray(player, eca); - CCounter[] _ctref = _getReferenceCounter(eca); - int _animeref = _getReferenceAnimationDuration(player, eca); + return null; + } - if (_ref != null && _ref.Length > 0 && _ctref != null) - { - _ctref[player] = new CCounter(0, _ref.Length - 1, _animeref / (float)_ref.Length, TJAPlayer3.Timer); - } - } + 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; + } - public static void tMenuResetTimer(ECharacterAnimation eca) - { - for (int i = 0; i < 5; i++) - { - tMenuResetTimer(i, eca); - } - } + public static int _getReferenceAnimationDuration(int player, ECharacterAnimation eca) { + int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character; - public static void tMenuDisplayCharacter(int player, int x, int y, ECharacterAnimation eca, int opacity = 255) - { - int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character; - CTexture[] _ref = _getReferenceArray(player, eca); - CCounter[] _ctref = _getReferenceCounter(eca); - bool _substitute = _usesSubstituteTexture(player, eca); + switch (eca) { + case (ECharacterAnimation.NORMAL): { + return TJAPlayer3.Skin.Characters_Menu_Loop_AnimationDuration[_charaId]; + } + case (ECharacterAnimation.START): { + return TJAPlayer3.Skin.Characters_Menu_Start_AnimationDuration[_charaId]; + } + case (ECharacterAnimation.SELECT): { + return TJAPlayer3.Skin.Characters_Menu_Select_AnimationDuration[_charaId]; + } + case (ECharacterAnimation.WAIT): { + return TJAPlayer3.Skin.Characters_Menu_Wait_AnimationDuration[_charaId]; + } + case (ECharacterAnimation.ENTRY): { + return TJAPlayer3.Skin.Characters_Title_Entry_AnimationDuration[_charaId]; + } + case (ECharacterAnimation.ENTRY_NORMAL): { + return TJAPlayer3.Skin.Characters_Title_Normal_AnimationDuration[_charaId]; + } + } + return 1000; + } - 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(); + 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; + } + } - // Quick fix - if (_ctref[player].CurrentValue >= _ref.Length) return; + } - var _tex = _ref[_ctref[player].CurrentValue]; - _tex.Opacity = opacity; + public static void tMenuResetTimer(int player, ECharacterAnimation eca) { + CTexture[] _ref = _getReferenceArray(player, eca); + CCounter[] _ctref = _getReferenceCounter(eca); + int _animeref = _getReferenceAnimationDuration(player, eca); - float resolutionRatioX = TJAPlayer3.Skin.Resolution[0] / (float)TJAPlayer3.Skin.Characters_Resolution[_charaId][0]; - float resolutionRatioY = TJAPlayer3.Skin.Resolution[1] / (float)TJAPlayer3.Skin.Characters_Resolution[_charaId][1]; + if (_ref != null && _ref.Length > 0 && _ctref != null) { + _ctref[player] = new CCounter(0, _ref.Length - 1, _animeref / (float)_ref.Length, TJAPlayer3.Timer); + } + } - //float _x = (x + (150.0f * (TJAPlayer3.Skin.Characters_Resolution[_charaId][0] / 1280.0f))) * resolutionRatioX; - //float _y = (y + (((_substitute == true) ? 290 : _ref[_ctref[player].n現在の値].szテクスチャサイズ.Height)) * (TJAPlayer3.Skin.Characters_Resolution[_charaId][1] / 720.0f)) * resolutionRatioY; + public static void tMenuResetTimer(ECharacterAnimation eca) { + for (int i = 0; i < 5; i++) { + tMenuResetTimer(i, eca); + } + } - _tex.vcScaleRatio.X *= resolutionRatioX; - _tex.vcScaleRatio.Y *= resolutionRatioY; + public static void tMenuDisplayCharacter(int player, int x, int y, ECharacterAnimation eca, int opacity = 255) { + int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character; + CTexture[] _ref = _getReferenceArray(player, eca); + CCounter[] _ctref = _getReferenceCounter(eca); + bool _substitute = _usesSubstituteTexture(player, eca); - float _x = x; - float _y = y; + 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(); - if (player % 2 == 0) - { - //_ref[_ctref[player].n現在の値].t2D描画(x, y); - //_ref[_ctref[player].n現在の値].t2D中心基準描画(x + 150, y + 156); + // Quick fix + if (_ctref[player].CurrentValue >= _ref.Length) return; - _tex.t2D拡大率考慮下中心基準描画( - _x, - _y // 312 - ); + var _tex = _ref[_ctref[player].CurrentValue]; + + _tex.Opacity = opacity; + + float resolutionRatioX = TJAPlayer3.Skin.Resolution[0] / (float)TJAPlayer3.Skin.Characters_Resolution[_charaId][0]; + float resolutionRatioY = TJAPlayer3.Skin.Resolution[1] / (float)TJAPlayer3.Skin.Characters_Resolution[_charaId][1]; + + //float _x = (x + (150.0f * (TJAPlayer3.Skin.Characters_Resolution[_charaId][0] / 1280.0f))) * resolutionRatioX; + //float _y = (y + (((_substitute == true) ? 290 : _ref[_ctref[player].n現在の値].szテクスチャサイズ.Height)) * (TJAPlayer3.Skin.Characters_Resolution[_charaId][1] / 720.0f)) * resolutionRatioY; + + _tex.vcScaleRatio.X *= resolutionRatioX; + _tex.vcScaleRatio.Y *= resolutionRatioY; + + float _x = x; + float _y = y; + + if (player % 2 == 0) { + //_ref[_ctref[player].n現在の値].t2D描画(x, y); + //_ref[_ctref[player].n現在の値].t2D中心基準描画(x + 150, y + 156); + + _tex.t2D拡大率考慮下中心基準描画( + _x, + _y // 312 + ); - } - else - { - //_ref[_ctref[player].n現在の値].t2D左右反転描画(x, y); - //_ref[_ctref[player].n現在の値].t2D中心基準描画Mirrored(x + 150, y + 156); + } else { + //_ref[_ctref[player].n現在の値].t2D左右反転描画(x, y); + //_ref[_ctref[player].n現在の値].t2D中心基準描画Mirrored(x + 150, y + 156); - _tex.t2D拡大率考慮下中心基準描画Mirrored( - _x, - _y // 312 - ); - } + _tex.t2D拡大率考慮下中心基準描画Mirrored( + _x, + _y // 312 + ); + } - _tex.vcScaleRatio.X = 1f; - _tex.vcScaleRatio.Y = 1f; + _tex.vcScaleRatio.X = 1f; + _tex.vcScaleRatio.Y = 1f; - _tex.Opacity = 255; + _tex.Opacity = 255; - } + } - } - } + } + } } diff --git a/OpenTaiko/src/Character/CResultCharacter.cs b/OpenTaiko/src/Character/CResultCharacter.cs index c7c14658..9f09c528 100644 --- a/OpenTaiko/src/Character/CResultCharacter.cs +++ b/OpenTaiko/src/Character/CResultCharacter.cs @@ -1,296 +1,245 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - 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 TJAPlayer3 { + 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 enum ECharacterResult - { - // Song select - NORMAL, - CLEAR, - FAILED, - FAILED_IN, - } + public enum ECharacterResult { + // Song select + NORMAL, + CLEAR, + FAILED, + FAILED_IN, + } - public static bool tIsCounterProcessing(int player, ECharacterResult eca) - { - CCounter[] _ctref = _getReferenceCounter(eca); + public static bool tIsCounterProcessing(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].IsTicked; + return false; + } - public static bool tIsCounterEnded(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].IsEnded; - return false; - } + if (_ctref[player] != null) + return _ctref[player].IsEnded; + return false; + } - private static bool _usesSubstituteTexture(int player, ECharacterResult eca) - { - int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character; + private static bool _usesSubstituteTexture(int player, ECharacterResult eca) { + int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character; - if (_charaId >= 0 && _charaId < TJAPlayer3.Skin.Characters_Ptn) - { - switch (eca) - { - case (ECharacterResult.NORMAL): - { - if (TJAPlayer3.Tx.Characters_Result_Normal[_charaId].Length > 0) - return false; - break; - } - case (ECharacterResult.CLEAR): - { - if (TJAPlayer3.Tx.Characters_Result_Clear[_charaId].Length > 0) - return false; - break; - } - case (ECharacterResult.FAILED): - { - if (TJAPlayer3.Tx.Characters_Result_Failed[_charaId].Length > 0) - return false; - break; - } - case (ECharacterResult.FAILED_IN): - { - if (TJAPlayer3.Tx.Characters_Result_Failed_In[_charaId].Length > 0) - return false; - break; - } - } - } + if (_charaId >= 0 && _charaId < TJAPlayer3.Skin.Characters_Ptn) { + switch (eca) { + case (ECharacterResult.NORMAL): { + if (TJAPlayer3.Tx.Characters_Result_Normal[_charaId].Length > 0) + return false; + break; + } + case (ECharacterResult.CLEAR): { + if (TJAPlayer3.Tx.Characters_Result_Clear[_charaId].Length > 0) + return false; + break; + } + case (ECharacterResult.FAILED): { + if (TJAPlayer3.Tx.Characters_Result_Failed[_charaId].Length > 0) + return false; + break; + } + case (ECharacterResult.FAILED_IN): { + if (TJAPlayer3.Tx.Characters_Result_Failed_In[_charaId].Length > 0) + return false; + break; + } + } + } - return true; - } + return true; + } - public static CTexture[] _getReferenceArray(int player, ECharacterResult eca) - { - int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character; + public static CTexture[] _getReferenceArray(int player, ECharacterResult eca) { + int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character; - if (_charaId >= 0 && _charaId < TJAPlayer3.Skin.Characters_Ptn) - { - switch (eca) - { - case (ECharacterResult.NORMAL): - { - if (TJAPlayer3.Tx.Characters_Result_Normal[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_Result_Normal[_charaId]; - if (TJAPlayer3.Tx.Characters_Normal[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_Normal[_charaId]; - break; - } - case (ECharacterResult.CLEAR): - { - if (TJAPlayer3.Tx.Characters_Result_Clear[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_Result_Clear[_charaId]; - if (TJAPlayer3.Tx.Characters_10Combo[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_10Combo[_charaId]; - break; - } - case (ECharacterResult.FAILED): - { - if (TJAPlayer3.Tx.Characters_Result_Failed[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_Result_Failed[_charaId]; - if (TJAPlayer3.Tx.Characters_Normal[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_Normal[_charaId]; - break; - } - case (ECharacterResult.FAILED_IN): - { - if (TJAPlayer3.Tx.Characters_Result_Failed_In[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_Result_Failed_In[_charaId]; - if (TJAPlayer3.Tx.Characters_Normal[_charaId].Length > 0) - return TJAPlayer3.Tx.Characters_Normal[_charaId]; - break; - } - } - } + if (_charaId >= 0 && _charaId < TJAPlayer3.Skin.Characters_Ptn) { + switch (eca) { + case (ECharacterResult.NORMAL): { + if (TJAPlayer3.Tx.Characters_Result_Normal[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_Result_Normal[_charaId]; + if (TJAPlayer3.Tx.Characters_Normal[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_Normal[_charaId]; + break; + } + case (ECharacterResult.CLEAR): { + if (TJAPlayer3.Tx.Characters_Result_Clear[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_Result_Clear[_charaId]; + if (TJAPlayer3.Tx.Characters_10Combo[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_10Combo[_charaId]; + break; + } + case (ECharacterResult.FAILED): { + if (TJAPlayer3.Tx.Characters_Result_Failed[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_Result_Failed[_charaId]; + if (TJAPlayer3.Tx.Characters_Normal[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_Normal[_charaId]; + break; + } + case (ECharacterResult.FAILED_IN): { + if (TJAPlayer3.Tx.Characters_Result_Failed_In[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_Result_Failed_In[_charaId]; + if (TJAPlayer3.Tx.Characters_Normal[_charaId].Length > 0) + return TJAPlayer3.Tx.Characters_Normal[_charaId]; + break; + } + } + } - return null; - } + return null; + } - 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; - } + 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; + } - public static int _getReferenceAnimationDuration(int player, ECharacterResult eca) - { - int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character; + public static int _getReferenceAnimationDuration(int player, ECharacterResult eca) { + int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character; - switch (eca) - { - case (ECharacterResult.NORMAL): - { - return TJAPlayer3.Skin.Characters_Result_Normal_AnimationDuration[_charaId]; - } - case (ECharacterResult.CLEAR): - { - return TJAPlayer3.Skin.Characters_Result_Clear_AnimationDuration[_charaId]; - } - case (ECharacterResult.FAILED): - { - return TJAPlayer3.Skin.Characters_Result_Failed_AnimationDuration[_charaId]; - } - case (ECharacterResult.FAILED_IN): - { - return TJAPlayer3.Skin.Characters_Result_Failed_In_AnimationDuration[_charaId]; - } - } - return 1000; - } + switch (eca) { + case (ECharacterResult.NORMAL): { + return TJAPlayer3.Skin.Characters_Result_Normal_AnimationDuration[_charaId]; + } + case (ECharacterResult.CLEAR): { + return TJAPlayer3.Skin.Characters_Result_Clear_AnimationDuration[_charaId]; + } + case (ECharacterResult.FAILED): { + return TJAPlayer3.Skin.Characters_Result_Failed_AnimationDuration[_charaId]; + } + case (ECharacterResult.FAILED_IN): { + return TJAPlayer3.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 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); + 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, TJAPlayer3.Timer); - } - } + if (_ref != null && _ref.Length > 0 && _ctref != null) { + _ctref[player] = new CCounter(0, _ref.Length - 1, _animeref / (float)_ref.Length, TJAPlayer3.Timer); + } + } - public static void tMenuResetTimer(ECharacterResult eca) - { - for (int i = 0; i < 5; i++) - { - tMenuResetTimer(i, eca); - } - } + 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 = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character; - CTexture[] _ref = _getReferenceArray(player, eca); - CCounter[] _ctref = _getReferenceCounter(eca); - bool _substitute = _usesSubstituteTexture(player, eca); + public static void tMenuDisplayCharacter(int player, int x, int y, ECharacterResult eca, int pos = 0, int opacity = 255) { + int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.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(); + 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; + // Quick fix + if (_ctref[player].CurrentValue >= _ref.Length) return; - var _tex = _ref[_ctref[player].CurrentValue]; + var _tex = _ref[_ctref[player].CurrentValue]; - _tex.Opacity = opacity; + _tex.Opacity = opacity; - float resolutionRatioX = TJAPlayer3.Skin.Resolution[0] / (float)TJAPlayer3.Skin.Characters_Resolution[_charaId][0]; - float resolutionRatioY = TJAPlayer3.Skin.Resolution[1] / (float)TJAPlayer3.Skin.Characters_Resolution[_charaId][1]; + float resolutionRatioX = TJAPlayer3.Skin.Resolution[0] / (float)TJAPlayer3.Skin.Characters_Resolution[_charaId][0]; + float resolutionRatioY = TJAPlayer3.Skin.Resolution[1] / (float)TJAPlayer3.Skin.Characters_Resolution[_charaId][1]; - //202 - //float _x = (x - (((_substitute == true) ? 20 : 40) * (TJAPlayer3.Skin.Characters_Resolution[_charaId][0] / 1280.0f))) * resolutionRatioX; + //202 + //float _x = (x - (((_substitute == true) ? 20 : 40) * (TJAPlayer3.Skin.Characters_Resolution[_charaId][0] / 1280.0f))) * resolutionRatioX; - //532 - //float _y = (y - (((_substitute == true) ? 20 : 40) * (TJAPlayer3.Skin.Characters_Resolution[_charaId][1] / 720.0f))) * resolutionRatioY; + //532 + //float _y = (y - (((_substitute == true) ? 20 : 40) * (TJAPlayer3.Skin.Characters_Resolution[_charaId][1] / 720.0f))) * resolutionRatioY; - float _x = x; - float _y = y; + float _x = x; + float _y = y; - _tex.vcScaleRatio.X *= resolutionRatioX; - _tex.vcScaleRatio.Y *= resolutionRatioY; + _tex.vcScaleRatio.X *= resolutionRatioX; + _tex.vcScaleRatio.Y *= resolutionRatioY; - if (pos % 2 == 0 || TJAPlayer3.ConfigIni.nPlayerCount > 2) - { - _tex.t2D拡大率考慮下中心基準描画( - _x, - _y - ); - } - else - { - _tex.t2D拡大率考慮下中心基準描画Mirrored( - _x, - _y - ); - } + if (pos % 2 == 0 || TJAPlayer3.ConfigIni.nPlayerCount > 2) { + _tex.t2D拡大率考慮下中心基準描画( + _x, + _y + ); + } else { + _tex.t2D拡大率考慮下中心基準描画Mirrored( + _x, + _y + ); + } - _tex.vcScaleRatio.X = 1f; - _tex.vcScaleRatio.Y = 1f; + _tex.vcScaleRatio.X = 1f; + _tex.vcScaleRatio.Y = 1f; - _tex.Opacity = 255; + _tex.Opacity = 255; - } + } - } - } + } + } } diff --git a/OpenTaiko/src/Character/PuchiChara.cs b/OpenTaiko/src/Character/PuchiChara.cs index 80aa8e9b..bdda8bdf 100644 --- a/OpenTaiko/src/Character/PuchiChara.cs +++ b/OpenTaiko/src/Character/PuchiChara.cs @@ -1,133 +1,116 @@ -using TJAPlayer3; -using FDK; -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Text; +using FDK; using Silk.NET.Maths; - using Rectangle = System.Drawing.Rectangle; -namespace TJAPlayer3 -{ - class PuchiChara : CActivity - { - public PuchiChara() - { - base.IsDeActivated = true; - } +namespace TJAPlayer3 { + class PuchiChara : CActivity { + public PuchiChara() { + base.IsDeActivated = true; + } - public override void Activate() - { - Counter = new CCounter(0, TJAPlayer3.Skin.Game_PuchiChara[2] - 1, TJAPlayer3.Skin.Game_PuchiChara_Timer * 0.5f, TJAPlayer3.Timer); - SineCounter = new CCounter(0, 360, TJAPlayer3.Skin.Game_PuchiChara_SineTimer, SoundManager.PlayTimer); - SineCounterIdle = new CCounter(1, 360, (float)TJAPlayer3.Skin.Game_PuchiChara_SineTimer * 2f, TJAPlayer3.Timer); - this.inGame = false; - base.Activate(); - } - public override void DeActivate() - { - Counter = null; - SineCounter = null; - SineCounterIdle = null; - base.DeActivate(); - } + public override void Activate() { + Counter = new CCounter(0, TJAPlayer3.Skin.Game_PuchiChara[2] - 1, TJAPlayer3.Skin.Game_PuchiChara_Timer * 0.5f, TJAPlayer3.Timer); + SineCounter = new CCounter(0, 360, TJAPlayer3.Skin.Game_PuchiChara_SineTimer, SoundManager.PlayTimer); + SineCounterIdle = new CCounter(1, 360, (float)TJAPlayer3.Skin.Game_PuchiChara_SineTimer * 2f, TJAPlayer3.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 = TJAPlayer3.SaveFileInstances[p].data.PuchiChara; - var _pcs = TJAPlayer3.Skin.Puchicharas_Name; - int puriChar = 0; - if (_pcs.Contains(_pc)) - puriChar = _pcs.ToList().IndexOf(_pc); + public static int tGetPuchiCharaIndexByName(int p) { + var _pc = TJAPlayer3.SaveFileInstances[p].data.PuchiChara; + var _pcs = TJAPlayer3.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, TJAPlayer3.Skin.Game_PuchiChara[2] - 1, (int)(TJAPlayer3.Skin.Game_PuchiChara_Timer * bpm / TJAPlayer3.Skin.Game_PuchiChara[2]), TJAPlayer3.Timer); - SineCounter = new CCounter(1, 360, TJAPlayer3.Skin.Game_PuchiChara_SineTimer * bpm / 180, SoundManager.PlayTimer); - this.inGame = true; - } + return puriChar; + } - public void IdleAnimation() - { - this.inGame = false; - } + public void ChangeBPM(double bpm) { + Counter = new CCounter(0, TJAPlayer3.Skin.Game_PuchiChara[2] - 1, (int)(TJAPlayer3.Skin.Game_PuchiChara_Timer * bpm / TJAPlayer3.Skin.Game_PuchiChara[2]), TJAPlayer3.Timer); + SineCounter = new CCounter(1, 360, TJAPlayer3.Skin.Game_PuchiChara_SineTimer * bpm / 180, SoundManager.PlayTimer); + this.inGame = true; + } - /// - /// ぷちキャラを描画する。(オーバーライドじゃないよ) - /// - /// X座標(中央) - /// Y座標(中央) - /// 不透明度 - /// - public int On進行描画(int x, int y, bool isGrowing, int alpha = 255, bool isBalloon = false, int player = 0, float scale = 1.0f) - { - if (!TJAPlayer3.ConfigIni.ShowPuchiChara) return base.Draw(); - if (Counter == null || SineCounter == null || TJAPlayer3.Tx.Puchichara == null) return base.Draw(); - Counter.TickLoop(); - SineCounter.TickLoopDB(); - SineCounterIdle.TickLoop(); + public void IdleAnimation() { + this.inGame = false; + } - int p = TJAPlayer3.GetActualPlayer(player); + /// + /// ぷちキャラを描画する。(オーバーライドじゃないよ) + /// + /// X座標(中央) + /// Y座標(中央) + /// 不透明度 + /// + public int On進行描画(int x, int y, bool isGrowing, int alpha = 255, bool isBalloon = false, int player = 0, float scale = 1.0f) { + if (!TJAPlayer3.ConfigIni.ShowPuchiChara) return base.Draw(); + if (Counter == null || SineCounter == null || TJAPlayer3.Tx.Puchichara == null) return base.Draw(); + Counter.TickLoop(); + SineCounter.TickLoopDB(); + SineCounterIdle.TickLoop(); - /* + int p = TJAPlayer3.GetActualPlayer(player); + + /* TJAPlayer3.act文字コンソール.tPrint(700, 500, C文字コンソール.Eフォント種別.白, Counter.n現在の値.ToString()); TJAPlayer3.act文字コンソール.tPrint(700, 520, C文字コンソール.Eフォント種別.白, SineCounter.n現在の値.ToString()); TJAPlayer3.act文字コンソール.tPrint(700, 540, C文字コンソール.Eフォント種別.白, SineCounterIdle.n現在の値.ToString()); */ - if (inGame) - sineY = (double)SineCounter.CurrentValue; - else - sineY = (double)SineCounterIdle.CurrentValue; + if (inGame) + sineY = (double)SineCounter.CurrentValue; + else + sineY = (double)SineCounterIdle.CurrentValue; - // TJAPlayer3.act文字コンソール.tPrint(700, 560, C文字コンソール.Eフォント種別.白, sineY.ToString()); + // TJAPlayer3.act文字コンソール.tPrint(700, 560, C文字コンソール.Eフォント種別.白, sineY.ToString()); - sineY = Math.Sin(sineY * (Math.PI / 180)) * (TJAPlayer3.Skin.Game_PuchiChara_Sine * (isBalloon ? TJAPlayer3.Skin.Game_PuchiChara_Scale[1] : TJAPlayer3.Skin.Game_PuchiChara_Scale[0])); + sineY = Math.Sin(sineY * (Math.PI / 180)) * (TJAPlayer3.Skin.Game_PuchiChara_Sine * (isBalloon ? TJAPlayer3.Skin.Game_PuchiChara_Scale[1] : TJAPlayer3.Skin.Game_PuchiChara_Scale[0])); - // TJAPlayer3.act文字コンソール.tPrint(700, 580, C文字コンソール.Eフォント種別.白, sineY.ToString()); + // TJAPlayer3.act文字コンソール.tPrint(700, 580, C文字コンソール.Eフォント種別.白, sineY.ToString()); - //int puriChar = Math.Max(0, Math.Min(TJAPlayer3.Skin.Puchichara_Ptn - 1, TJAPlayer3.NamePlateConfig.data.PuchiChara[p])); + //int puriChar = Math.Max(0, Math.Min(TJAPlayer3.Skin.Puchichara_Ptn - 1, TJAPlayer3.NamePlateConfig.data.PuchiChara[p])); - int puriChar = PuchiChara.tGetPuchiCharaIndexByName(p); + int puriChar = PuchiChara.tGetPuchiCharaIndexByName(p); - var chara = TJAPlayer3.Tx.Puchichara[puriChar].tx; - //TJAPlayer3.Tx.PuchiChara[puriChar]; + var chara = TJAPlayer3.Tx.Puchichara[puriChar].tx; + //TJAPlayer3.Tx.PuchiChara[puriChar]; - if (chara != null) - { - float puchiScale = TJAPlayer3.Skin.Resolution[1] / 720.0f; + if (chara != null) { + float puchiScale = TJAPlayer3.Skin.Resolution[1] / 720.0f; - chara.vcScaleRatio = new Vector3D((isBalloon ? TJAPlayer3.Skin.Game_PuchiChara_Scale[1] * puchiScale : TJAPlayer3.Skin.Game_PuchiChara_Scale[0] * puchiScale)); - chara.vcScaleRatio.X *= scale; - chara.vcScaleRatio.Y *= scale; - chara.Opacity = alpha; + chara.vcScaleRatio = new Vector3D((isBalloon ? TJAPlayer3.Skin.Game_PuchiChara_Scale[1] * puchiScale : TJAPlayer3.Skin.Game_PuchiChara_Scale[0] * puchiScale)); + chara.vcScaleRatio.X *= scale; + chara.vcScaleRatio.Y *= scale; + chara.Opacity = alpha; - // (isGrowing ? TJAPlayer3.Skin.Game_PuchiChara[1] : 0) => Height + // (isGrowing ? TJAPlayer3.Skin.Game_PuchiChara[1] : 0) => Height - /* To do : + /* To do : ** ** - Yellow light color filter when isGrowing is true */ - int adjustedX = x - 32; - int adjustedY = y - 32; + int adjustedX = x - 32; + int adjustedY = y - 32; - chara.t2D拡大率考慮中央基準描画(adjustedX, adjustedY + (int)sineY, new Rectangle((Counter.CurrentValue + 2) * TJAPlayer3.Skin.Game_PuchiChara[0], 0, TJAPlayer3.Skin.Game_PuchiChara[0], TJAPlayer3.Skin.Game_PuchiChara[1])); - } + chara.t2D拡大率考慮中央基準描画(adjustedX, adjustedY + (int)sineY, new Rectangle((Counter.CurrentValue + 2) * TJAPlayer3.Skin.Game_PuchiChara[0], 0, TJAPlayer3.Skin.Game_PuchiChara[0], TJAPlayer3.Skin.Game_PuchiChara[1])); + } - return base.Draw(); - } + return base.Draw(); + } - public double sineY; + public double sineY; - public CCounter Counter; - private CCounter SineCounter; - private CCounter SineCounterIdle; - private bool inGame; - } -} \ No newline at end of file + 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 3496df11..88652caa 100644 --- a/OpenTaiko/src/Common/BestPlayRecords.cs +++ b/OpenTaiko/src/Common/BestPlayRecords.cs @@ -1,225 +1,198 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; +namespace TJAPlayer3 { + internal class BestPlayRecords { -namespace TJAPlayer3 -{ - internal class BestPlayRecords - { + public enum EClearStatus { + NONE = 0, + ASSISTED_CLEAR = 1, + CLEAR = 2, + FC = 3, + PERFECT = 4, + TOTAL = 5 + } - public enum EClearStatus - { - NONE = 0, - ASSISTED_CLEAR = 1, - CLEAR = 2, - FC = 3, - PERFECT = 4, - TOTAL = 5 - } + 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 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 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 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 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 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 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 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 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 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 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 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 }; + // 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 }; + } + } - // 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 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(); - 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)); - // 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]++; - 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]++; - } - 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)); - // 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)); + 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++; - } - } + 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; - } - } + return stats; + } + } } diff --git a/OpenTaiko/src/Common/CConfigIni.cs b/OpenTaiko/src/Common/CConfigIni.cs index 8967a672..89fb3d1a 100644 --- a/OpenTaiko/src/Common/CConfigIni.cs +++ b/OpenTaiko/src/Common/CConfigIni.cs @@ -1,19 +1,12 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Text; -using System.Runtime.InteropServices; -using System.IO; +using System.ComponentModel; using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Text; using FDK; using FDK.ExtensionMethods; -using System.Linq; -using SampleFramework; -namespace TJAPlayer3 -{ - internal class CConfigIni : INotifyPropertyChanged - { +namespace TJAPlayer3 { + internal class CConfigIni : INotifyPropertyChanged { private const int MinimumKeyboardSoundLevelIncrement = 1; private const int MaximumKeyboardSoundLevelIncrement = 20; private const int DefaultKeyboardSoundLevelIncrement = 5; @@ -21,665 +14,486 @@ namespace TJAPlayer3 // クラス #region [ CKeyAssign ] - public class CKeyAssign - { - public class CKeyAssignPad - { - public CConfigIni.CKeyAssign.STKEYASSIGN[] HH - { - get - { + public class CKeyAssign { + public class CKeyAssignPad { + public CConfigIni.CKeyAssign.STKEYASSIGN[] HH { + get { return this.padHH_R; } - set - { + set { this.padHH_R = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] R - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] R { + get { return this.padHH_R; } - set - { + set { this.padHH_R = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] SD - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] SD { + get { return this.padSD_G; } - set - { + set { this.padSD_G = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] G - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] G { + get { return this.padSD_G; } - set - { + set { this.padSD_G = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] BD - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] BD { + get { return this.padBD_B; } - set - { + set { this.padBD_B = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] B - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] B { + get { return this.padBD_B; } - set - { + set { this.padBD_B = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] HT - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] HT { + get { return this.padHT_Pick; } - set - { + set { this.padHT_Pick = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] Pick - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] Pick { + get { return this.padHT_Pick; } - set - { + set { this.padHT_Pick = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] LT - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] LT { + get { return this.padLT_Wail; } - set - { + set { this.padLT_Wail = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] Wail - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] Wail { + get { return this.padLT_Wail; } - set - { + set { this.padLT_Wail = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] FT - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] FT { + get { return this.padFT_Cancel; } - set - { + set { this.padFT_Cancel = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] Cancel - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] Cancel { + get { return this.padFT_Cancel; } - set - { + set { this.padFT_Cancel = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] CY - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] CY { + get { return this.padCY_Decide; } - set - { + set { this.padCY_Decide = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] Decide - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] Decide { + get { return this.padCY_Decide; } - set - { + set { this.padCY_Decide = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] HHO - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] HHO { + get { return this.padHHO; } - set - { + set { this.padHHO = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] RD - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] RD { + get { return this.padRD; } - set - { + set { this.padRD = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] LC - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] LC { + get { return this.padLC; } - set - { + set { this.padLC = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] LP - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] LP { + get { return this.padLP; } - set - { + set { this.padLP = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] LBD - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] LBD { + get { return this.padLBD; } - set - { + set { this.padLBD = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed { + get { return this.padLRed; } - set - { + set { this.padLRed = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed { + get { return this.padRRed; } - set - { + set { this.padRRed = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue { + get { return this.padLBlue; } - set - { + set { this.padLBlue = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue { + get { return this.padRBlue; } - set - { + set { this.padRBlue = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed2P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed2P { + get { return this.padLRed2P; } - set - { + set { this.padLRed2P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed2P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed2P { + get { return this.padRRed2P; } - set - { + set { this.padRRed2P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue2P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue2P { + get { return this.padLBlue2P; } - set - { + set { this.padLBlue2P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue2P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue2P { + get { return this.padRBlue2P; } - set - { + set { this.padRBlue2P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed3P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed3P { + get { return this.padLRed3P; } - set - { + set { this.padLRed3P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed3P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed3P { + get { return this.padRRed3P; } - set - { + set { this.padRRed3P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue3P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue3P { + get { return this.padLBlue3P; } - set - { + set { this.padLBlue3P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue3P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue3P { + get { return this.padRBlue3P; } - set - { + set { this.padRBlue3P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed4P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed4P { + get { return this.padLRed4P; } - set - { + set { this.padLRed4P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed4P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed4P { + get { return this.padRRed4P; } - set - { + set { this.padRRed4P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue4P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue4P { + get { return this.padLBlue4P; } - set - { + set { this.padLBlue4P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue4P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue4P { + get { return this.padRBlue4P; } - set - { + set { this.padRBlue4P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed5P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed5P { + get { return this.padLRed5P; } - set - { + set { this.padLRed5P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed5P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed5P { + get { return this.padRRed5P; } - set - { + set { this.padRRed5P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue5P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue5P { + get { return this.padLBlue5P; } - set - { + set { this.padLBlue5P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue5P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue5P { + get { return this.padRBlue5P; } - set - { + set { this.padRBlue5P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap { + get { return this.padClap; } - set - { + set { this.padClap = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap2P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap2P { + get { return this.padClap2P; } - set - { + set { this.padClap2P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap3P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap3P { + get { return this.padClap3P; } - set - { + set { this.padClap3P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap4P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap4P { + get { return this.padClap4P; } - set - { + set { this.padClap4P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap5P - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap5P { + get { return this.padClap5P; } - set - { + set { this.padClap5P = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftChange - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftChange { + get { return this.padLeftChange; } - set - { + set { this.padLeftChange = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightChange - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightChange { + get { return this.padRightChange; } - set - { + set { this.padRightChange = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] Capture - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] Capture { + get { return this.padCapture; } - set - { + set { this.padCapture = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] SongVolIncrease - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] SongVolIncrease { + get { return this.padSongVolIncrease; } - set - { + set { this.padSongVolIncrease = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] SongVolDecrease - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] SongVolDecrease { + get { return this.padSongVolDecrease; } - set - { + set { this.padSongVolDecrease = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] DisplayHits - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] DisplayHits { + get { return this.padDisplayHits; } - set - { + set { this.padDisplayHits = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] DisplayDebug - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] DisplayDebug { + get { return this.padDisplayDebug; } - set - { + set { this.padDisplayDebug = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] QuickConfig - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] QuickConfig { + get { return this.padQuickConfig; } - set - { + set { this.padQuickConfig = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] NewHeya - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] NewHeya { + get { return this.padNewHeya; } - set - { + set { this.padNewHeya = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] SortSongs - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] SortSongs { + get { return this.padSortSongs; } - set - { + set { this.padSortSongs = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] ToggleAutoP1 - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] ToggleAutoP1 { + get { return this.padToggleAutoP1; } - set - { + set { this.padToggleAutoP1 = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] ToggleAutoP2 - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] ToggleAutoP2 { + get { return this.padToggleAutoP2; } - set - { + set { this.padToggleAutoP2 = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] ToggleTrainingMode - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] ToggleTrainingMode { + get { return this.padToggleTrainingMode; } - set - { + set { this.padToggleTrainingMode = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] CycleVideoDisplayMode - { - get - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] CycleVideoDisplayMode { + get { return this.padCycleVideoDisplayMode; } - set - { + set { this.padCycleVideoDisplayMode = value; } } - public CConfigIni.CKeyAssign.STKEYASSIGN[] this[int index] - { - get - { - switch (index) - { + public CConfigIni.CKeyAssign.STKEYASSIGN[] this[int index] { + get { + switch (index) { case (int)EKeyConfigPad.HH: return this.padHH_R; @@ -881,13 +695,11 @@ namespace TJAPlayer3 case (int)EKeyConfigPad.TrainingJumpToLastMeasure: return this.TrainingJumpToLastMeasure; - } + } throw new IndexOutOfRangeException(); } - set - { - switch (index) - { + set { + switch (index) { case (int)EKeyConfigPad.HH: this.padHH_R = value; return; @@ -1092,70 +904,70 @@ namespace TJAPlayer3 this.padCycleVideoDisplayMode = value; return; - case (int)EKeyConfigPad.TrainingIncreaseScrollSpeed: - this.TrainingIncreaseScrollSpeed = value; + case (int)EKeyConfigPad.TrainingIncreaseScrollSpeed: + this.TrainingIncreaseScrollSpeed = value; return; - case (int)EKeyConfigPad.TrainingDecreaseScrollSpeed: - this.TrainingDecreaseScrollSpeed = value; + case (int)EKeyConfigPad.TrainingDecreaseScrollSpeed: + this.TrainingDecreaseScrollSpeed = value; return; - case (int)EKeyConfigPad.TrainingIncreaseSongSpeed: - this.TrainingIncreaseSongSpeed = value; + case (int)EKeyConfigPad.TrainingIncreaseSongSpeed: + this.TrainingIncreaseSongSpeed = value; return; - case (int)EKeyConfigPad.TrainingDecreaseSongSpeed: - this.TrainingDecreaseSongSpeed = value; + case (int)EKeyConfigPad.TrainingDecreaseSongSpeed: + this.TrainingDecreaseSongSpeed = value; return; - case (int)EKeyConfigPad.TrainingToggleAuto: - this.TrainingToggleAuto = value; + case (int)EKeyConfigPad.TrainingToggleAuto: + this.TrainingToggleAuto = value; return; - case (int)EKeyConfigPad.TrainingBranchNormal: - this.TrainingBranchNormal = value; + case (int)EKeyConfigPad.TrainingBranchNormal: + this.TrainingBranchNormal = value; return; - case (int)EKeyConfigPad.TrainingBranchExpert: - this.TrainingBranchExpert = value; + case (int)EKeyConfigPad.TrainingBranchExpert: + this.TrainingBranchExpert = value; return; - case (int)EKeyConfigPad.TrainingBranchMaster: - this.TrainingBranchMaster = value; + case (int)EKeyConfigPad.TrainingBranchMaster: + this.TrainingBranchMaster = value; return; - case (int)EKeyConfigPad.TrainingPause: - this.TrainingPause = value; + case (int)EKeyConfigPad.TrainingPause: + this.TrainingPause = value; return; - case (int)EKeyConfigPad.TrainingBookmark: - this.TrainingBookmark = value; + case (int)EKeyConfigPad.TrainingBookmark: + this.TrainingBookmark = value; return; - case (int)EKeyConfigPad.TrainingMoveForwardMeasure: - this.TrainingMoveForwardMeasure = value; + case (int)EKeyConfigPad.TrainingMoveForwardMeasure: + this.TrainingMoveForwardMeasure = value; return; - case (int)EKeyConfigPad.TrainingMoveBackMeasure: - this.TrainingMoveBackMeasure = value; + case (int)EKeyConfigPad.TrainingMoveBackMeasure: + this.TrainingMoveBackMeasure = value; return; - case (int)EKeyConfigPad.TrainingSkipForwardMeasure: - this.TrainingSkipForwardMeasure = value; + case (int)EKeyConfigPad.TrainingSkipForwardMeasure: + this.TrainingSkipForwardMeasure = value; return; - case (int)EKeyConfigPad.TrainingSkipBackMeasure: - this.TrainingSkipBackMeasure = value; + case (int)EKeyConfigPad.TrainingSkipBackMeasure: + this.TrainingSkipBackMeasure = value; return; - case (int)EKeyConfigPad.TrainingJumpToFirstMeasure: - this.TrainingJumpToFirstMeasure = value; + case (int)EKeyConfigPad.TrainingJumpToFirstMeasure: + this.TrainingJumpToFirstMeasure = value; return; - case (int)EKeyConfigPad.TrainingJumpToLastMeasure: - this.TrainingJumpToLastMeasure = value; + case (int)EKeyConfigPad.TrainingJumpToLastMeasure: + this.TrainingJumpToLastMeasure = value; return; - } + } throw new IndexOutOfRangeException(); } } @@ -1237,23 +1049,20 @@ namespace TJAPlayer3 public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingDecreaseSongSpeed; public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingJumpToFirstMeasure; public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingJumpToLastMeasure; - //----------------- - #endregion - } + //----------------- + #endregion + } - public bool KeyIsPressed(STKEYASSIGN[] pad) - { + public bool KeyIsPressed(STKEYASSIGN[] pad) { return TJAPlayer3.InputManager.Keyboard.KeyPressed(pad.ToList().ConvertAll(key => key.コード)); } [StructLayout(LayoutKind.Sequential)] - public struct STKEYASSIGN - { + public struct STKEYASSIGN { public EInputDevice 入力デバイス; public int ID; public int コード; - public STKEYASSIGN(EInputDevice DeviceType, int nID, int nCode) - { + public STKEYASSIGN(EInputDevice DeviceType, int nID, int nCode) { this.入力デバイス = DeviceType; this.ID = nID; this.コード = nCode; @@ -1265,12 +1074,9 @@ namespace TJAPlayer3 public CKeyAssignPad Guitar = new CKeyAssignPad(); public CKeyAssignPad Taiko = new CKeyAssignPad(); public CKeyAssignPad System = new CKeyAssignPad(); - public CKeyAssignPad this[int index] - { - get - { - switch (index) - { + public CKeyAssignPad this[int index] { + get { + switch (index) { case (int)EKeyConfigPart.DRUMS: return this.Drums; @@ -1288,10 +1094,8 @@ namespace TJAPlayer3 } throw new IndexOutOfRangeException(); } - set - { - switch (index) - { + set { + switch (index) { case (int)EKeyConfigPart.DRUMS: this.Drums = value; return; @@ -1319,8 +1123,7 @@ namespace TJAPlayer3 #endregion // - public enum ESoundDeviceTypeForConfig - { + public enum ESoundDeviceTypeForConfig { Bass, ASIO, WASAPI_Exclusive, @@ -1329,16 +1132,14 @@ namespace TJAPlayer3 } // プロパティ - public class CAIPerformances - { + public class CAIPerformances { public int nGoodOdds; public int nPerfectOdds; public int nBadOdds; public int nRollSpeed; public int nMineHitOdds; - public CAIPerformances(int po, int go, int bo, int rp, int mho = 0) - { + public CAIPerformances(int po, int go, int bo, int rp, int mho = 0) { nGoodOdds = go; nPerfectOdds = po; nBadOdds = bo; @@ -1347,14 +1148,12 @@ namespace TJAPlayer3 } } - public class CTimingZones - { + public class CTimingZones { public int nGoodZone; public int nOkZone; public int nBadZone; - public CTimingZones(int gz, int oz, int bz) - { + public CTimingZones(int gz, int oz, int bz) { nGoodZone = gz; nOkZone = oz; nBadZone = bz; @@ -1392,8 +1191,7 @@ namespace TJAPlayer3 public int nフレーム毎スリープms; // #xxxxx 2011.11.27 yyagi add public int nSongSpeed; - public double SongPlaybackSpeed - { + public double SongPlaybackSpeed { get => ((double)nSongSpeed) / 20.0; } @@ -1403,64 +1201,56 @@ namespace TJAPlayer3 private bool _applyLoudnessMetadata; - public bool ApplyLoudnessMetadata - { + public bool ApplyLoudnessMetadata { get => _applyLoudnessMetadata; set => SetProperty(ref _applyLoudnessMetadata, value, nameof(ApplyLoudnessMetadata)); } private double _targetLoudness; - public double TargetLoudness - { + public double TargetLoudness { get => _targetLoudness; set => SetProperty(ref _targetLoudness, value, nameof(TargetLoudness)); } private bool _applySongVol; - public bool ApplySongVol - { + public bool ApplySongVol { get => _applySongVol; set => SetProperty(ref _applySongVol, value, nameof(ApplySongVol)); } private int _soundEffectLevel; - public int SoundEffectLevel - { + public int SoundEffectLevel { get => _soundEffectLevel; set => SetProperty(ref _soundEffectLevel, value, nameof(SoundEffectLevel)); } private int _voiceLevel; - public int VoiceLevel - { + public int VoiceLevel { get => _voiceLevel; set => SetProperty(ref _voiceLevel, value, nameof(VoiceLevel)); } private int _songPreviewLevel; - public int SongPreviewLevel - { + public int SongPreviewLevel { get => _songPreviewLevel; set => SetProperty(ref _songPreviewLevel, value, nameof(SongPreviewLevel)); } private int _songPlaybackLevel; - public int SongPlaybackLevel - { + public int SongPlaybackLevel { get => _songPlaybackLevel; set => SetProperty(ref _songPlaybackLevel, value, nameof(SongPlaybackLevel)); } private int _keyboardSoundLevelIncrement; - public int KeyboardSoundLevelIncrement - { + public int KeyboardSoundLevelIncrement { get => _keyboardSoundLevelIncrement; set => SetProperty( ref _keyboardSoundLevelIncrement, @@ -1482,21 +1272,15 @@ namespace TJAPlayer3 private int _nPlayerCount; public int nPreviousPlayerCount = 1; // Specific usages - public int nPlayerCount - { - get - { - if (bAIBattleMode) - { + public int nPlayerCount { + get { + if (bAIBattleMode) { return 2; - } - else - { + } else { return _nPlayerCount; } } - set - { + set { _nPlayerCount = value; } } @@ -1576,43 +1360,36 @@ namespace TJAPlayer3 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 }, - }; + 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 判定文字表示位置; -// public int nハイハット切り捨て下限Velocity; -// public int n切り捨て下限Velocity; // #23857 2010.12.12 yyagi VelocityMin + // public int nハイハット切り捨て下限Velocity; + // public int n切り捨て下限Velocity; // #23857 2010.12.12 yyagi VelocityMin 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 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 bool bIsEnabledSystemMenu; // #28200 2012.5.1 yyagi System Menuの使用可否切替 + public string strSystemSkinSubfolderFullName; // #28195 2012.5.2 yyagi Skin切替用 System/以下のサブフォルダ名 - public void tInitializeAILevel() - { + public void tInitializeAILevel() { this.nAILevel = this.nDefaultAILevel; } - public bool bEnterがキー割り当てのどこにも使用されていない - { - 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 ].入力デバイス == EInputDevice.Keyboard ) && ( this.KeyAssign[ i ][ j ][ k ].コード == (int)SlimDXKeys.Key.Return ) ) - { + public bool bEnterがキー割り当てのどこにも使用されていない { + 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].入力デバイス == EInputDevice.Keyboard) && (this.KeyAssign[i][j][k].コード == (int)SlimDXKeys.Key.Return)) { return false; } } @@ -1621,62 +1398,48 @@ namespace TJAPlayer3 return true; } } - public bool bウィンドウモード - { - get - { + public bool bウィンドウモード { + get { return !this.bFullScreen; } - set - { + set { this.bFullScreen = !value; } } - public bool b演奏情報を表示しない - { - get - { + public bool b演奏情報を表示しない { + get { return !this.bDisplayDebugInfo; } - set - { + set { this.bDisplayDebugInfo = !value; } } - public int n背景の透過度 - { - get - { + public int n背景の透過度 { + get { return this.nBGAlpha; } - set - { - if( value < 0 ) - { + set { + if (value < 0) { this.nBGAlpha = 0; - } - else if( value > 0xff ) - { + } else if (value > 0xff) { this.nBGAlpha = 0xff; - } - else - { + } 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 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; @@ -1686,12 +1449,12 @@ namespace TJAPlayer3 public bool bViewerDrums有効, bViewerGuitar有効; //public bool bNoMP3Streaming; // 2014.4.14 yyagi; mp3のシーク位置がおかしくなる場合は、これをtrueにすることで、wavにデコードしてからオンメモリ再生する public int nMasterVolume; - public bool ShinuchiMode; // 真打モード - public bool FastRender; // 事前画像描画モード - public bool ASyncTextureLoad; // 事前画像描画モード - public bool PreAssetsLoading; // 事前画像描画モード - public bool SimpleMode; // 事前画像描画モード - public int MusicPreTimeMs; // 音源再生前の待機時間ms + 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; } @@ -1704,19 +1467,15 @@ namespace TJAPlayer3 #region [ STRANGE ] public STRANGE nヒット範囲ms; - [StructLayout( LayoutKind.Sequential )] - public struct STRANGE - { + [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 ) - { + public int this[int index] { + get { + switch (index) { case 0: return this.Perfect; @@ -1731,10 +1490,8 @@ namespace TJAPlayer3 } throw new IndexOutOfRangeException(); } - set - { - switch( index ) - { + set { + switch (index) { case 0: this.Perfect = value; return; @@ -1758,9 +1515,8 @@ namespace TJAPlayer3 #endregion #region [ STLANEVALUE ] public STLANEVALUE nVelocityMin; - [StructLayout( LayoutKind.Sequential )] - public struct STLANEVALUE - { + [StructLayout(LayoutKind.Sequential)] + public struct STLANEVALUE { public int LC; public int HH; public int SD; @@ -1770,16 +1526,13 @@ namespace TJAPlayer3 public int FT; public int CY; public int RD; - public int LP; - public int LBD; + public int LP; + public int LBD; public int Guitar; public int Bass; - public int this[ int index ] - { - get - { - switch( index ) - { + public int this[int index] { + get { + switch (index) { case 0: return this.LC; @@ -1821,10 +1574,8 @@ namespace TJAPlayer3 } throw new IndexOutOfRangeException(); } - set - { - switch( index ) - { + set { + switch (index) { case 0: this.LC = value; return; @@ -1884,41 +1635,40 @@ namespace TJAPlayer3 #endregion - #region[Ver.K追加オプション] - //-------------------------- - //ゲーム内のオプションに加えて、 - //システム周りのオプションもこのブロックで記述している。 - #region[Display] - //-------------------------- - public EClipDispType eClipDispType; - #endregion + #region[Ver.K追加オプション] + //-------------------------- + //ゲーム内のオプションに加えて、 + //システム周りのオプションもこのブロックで記述している。 + #region[Display] + //-------------------------- + public EClipDispType eClipDispType; + #endregion - #region[Position] - public Eレーンタイプ eLaneType; - public Eミラー eMirror; + #region[Position] + public Eレーンタイプ eLaneType; + public Eミラー eMirror; - #endregion - #region[System] - public bool bDirectShowMode; - #endregion + #endregion + #region[System] + public bool bDirectShowMode; + #endregion - //-------------------------- - #endregion + //-------------------------- + #endregion - // コンストラクタ + // コンストラクタ - public CConfigIni() - { + public CConfigIni() { this.strSongsPath = "Songs" + Path.DirectorySeparatorChar; this.bFullScreen = 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.nフレーム毎スリープms = -1; // #xxxxx 2011.11.27 yyagi add - this.n非フォーカス時スリープms = 1; // #23568 2010.11.04 ikanick add + this.nWindowBaseYPosition = 100; + this.nWindowWidth = SampleFramework.GameWindowSize.Width; // #23510 2010.10.31 yyagi add + this.nWindowHeight = SampleFramework.GameWindowSize.Height; // + this.nフレーム毎スリープms = -1; // #xxxxx 2011.11.27 yyagi add + this.n非フォーカス時スリープms = 1; // #23568 2010.11.04 ikanick add this._bGuitar有効 = true; this._bDrums有効 = true; this.nBGAlpha = 100; @@ -1942,8 +1692,8 @@ namespace TJAPlayer3 this.bAIBattleMode = false; this.FontName = CFontRenderer.DefaultFontName; - this.BoxFontName = CFontRenderer.DefaultFontName; - this.ApplyLoudnessMetadata = true; + this.BoxFontName = CFontRenderer.DefaultFontName; + this.ApplyLoudnessMetadata = true; this.bEnableCountdownTimer = true; this.sLang = "ja"; this.nLayoutType = 1; @@ -1965,12 +1715,12 @@ namespace TJAPlayer3 // 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.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]; @@ -1981,30 +1731,27 @@ namespace TJAPlayer3 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.判定文字表示位置[ i ] = E判定文字表示位置.レーン上; - this.eInvisible[ i ] = EInvisible.OFF; + for (int i = 0; i < 3; i++) { + this.bReverse[i] = false; + this.判定文字表示位置[i] = E判定文字表示位置.レーン上; + this.eInvisible[i] = EInvisible.OFF; } - for (int i = 0; i < 5; i++) - { + for (int i = 0; i < 5; i++) { this.eRandom[i] = ERandomMode.OFF; this.nScrollSpeed[i] = 9; this.nTimingZones[i] = 2; - } + } this.nSongSpeed = 20; this.b演奏速度が一倍速であるとき以外音声を再生しない = false; #region [ AutoPlay ] - for (int i = 0; i < 5; i++) - { + for (int i = 0; i < 5; i++) { this.bAutoPlay[i] = false; } - this.bAuto先生の連打 = true; + this.bAuto先生の連打 = true; #endregion this.nヒット範囲ms = new STRANGE(); this.nヒット範囲ms.Perfect = 25; @@ -2012,11 +1759,11 @@ namespace TJAPlayer3 this.nヒット範囲ms.Good = 75; this.nヒット範囲ms.Poor = 108; this.ConfigIniファイル名 = ""; - this.dicJoystick = new Dictionary( 10 ); - this.dicGamepad = new Dictionary( 10 ); + this.dicJoystick = new Dictionary(10); + this.dicGamepad = new Dictionary(10); this.tデフォルトのキーアサインに設定する(); #region [ velocityMin ] - this.nVelocityMin.LC = 0; // #23857 2011.1.31 yyagi VelocityMin + this.nVelocityMin.LC = 0; // #23857 2011.1.31 yyagi VelocityMin this.nVelocityMin.HH = 20; this.nVelocityMin.SD = 0; this.nVelocityMin.BD = 0; @@ -2025,195 +1772,187 @@ namespace TJAPlayer3 this.nVelocityMin.FT = 0; this.nVelocityMin.CY = 0; this.nVelocityMin.RD = 0; - this.nVelocityMin.LP = 0; - this.nVelocityMin.LBD = 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.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 レーン毎の最大同時発音数 + 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.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 ] - this.nSoundDeviceType = OperatingSystem.IsWindows() ? (int)ESoundDeviceTypeForConfig.WASAPI_Shared : (int)ESoundDeviceTypeForConfig.Bass; // #24820 2012.12.23 yyagi 初期値はACM | #31927 2013.8.25 yyagi OSにより初期値変更 + this.nSoundDeviceType = OperatingSystem.IsWindows() ? (int)ESoundDeviceTypeForConfig.WASAPI_Shared : (int)ESoundDeviceTypeForConfig.Bass; // #24820 2012.12.23 yyagi 初期値はACM | #31927 2013.8.25 yyagi OSにより初期値変更 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(自動設定) + 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 - this.bUseOSTimer = true; // #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.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.bUseOSTimer = true; // #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.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での、チップフェードアウト時間 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; + + this.bBranchGuide = false; + this.nScoreMode = 2; + this.nDefaultCourse = (int)Difficulty.Normal; + this.nBranchAnime = 1; + + this.bJudgeBigNotes = false; bForceNormalGauge = false; - this.nBigNoteWaitTimems = 50; + this.nBigNoteWaitTimems = 50; - this.bJudgeCountDisplay = false; + this.bJudgeCountDisplay = false; ShowExExtraAnime = true; ShowChara = true; - ShowDancer = true; - ShowRunner = true; - ShowFooter = true; - ShowMob = true; - ShowPuchiChara = true; + ShowDancer = true; + ShowRunner = true; + ShowFooter = true; + ShowMob = true; + ShowPuchiChara = true; this.eSTEALTH = new EStealthMode[5]; - for (int i = 0; i < 5; i++) + for (int i = 0; i < 5; i++) this.eSTEALTH[i] = EStealthMode.OFF; - this.bNoInfo = false; + this.bNoInfo = false; //this.bNoMP3Streaming = false; this.nMasterVolume = 100; // #33700 2014.4.26 yyagi マスターボリュームの設定(WASAPI/ASIO用) this.bHispeedRandom = false; - this.nDefaultSongSort = 2; + this.nDefaultSongSort = 2; this.nRecentlyPlayedMax = 5; - this.eGameMode = EGame.OFF; + 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 + 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 = Eレーンタイプ.TypeA; - this.bDirectShowMode = false; - #endregion - } - public CConfigIni( string iniファイル名 ) - : this() - { - this.tファイルから読み込み( iniファイル名 ); + MusicPreTimeMs = 1000; // 一秒 + SendDiscordPlayingInformation = true; + #region[ Ver.K追加 ] + this.eLaneType = Eレーンタイプ.TypeA; + this.bDirectShowMode = false; + #endregion + } + public CConfigIni(string iniファイル名) + : this() { + this.tファイルから読み込み(iniファイル名); } // メソッド - public void t指定した入力が既にアサイン済みである場合はそれを全削除する( EInputDevice DeviceType, int nID, int nCode, EKeyConfigPad pad ) - { + public void t指定した入力が既にアサイン済みである場合はそれを全削除する(EInputDevice DeviceType, int nID, int nCode, EKeyConfigPad pad) { var isMenu = pad == EKeyConfigPad.Decide || pad == EKeyConfigPad.RightChange || pad == EKeyConfigPad.LeftChange; - for( int i = 0; i <= (int)EKeyConfigPart.SYSTEM; i++ ) - { - for( int j = 0; j < (int)EKeyConfigPad.Capture; j++ ) // Do not restrict duplicate keybinds for System controls + for (int i = 0; i <= (int)EKeyConfigPart.SYSTEM; i++) { + for (int j = 0; j < (int)EKeyConfigPad.Capture; j++) // Do not restrict duplicate keybinds for System controls { - if (isMenu ? + if (isMenu ? (j != (int)EKeyConfigPad.LeftChange && j != (int)EKeyConfigPad.RightChange && j != (int)EKeyConfigPad.Decide) : (j == (int)EKeyConfigPad.LeftChange || j == (int)EKeyConfigPad.RightChange || j == (int)EKeyConfigPad.Decide)) continue; - for( int k = 0; k < 0x10; k++ ) - { - if( ( ( this.KeyAssign[ i ][ j ][ k ].入力デバイス == DeviceType ) && ( this.KeyAssign[ i ][ j ][ k ].ID == nID ) ) && ( this.KeyAssign[ i ][ j ][ k ].コード == nCode ) ) - { - for( int m = k; m < 15; m++ ) - { - this.KeyAssign[ i ][ j ][ m ] = this.KeyAssign[ i ][ j ][ m + 1 ]; + for (int k = 0; k < 0x10; k++) { + if (((this.KeyAssign[i][j][k].入力デバイス == DeviceType) && (this.KeyAssign[i][j][k].ID == nID)) && (this.KeyAssign[i][j][k].コード == nCode)) { + for (int m = k; m < 15; m++) { + this.KeyAssign[i][j][m] = this.KeyAssign[i][j][m + 1]; } - this.KeyAssign[ i ][ j ][ 15 ].入力デバイス = EInputDevice.Unknown; - this.KeyAssign[ i ][ j ][ 15 ].ID = 0; - this.KeyAssign[ i ][ j ][ 15 ].コード = 0; + this.KeyAssign[i][j][15].入力デバイス = EInputDevice.Unknown; + this.KeyAssign[i][j][15].ID = 0; + this.KeyAssign[i][j][15].コード = 0; k--; } } } } } - public void t書き出し( string iniファイル名 ) - { - StreamWriter sw = new StreamWriter( iniファイル名, false, Encoding.GetEncoding(TJAPlayer3.sEncType) ); - sw.WriteLine( ";-------------------" ); - + public void t書き出し(string iniファイル名) { + StreamWriter sw = new StreamWriter(iniファイル名, false, Encoding.GetEncoding(TJAPlayer3.sEncType)); + sw.WriteLine(";-------------------"); + #region [ System ] - sw.WriteLine( "[System]" ); + sw.WriteLine("[System]"); sw.WriteLine(); #region [ Version ] - sw.WriteLine( "; リリースバージョン" ); - sw.WriteLine( "; Release Version." ); - sw.WriteLine( "Version={0}", TJAPlayer3.VERSION ); + sw.WriteLine("; リリースバージョン"); + sw.WriteLine("; Release Version."); + sw.WriteLine("Version={0}", TJAPlayer3.VERSION); sw.WriteLine(); #endregion #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(@"; セミコロン(;)で区切ることにより複数のパスを指定できます。(例: 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 #region [ スキン関連 ] #region [ Skinパスの絶対パス→相対パス変換 ] - Uri uriRoot = new Uri( System.IO.Path.Combine( TJAPlayer3.strEXEのあるフォルダ, "System" + System.IO.Path.DirectorySeparatorChar ) ); - if ( strSystemSkinSubfolderFullName != null && strSystemSkinSubfolderFullName.Length == 0 ) - { + Uri uriRoot = new Uri(System.IO.Path.Combine(TJAPlayer3.strEXEのあるフォルダ, "System" + System.IO.Path.DirectorySeparatorChar)); + if (strSystemSkinSubfolderFullName != null && strSystemSkinSubfolderFullName.Length == 0) { // Config.iniが空の状態でDTXManiaをViewerとして起動_終了すると、strSystemSkinSubfolderFullName が空の状態でここに来る。 // → 初期値として Default/ を設定する。 - strSystemSkinSubfolderFullName = System.IO.Path.Combine( TJAPlayer3.strEXEのあるフォルダ, "System" + System.IO.Path.DirectorySeparatorChar + "Default" + System.IO.Path.DirectorySeparatorChar ); + strSystemSkinSubfolderFullName = System.IO.Path.Combine(TJAPlayer3.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 ); // 区切り文字が\ではなく/なので置換する + 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("; 使用する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 + 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] + #region [Language] - sw.WriteLine("; プレイ中やメニューの表示される言語を変更。"); + sw.WriteLine("; プレイ中やメニューの表示される言語を変更。"); sw.WriteLine("; Change the displayed language ingame and within the menus."); sw.WriteLine("Lang={0}", this.sLang); sw.WriteLine(); @@ -2228,109 +1967,108 @@ namespace TJAPlayer3 sw.WriteLine("LayoutType={0}", this.nLayoutType); sw.WriteLine(); - #endregion + #endregion - #region [Save Files] + #region [Save Files] - sw.WriteLine("; File paths on the Saves folder."); - sw.WriteLine("SaveFileName={0}", String.Join(",", this.sSaveFile)); - 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("; File paths on the Saves folder."); + sw.WriteLine("SaveFileName={0}", String.Join(",", this.sSaveFile)); 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.n非フォーカス時スリープms ); // そのまま引用(苦笑) + #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.n非フォーカス時スリープms); // そのまま引用(苦笑) 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.nフレーム毎スリープms ); // + #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.nフレーム毎スリープms); // 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を使用します。" ); + #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("; 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("; 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("; 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." ); + 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 ] ); + for (int i = 0; i < asiodev.Length; i++) { + sw.WriteLine("; {0}: {1}", i, asiodev[i]); } - sw.WriteLine( "ASIODevice={0}", (int) this.nASIODevice ); + sw.WriteLine("ASIODevice={0}", (int)this.nASIODevice); sw.WriteLine(); //sw.WriteLine( "; ASIO使用時のサウンドバッファサイズ" ); @@ -2346,10 +2084,10 @@ namespace TJAPlayer3 //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("; 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( "; 全体ボリュームの設定" ); @@ -2360,107 +2098,107 @@ namespace TJAPlayer3 //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("; 背景画像の半透明割合(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("; 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("; 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("; 動画表示モード( 0:表示しない, 1:背景のみ, 2:窓表示のみ, 3:両方)"); + sw.WriteLine("ClipDispType={0}", (int)this.eClipDispType); sw.WriteLine(); #endregion - #region [ プレビュー音 ] - sw.WriteLine( "; 曲選択からプレビュー音の再生までのウェイト[ms]" ); - sw.WriteLine( "PreviewSoundWait={0}", this.n曲が選択されてからプレビュー音が鳴るまでのウェイトms ); + #region [ プレビュー音 ] + sw.WriteLine("; 曲選択からプレビュー音の再生までのウェイト[ms]"); + sw.WriteLine("PreviewSoundWait={0}", this.n曲が選択されてからプレビュー音が鳴るまでのウェイトms); sw.WriteLine(); - sw.WriteLine( "; 曲選択からプレビュー画像表示までのウェイト[ms]" ); - sw.WriteLine( "PreviewImageWait={0}", this.n曲が選択されてからプレビュー画像が表示開始されるまでのウェイトms ); + sw.WriteLine("; 曲選択からプレビュー画像表示までのウェイト[ms]"); + sw.WriteLine("PreviewImageWait={0}", this.n曲が選択されてからプレビュー画像が表示開始されるまでのウェイトms); 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.bBGM音を発声する ? 1 : 0 ); + sw.WriteLine("; BGM の再生(0:OFF, 1:ON)"); + sw.WriteLine("BGMSound={0}", this.bBGM音を発声する ? 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.n表示可能な最小コンボ数.Drums); - sw.WriteLine(); - sw.WriteLine( "; RANDOM SELECT で子BOXを検索対象に含める (0:OFF, 1:ON)" ); - sw.WriteLine( "RandomFromSubBox={0}", this.bIncludeSubfoldersOnRandomSelect ? 1 : 0 ); + sw.WriteLine("MinComboDrums={0}", this.n表示可能な最小コンボ数.Drums); 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("; RANDOM SELECT で子BOXを検索対象に含める (0:OFF, 1:ON)"); + sw.WriteLine("RandomFromSubBox={0}", this.bIncludeSubfoldersOnRandomSelect ? 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("; 演奏情報を表示する (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). ({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("; 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("; .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($"; 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( $"; ゲーム中の音源の音量 ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)" ); - sw.WriteLine( $"; Song playback level ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)" ); - sw.WriteLine( "{0}={1}", nameof(SongPlaybackLevel), SongPlaybackLevel ); + 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( $"; キーボードによる音量変更の増加量、減少量 ({MinimumKeyboardSoundLevelIncrement}-{MaximumKeyboardSoundLevelIncrement})" ); - sw.WriteLine( $"; Keyboard sound level increment ({MinimumKeyboardSoundLevelIncrement}-{MaximumKeyboardSoundLevelIncrement})" ); - sw.WriteLine( "{0}={1}", nameof(KeyboardSoundLevelIncrement), KeyboardSoundLevelIncrement ); + 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( "; Stoic mode. (0:OFF, 1:ON)" ); - sw.WriteLine( "StoicMode={0}", this.bストイックモード ? 1 : 0 ); + 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("; ストイックモード(0:OFF, 1:ON)"); + sw.WriteLine("; Stoic mode. (0:OFF, 1:ON)"); + sw.WriteLine("StoicMode={0}", this.bストイックモード ? 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("; バッファ入力モード(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("; 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("; リザルト画像自動保存機能(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にしてください) " ); // @@ -2469,11 +2207,11 @@ namespace TJAPlayer3 //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(); + 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]" ); @@ -2486,17 +2224,17 @@ namespace TJAPlayer3 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 + 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); + #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); @@ -2506,8 +2244,8 @@ namespace TJAPlayer3 sw.WriteLine("DefaultAILevel={0}", this.nDefaultAILevel); //sw.WriteLine("AIBattleMode={0}", bAIBattleMode ? 1 : 0); sw.WriteLine(); - sw.WriteLine(";-------------------"); - #endregion + sw.WriteLine(";-------------------"); + #endregion /* #region [ HitRange ] @@ -2522,65 +2260,65 @@ namespace TJAPlayer3 #endregion */ - #region [ Log ] - sw.WriteLine( "[Log]" ); + #region [ Log ] + sw.WriteLine("[Log]"); sw.WriteLine(); - sw.WriteLine( "; Log出力(0:OFF, 1:ON)" ); - sw.WriteLine( "OutputLog={0}", this.bOutputLogs ? 1 : 0 ); + 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.bLog曲検索ログ出力 ? 1 : 0 ); + sw.WriteLine("; 曲データ検索に関するLog出力(0:OFF, 1:ON)"); + sw.WriteLine("TraceSongSearch={0}", this.bLog曲検索ログ出力 ? 1 : 0); sw.WriteLine(); - sw.WriteLine( "; 画像やサウンドの作成_解放に関するLog出力(0:OFF, 1:ON)" ); - sw.WriteLine( "TraceCreatedDisposed={0}", this.bLog作成解放ログ出力 ? 1 : 0 ); + sw.WriteLine("; 画像やサウンドの作成_解放に関するLog出力(0:OFF, 1:ON)"); + sw.WriteLine("TraceCreatedDisposed={0}", this.bLog作成解放ログ出力 ? 1 : 0); sw.WriteLine(); - sw.WriteLine( "; DTX読み込み詳細に関するLog出力(0:OFF, 1:ON)" ); - sw.WriteLine( "TraceDTXDetails={0}", this.bLogDTX詳細ログ出力 ? 1 : 0 ); + sw.WriteLine("; DTX読み込み詳細に関するLog出力(0:OFF, 1:ON)"); + sw.WriteLine("TraceDTXDetails={0}", this.bLogDTX詳細ログ出力 ? 1 : 0); sw.WriteLine(); - sw.WriteLine( ";-------------------" ); + sw.WriteLine(";-------------------"); #endregion #region [ PlayOption ] - sw.WriteLine( "[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: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("; 選曲画面でのタイマーを有効にするかどうか(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("; ドラムチップ非表示モード (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("; ドラム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("; 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("; 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("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]); @@ -2607,8 +2345,8 @@ namespace TJAPlayer3 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("; 演奏速度(5~40)(→x5/20~x40/20)"); + sw.WriteLine("PlaySpeed={0}", this.nSongSpeed); sw.WriteLine(); sw.WriteLine("; 演奏速度が一倍速であるときのみBGMを再生する(0:OFF, 1:ON)"); @@ -2616,50 +2354,50 @@ namespace TJAPlayer3 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("; スコア計算方法(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("; 大音符の両手入力待機時間(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("; 大音符の両手判定(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("; ゲージを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("; 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("; 譜面分岐のアニメーション(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("; デフォルトの曲ソート(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(); + 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("; 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("; ゲーム(0:OFF, 1:完走!叩ききりまショー!, 2:完走!叩ききりまショー!(激辛) )"); + sw.WriteLine("GameMode={0}", (int)this.eGameMode); sw.WriteLine(); sw.WriteLine(); sw.WriteLine("; 特訓モード時にPgUp/PgDnで何小節飛ばすか"); @@ -2669,11 +2407,11 @@ namespace TJAPlayer3 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("; 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]); @@ -2681,80 +2419,78 @@ namespace TJAPlayer3 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("; 判定数の表示(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("; プレイ人数"); + sw.WriteLine("PlayerCount={0}", this.nPlayerCount); + sw.WriteLine(); - sw.WriteLine( ";-------------------" ); + sw.WriteLine(";-------------------"); #endregion #region [ GUID ] - sw.WriteLine( "[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.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 ); + 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("; キーアサイン"); + 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.tキーの書き出し( sw, this.KeyAssign.Drums.LeftRed ); - sw.WriteLine(); - sw.Write( "RightRed=" ); - this.tキーの書き出し( sw, this.KeyAssign.Drums.RightRed ); - sw.WriteLine(); - sw.Write( "LeftBlue=" ); // #27029 2012.1.4 from - this.tキーの書き出し( sw, this.KeyAssign.Drums.LeftBlue ); // - sw.WriteLine(); // - sw.Write( "RightBlue=" ); // #27029 2012.1.4 from - this.tキーの書き出し( sw, this.KeyAssign.Drums.RightBlue ); // + sw.WriteLine("[DrumsKeyAssign]"); sw.WriteLine(); - sw.Write( "LeftRed2P=" ); - this.tキーの書き出し( sw, this.KeyAssign.Drums.LeftRed2P ); + sw.Write("LeftRed="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.LeftRed); sw.WriteLine(); - sw.Write( "RightRed2P=" ); - this.tキーの書き出し( sw, this.KeyAssign.Drums.RightRed2P ); + sw.Write("RightRed="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.RightRed); sw.WriteLine(); - sw.Write( "LeftBlue2P=" ); // #27029 2012.1.4 from - this.tキーの書き出し( sw, this.KeyAssign.Drums.LeftBlue2P ); // - sw.WriteLine(); // - sw.Write( "RightBlue2P=" ); // #27029 2012.1.4 from - this.tキーの書き出し( sw, this.KeyAssign.Drums.RightBlue2P ); // + sw.Write("LeftBlue="); // #27029 2012.1.4 from + this.tキーの書き出し(sw, this.KeyAssign.Drums.LeftBlue); // + sw.WriteLine(); // + sw.Write("RightBlue="); // #27029 2012.1.4 from + this.tキーの書き出し(sw, this.KeyAssign.Drums.RightBlue); // + sw.WriteLine(); + + sw.Write("LeftRed2P="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.LeftRed2P); + sw.WriteLine(); + sw.Write("RightRed2P="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.RightRed2P); + sw.WriteLine(); + sw.Write("LeftBlue2P="); // #27029 2012.1.4 from + this.tキーの書き出し(sw, this.KeyAssign.Drums.LeftBlue2P); // + sw.WriteLine(); // + sw.Write("RightBlue2P="); // #27029 2012.1.4 from + this.tキーの書き出し(sw, this.KeyAssign.Drums.RightBlue2P); // sw.WriteLine(); sw.Write("LeftRed3P="); @@ -2828,593 +2564,443 @@ namespace TJAPlayer3 sw.WriteLine(); #endregion #region [ SystemKeyAssign ] - sw.WriteLine( "[SystemKeyAssign]" ); + sw.WriteLine("[SystemKeyAssign]"); sw.WriteLine(); - sw.Write( "Capture=" ); - this.tキーの書き出し( sw, this.KeyAssign.System.Capture ); + sw.Write("Capture="); + this.tキーの書き出し(sw, this.KeyAssign.System.Capture); sw.WriteLine(); - sw.Write( "SongVolumeIncrease=" ); - this.tキーの書き出し( sw, this.KeyAssign.System.SongVolIncrease ); + sw.Write("SongVolumeIncrease="); + this.tキーの書き出し(sw, this.KeyAssign.System.SongVolIncrease); sw.WriteLine(); - sw.Write( "SongVolumeDecrease=" ); - this.tキーの書き出し( sw, this.KeyAssign.System.SongVolDecrease ); + sw.Write("SongVolumeDecrease="); + this.tキーの書き出し(sw, this.KeyAssign.System.SongVolDecrease); sw.WriteLine(); - sw.Write( "DisplayHits=" ); - this.tキーの書き出し( sw, this.KeyAssign.System.DisplayHits ); + sw.Write("DisplayHits="); + this.tキーの書き出し(sw, this.KeyAssign.System.DisplayHits); sw.WriteLine(); - sw.Write( "DisplayDebug=" ); - this.tキーの書き出し( sw, this.KeyAssign.System.DisplayDebug ); + sw.Write("DisplayDebug="); + this.tキーの書き出し(sw, this.KeyAssign.System.DisplayDebug); sw.WriteLine(); - sw.Write( "QuickConfig=" ); - this.tキーの書き出し( sw, this.KeyAssign.System.QuickConfig ); + sw.Write("QuickConfig="); + this.tキーの書き出し(sw, this.KeyAssign.System.QuickConfig); sw.WriteLine(); - sw.Write( "NewHeya=" ); - this.tキーの書き出し( sw, this.KeyAssign.System.NewHeya ); + sw.Write("NewHeya="); + this.tキーの書き出し(sw, this.KeyAssign.System.NewHeya); sw.WriteLine(); - sw.Write( "SortSongs=" ); - this.tキーの書き出し( sw, this.KeyAssign.System.SortSongs ); + sw.Write("SortSongs="); + this.tキーの書き出し(sw, this.KeyAssign.System.SortSongs); sw.WriteLine(); - sw.Write( "ToggleAutoP1=" ); - this.tキーの書き出し( sw, this.KeyAssign.System.ToggleAutoP1 ); + sw.Write("ToggleAutoP1="); + this.tキーの書き出し(sw, this.KeyAssign.System.ToggleAutoP1); sw.WriteLine(); - sw.Write( "ToggleAutoP2=" ); - this.tキーの書き出し( sw, this.KeyAssign.System.ToggleAutoP2 ); + sw.Write("ToggleAutoP2="); + this.tキーの書き出し(sw, this.KeyAssign.System.ToggleAutoP2); sw.WriteLine(); - sw.Write( "ToggleTrainingMode=" ); - this.tキーの書き出し( sw, this.KeyAssign.System.ToggleTrainingMode ); + sw.Write("ToggleTrainingMode="); + this.tキーの書き出し(sw, this.KeyAssign.System.ToggleTrainingMode); sw.WriteLine(); - sw.Write( "CycleVideoDisplayMode=" ); - this.tキーの書き出し( sw, this.KeyAssign.System.CycleVideoDisplayMode ); + sw.Write("CycleVideoDisplayMode="); + this.tキーの書き出し(sw, this.KeyAssign.System.CycleVideoDisplayMode); sw.WriteLine(); sw.WriteLine(); #endregion #region [ TrainingKeyAssign ] - sw.WriteLine( "[TrainingKeyAssign]" ); + sw.WriteLine("[TrainingKeyAssign]"); sw.WriteLine(); - sw.Write("TrainingIncreaseScrollSpeed="); - this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingIncreaseScrollSpeed); - sw.WriteLine(); - sw.Write("TrainingDecreaseScrollSpeed="); - this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingDecreaseScrollSpeed); - sw.WriteLine(); - sw.Write("TrainingIncreaseSongSpeed="); - this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingIncreaseSongSpeed); - sw.WriteLine(); - sw.Write("TrainingDecreaseSongSpeed="); - this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingDecreaseSongSpeed); - sw.WriteLine(); - sw.Write("TrainingToggleAuto="); - this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingToggleAuto); - sw.WriteLine(); - sw.Write("TrainingBranchNormal="); - this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingBranchNormal); - sw.WriteLine(); - sw.Write("TrainingBranchExpert="); - this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingBranchExpert); - sw.WriteLine(); - sw.Write("TrainingBranchMaster="); - this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingBranchMaster); - sw.WriteLine(); - sw.Write("TrainingPause="); - this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingPause); - sw.WriteLine(); - sw.Write("TrainingBookmark="); - this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingBookmark); - sw.WriteLine(); - sw.Write("TrainingMoveForwardMeasure="); - this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingMoveForwardMeasure); - sw.WriteLine(); - sw.Write("TrainingMoveBackMeasure="); - this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingMoveBackMeasure); - sw.WriteLine(); - sw.Write("TrainingSkipForwardMeasure="); - this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingSkipForwardMeasure); - sw.WriteLine(); - sw.Write("TrainingSkipBackMeasure="); - this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingSkipBackMeasure); - sw.WriteLine(); - sw.Write("TrainingJumpToFirstMeasure="); - this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingJumpToFirstMeasure); - sw.WriteLine(); - sw.Write("TrainingJumpToLastMeasure="); - this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingJumpToLastMeasure); - sw.WriteLine(); + sw.Write("TrainingIncreaseScrollSpeed="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingIncreaseScrollSpeed); sw.WriteLine(); - #endregion + sw.Write("TrainingDecreaseScrollSpeed="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingDecreaseScrollSpeed); + sw.WriteLine(); + sw.Write("TrainingIncreaseSongSpeed="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingIncreaseSongSpeed); + sw.WriteLine(); + sw.Write("TrainingDecreaseSongSpeed="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingDecreaseSongSpeed); + sw.WriteLine(); + sw.Write("TrainingToggleAuto="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingToggleAuto); + sw.WriteLine(); + sw.Write("TrainingBranchNormal="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingBranchNormal); + sw.WriteLine(); + sw.Write("TrainingBranchExpert="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingBranchExpert); + sw.WriteLine(); + sw.Write("TrainingBranchMaster="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingBranchMaster); + sw.WriteLine(); + sw.Write("TrainingPause="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingPause); + sw.WriteLine(); + sw.Write("TrainingBookmark="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingBookmark); + sw.WriteLine(); + sw.Write("TrainingMoveForwardMeasure="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingMoveForwardMeasure); + sw.WriteLine(); + sw.Write("TrainingMoveBackMeasure="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingMoveBackMeasure); + sw.WriteLine(); + sw.Write("TrainingSkipForwardMeasure="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingSkipForwardMeasure); + sw.WriteLine(); + sw.Write("TrainingSkipBackMeasure="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingSkipBackMeasure); + sw.WriteLine(); + sw.Write("TrainingJumpToFirstMeasure="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingJumpToFirstMeasure); + sw.WriteLine(); + sw.Write("TrainingJumpToLastMeasure="); + this.tキーの書き出し(sw, this.KeyAssign.Drums.TrainingJumpToLastMeasure); + sw.WriteLine(); + sw.WriteLine(); + #endregion - sw.Close(); + sw.Close(); } - public void tファイルから読み込み( string iniファイル名 ) - { + public void tファイルから読み込み(string iniファイル名) { this.ConfigIniファイル名 = iniファイル名; - this.bConfigIniが存在している = File.Exists( this.ConfigIniファイル名 ); - if( this.bConfigIniが存在している ) - { + this.bConfigIniが存在している = File.Exists(this.ConfigIniファイル名); + if (this.bConfigIniが存在している) { string str; this.tキーアサインを全部クリアする(); - using ( StreamReader reader = new StreamReader( this.ConfigIniファイル名, Encoding.GetEncoding(TJAPlayer3.sEncType) ) ) - { + using (StreamReader reader = new StreamReader(this.ConfigIniファイル名, Encoding.GetEncoding(TJAPlayer3.sEncType))) { str = reader.ReadToEnd(); } - t文字列から読み込み( str ); + t文字列から読み込み(str); } } - private void t文字列から読み込み( string strAllSettings ) // 2011.4.13 yyagi; refactored to make initial KeyConfig easier. + private void t文字列から読み込み(string strAllSettings) // 2011.4.13 yyagi; refactored to make initial KeyConfig easier. { Eセクション種別 unknown = Eセクション種別.Unknown; 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[] 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 str3; string str4; - if ( str[ 0 ] == '[' ) - { + if (str[0] == '[') { #region [ セクションの変更 ] //----------------------------- - StringBuilder builder = new StringBuilder( 0x20 ); + StringBuilder builder = new StringBuilder(0x20); int num = 1; - while ( ( num < str.Length ) && ( str[ num ] != ']' ) ) - { - builder.Append( str[ num++ ] ); + while ((num < str.Length) && (str[num] != ']')) { + builder.Append(str[num++]); } string str2 = builder.ToString(); - if ( str2.Equals( "System" ) ) - { + if (str2.Equals("System")) { unknown = Eセクション種別.System; - } - else if (str2.Equals("AutoPlay")) - { - unknown = Eセクション種別.AutoPlay; - } - else if (str2.Equals("HitRange")) - { - unknown = Eセクション種別.HitRange; - } - else if ( str2.Equals( "Log" ) ) - { + } else if (str2.Equals("AutoPlay")) { + unknown = Eセクション種別.AutoPlay; + } else if (str2.Equals("HitRange")) { + unknown = Eセクション種別.HitRange; + } else if (str2.Equals("Log")) { unknown = Eセクション種別.Log; - } - else if ( str2.Equals( "PlayOption" ) ) - { + } else if (str2.Equals("PlayOption")) { unknown = Eセクション種別.PlayOption; - } - else if ( str2.Equals( "ViewerOption" ) ) - { + } else if (str2.Equals("ViewerOption")) { unknown = Eセクション種別.ViewerOption; - } - else if ( str2.Equals( "GUID" ) ) - { + } else if (str2.Equals("GUID")) { unknown = Eセクション種別.GUID; - } - else if ( str2.Equals( "DrumsKeyAssign" ) ) - { + } else if (str2.Equals("DrumsKeyAssign")) { unknown = Eセクション種別.DrumsKeyAssign; - } - else if ( str2.Equals( "SystemKeyAssign" ) ) - { + } else if (str2.Equals("SystemKeyAssign")) { unknown = Eセクション種別.SystemKeyAssign; - } - else if ( str2.Equals( "TrainingKeyAssign" )) - { + } else if (str2.Equals("TrainingKeyAssign")) { unknown = Eセクション種別.TrainingKeyAssign; - } - else if( str2.Equals( "Temp" ) ) - { + } else if (str2.Equals("Temp")) { unknown = Eセクション種別.Temp; - } - else - { + } else { unknown = Eセクション種別.Unknown; } //----------------------------- #endregion - } - else - { - string[] strArray = str.Split( new char[] { '=' } ); - if( strArray.Length == 2 ) - { - str3 = strArray[ 0 ].Trim(); - str4 = strArray[ 1 ].Trim(); - switch( unknown ) - { + } else { + string[] strArray = str.Split(new char[] { '=' }); + if (strArray.Length == 2) { + str3 = strArray[0].Trim(); + str4 = strArray[1].Trim(); + switch (unknown) { #region [ [System] ] //----------------------------- - case Eセクション種別.System: - { + case Eセクション種別.System: { #region [ TJAPath ] - if( str3.Equals( "TJAPath" ) ) - { + if (str3.Equals("TJAPath")) { this.strSongsPath = str4; } #endregion - else if( str3.Equals("Lang")) - { + else if (str3.Equals("Lang")) { this.sLang = str4; CLangManager.langAttach(str4); - } - - else if (str3.Equals("LayoutType")) - { + } else if (str3.Equals("LayoutType")) { this.nLayoutType = int.Parse(str4); - } - - else if (str3.Equals("SaveFileName")) - { + } else if (str3.Equals("SaveFileName")) { var _s = str4.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]; - } - } - } + 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]; + } + } + } #region [ skin関係 ] - else if ( str3.Equals( "SkinPath" ) ) - { + else if (str3.Equals("SkinPath")) { string absSkinPath = str4; - if ( !System.IO.Path.IsPathRooted( str4 ) ) - { - absSkinPath = System.IO.Path.Combine( TJAPlayer3.strEXEのあるフォルダ, "System" ); - absSkinPath = System.IO.Path.Combine( absSkinPath, str4 ); - Uri u = new Uri( absSkinPath ); - absSkinPath = u.AbsolutePath.ToString(); // str4内に相対パスがある場合に備える - absSkinPath = System.Web.HttpUtility.UrlDecode( absSkinPath ); // デコードする - absSkinPath = absSkinPath.Replace( '/', System.IO.Path.DirectorySeparatorChar ); // 区切り文字が\ではなく/なので置換する + if (!System.IO.Path.IsPathRooted(str4)) { + absSkinPath = System.IO.Path.Combine(TJAPlayer3.strEXEのあるフォルダ, "System"); + absSkinPath = System.IO.Path.Combine(absSkinPath, str4); + 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側と表記を統一する + if (absSkinPath[absSkinPath.Length - 1] != System.IO.Path.DirectorySeparatorChar) // フォルダ名末尾に\を必ずつけて、CSkin側と表記を統一する { absSkinPath += System.IO.Path.DirectorySeparatorChar; } this.strSystemSkinSubfolderFullName = absSkinPath; + } else if (str3.Equals(nameof(PreAssetsLoading))) { + PreAssetsLoading = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals(nameof(FastRender))) { + FastRender = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals(nameof(ASyncTextureLoad))) { + ASyncTextureLoad = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals(nameof(SimpleMode))) { + SimpleMode = CConversion.bONorOFF(str4[0]); } - else if (str3.Equals(nameof(PreAssetsLoading))) - { - PreAssetsLoading = CConversion.bONorOFF(str4[0]); - } - else if (str3.Equals(nameof(FastRender))) - { - FastRender = CConversion.bONorOFF(str4[0]); - } - else if (str3.Equals(nameof(ASyncTextureLoad))) - { - ASyncTextureLoad = CConversion.bONorOFF(str4[0]); - } - else if (str3.Equals(nameof(SimpleMode))) - { - SimpleMode = CConversion.bONorOFF(str4[0]); - } - #endregion - #region [ Window関係 ] - else if ( str3.Equals( "GraphicsDeviceType" ) ) - { - this.nGraphicsDeviceType = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 4, this.nGraphicsDeviceType ); - } - else if (str3.Equals("FullScreen")) - { - this.bFullScreen = CConversion.bONorOFF(str4[0]); - } - else if ( str3.Equals( "WindowX" ) ) // #30675 2013.02.04 ikanick add - { + #endregion + #region [ Window関係 ] + else if (str3.Equals("GraphicsDeviceType")) { + this.nGraphicsDeviceType = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 4, this.nGraphicsDeviceType); + } else if (str3.Equals("FullScreen")) { + this.bFullScreen = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("WindowX")) // #30675 2013.02.04 ikanick add + { this.nWindowBaseXPosition = CConversion.n値を文字列から取得して範囲内に丸めて返す( - str4, 0, 9999 , this.nWindowBaseXPosition ); - } - else if ( str3.Equals( "WindowY" ) ) // #30675 2013.02.04 ikanick add - { + str4, 0, 9999, this.nWindowBaseXPosition); + } else if (str3.Equals("WindowY")) // #30675 2013.02.04 ikanick add + { this.nWindowBaseYPosition = CConversion.n値を文字列から取得して範囲内に丸めて返す( - str4, 0, 9999 , this.nWindowBaseYPosition ); - } - else if ( str3.Equals( "WindowWidth" ) ) // #23510 2010.10.31 yyagi add - { - this.nWindowWidth = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 1, 65535, this.nWindowWidth ); - if( this.nWindowWidth <= 0 ) - { + str4, 0, 9999, this.nWindowBaseYPosition); + } else if (str3.Equals("WindowWidth")) // #23510 2010.10.31 yyagi add + { + this.nWindowWidth = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 1, 65535, this.nWindowWidth); + if (this.nWindowWidth <= 0) { this.nWindowWidth = SampleFramework.GameWindowSize.Width; } - } - else if( str3.Equals( "WindowHeight" ) ) // #23510 2010.10.31 yyagi add - { - this.nWindowHeight = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 1, 65535, this.nWindowHeight ); - if( this.nWindowHeight <= 0 ) - { + } else if (str3.Equals("WindowHeight")) // #23510 2010.10.31 yyagi add + { + this.nWindowHeight = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 1, 65535, this.nWindowHeight); + if (this.nWindowHeight <= 0) { this.nWindowHeight = SampleFramework.GameWindowSize.Height; } + } else if (str3.Equals("DoubleClickFullScreen")) // #26752 2011.11.27 yyagi + { + this.bIsAllowedDoubleClickFullscreen = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("EnableSystemMenu")) // #28200 2012.5.1 yyagi + { + this.bIsEnabledSystemMenu = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("BackSleep")) // #23568 2010.11.04 ikanick add + { + this.n非フォーカス時スリープms = CConversion.n値を文字列から取得して範囲内にちゃんと丸めて返す(str4, 0, 50, this.n非フォーカス時スリープms); } - else if ( str3.Equals( "DoubleClickFullScreen" ) ) // #26752 2011.11.27 yyagi - { - this.bIsAllowedDoubleClickFullscreen = CConversion.bONorOFF( str4[ 0 ] ); - } - else if ( str3.Equals( "EnableSystemMenu" ) ) // #28200 2012.5.1 yyagi - { - this.bIsEnabledSystemMenu = CConversion.bONorOFF( str4[ 0 ] ); - } - else if ( str3.Equals( "BackSleep" ) ) // #23568 2010.11.04 ikanick add - { - this.n非フォーカス時スリープms = CConversion.n値を文字列から取得して範囲内にちゃんと丸めて返す( str4, 0, 50, this.n非フォーカス時スリープms ); - } - #endregion + #endregion - #region [ WASAPI/ASIO関係 ] - else if ( str3.Equals( "SoundDeviceType" ) ) - { - this.nSoundDeviceType = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 4, this.nSoundDeviceType ); - } - else if ( str3.Equals( "BassBufferSizeMs" ) ) - { - this.nBassBufferSizeMs = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 9999, this.nBassBufferSizeMs ); - } - else if ( str3.Equals( "WASAPIBufferSizeMs" ) ) - { - this.nWASAPIBufferSizeMs = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 9999, this.nWASAPIBufferSizeMs ); - } - else if ( str3.Equals( "ASIODevice" ) ) - { + #region [ WASAPI/ASIO関係 ] + else if (str3.Equals("SoundDeviceType")) { + this.nSoundDeviceType = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 4, this.nSoundDeviceType); + } else if (str3.Equals("BassBufferSizeMs")) { + this.nBassBufferSizeMs = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 9999, this.nBassBufferSizeMs); + } else if (str3.Equals("WASAPIBufferSizeMs")) { + this.nWASAPIBufferSizeMs = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 9999, this.nWASAPIBufferSizeMs); + } else if (str3.Equals("ASIODevice")) { string[] asiodev = CEnumerateAllAsioDevices.GetAllASIODevices(); - this.nASIODevice = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, asiodev.Length - 1, this.nASIODevice ); + this.nASIODevice = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, asiodev.Length - 1, this.nASIODevice); } - //else if ( str3.Equals( "ASIOBufferSizeMs" ) ) - //{ - // this.nASIOBufferSizeMs = C変換.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 9999, this.nASIOBufferSizeMs ); - //} - //else if ( str3.Equals( "DynamicBassMixerManagement" ) ) - //{ - // this.bDynamicBassMixerManagement = C変換.bONorOFF( str4[ 0 ] ); - //} - else if ( str3.Equals( "SoundTimerType" ) ) // #33689 2014.6.6 yyagi - { - this.bUseOSTimer = CConversion.bONorOFF( str4[ 0 ] ); + //else if ( str3.Equals( "ASIOBufferSizeMs" ) ) + //{ + // this.nASIOBufferSizeMs = C変換.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 9999, this.nASIOBufferSizeMs ); + //} + //else if ( str3.Equals( "DynamicBassMixerManagement" ) ) + //{ + // this.bDynamicBassMixerManagement = C変換.bONorOFF( str4[ 0 ] ); + //} + else if (str3.Equals("SoundTimerType")) // #33689 2014.6.6 yyagi + { + this.bUseOSTimer = CConversion.bONorOFF(str4[0]); } - //else if ( str3.Equals( "MasterVolume" ) ) - //{ - // this.nMasterVolume = C変換.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 100, this.nMasterVolume ); - //} - #endregion + //else if ( str3.Equals( "MasterVolume" ) ) + //{ + // this.nMasterVolume = C変換.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 100, this.nMasterVolume ); + //} + #endregion - #region [ フォント ] - else if (str3.Equals("FontName")) - { - this.FontName = str4; - } - else if (str3.Equals("BoxFontName")) - { - this.BoxFontName = str4; - } - #endregion + #region [ フォント ] + else if (str3.Equals("FontName")) { + this.FontName = str4; + } else if (str3.Equals("BoxFontName")) { + this.BoxFontName = str4; + } + #endregion - else if ( str3.Equals( "VSyncWait" ) ) - { - this.bEnableVSync = CConversion.bONorOFF( str4[ 0 ] ); - } - else if( str3.Equals( "SleepTimePerFrame" ) ) // #23568 2011.11.27 yyagi - { - this.nフレーム毎スリープms = CConversion.n値を文字列から取得して範囲内にちゃんと丸めて返す( str4, -1, 50, this.nフレーム毎スリープms ); - } - else if( str3.Equals( "BGAlpha" ) ) - { - this.n背景の透過度 = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 0xff, this.n背景の透過度 ); + else if (str3.Equals("VSyncWait")) { + this.bEnableVSync = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("SleepTimePerFrame")) // #23568 2011.11.27 yyagi + { + this.nフレーム毎スリープms = CConversion.n値を文字列から取得して範囲内にちゃんと丸めて返す(str4, -1, 50, this.nフレーム毎スリープms); + } else if (str3.Equals("BGAlpha")) { + this.n背景の透過度 = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 0xff, this.n背景の透過度); } #region [ AVI/BGA ] - else if( str3.Equals( "AVI" ) ) - { - this.bEnableAVI = CConversion.bONorOFF( str4[ 0 ] ); - } - else if( str3.Equals( "BGA" ) ) - { - this.bEnableBGA = CConversion.bONorOFF( str4[ 0 ] ); - } - else if( str3.Equals( "ClipDispType" ) ) - { - this.eClipDispType = (EClipDispType)CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 3, (int) this.eClipDispType ); + else if (str3.Equals("AVI")) { + this.bEnableAVI = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("BGA")) { + this.bEnableBGA = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("ClipDispType")) { + this.eClipDispType = (EClipDispType)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 3, (int)this.eClipDispType); } #endregion #region [ プレビュー音 ] - else if( str3.Equals( "PreviewSoundWait" ) ) - { - this.n曲が選択されてからプレビュー音が鳴るまでのウェイトms = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 0x5f5e0ff, this.n曲が選択されてからプレビュー音が鳴るまでのウェイトms ); - } - else if( str3.Equals( "PreviewImageWait" ) ) - { - this.n曲が選択されてからプレビュー画像が表示開始されるまでのウェイトms = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 0x5f5e0ff, this.n曲が選択されてからプレビュー画像が表示開始されるまでのウェイトms ); + else if (str3.Equals("PreviewSoundWait")) { + this.n曲が選択されてからプレビュー音が鳴るまでのウェイトms = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 0x5f5e0ff, this.n曲が選択されてからプレビュー音が鳴るまでのウェイトms); + } else if (str3.Equals("PreviewImageWait")) { + this.n曲が選択されてからプレビュー画像が表示開始されるまでのウェイトms = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 0x5f5e0ff, this.n曲が選択されてからプレビュー画像が表示開始されるまでのウェイトms); } #endregion #region [ BGM/ドラムのヒット音 ] - else if( str3.Equals( "BGMSound" ) ) - { - this.bBGM音を発声する = CConversion.bONorOFF( str4[ 0 ] ); + else if (str3.Equals("BGMSound")) { + this.bBGM音を発声する = CConversion.bONorOFF(str4[0]); } #endregion - else if (str3.Equals("DanTowerHide")) - { + else if (str3.Equals("DanTowerHide")) { this.bDanTowerHide = CConversion.bONorOFF(str4[0]); - } - else if( str3.Equals( "RandomFromSubBox" ) ) - { - this.bIncludeSubfoldersOnRandomSelect = CConversion.bONorOFF( str4[ 0 ] ); + } else if (str3.Equals("RandomFromSubBox")) { + this.bIncludeSubfoldersOnRandomSelect = CConversion.bONorOFF(str4[0]); } #region [ コンボ数 ] - else if( str3.Equals( "MinComboDrums" ) ) - { - this.n表示可能な最小コンボ数.Drums = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 1, 0x1869f, this.n表示可能な最小コンボ数.Drums ); + else if (str3.Equals("MinComboDrums")) { + this.n表示可能な最小コンボ数.Drums = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 1, 0x1869f, this.n表示可能な最小コンボ数.Drums); } #endregion - else if( str3.Equals( "ShowDebugStatus" ) ) - { - this.bDisplayDebugInfo = CConversion.bONorOFF( str4[ 0 ] ); - } - else if( str3.Equals( nameof(ApplyLoudnessMetadata) ) ) - { - this.ApplyLoudnessMetadata = CConversion.bONorOFF( str4[ 0 ] ); - } - else if( str3.Equals( nameof(TargetLoudness) ) ) - { - this.TargetLoudness = CConversion.db値を文字列から取得して範囲内に丸めて返す( str4, CSound.MinimumLufs.ToDouble(), CSound.MaximumLufs.ToDouble(), this.TargetLoudness ); - } - else if( str3.Equals( nameof(ApplySongVol) ) ) - { - this.ApplySongVol = CConversion.bONorOFF( str4[ 0 ] ); - } - else if( str3.Equals( nameof(SoundEffectLevel) ) ) - { - this.SoundEffectLevel = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, this.SoundEffectLevel ); - } - else if( str3.Equals( nameof(VoiceLevel) ) ) - { - this.VoiceLevel = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, this.VoiceLevel ); - } - else if( str3.Equals( nameof(SongPreviewLevel) ) ) - { - this.SongPreviewLevel = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, this.SongPreviewLevel ); - } - else if ( str3.Equals( nameof(SongPlaybackLevel) ) ) - { - this.SongPlaybackLevel = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, this.SongPlaybackLevel ); - } - else if( str3.Equals( nameof(KeyboardSoundLevelIncrement) ) ) - { - this.KeyboardSoundLevelIncrement = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, MinimumKeyboardSoundLevelIncrement, MaximumKeyboardSoundLevelIncrement, this.KeyboardSoundLevelIncrement ); - } - else if( str3.Equals(nameof(MusicPreTimeMs))) - { - MusicPreTimeMs = int.Parse(str4); - } - else if( str3.Equals( "StoicMode" ) ) - { - this.bストイックモード = CConversion.bONorOFF( str4[ 0 ] ); - } - else if ( str3.Equals( "AutoResultCapture" ) ) // #25399 2011.6.9 yyagi - { - this.bIsAutoResultCapture = CConversion.bONorOFF( str4[ 0 ] ); - } - else if (str3.Equals(nameof(SendDiscordPlayingInformation))) - { - SendDiscordPlayingInformation = CConversion.bONorOFF(str4[0]); - } - else if ( str3.Equals( "TimeStretch" ) ) // #23664 2013.2.24 yyagi - { - this.bTimeStretch = CConversion.bONorOFF( str4[ 0 ] ); + else if (str3.Equals("ShowDebugStatus")) { + this.bDisplayDebugInfo = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals(nameof(ApplyLoudnessMetadata))) { + this.ApplyLoudnessMetadata = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals(nameof(TargetLoudness))) { + this.TargetLoudness = CConversion.db値を文字列から取得して範囲内に丸めて返す(str4, CSound.MinimumLufs.ToDouble(), CSound.MaximumLufs.ToDouble(), this.TargetLoudness); + } else if (str3.Equals(nameof(ApplySongVol))) { + this.ApplySongVol = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals(nameof(SoundEffectLevel))) { + this.SoundEffectLevel = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, this.SoundEffectLevel); + } else if (str3.Equals(nameof(VoiceLevel))) { + this.VoiceLevel = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, this.VoiceLevel); + } else if (str3.Equals(nameof(SongPreviewLevel))) { + this.SongPreviewLevel = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, this.SongPreviewLevel); + } else if (str3.Equals(nameof(SongPlaybackLevel))) { + this.SongPlaybackLevel = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, this.SongPlaybackLevel); + } else if (str3.Equals(nameof(KeyboardSoundLevelIncrement))) { + this.KeyboardSoundLevelIncrement = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, MinimumKeyboardSoundLevelIncrement, MaximumKeyboardSoundLevelIncrement, this.KeyboardSoundLevelIncrement); + } else if (str3.Equals(nameof(MusicPreTimeMs))) { + MusicPreTimeMs = int.Parse(str4); + } else if (str3.Equals("StoicMode")) { + this.bストイックモード = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("AutoResultCapture")) // #25399 2011.6.9 yyagi + { + this.bIsAutoResultCapture = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals(nameof(SendDiscordPlayingInformation))) { + SendDiscordPlayingInformation = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("TimeStretch")) // #23664 2013.2.24 yyagi + { + this.bTimeStretch = CConversion.bONorOFF(str4[0]); } #region [ AdjustTime ] - else if (str3.Equals("GlobalOffset")) - { + else if (str3.Equals("GlobalOffset")) { this.nGlobalOffsetMs = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, -9999, 9999, this.nGlobalOffsetMs); } #endregion - else if( str3.Equals( "BufferedInput" ) ) - { - this.bBufferedInputs = CConversion.bONorOFF( str4[ 0 ] ); - } - else if ( str3.Equals( "PolyphonicSounds" ) ) // #28228 2012.5.1 yyagi - { - this.nPoliphonicSounds = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 1, 8, this.nPoliphonicSounds ); + else if (str3.Equals("BufferedInput")) { + this.bBufferedInputs = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("PolyphonicSounds")) // #28228 2012.5.1 yyagi + { + this.nPoliphonicSounds = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 1, 8, this.nPoliphonicSounds); } #region [ VelocityMin ] - else if ( str3.Equals( "LCVelocityMin" ) ) // #23857 2010.12.12 yyagi - { - this.nVelocityMin.LC = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 127, this.nVelocityMin.LC ); - } - else if( str3.Equals( "HHVelocityMin" ) ) - { - this.nVelocityMin.HH = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 127, this.nVelocityMin.HH ); - } - else if( str3.Equals( "SDVelocityMin" ) ) // #23857 2011.1.31 yyagi - { - this.nVelocityMin.SD = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 127, this.nVelocityMin.SD ); - } - else if( str3.Equals( "BDVelocityMin" ) ) // #23857 2011.1.31 yyagi - { - this.nVelocityMin.BD = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 127, this.nVelocityMin.BD ); - } - else if( str3.Equals( "HTVelocityMin" ) ) // #23857 2011.1.31 yyagi - { - this.nVelocityMin.HT = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 127, this.nVelocityMin.HT ); - } - else if( str3.Equals( "LTVelocityMin" ) ) // #23857 2011.1.31 yyagi - { - this.nVelocityMin.LT = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 127, this.nVelocityMin.LT ); - } - else if( str3.Equals( "FTVelocityMin" ) ) // #23857 2011.1.31 yyagi - { - this.nVelocityMin.FT = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 127, this.nVelocityMin.FT ); - } - else if( str3.Equals( "CYVelocityMin" ) ) // #23857 2011.1.31 yyagi - { - this.nVelocityMin.CY = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 127, this.nVelocityMin.CY ); - } - else if( str3.Equals( "RDVelocityMin" ) ) // #23857 2011.1.31 yyagi - { - this.nVelocityMin.RD = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 127, this.nVelocityMin.RD ); + else if (str3.Equals("LCVelocityMin")) // #23857 2010.12.12 yyagi + { + this.nVelocityMin.LC = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 127, this.nVelocityMin.LC); + } else if (str3.Equals("HHVelocityMin")) { + this.nVelocityMin.HH = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 127, this.nVelocityMin.HH); + } else if (str3.Equals("SDVelocityMin")) // #23857 2011.1.31 yyagi + { + this.nVelocityMin.SD = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 127, this.nVelocityMin.SD); + } else if (str3.Equals("BDVelocityMin")) // #23857 2011.1.31 yyagi + { + this.nVelocityMin.BD = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 127, this.nVelocityMin.BD); + } else if (str3.Equals("HTVelocityMin")) // #23857 2011.1.31 yyagi + { + this.nVelocityMin.HT = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 127, this.nVelocityMin.HT); + } else if (str3.Equals("LTVelocityMin")) // #23857 2011.1.31 yyagi + { + this.nVelocityMin.LT = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 127, this.nVelocityMin.LT); + } else if (str3.Equals("FTVelocityMin")) // #23857 2011.1.31 yyagi + { + this.nVelocityMin.FT = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 127, this.nVelocityMin.FT); + } else if (str3.Equals("CYVelocityMin")) // #23857 2011.1.31 yyagi + { + this.nVelocityMin.CY = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 127, this.nVelocityMin.CY); + } else if (str3.Equals("RDVelocityMin")) // #23857 2011.1.31 yyagi + { + this.nVelocityMin.RD = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 127, this.nVelocityMin.RD); } #endregion - //else if ( str3.Equals( "NoMP3Streaming" ) ) - //{ - // this.bNoMP3Streaming = C変換.bONorOFF( str4[ 0 ] ); - //} - #region[ Ver.K追加 ] - else if ( str3.Equals( "DirectShowMode" ) ) // #28228 2012.5.1 yyagi - { - this.bDirectShowMode = CConversion.bONorOFF( str4[ 0 ] ); ; + //else if ( str3.Equals( "NoMP3Streaming" ) ) + //{ + // this.bNoMP3Streaming = C変換.bONorOFF( str4[ 0 ] ); + //} + #region[ Ver.K追加 ] + else if (str3.Equals("DirectShowMode")) // #28228 2012.5.1 yyagi + { + this.bDirectShowMode = CConversion.bONorOFF(str4[0]); ; } #endregion - else if (str3.Equals(nameof(TJAP3FolderMode))) - { + else if (str3.Equals(nameof(TJAP3FolderMode))) { TJAP3FolderMode = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("EndingAnime")) { + this.bEndingAnime = CConversion.bONorOFF(str4[0]); } - else if( str3.Equals( "EndingAnime" ) ) - { - this.bEndingAnime = CConversion.bONorOFF( str4[ 0 ] ); - } - continue; + continue; } - //----------------------------- - #endregion + //----------------------------- + #endregion - #region [ [AutoPlay] ] - //----------------------------- - case Eセクション種別.AutoPlay: - if (str3.Equals("Taiko")) - { - this.bAutoPlay[0] = CConversion.bONorOFF(str4[0]); - } - else if (str3.Equals("Taiko2P")) - { + #region [ [AutoPlay] ] + //----------------------------- + case Eセクション種別.AutoPlay: + if (str3.Equals("Taiko")) { + this.bAutoPlay[0] = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("Taiko2P")) { this.bAutoPlay[1] = CConversion.bONorOFF(str4[0]); - } - else if (str3.Equals("Taiko3P")) - { + } else if (str3.Equals("Taiko3P")) { this.bAutoPlay[2] = CConversion.bONorOFF(str4[0]); - } - else if (str3.Equals("Taiko4P")) - { + } else if (str3.Equals("Taiko4P")) { this.bAutoPlay[3] = CConversion.bONorOFF(str4[0]); - } - else if (str3.Equals("Taiko5P")) - { + } else if (str3.Equals("Taiko5P")) { this.bAutoPlay[4] = CConversion.bONorOFF(str4[0]); - } - else if (str3.Equals("TaikoAutoRoll")) - { - this.bAuto先生の連打 = CConversion.bONorOFF(str4[0]); - } - else if (str3.Equals("RollsPerSec")) - { + } else if (str3.Equals("TaikoAutoRoll")) { + this.bAuto先生の連打 = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("RollsPerSec")) { this.nRollsPerSec = int.Parse(str4); - } - else if (str3.Equals("DefaultAILevel")) - { + } else if (str3.Equals("DefaultAILevel")) { this.nDefaultAILevel = int.Parse(str4); this.nAILevel = this.nDefaultAILevel; } @@ -3425,52 +3011,37 @@ namespace TJAPlayer3 } */ continue; - //----------------------------- - #endregion + //----------------------------- + #endregion - #region [ [HitRange] ] - //----------------------------- - case Eセクション種別.HitRange: - if (str3.Equals("Perfect")) - { - this.nヒット範囲ms.Perfect = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 0x3e7, this.nヒット範囲ms.Perfect); - } - else if (str3.Equals("Great")) - { - this.nヒット範囲ms.Great = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 0x3e7, this.nヒット範囲ms.Great); - } - else if (str3.Equals("Good")) - { - this.nヒット範囲ms.Good = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 0x3e7, this.nヒット範囲ms.Good); - } - else if (str3.Equals("Poor")) - { - this.nヒット範囲ms.Poor = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 0x3e7, this.nヒット範囲ms.Poor); - } - continue; + #region [ [HitRange] ] + //----------------------------- + case Eセクション種別.HitRange: + if (str3.Equals("Perfect")) { + this.nヒット範囲ms.Perfect = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 0x3e7, this.nヒット範囲ms.Perfect); + } else if (str3.Equals("Great")) { + this.nヒット範囲ms.Great = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 0x3e7, this.nヒット範囲ms.Great); + } else if (str3.Equals("Good")) { + this.nヒット範囲ms.Good = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 0x3e7, this.nヒット範囲ms.Good); + } else if (str3.Equals("Poor")) { + this.nヒット範囲ms.Poor = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 0x3e7, this.nヒット範囲ms.Poor); + } + continue; - //----------------------------- - #endregion + //----------------------------- + #endregion - #region [ [Log] ] - //----------------------------- - case Eセクション種別.Log: - { - if( str3.Equals( "OutputLog" ) ) - { - this.bOutputLogs = CConversion.bONorOFF( str4[ 0 ] ); - } - else if( str3.Equals( "TraceCreatedDisposed" ) ) - { - this.bLog作成解放ログ出力 = CConversion.bONorOFF( str4[ 0 ] ); - } - else if( str3.Equals( "TraceDTXDetails" ) ) - { - this.bLogDTX詳細ログ出力 = CConversion.bONorOFF( str4[ 0 ] ); - } - else if( str3.Equals( "TraceSongSearch" ) ) - { - this.bLog曲検索ログ出力 = CConversion.bONorOFF( str4[ 0 ] ); + #region [ [Log] ] + //----------------------------- + case Eセクション種別.Log: { + if (str3.Equals("OutputLog")) { + this.bOutputLogs = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("TraceCreatedDisposed")) { + this.bLog作成解放ログ出力 = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("TraceDTXDetails")) { + this.bLogDTX詳細ログ出力 = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("TraceSongSearch")) { + this.bLog曲検索ログ出力 = CConversion.bONorOFF(str4[0]); } continue; } @@ -3479,50 +3050,32 @@ namespace TJAPlayer3 #region [ [PlayOption] ] //----------------------------- - case Eセクション種別.PlayOption: - { - if (str3.Equals("ShowChara")) - { + case Eセクション種別.PlayOption: { + if (str3.Equals("ShowChara")) { ShowChara = CConversion.bONorOFF(str4[0]); - } - else if (str3.Equals("ShowDancer")) - { + } else if (str3.Equals("ShowDancer")) { ShowDancer = CConversion.bONorOFF(str4[0]); - } - else if (str3.Equals("ShowRunner")) - { + } else if (str3.Equals("ShowRunner")) { ShowRunner = CConversion.bONorOFF(str4[0]); - } - else if (str3.Equals("ShowMob")) - { + } else if (str3.Equals("ShowMob")) { ShowMob = CConversion.bONorOFF(str4[0]); - } - else if (str3.Equals("ShowFooter")) - { + } else if (str3.Equals("ShowFooter")) { ShowFooter = CConversion.bONorOFF(str4[0]); - } - else if (str3.Equals("ShowPuchiChara")) - { + } else if (str3.Equals("ShowPuchiChara")) { ShowPuchiChara = CConversion.bONorOFF(str4[0]); - } - else if (str3.Equals("EnableCountDownTimer")) - { + } else if (str3.Equals("EnableCountDownTimer")) { this.bEnableCountdownTimer = CConversion.bONorOFF(str4[0]); } #region [ Invisible ] - else if (str3.Equals("DrumsInvisible")) - { + else if (str3.Equals("DrumsInvisible")) { this.eInvisible.Drums = (EInvisible)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 2, (int)this.eInvisible.Drums); } #endregion - else if (str3.Equals("DrumsReverse")) - { + else if (str3.Equals("DrumsReverse")) { this.bReverse.Drums = CConversion.bONorOFF(str4[0]); - } - else if (str3.Equals("DrumsPosition")) - { + } else if (str3.Equals("DrumsPosition")) { this.判定文字表示位置.Drums = (E判定文字表示位置)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 2, (int)this.判定文字表示位置.Drums); } @@ -3530,24 +3083,15 @@ namespace TJAPlayer3 #region [Scroll Speed] - else if (str3.Equals("DrumsScrollSpeed") || str3.Equals("DrumsScrollSpeed1P")) - { + else if (str3.Equals("DrumsScrollSpeed") || str3.Equals("DrumsScrollSpeed1P")) { this.nScrollSpeed[0] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 0x7cf, this.nScrollSpeed[0]); - } - else if (str3.Equals("DrumsScrollSpeed2P")) - { + } else if (str3.Equals("DrumsScrollSpeed2P")) { this.nScrollSpeed[1] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 0x7cf, this.nScrollSpeed[1]); - } - else if (str3.Equals("DrumsScrollSpeed3P")) - { + } else if (str3.Equals("DrumsScrollSpeed3P")) { this.nScrollSpeed[2] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 0x7cf, this.nScrollSpeed[2]); - } - else if (str3.Equals("DrumsScrollSpeed4P")) - { + } else if (str3.Equals("DrumsScrollSpeed4P")) { this.nScrollSpeed[3] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 0x7cf, this.nScrollSpeed[3]); - } - else if (str3.Equals("DrumsScrollSpeed5P")) - { + } else if (str3.Equals("DrumsScrollSpeed5P")) { this.nScrollSpeed[4] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 0x7cf, this.nScrollSpeed[4]); } @@ -3555,24 +3099,15 @@ namespace TJAPlayer3 #region [Timing Zones] - else if (str3.Equals("TimingZones1P")) - { + else if (str3.Equals("TimingZones1P")) { this.nTimingZones[0] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 4, this.nTimingZones[0]); - } - else if (str3.Equals("TimingZones2P")) - { + } else if (str3.Equals("TimingZones2P")) { this.nTimingZones[1] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 4, this.nTimingZones[1]); - } - else if (str3.Equals("TimingZones3P")) - { + } else if (str3.Equals("TimingZones3P")) { this.nTimingZones[2] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 4, this.nTimingZones[2]); - } - else if (str3.Equals("TimingZones4P")) - { + } else if (str3.Equals("TimingZones4P")) { this.nTimingZones[3] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 4, this.nTimingZones[3]); - } - else if (str3.Equals("TimingZones5P")) - { + } else if (str3.Equals("TimingZones5P")) { this.nTimingZones[4] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 4, this.nTimingZones[4]); } @@ -3581,24 +3116,15 @@ namespace TJAPlayer3 #region [Just] - else if (str3.Equals("Just") || str3.Equals("Just1P")) - { + else if (str3.Equals("Just") || str3.Equals("Just1P")) { this.bJust[0] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 2, this.bJust[0]); - } - else if (str3.Equals("Just2P")) - { + } else if (str3.Equals("Just2P")) { this.bJust[1] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 2, this.bJust[1]); - } - else if (str3.Equals("Just3P")) - { + } else if (str3.Equals("Just3P")) { this.bJust[2] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 2, this.bJust[2]); - } - else if (str3.Equals("Just4P")) - { + } else if (str3.Equals("Just4P")) { this.bJust[3] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 2, this.bJust[3]); - } - else if (str3.Equals("Just5P")) - { + } else if (str3.Equals("Just5P")) { this.bJust[4] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 2, this.bJust[4]); } @@ -3606,24 +3132,15 @@ namespace TJAPlayer3 #region [Hitsounds] - else if (str3.Equals("HitSounds1P")) - { + else if (str3.Equals("HitSounds1P")) { this.nHitSounds[0] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 9999999, this.nHitSounds[0]); - } - else if (str3.Equals("HitSounds2P")) - { + } else if (str3.Equals("HitSounds2P")) { this.nHitSounds[1] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 9999999, this.nHitSounds[1]); - } - else if (str3.Equals("HitSounds3P")) - { + } else if (str3.Equals("HitSounds3P")) { this.nHitSounds[2] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 9999999, this.nHitSounds[2]); - } - else if (str3.Equals("HitSounds4P")) - { + } else if (str3.Equals("HitSounds4P")) { this.nHitSounds[3] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 9999999, this.nHitSounds[3]); - } - else if (str3.Equals("HitSounds5P")) - { + } else if (str3.Equals("HitSounds5P")) { this.nHitSounds[4] = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 9999999, this.nHitSounds[4]); } @@ -3631,24 +3148,15 @@ namespace TJAPlayer3 #region [Gametype] - else if (str3.Equals("Gametype1P")) - { + else if (str3.Equals("Gametype1P")) { this.nGameType[0] = (EGameType)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 1, (int)this.nGameType[0]); - } - else if (str3.Equals("Gametype2P")) - { + } else if (str3.Equals("Gametype2P")) { this.nGameType[1] = (EGameType)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 1, (int)this.nGameType[1]); - } - else if (str3.Equals("Gametype3P")) - { + } else if (str3.Equals("Gametype3P")) { this.nGameType[2] = (EGameType)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 1, (int)this.nGameType[2]); - } - else if (str3.Equals("Gametype4P")) - { + } else if (str3.Equals("Gametype4P")) { this.nGameType[3] = (EGameType)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 1, (int)this.nGameType[3]); - } - else if (str3.Equals("Gametype5P")) - { + } else if (str3.Equals("Gametype5P")) { this.nGameType[4] = (EGameType)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 1, (int)this.nGameType[4]); } @@ -3656,24 +3164,15 @@ namespace TJAPlayer3 #region [Fun mods] - else if (str3.Equals("FunMods1P")) - { + else if (str3.Equals("FunMods1P")) { this.nFunMods[0] = (EFunMods)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, (int)EFunMods.TOTAL - 1, (int)this.nFunMods[0]); - } - else if (str3.Equals("FunMods2P")) - { + } else if (str3.Equals("FunMods2P")) { this.nFunMods[1] = (EFunMods)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, (int)EFunMods.TOTAL - 1, (int)this.nFunMods[1]); - } - else if (str3.Equals("FunMods3P")) - { + } else if (str3.Equals("FunMods3P")) { this.nFunMods[2] = (EFunMods)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, (int)EFunMods.TOTAL - 1, (int)this.nFunMods[2]); - } - else if (str3.Equals("FunMods4P")) - { + } else if (str3.Equals("FunMods4P")) { this.nFunMods[3] = (EFunMods)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, (int)EFunMods.TOTAL - 1, (int)this.nFunMods[3]); - } - else if (str3.Equals("FunMods5P")) - { + } else if (str3.Equals("FunMods5P")) { this.nFunMods[4] = (EFunMods)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, (int)EFunMods.TOTAL - 1, (int)this.nFunMods[4]); } @@ -3681,24 +3180,15 @@ namespace TJAPlayer3 #region [Stealh] - else if (str3.Equals("TaikoStealth1P") || str3.Equals("TaikoStealth")) - { + else if (str3.Equals("TaikoStealth1P") || str3.Equals("TaikoStealth")) { this.eSTEALTH[0] = (EStealthMode)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 3, (int)this.eSTEALTH[0]); - } - else if (str3.Equals("TaikoStealth2P")) - { + } else if (str3.Equals("TaikoStealth2P")) { this.eSTEALTH[1] = (EStealthMode)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 3, (int)this.eSTEALTH[1]); - } - else if (str3.Equals("TaikoStealth3P")) - { + } else if (str3.Equals("TaikoStealth3P")) { this.eSTEALTH[2] = (EStealthMode)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 3, (int)this.eSTEALTH[2]); - } - else if (str3.Equals("TaikoStealth4P")) - { + } else if (str3.Equals("TaikoStealth4P")) { this.eSTEALTH[3] = (EStealthMode)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 3, (int)this.eSTEALTH[3]); - } - else if (str3.Equals("TaikoStealth5P")) - { + } else if (str3.Equals("TaikoStealth5P")) { this.eSTEALTH[4] = (EStealthMode)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 3, (int)this.eSTEALTH[4]); } @@ -3706,24 +3196,15 @@ namespace TJAPlayer3 #region [Random/Mirror] - else if (str3.Equals("TaikoRandom1P") || str3.Equals("TaikoRandom")) - { + else if (str3.Equals("TaikoRandom1P") || str3.Equals("TaikoRandom")) { this.eRandom[0] = (ERandomMode)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 4, (int)this.eRandom[0]); - } - else if (str3.Equals("TaikoRandom2P")) - { + } else if (str3.Equals("TaikoRandom2P")) { this.eRandom[1] = (ERandomMode)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 4, (int)this.eRandom[1]); - } - else if (str3.Equals("TaikoRandom3P")) - { + } else if (str3.Equals("TaikoRandom3P")) { this.eRandom[2] = (ERandomMode)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 4, (int)this.eRandom[2]); - } - else if (str3.Equals("TaikoRandom4P")) - { + } else if (str3.Equals("TaikoRandom4P")) { this.eRandom[3] = (ERandomMode)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 4, (int)this.eRandom[3]); - } - else if (str3.Equals("TaikoRandom5P")) - { + } else if (str3.Equals("TaikoRandom5P")) { this.eRandom[4] = (ERandomMode)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 4, (int)this.eRandom[4]); } @@ -3734,98 +3215,53 @@ namespace TJAPlayer3 - else if ( str3.Equals( "PlaySpeed" ) ) - { - this.nSongSpeed = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 5, 400, this.nSongSpeed ); - } - else if (str3.Equals("PlaySpeedNotEqualOneNoSound")) - { + else if (str3.Equals("PlaySpeed")) { + this.nSongSpeed = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 5, 400, this.nSongSpeed); + } else if (str3.Equals("PlaySpeedNotEqualOneNoSound")) { this.b演奏速度が一倍速であるとき以外音声を再生しない = CConversion.bONorOFF(str4[0]); - } - - else if ( str3.Equals( "Risky" ) ) // #23559 2011.6.23 yyagi - { - this.nRisky = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 10, this.nRisky ); - } - else if ( str3.Equals( "DrumsTight" ) ) - { - this.bTight = CConversion.bONorOFF( str4[ 0 ] ); - } - else if ( str3.Equals( "BranchGuide" ) ) - { - this.bBranchGuide = CConversion.bONorOFF( str4[ 0 ] ); - } - else if ( str3.Equals( "DefaultCourse" ) ) //2017.01.30 DD - { - this.nDefaultCourse = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 5, this.nDefaultCourse ); - } - else if ( str3.Equals( "ScoreMode" ) ) - { - this.nScoreMode = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 3, this.nScoreMode ); - } - else if ( str3.Equals( "HispeedRandom" ) ) - { - this.bHispeedRandom = CConversion.bONorOFF( str4[ 0 ] ); - } - else if ( str3.Equals( "BigNotesWaitTime" ) ) - { - this.nBigNoteWaitTimems = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 1, 100, this.nBigNoteWaitTimems ); - } - else if ( str3.Equals( "BigNotesJudge" ) ) - { - this.bJudgeBigNotes = CConversion.bONorOFF( str4[ 0 ] ); - } - else if ( str3.Equals( "ForceNormalGauge" ) ) - { - this.bForceNormalGauge = CConversion.bONorOFF( str4[ 0 ] ); - } - else if ( str3.Equals( "BranchAnime" ) ) - { - this.nBranchAnime = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 1, this.nBranchAnime ); - } - else if ( str3.Equals( "NoInfo" ) ) - { - this.bNoInfo = CConversion.bONorOFF( str4[ 0 ] ); - } - else if ( str3.Equals( "DefaultSongSort" ) ) - { - this.nDefaultSongSort = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 2, this.nDefaultSongSort ); - } - else if (str3.Equals("RecentlyPlayedMax")) - { + } else if (str3.Equals("Risky")) // #23559 2011.6.23 yyagi + { + this.nRisky = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 10, this.nRisky); + } else if (str3.Equals("DrumsTight")) { + this.bTight = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("BranchGuide")) { + this.bBranchGuide = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("DefaultCourse")) //2017.01.30 DD + { + this.nDefaultCourse = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 5, this.nDefaultCourse); + } else if (str3.Equals("ScoreMode")) { + this.nScoreMode = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 3, this.nScoreMode); + } else if (str3.Equals("HispeedRandom")) { + this.bHispeedRandom = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("BigNotesWaitTime")) { + this.nBigNoteWaitTimems = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 1, 100, this.nBigNoteWaitTimems); + } else if (str3.Equals("BigNotesJudge")) { + this.bJudgeBigNotes = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("ForceNormalGauge")) { + this.bForceNormalGauge = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("BranchAnime")) { + this.nBranchAnime = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 1, this.nBranchAnime); + } else if (str3.Equals("NoInfo")) { + this.bNoInfo = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("DefaultSongSort")) { + this.nDefaultSongSort = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 2, this.nDefaultSongSort); + } else if (str3.Equals("RecentlyPlayedMax")) { this.nRecentlyPlayedMax = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 9999, this.nRecentlyPlayedMax); - } - else if( str3.Equals( "GameMode" ) ) - { - this.eGameMode = (EGame) CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 2, (int) this.eGameMode ); - } - else if (str3.Equals("TokkunSkipMeasures")) - { + } else if (str3.Equals("GameMode")) { + this.eGameMode = (EGame)CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 2, (int)this.eGameMode); + } else if (str3.Equals("TokkunSkipMeasures")) { this.TokkunSkipMeasures = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 9999, this.TokkunSkipMeasures); - } - else if (str3.Equals(nameof(TokkunMashInterval))) - { + } else if (str3.Equals(nameof(TokkunMashInterval))) { this.TokkunMashInterval = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 0, 9999, this.TokkunMashInterval); - } - else if( str3.Equals( "JudgeCountDisplay" ) ) - { - this.bJudgeCountDisplay = CConversion.bONorOFF( str4[ 0 ] ); - } - else if (str3.Equals("ShowExExtraAnime")) - { + } else if (str3.Equals("JudgeCountDisplay")) { + this.bJudgeCountDisplay = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("ShowExExtraAnime")) { this.ShowExExtraAnime = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("PlayerCount")) { + this.nPlayerCount = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, 1, 5, this.nPlayerCount); + } else if (str3.Equals(nameof(ShinuchiMode))) { + ShinuchiMode = CConversion.bONorOFF(str4[0]); } - - - - else if ( str3.Equals( "PlayerCount" ) ) - { - this.nPlayerCount = CConversion.n値を文字列から取得して範囲内に丸めて返す( str4, 1, 5, this.nPlayerCount ); - } - else if(str3.Equals(nameof(ShinuchiMode))) - { - ShinuchiMode = CConversion.bONorOFF(str4[0]); - } continue; } //----------------------------- @@ -3833,8 +3269,7 @@ namespace TJAPlayer3 #region [ [ViewerOption] ] //----------------------------- - case Eセクション種別.ViewerOption: - { + case Eセクション種別.ViewerOption: { /* if ( str3.Equals( "ViewerDrumsScrollSpeed" ) ) { @@ -3849,25 +3284,16 @@ namespace TJAPlayer3 this.nViewerScrollSpeed.Bass = C変換.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 1999, this.nViewerScrollSpeed.Bass ); } */ - if ( str3.Equals( "ViewerVSyncWait" ) ) - { - this.bViewerVSyncWait = CConversion.bONorOFF( str4[ 0 ] ); - } - else if ( str3.Equals( "ViewerShowDebugStatus" ) ) - { - this.bViewerShowDebugStatus = CConversion.bONorOFF( str4[ 0 ] ); - } - else if ( str3.Equals( "ViewerTimeStretch" ) ) - { - this.bViewerTimeStretch = CConversion.bONorOFF( str4[ 0 ] ); - } - else if ( str3.Equals( "ViewerGuitar" ) ) - { - this.bViewerGuitar有効 = CConversion.bONorOFF( str4[ 0 ] ); - } - else if ( str3.Equals( "ViewerDrums" ) ) - { - this.bViewerDrums有効 = CConversion.bONorOFF( str4[ 0 ] ); + if (str3.Equals("ViewerVSyncWait")) { + this.bViewerVSyncWait = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("ViewerShowDebugStatus")) { + this.bViewerShowDebugStatus = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("ViewerTimeStretch")) { + this.bViewerTimeStretch = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("ViewerGuitar")) { + this.bViewerGuitar有効 = CConversion.bONorOFF(str4[0]); + } else if (str3.Equals("ViewerDrums")) { + this.bViewerDrums有効 = CConversion.bONorOFF(str4[0]); } continue; } @@ -3877,13 +3303,10 @@ namespace TJAPlayer3 #region [ [GUID] ] //----------------------------- case Eセクション種別.GUID: - if( str3.Equals( "JoystickID" ) ) - { - this.tJoystickIDの取得( str4 ); - } - else if( str3.Equals( "GamepadID" ) ) - { - this.tGamepadIDの取得( str4 ); + if (str3.Equals("JoystickID")) { + this.tJoystickIDの取得(str4); + } else if (str3.Equals("GamepadID")) { + this.tGamepadIDの取得(str4); } continue; //----------------------------- @@ -3891,128 +3314,79 @@ namespace TJAPlayer3 #region [ [DrumsKeyAssign] ] //----------------------------- - case Eセクション種別.DrumsKeyAssign: - { - if( str3.Equals( "LeftRed" ) ) - { - this.tキーの読み出しと設定( str4, this.KeyAssign.Drums.LeftRed ); - } - else if( str3.Equals( "RightRed" ) ) - { - this.tキーの読み出しと設定( str4, this.KeyAssign.Drums.RightRed ); - } - else if( str3.Equals( "LeftBlue" ) ) // #27029 2012.1.4 from - { // - this.tキーの読み出しと設定( str4, this.KeyAssign.Drums.LeftBlue ); // - } // - else if( str3.Equals( "RightBlue" ) ) // #27029 2012.1.4 from - { // - this.tキーの読み出しと設定( str4, this.KeyAssign.Drums.RightBlue ); // - } - - else if( str3.Equals( "LeftRed2P" ) ) - { - this.tキーの読み出しと設定( str4, this.KeyAssign.Drums.LeftRed2P ); - } - else if( str3.Equals( "RightRed2P" ) ) - { - this.tキーの読み出しと設定( str4, this.KeyAssign.Drums.RightRed2P ); - } - else if( str3.Equals( "LeftBlue2P" ) ) // #27029 2012.1.4 from - { // - this.tキーの読み出しと設定( str4, this.KeyAssign.Drums.LeftBlue2P ); // - } // - else if( str3.Equals( "RightBlue2P" ) ) // #27029 2012.1.4 from - { // - this.tキーの読み出しと設定( str4, this.KeyAssign.Drums.RightBlue2P ); // - } - - else if (str3.Equals("LeftRed3P")) - { + case Eセクション種別.DrumsKeyAssign: { + if (str3.Equals("LeftRed")) { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.LeftRed); + } else if (str3.Equals("RightRed")) { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.RightRed); + } else if (str3.Equals("LeftBlue")) // #27029 2012.1.4 from + { // + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.LeftBlue); // + } // + else if (str3.Equals("RightBlue")) // #27029 2012.1.4 from + { // + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.RightBlue); // + } else if (str3.Equals("LeftRed2P")) { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.LeftRed2P); + } else if (str3.Equals("RightRed2P")) { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.RightRed2P); + } else if (str3.Equals("LeftBlue2P")) // #27029 2012.1.4 from + { // + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.LeftBlue2P); // + } // + else if (str3.Equals("RightBlue2P")) // #27029 2012.1.4 from + { // + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.RightBlue2P); // + } else if (str3.Equals("LeftRed3P")) { this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.LeftRed3P); - } - else if (str3.Equals("RightRed3P")) - { + } else if (str3.Equals("RightRed3P")) { this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.RightRed3P); - } - else if (str3.Equals("LeftBlue3P")) // #27029 2012.1.4 from - { // + } else if (str3.Equals("LeftBlue3P")) // #27029 2012.1.4 from + { // this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.LeftBlue3P); // } // - else if (str3.Equals("RightBlue3P")) // #27029 2012.1.4 from - { // + else if (str3.Equals("RightBlue3P")) // #27029 2012.1.4 from + { // this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.RightBlue3P); // - } - - else if (str3.Equals("LeftRed4P")) - { + } else if (str3.Equals("LeftRed4P")) { this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.LeftRed4P); - } - else if (str3.Equals("RightRed4P")) - { + } else if (str3.Equals("RightRed4P")) { this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.RightRed4P); - } - else if (str3.Equals("LeftBlue4P")) // #27029 2012.1.4 from - { // + } else if (str3.Equals("LeftBlue4P")) // #27029 2012.1.4 from + { // this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.LeftBlue4P); // } // - else if (str3.Equals("RightBlue4P")) // #27029 2012.1.4 from - { // + else if (str3.Equals("RightBlue4P")) // #27029 2012.1.4 from + { // this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.RightBlue4P); // - } - - else if (str3.Equals("LeftRed5P")) - { + } else if (str3.Equals("LeftRed5P")) { this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.LeftRed5P); - } - else if (str3.Equals("RightRed5P")) - { + } else if (str3.Equals("RightRed5P")) { this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.RightRed5P); - } - else if (str3.Equals("LeftBlue5P")) // #27029 2012.1.4 from - { // + } else if (str3.Equals("LeftBlue5P")) // #27029 2012.1.4 from + { // this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.LeftBlue5P); // } // - else if (str3.Equals("RightBlue5P")) // #27029 2012.1.4 from - { // + else if (str3.Equals("RightBlue5P")) // #27029 2012.1.4 from + { // this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.RightBlue5P); // - } - - else if (str3.Equals("Clap")) - { + } else if (str3.Equals("Clap")) { this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.Clap); - } - else if (str3.Equals("Clap2P")) - { + } else if (str3.Equals("Clap2P")) { this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.Clap2P); - } - else if (str3.Equals("Clap3P")) - { + } else if (str3.Equals("Clap3P")) { this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.Clap3P); - } - else if (str3.Equals("Clap4P")) - { + } else if (str3.Equals("Clap4P")) { this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.Clap4P); - } - else if (str3.Equals("Clap5P")) - { + } else if (str3.Equals("Clap5P")) { this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.Clap5P); - } - - else if (str3.Equals("Decide")) - { + } else if (str3.Equals("Decide")) { this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.Decide); - } - else if (str3.Equals("Cancel")) - { + } else if (str3.Equals("Cancel")) { this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.Cancel); - } - else if (str3.Equals("LeftChange")) - { + } else if (str3.Equals("LeftChange")) { this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.LeftChange); - } - else if (str3.Equals("RightChange")) - { + } else if (str3.Equals("RightChange")) { this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.RightChange); } @@ -4023,173 +3397,139 @@ namespace TJAPlayer3 #region [ [SystemKeyAssign] ] //----------------------------- - case Eセクション種別.SystemKeyAssign: - { - switch (str3) - { - case "Capture": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.System.Capture); - break; - } - case "SongVolumeIncrease": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.System.SongVolIncrease); - break; - } - case "SongVolumeDecrease": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.System.SongVolDecrease); - break; - } - case "DisplayHits": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.System.DisplayHits); - break; - } - case "DisplayDebug": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.System.DisplayDebug); - break; - } - case "QuickConfig": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.System.QuickConfig); - break; - } - case "NewHeya": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.System.NewHeya); - break; - } - case "SortSongs": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.System.SortSongs); - break; - } - case "ToggleAutoP1": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.System.ToggleAutoP1); - break; - } - case "ToggleAutoP2": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.System.ToggleAutoP2); - break; - } - case "ToggleTrainingMode": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.System.ToggleTrainingMode); - break; - } - case "CycleVideoDisplayMode": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.System.CycleVideoDisplayMode); - break; - } - } - continue; - } - #endregion - #region [ [TrainingKeyAssign] ] - case Eセクション種別.TrainingKeyAssign: - { - switch (str3) - { - case "TrainingIncreaseScrollSpeed": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingIncreaseScrollSpeed); - break; - } - case "TrainingDecreaseScrollSpeed": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingDecreaseScrollSpeed); - break; - } - case "TrainingIncreaseSongSpeed": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingIncreaseSongSpeed); - break; - } - case "TrainingDecreaseSongSpeed": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingDecreaseSongSpeed); - break; - } - case "TrainingToggleAuto": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingToggleAuto); - break; - } - case "TrainingBranchNormal": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingBranchNormal); - break; - } - case "TrainingBranchExpert": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingBranchExpert); - break; - } - case "TrainingBranchMaster": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingBranchMaster); - break; - } - case "TrainingPause": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingPause); - break; - } - case "TrainingBookmark": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingBookmark); - break; - } - case "TrainingMoveForwardMeasure": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingMoveForwardMeasure); - break; - } - case "TrainingMoveBackMeasure": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingMoveBackMeasure); - break; - } - case "TrainingSkipForwardMeasure": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingSkipForwardMeasure); - break; - } - case "TrainingSkipBackMeasure": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingSkipBackMeasure); - break; - } - case "TrainingJumpToFirstMeasure": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingJumpToFirstMeasure); - break; - } - case "TrainingJumpToLastMeasure": - { - this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingJumpToLastMeasure); - break; + case Eセクション種別.SystemKeyAssign: { + switch (str3) { + case "Capture": { + this.tキーの読み出しと設定(str4, this.KeyAssign.System.Capture); + break; + } + case "SongVolumeIncrease": { + this.tキーの読み出しと設定(str4, this.KeyAssign.System.SongVolIncrease); + break; + } + case "SongVolumeDecrease": { + this.tキーの読み出しと設定(str4, this.KeyAssign.System.SongVolDecrease); + break; + } + case "DisplayHits": { + this.tキーの読み出しと設定(str4, this.KeyAssign.System.DisplayHits); + break; + } + case "DisplayDebug": { + this.tキーの読み出しと設定(str4, this.KeyAssign.System.DisplayDebug); + break; + } + case "QuickConfig": { + this.tキーの読み出しと設定(str4, this.KeyAssign.System.QuickConfig); + break; + } + case "NewHeya": { + this.tキーの読み出しと設定(str4, this.KeyAssign.System.NewHeya); + break; + } + case "SortSongs": { + this.tキーの読み出しと設定(str4, this.KeyAssign.System.SortSongs); + break; + } + case "ToggleAutoP1": { + this.tキーの読み出しと設定(str4, this.KeyAssign.System.ToggleAutoP1); + break; + } + case "ToggleAutoP2": { + this.tキーの読み出しと設定(str4, this.KeyAssign.System.ToggleAutoP2); + break; + } + case "ToggleTrainingMode": { + this.tキーの読み出しと設定(str4, this.KeyAssign.System.ToggleTrainingMode); + break; + } + case "CycleVideoDisplayMode": { + this.tキーの読み出しと設定(str4, this.KeyAssign.System.CycleVideoDisplayMode); + break; + } } + continue; } - continue; - } - //----------------------------- #endregion + #region [ [TrainingKeyAssign] ] + case Eセクション種別.TrainingKeyAssign: { + switch (str3) { + case "TrainingIncreaseScrollSpeed": { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingIncreaseScrollSpeed); + break; + } + case "TrainingDecreaseScrollSpeed": { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingDecreaseScrollSpeed); + break; + } + case "TrainingIncreaseSongSpeed": { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingIncreaseSongSpeed); + break; + } + case "TrainingDecreaseSongSpeed": { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingDecreaseSongSpeed); + break; + } + case "TrainingToggleAuto": { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingToggleAuto); + break; + } + case "TrainingBranchNormal": { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingBranchNormal); + break; + } + case "TrainingBranchExpert": { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingBranchExpert); + break; + } + case "TrainingBranchMaster": { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingBranchMaster); + break; + } + case "TrainingPause": { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingPause); + break; + } + case "TrainingBookmark": { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingBookmark); + break; + } + case "TrainingMoveForwardMeasure": { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingMoveForwardMeasure); + break; + } + case "TrainingMoveBackMeasure": { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingMoveBackMeasure); + break; + } + case "TrainingSkipForwardMeasure": { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingSkipForwardMeasure); + break; + } + case "TrainingSkipBackMeasure": { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingSkipBackMeasure); + break; + } + case "TrainingJumpToFirstMeasure": { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingJumpToFirstMeasure); + break; + } + case "TrainingJumpToLastMeasure": { + this.tキーの読み出しと設定(str4, this.KeyAssign.Drums.TrainingJumpToLastMeasure); + break; + } + } + continue; + } + //----------------------------- + #endregion } } } continue; - } - catch ( Exception exception ) - { - Trace.TraceError( exception.ToString() ); - Trace.TraceError( "例外が発生しましたが処理を継続します。 (93c4c5cd-4996-4e8c-a82f-a179ff590b44)" ); + } catch (Exception exception) { + Trace.TraceError(exception.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (93c4c5cd-4996-4e8c-a82f-a179ff590b44)"); continue; } } @@ -4200,8 +3540,7 @@ namespace TJAPlayer3 #region [ private ] //----------------- - private enum Eセクション種別 - { + private enum Eセクション種別 { Unknown, System, Log, @@ -4221,110 +3560,89 @@ namespace TJAPlayer3 private bool bConfigIniが存在している; private string ConfigIniファイル名; - private void tJoystickIDの取得( string strキー記述 ) - { - string[] strArray = strキー記述.Split( new char[] { ',' } ); - if( strArray.Length >= 2 ) - { + private void tJoystickIDの取得(string strキー記述) { + string[] strArray = strキー記述.Split(new char[] { ',' }); + if (strArray.Length >= 2) { int result = 0; - if( ( int.TryParse( strArray[ 0 ], out result ) && ( result >= 0 ) ) && ( result <= 9 ) ) - { - if( this.dicJoystick.ContainsKey( result ) ) - { - this.dicJoystick.Remove( result ); + if ((int.TryParse(strArray[0], out result) && (result >= 0)) && (result <= 9)) { + if (this.dicJoystick.ContainsKey(result)) { + this.dicJoystick.Remove(result); } - this.dicJoystick.Add( result, strArray[ 1 ] ); + this.dicJoystick.Add(result, strArray[1]); } } } - private void tGamepadIDの取得( string strキー記述 ) - { - string[] strArray = strキー記述.Split( new char[] { ',' } ); - if( strArray.Length >= 2 ) - { + private void tGamepadIDの取得(string strキー記述) { + string[] strArray = strキー記述.Split(new char[] { ',' }); + if (strArray.Length >= 2) { int result = 0; - if( ( int.TryParse( strArray[ 0 ], out result ) && ( result >= 0 ) ) && ( result <= 9 ) ) - { - if( this.dicGamepad.ContainsKey( result ) ) - { - this.dicGamepad.Remove( result ); + if ((int.TryParse(strArray[0], out result) && (result >= 0)) && (result <= 9)) { + if (this.dicGamepad.ContainsKey(result)) { + this.dicGamepad.Remove(result); } - this.dicGamepad.Add( result, strArray[ 1 ] ); + this.dicGamepad.Add(result, strArray[1]); } } } - private void tキーアサインを全部クリアする() - { + private void tキーアサインを全部クリアする() { 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 ); + 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 tキーの書き出し( StreamWriter sw, CKeyAssign.STKEYASSIGN[] assign ) - { + private void tキーの書き出し(StreamWriter sw, CKeyAssign.STKEYASSIGN[] assign) { bool flag = true; - for( int i = 0; i < 0x10; i++ ) - { - if( assign[ i ].入力デバイス == EInputDevice.Unknown ) - { + for (int i = 0; i < 0x10; i++) { + if (assign[i].入力デバイス == EInputDevice.Unknown) { continue; } - if( !flag ) - { - sw.Write( ',' ); + if (!flag) { + sw.Write(','); } flag = false; - switch( assign[ i ].入力デバイス ) - { + switch (assign[i].入力デバイス) { case EInputDevice.Keyboard: - sw.Write( 'K' ); + sw.Write('K'); break; case EInputDevice.MIDIInput: - sw.Write( 'M' ); + sw.Write('M'); break; case EInputDevice.Joypad: - sw.Write( 'J' ); + sw.Write('J'); break; case EInputDevice.Gamepad: - sw.Write( 'G' ); + sw.Write('G'); break; case EInputDevice.Mouse: - sw.Write( 'N' ); + sw.Write('N'); break; } - sw.Write( "{0}{1}", "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".Substring( assign[ i ].ID, 1 ), assign[ i ].コード ); // #24166 2011.1.15 yyagi: to support ID > 10, change 2nd character from Decimal to 36-numeral system. (e.g. J1023 -> JA23) + sw.Write("{0}{1}", "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".Substring(assign[i].ID, 1), assign[i].コード); // #24166 2011.1.15 yyagi: to support ID > 10, change 2nd character from Decimal to 36-numeral system. (e.g. J1023 -> JA23) } } - private void tキーの読み出しと設定( string strキー記述, CKeyAssign.STKEYASSIGN[] assign ) - { - string[] strArray = strキー記述.Split( new char[] { ',' } ); - for( int i = 0; ( i < strArray.Length ) && ( i < 0x10 ); i++ ) - { + private void tキーの読み出しと設定(string strキー記述, CKeyAssign.STKEYASSIGN[] assign) { + string[] strArray = strキー記述.Split(new char[] { ',' }); + for (int i = 0; (i < strArray.Length) && (i < 0x10); i++) { EInputDevice e入力デバイス; int id; int code; - string str = strArray[ i ].Trim().ToUpper(); - if ( str.Length >= 3 ) - { + string str = strArray[i].Trim().ToUpper(); + if (str.Length >= 3) { e入力デバイス = EInputDevice.Unknown; - switch ( str[ 0 ] ) - { + switch (str[0]) { case 'J': e入力デバイス = EInputDevice.Joypad; break; - + case 'G': e入力デバイス = EInputDevice.Gamepad; break; @@ -4344,23 +3662,19 @@ namespace TJAPlayer3 e入力デバイス = EInputDevice.Mouse; break; } - } - else - { + } else { continue; } - id = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".IndexOf( str[ 1 ] ); // #24166 2011.1.15 yyagi: to support ID > 10, change 2nd character from Decimal to 36-numeral system. (e.g. J1023 -> JA23) - if( ( ( id >= 0 ) && int.TryParse( str.Substring( 2 ), out code ) ) && ( ( code >= 0 ) && ( code <= 0xff ) ) ) - { + id = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".IndexOf(str[1]); // #24166 2011.1.15 yyagi: to support ID > 10, change 2nd character from Decimal to 36-numeral system. (e.g. J1023 -> JA23) + if (((id >= 0) && int.TryParse(str.Substring(2), out code)) && ((code >= 0) && (code <= 0xff))) { //this.t指定した入力が既にアサイン済みである場合はそれを全削除する( e入力デバイス, id, code ); - assign[ i ].入力デバイス = e入力デバイス; - assign[ i ].ID = id; - assign[ i ].コード = code; + assign[i].入力デバイス = e入力デバイス; + assign[i].ID = id; + assign[i].コード = code; } } } - private void tデフォルトのキーアサインに設定する() - { + private void tデフォルトのキーアサインに設定する() { this.tキーアサインを全部クリアする(); string strDefaultKeyAssign = @" @@ -4427,29 +3741,26 @@ TrainingSkipBackMeasure=K0108 TrainingJumpToFirstMeasure=K070 TrainingJumpToLastMeasure=K051 "; - t文字列から読み込み( strDefaultKeyAssign ); + t文字列から読み込み(strDefaultKeyAssign); } //----------------- #endregion - public event PropertyChangedEventHandler PropertyChanged; + public event PropertyChangedEventHandler PropertyChanged; - private bool SetProperty(ref T storage, T value, string propertyName = null) - { - if (Equals(storage, value)) - { - return false; - } + private bool SetProperty(ref T storage, T value, string propertyName = null) { + if (Equals(storage, value)) { + return false; + } - storage = value; - OnPropertyChanged(propertyName); - return true; - } + 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/CCrypto.cs b/OpenTaiko/src/Common/CCrypto.cs index c2f641f9..884f2b53 100644 --- a/OpenTaiko/src/Common/CCrypto.cs +++ b/OpenTaiko/src/Common/CCrypto.cs @@ -1,34 +1,25 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using System.Security.Cryptography; using System.Text; -using System.Threading.Tasks; -using System.Security.Cryptography; -namespace TJAPlayer3 -{ - internal class CCrypto - { - internal static readonly char[] chars = - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".ToCharArray(); +namespace TJAPlayer3 { + internal class CCrypto { + internal static readonly char[] chars = + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".ToCharArray(); - 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; + 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]); - } + result.Append(chars[idx]); + } - return result.ToString(); - } - } + return result.ToString(); + } + } } diff --git a/OpenTaiko/src/Common/CDTXVersion.cs b/OpenTaiko/src/Common/CDTXVersion.cs index a83090ce..7c4cc11a 100644 --- a/OpenTaiko/src/Common/CDTXVersion.cs +++ b/OpenTaiko/src/Common/CDTXVersion.cs @@ -1,23 +1,18 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Text; -namespace TJAPlayer3 -{ +namespace TJAPlayer3 { /// /// DTXMania のバージョン。 /// 例1:"078b" → 整数部=078, 小数部=2000000 ('英字'+'yymmdd') /// 例2:"078a(100124)" → 整数部=078, 小数部=1100124 ('英字'+'yymmdd') /// - public class CDTXVersion - { + public class CDTXVersion { // プロパティ /// /// バージョンが未知のときに true になる。 /// - public bool Unknown - { + public bool Unknown { get; private set; } @@ -40,159 +35,129 @@ namespace TJAPlayer3 // コンストラクタ - public CDTXVersion() - { + public CDTXVersion() { this.n整数部 = 0; this.n小数部 = 0; this.Unknown = true; } - public CDTXVersion( int n整数部 ) - { + public CDTXVersion(int n整数部) { this.n整数部 = n整数部; this.n小数部 = 0; this.Unknown = false; } - public CDTXVersion( string Version ) - { + public CDTXVersion(string Version) { this.n整数部 = 0; this.n小数部 = 0; this.Unknown = true; - - if( Version.ToLower().Equals( "unknown" ) ) - { + + if (Version.ToLower().Equals("unknown")) { this.Unknown = true; - } - else - { + } else { int num = 0; int length = Version.Length; - if( ( num < length ) && char.IsDigit( Version[ num ] ) ) - { + if ((num < length) && char.IsDigit(Version[num])) { // 整数部 取得 - while( ( num < length ) && char.IsDigit( Version[ num ] ) ) - { - this.n整数部 = ( this.n整数部 * 10 ) + CDTXVersion.DIG10.IndexOf( Version[ num++ ] ); + while ((num < length) && char.IsDigit(Version[num])) { + this.n整数部 = (this.n整数部 * 10) + CDTXVersion.DIG10.IndexOf(Version[num++]); } // 小数部(1)英字部分 取得 - while( ( num < length ) && ( ( Version[ num ] == ' ' ) || ( Version[ num ] == '(' ) ) ) - { + while ((num < length) && ((Version[num] == ' ') || (Version[num] == '('))) { num++; } - if( ( num < length ) && ( CDTXVersion.DIG36.IndexOf( Version[ num ] ) >= 10 ) ) - { - this.n小数部 = CDTXVersion.DIG36.IndexOf( Version[ num++ ] ) - 10; - if( this.n小数部 >= 0x1a ) - { + if ((num < length) && (CDTXVersion.DIG36.IndexOf(Version[num]) >= 10)) { + this.n小数部 = CDTXVersion.DIG36.IndexOf(Version[num++]) - 10; + if (this.n小数部 >= 0x1a) { this.n小数部 -= 0x1a; } this.n小数部++; } // 小数部(2)日付部分(yymmdd) 取得 - while( ( num < length ) && ( ( Version[ num ] == ' ' ) || ( Version[ num ] == '(' ) ) ) - { + while ((num < length) && ((Version[num] == ' ') || (Version[num] == '('))) { num++; } - for( int i = 0; i < 6; i++ ) - { + for (int i = 0; i < 6; i++) { this.n小数部 *= 10; - if( ( num < length ) && char.IsDigit( Version[ num ] ) ) - { - this.n小数部 += CDTXVersion.DIG10.IndexOf( Version[ num ] ); + if ((num < length) && char.IsDigit(Version[num])) { + this.n小数部 += CDTXVersion.DIG10.IndexOf(Version[num]); } num++; } this.Unknown = false; - } - else - { + } else { this.Unknown = true; } } } - public CDTXVersion( int n整数部, int n小数部 ) - { + public CDTXVersion(int n整数部, int n小数部) { this.n整数部 = n整数部; this.n小数部 = n小数部; this.Unknown = false; } - + // メソッド - - public string toString() - { - var result = new StringBuilder( 32 ); + + public string toString() { + var result = new StringBuilder(32); // 整数部 - result.Append( this.n整数部.ToString( "000" ) ); + result.Append(this.n整数部.ToString("000")); // 英字部分(あれば) - if( this.n小数部 >= 1000000 ) - { - int n英字 = Math.Min( this.n小数部 / 1000000, 26 ); // 1~26 - result.Append( CDTXVersion.DIG36[ 10 + ( n英字 - 1 ) ] ); + if (this.n小数部 >= 1000000) { + int n英字 = Math.Min(this.n小数部 / 1000000, 26); // 1~26 + result.Append(CDTXVersion.DIG36[10 + (n英字 - 1)]); } // 日付部分(あれば) int n日付 = this.n小数部 % 1000000; - if( n日付 > 0 ) - { - result.Append( '(' ); - result.Append( n日付.ToString( "000000" ) ); - result.Append( ')' ); + if (n日付 > 0) { + result.Append('('); + result.Append(n日付.ToString("000000")); + result.Append(')'); } return result.ToString(); } - public static bool operator ==( CDTXVersion x, CDTXVersion y ) - { - return ( ( ( x.n整数部 == y.n整数部 ) && ( x.n小数部 == y.n小数部 ) ) && ( x.Unknown == y.Unknown ) ); + public static bool operator ==(CDTXVersion x, CDTXVersion y) { + return (((x.n整数部 == y.n整数部) && (x.n小数部 == y.n小数部)) && (x.Unknown == y.Unknown)); } - public static bool operator >( CDTXVersion x, CDTXVersion y ) - { - return ( ( x.n整数部 > y.n整数部 ) || ( ( x.n整数部 == y.n整数部 ) && ( x.n小数部 > y.n小数部 ) ) ); + public static bool operator >(CDTXVersion x, CDTXVersion y) { + return ((x.n整数部 > y.n整数部) || ((x.n整数部 == y.n整数部) && (x.n小数部 > y.n小数部))); } - public static bool operator >=( CDTXVersion x, CDTXVersion y ) - { - return ( ( x.n整数部 > y.n整数部 ) || ( ( x.n整数部 == y.n整数部 ) && ( x.n小数部 >= y.n小数部 ) ) ); + public static bool operator >=(CDTXVersion x, CDTXVersion y) { + return ((x.n整数部 > y.n整数部) || ((x.n整数部 == y.n整数部) && (x.n小数部 >= y.n小数部))); } - public static bool operator !=( CDTXVersion x, CDTXVersion y ) - { - if( ( x.n整数部 == y.n整数部 ) && ( x.n小数部 == y.n小数部 ) ) - { - return ( x.Unknown != y.Unknown ); + public static bool operator !=(CDTXVersion x, CDTXVersion y) { + if ((x.n整数部 == y.n整数部) && (x.n小数部 == y.n小数部)) { + return (x.Unknown != y.Unknown); } return true; } - public static bool operator <( CDTXVersion x, CDTXVersion y ) - { - return ( ( x.n整数部 < y.n整数部 ) || ( ( x.n整数部 == y.n整数部 ) && ( x.n小数部 < y.n小数部 ) ) ); + public static bool operator <(CDTXVersion x, CDTXVersion y) { + return ((x.n整数部 < y.n整数部) || ((x.n整数部 == y.n整数部) && (x.n小数部 < y.n小数部))); } - public static bool operator <=( CDTXVersion x, CDTXVersion y ) - { - return ( ( x.n整数部 < y.n整数部 ) || ( ( x.n整数部 == y.n整数部 ) && ( x.n小数部 <= y.n小数部 ) ) ); + public static bool operator <=(CDTXVersion x, CDTXVersion y) { + return ((x.n整数部 < y.n整数部) || ((x.n整数部 == y.n整数部) && (x.n小数部 <= y.n小数部))); } - public override bool Equals(object obj) // 2011.1.3 yyagi: warningを無くすために追加 + public override bool Equals(object obj) // 2011.1.3 yyagi: warningを無くすために追加 { - if (obj == null) - { + if (obj == null) { return false; } - if (this.GetType() != obj.GetType()) - { + if (this.GetType() != obj.GetType()) { return false; } CDTXVersion objCDTXVersion = (CDTXVersion)obj; - if (!int.Equals(this.n整数部, objCDTXVersion.n整数部) || !int.Equals(this.n小数部, objCDTXVersion.n小数部)) - { + if (!int.Equals(this.n整数部, objCDTXVersion.n整数部) || !int.Equals(this.n小数部, objCDTXVersion.n小数部)) { return false; } return true; } - public override int GetHashCode() // 2011.1.3 yyagi: warningを無くすために追加 + public override int GetHashCode() // 2011.1.3 yyagi: warningを無くすために追加 { string v = this.toString(); return v.GetHashCode(); diff --git a/OpenTaiko/src/Common/CHitSounds.cs b/OpenTaiko/src/Common/CHitSounds.cs index 66aaf4bc..16f1bfc9 100644 --- a/OpenTaiko/src/Common/CHitSounds.cs +++ b/OpenTaiko/src/Common/CHitSounds.cs @@ -1,73 +1,59 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +namespace TJAPlayer3 { + class CHitSounds { + public CHitSounds(string path) { + tLoadFile(path); + for (int i = 0; i < 5; i++) { + tReloadHitSounds(TJAPlayer3.ConfigIni.nHitSounds[i], i); + } + } -namespace TJAPlayer3 -{ - class CHitSounds - { - public CHitSounds(string path) - { - tLoadFile(path); - for (int i = 0; i < 5; i++) - { - tReloadHitSounds(TJAPlayer3.ConfigIni.nHitSounds[i], i); - } - } + public bool tReloadHitSounds(int id, int player) { + if (id >= names.Length || id >= data.Length) + return false; - public bool tReloadHitSounds(int id, int player) - { - if (id >= names.Length || id >= data.Length) - return false; + string ext = ""; - string ext = ""; + if (data[id].format == "WAV") + ext = ".wav"; + else if (data[id].format == "OGG") + ext = ".ogg"; - if (data[id].format == "WAV") - ext = ".wav"; - else if (data[id].format == "OGG") - ext = ".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; - 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; + } - return true; - } + public string[] names; - 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]; - 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] - #region [private] + private class HitSoundsData { + public string name; + public string path; + public string format; + } - private class HitSoundsData - { - public string name; - public string path; - public string format; - } + private HitSoundsData[] data; - private HitSoundsData[] data; + private void tLoadFile(string path) { + data = ConfigManager.GetConfig>(path).ToArray(); - private void tLoadFile(string path) - { - data = ConfigManager.GetConfig>(path).ToArray(); + names = new string[data.Length]; - names = new string[data.Length]; + for (int i = 0; i < data.Length; i++) { + names[i] = data[i].name; + } + } - for (int i = 0; i < data.Length; i++) - { - names[i] = data[i].name; - } - } + #endregion - #endregion - - } + } } diff --git a/OpenTaiko/src/Common/CPad.cs b/OpenTaiko/src/Common/CPad.cs index 77754c42..a9a21009 100644 --- a/OpenTaiko/src/Common/CPad.cs +++ b/OpenTaiko/src/Common/CPad.cs @@ -1,26 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; using FDK; -namespace TJAPlayer3 -{ - public class CPad - { +namespace TJAPlayer3 { + public class CPad { // プロパティ internal STHIT st検知したデバイス; - [StructLayout( LayoutKind.Sequential )] - internal struct STHIT - { + [StructLayout(LayoutKind.Sequential)] + internal struct STHIT { public bool Keyboard; public bool MIDIIN; public bool Joypad; public bool Gamepad; public bool Mouse; - public void Clear() - { + public void Clear() { this.Keyboard = false; this.MIDIIN = false; this.Joypad = false; @@ -31,8 +24,7 @@ namespace TJAPlayer3 // コンストラクタ - internal CPad( CConfigIni configIni, CInputManager mgrInput ) - { + internal CPad(CConfigIni configIni, CInputManager mgrInput) { this.rConfigIni = configIni; this.rInput管理 = mgrInput; this.st検知したデバイス.Clear(); @@ -41,58 +33,47 @@ namespace TJAPlayer3 // メソッド - public List GetEvents( EInstrumentPad part, EPad pad ) - { - CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = this.rConfigIni.KeyAssign[ (int) part ][ (int) pad ]; + 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.rInput管理.InputDevices ) - { - if( ( device.InputEvents != null ) && ( device.InputEvents.Count != 0 ) ) - { - foreach( STInputEvent event2 in device.InputEvents ) - { - for( int i = 0; i < stkeyassignArray.Length; i++ ) - { - switch( stkeyassignArray[ i ].入力デバイス ) - { + foreach (IInputDevice device in this.rInput管理.InputDevices) { + if ((device.InputEvents != null) && (device.InputEvents.Count != 0)) { + foreach (STInputEvent event2 in device.InputEvents) { + for (int i = 0; i < stkeyassignArray.Length; i++) { + switch (stkeyassignArray[i].入力デバイス) { case EInputDevice.Keyboard: - if( ( device.CurrentType == InputDeviceType.Keyboard ) && ( event2.nKey == stkeyassignArray[ i ].コード ) ) - { - list.Add( event2 ); + if ((device.CurrentType == InputDeviceType.Keyboard) && (event2.nKey == stkeyassignArray[i].コード)) { + list.Add(event2); this.st検知したデバイス.Keyboard = true; } break; case EInputDevice.MIDIInput: - if( ( ( device.CurrentType == InputDeviceType.MidiIn ) && ( device.ID == stkeyassignArray[ i ].ID ) ) && ( event2.nKey == stkeyassignArray[ i ].コード ) ) - { - list.Add( event2 ); + if (((device.CurrentType == InputDeviceType.MidiIn) && (device.ID == stkeyassignArray[i].ID)) && (event2.nKey == stkeyassignArray[i].コード)) { + list.Add(event2); this.st検知したデバイス.MIDIIN = true; } break; case EInputDevice.Joypad: - if( ( ( device.CurrentType == InputDeviceType.Joystick ) && ( device.ID == stkeyassignArray[ i ].ID ) ) && ( event2.nKey == stkeyassignArray[ i ].コード ) ) - { - list.Add( event2 ); + if (((device.CurrentType == InputDeviceType.Joystick) && (device.ID == stkeyassignArray[i].ID)) && (event2.nKey == stkeyassignArray[i].コード)) { + list.Add(event2); this.st検知したデバイス.Joypad = true; } break; case EInputDevice.Gamepad: - if( ( ( device.CurrentType == InputDeviceType.Gamepad ) && ( device.ID == stkeyassignArray[ i ].ID ) ) && ( event2.nKey == stkeyassignArray[ i ].コード ) ) - { - list.Add( event2 ); + if (((device.CurrentType == InputDeviceType.Gamepad) && (device.ID == stkeyassignArray[i].ID)) && (event2.nKey == stkeyassignArray[i].コード)) { + list.Add(event2); this.st検知したデバイス.Gamepad = true; } break; case EInputDevice.Mouse: - if( ( device.CurrentType == InputDeviceType.Mouse ) && ( event2.nKey == stkeyassignArray[ i ].コード ) ) - { - list.Add( event2 ); + if ((device.CurrentType == InputDeviceType.Mouse) && (event2.nKey == stkeyassignArray[i].コード)) { + list.Add(event2); this.st検知したデバイス.Mouse = true; } break; @@ -104,58 +85,51 @@ namespace TJAPlayer3 } return list; } - public bool bPressed( EInstrumentPad part, EPad pad ) - { - if( part != EInstrumentPad.UNKNOWN ) - { - - CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = this.rConfigIni.KeyAssign[ (int) part ][ (int) pad ]; - for( int i = 0; i < stkeyassignArray.Length; i++ ) - { - switch( stkeyassignArray[ i ].入力デバイス ) - { + public bool bPressed(EInstrumentPad part, EPad pad) { + if (part != EInstrumentPad.UNKNOWN) { + + CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = this.rConfigIni.KeyAssign[(int)part][(int)pad]; + for (int i = 0; i < stkeyassignArray.Length; i++) { + switch (stkeyassignArray[i].入力デバイス) { case EInputDevice.Keyboard: - if( !this.rInput管理.Keyboard.KeyPressed( stkeyassignArray[ i ].コード ) ) + if (!this.rInput管理.Keyboard.KeyPressed(stkeyassignArray[i].コード)) break; this.st検知したデバイス.Keyboard = true; return true; - case EInputDevice.MIDIInput: - { - IInputDevice device2 = this.rInput管理.MidiIn( stkeyassignArray[ i ].ID ); - if( ( device2 == null ) || !device2.KeyPressed( stkeyassignArray[ i ].コード ) ) + case EInputDevice.MIDIInput: { + IInputDevice device2 = this.rInput管理.MidiIn(stkeyassignArray[i].ID); + if ((device2 == null) || !device2.KeyPressed(stkeyassignArray[i].コード)) break; this.st検知したデバイス.MIDIIN = true; return true; } - case EInputDevice.Joypad: - { - if( !this.rConfigIni.dicJoystick.ContainsKey( stkeyassignArray[ i ].ID ) ) + case EInputDevice.Joypad: { + if (!this.rConfigIni.dicJoystick.ContainsKey(stkeyassignArray[i].ID)) break; - IInputDevice device = this.rInput管理.Joystick( stkeyassignArray[ i ].ID ); - if( ( device == null ) || !device.KeyPressed( stkeyassignArray[ i ].コード ) ) + IInputDevice device = this.rInput管理.Joystick(stkeyassignArray[i].ID); + if ((device == null) || !device.KeyPressed(stkeyassignArray[i].コード)) break; this.st検知したデバイス.Joypad = true; return true; } - case EInputDevice.Gamepad: - { - if( !this.rConfigIni.dicJoystick.ContainsKey( stkeyassignArray[ i ].ID ) ) + case EInputDevice.Gamepad: { + if (!this.rConfigIni.dicJoystick.ContainsKey(stkeyassignArray[i].ID)) break; - IInputDevice device = this.rInput管理.Gamepad( stkeyassignArray[ i ].ID ); - if( ( device == null ) || !device.KeyPressed( stkeyassignArray[ i ].コード ) ) + IInputDevice device = this.rInput管理.Gamepad(stkeyassignArray[i].ID); + if ((device == null) || !device.KeyPressed(stkeyassignArray[i].コード)) break; this.st検知したデバイス.Gamepad = true; return true; } case EInputDevice.Mouse: - if( !this.rInput管理.Mouse.KeyPressed( stkeyassignArray[ i ].コード ) ) + if (!this.rInput管理.Mouse.KeyPressed(stkeyassignArray[i].コード)) break; this.st検知したデバイス.Mouse = true; @@ -165,71 +139,55 @@ namespace TJAPlayer3 } return false; } - public bool bPressedDGB( EPad pad ) - { - if( !this.bPressed( EInstrumentPad.DRUMS, pad ) && !this.bPressed( EInstrumentPad.GUITAR, pad ) ) - { - return this.bPressed( EInstrumentPad.BASS, pad ); + 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 ) - { - if( !this.bPressed( EInstrumentPad.GUITAR, pad ) ) - { - return this.bPressed( EInstrumentPad.BASS, pad ); + public bool bPressedGB(EPad pad) { + if (!this.bPressed(EInstrumentPad.GUITAR, pad)) { + return this.bPressed(EInstrumentPad.BASS, pad); } return true; } - public bool b押されている( EInstrumentPad part, EPad pad ) - { - if( part != EInstrumentPad.UNKNOWN ) - { - CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = this.rConfigIni.KeyAssign[ (int) part ][ (int) pad ]; - for( int i = 0; i < stkeyassignArray.Length; i++ ) - { - switch( stkeyassignArray[ i ].入力デバイス ) - { + public bool b押されている(EInstrumentPad part, EPad pad) { + if (part != EInstrumentPad.UNKNOWN) { + CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = this.rConfigIni.KeyAssign[(int)part][(int)pad]; + for (int i = 0; i < stkeyassignArray.Length; i++) { + switch (stkeyassignArray[i].入力デバイス) { case EInputDevice.Keyboard: - if( !this.rInput管理.Keyboard.KeyPressing( stkeyassignArray[ i ].コード ) ) - { + if (!this.rInput管理.Keyboard.KeyPressing(stkeyassignArray[i].コード)) { break; } this.st検知したデバイス.Keyboard = true; return true; - case EInputDevice.Joypad: - { - if( !this.rConfigIni.dicJoystick.ContainsKey( stkeyassignArray[ i ].ID ) ) - { + case EInputDevice.Joypad: { + if (!this.rConfigIni.dicJoystick.ContainsKey(stkeyassignArray[i].ID)) { break; } - IInputDevice device = this.rInput管理.Joystick( stkeyassignArray[ i ].ID ); - if( ( device == null ) || !device.KeyPressing( stkeyassignArray[ i ].コード ) ) - { + IInputDevice device = this.rInput管理.Joystick(stkeyassignArray[i].ID); + if ((device == null) || !device.KeyPressing(stkeyassignArray[i].コード)) { break; } this.st検知したデバイス.Joypad = true; return true; } - case EInputDevice.Gamepad: - { - if( !this.rConfigIni.dicJoystick.ContainsKey( stkeyassignArray[ i ].ID ) ) - { + case EInputDevice.Gamepad: { + if (!this.rConfigIni.dicJoystick.ContainsKey(stkeyassignArray[i].ID)) { break; } - IInputDevice device = this.rInput管理.Gamepad( stkeyassignArray[ i ].ID ); - if( ( device == null ) || !device.KeyPressing( stkeyassignArray[ i ].コード ) ) - { + IInputDevice device = this.rInput管理.Gamepad(stkeyassignArray[i].ID); + if ((device == null) || !device.KeyPressing(stkeyassignArray[i].コード)) { break; } this.st検知したデバイス.Gamepad = true; return true; } case EInputDevice.Mouse: - if( !this.rInput管理.Mouse.KeyPressing( stkeyassignArray[ i ].コード ) ) - { + if (!this.rInput管理.Mouse.KeyPressing(stkeyassignArray[i].コード)) { break; } this.st検知したデバイス.Mouse = true; @@ -239,11 +197,9 @@ namespace TJAPlayer3 } return false; } - public bool b押されているGB( EPad pad ) - { - if( !this.b押されている( EInstrumentPad.GUITAR, pad ) ) - { - return this.b押されている( EInstrumentPad.BASS, pad ); + public bool b押されているGB(EPad pad) { + if (!this.b押されている(EInstrumentPad.GUITAR, pad)) { + return this.b押されている(EInstrumentPad.BASS, pad); } return true; } diff --git a/OpenTaiko/src/Common/CSavableT.cs b/OpenTaiko/src/Common/CSavableT.cs index 48be9afe..07dfb0ba 100644 --- a/OpenTaiko/src/Common/CSavableT.cs +++ b/OpenTaiko/src/Common/CSavableT.cs @@ -1,43 +1,29 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.IO; +namespace TJAPlayer3 { + class CSavableT where T : new() { + public virtual string _fn { + get; + protected set; + } + public void tDBInitSavable() { + if (!File.Exists(_fn)) + tSaveFile(); + tLoadFile(); + } -namespace TJAPlayer3 -{ - class CSavableT where T : new() - { - public virtual string _fn - { - get; - protected set; - } - public void tDBInitSavable() - { - if (!File.Exists(_fn)) - tSaveFile(); + public T data = new T(); - tLoadFile(); - } + #region [private] - public T data = new T(); + private void tSaveFile() { + ConfigManager.SaveConfig(data, _fn); + } - #region [private] + private void tLoadFile() { + data = ConfigManager.GetConfig(_fn); + } - private void tSaveFile() - { - ConfigManager.SaveConfig(data, _fn); - } + #endregion - private void tLoadFile() - { - data = ConfigManager.GetConfig(_fn); - } - - #endregion - - } + } } diff --git a/OpenTaiko/src/Common/CSkin.cs b/OpenTaiko/src/Common/CSkin.cs index 677ef01c..42ec8980 100644 --- a/OpenTaiko/src/Common/CSkin.cs +++ b/OpenTaiko/src/Common/CSkin.cs @@ -1,3561 +1,2927 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.IO; -using System.Diagnostics; -using FDK; +using System.Diagnostics; using System.Drawing; -using System.Linq; - -namespace TJAPlayer3 -{ - // グローバル定数 - - 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 // システムサウンド総数の計算用 - } - - internal class CSkin : IDisposable - { - // クラス - - public class CSystemSound : IDisposable - { - // static フィールド - - public static CSkin.CSystemSound r最後に再生した排他システムサウンド; - - 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; - - return this.rSound[1 - this.nNextPlayingSoundNumber].IsPlaying; - } - } - public int nPosition_CurrentlyPlayingSound - { - get - { - CSound sound = this.rSound[1 - this.nNextPlayingSoundNumber]; - if (sound == null) - return 0; - - 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; - - 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; - } - } - } - 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++ ) // #27790 2012.3.10 yyagi 2回読み出しを、1回読みだし+1回メモリコピーに変更 - //// { - // try - // { - // this.rSound[ 0 ] = CDTXMania.Sound管理.tサウンドを生成する( CSkin.Path( this.strファイル名 ) ); - // } - // catch - // { - // this.rSound[ 0 ] = null; - // throw; - // } - // if ( this.rSound[ 0 ] == null ) // #28243 2012.5.3 yyagi "this.rSound[ 0 ].bストリーム再生する"時もCloneするようにし、rSound[1]がnullにならないよう修正→rSound[1]の再生正常化 - // { - // this.rSound[ 1 ] = null; - // } - // else - // { - // this.rSound[ 1 ] = ( CSound ) this.rSound[ 0 ].Clone(); // #27790 2012.3.10 yyagi add: to accelerate loading chip sounds - // CDTXMania.Sound管理.tサウンドを登録する( this.rSound[ 1 ] ); // #28243 2012.5.3 yyagi add (登録漏れによりストリーム再生処理が発生していなかった) - // } - - //// } - - for (int i = 0; i < 2; i++) // 一旦Cloneを止めてASIO対応に専念 - { - try - { - this.rSound[i] = TJAPlayer3.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 (TJAPlayer3.SoundManager.GetCurrentSoundDeviceType() != "DirectShow") - { - for (int i = 0; i < 2; i++) - { - if (this.rSound[i] != null) - { - TJAPlayer3.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) - { - TJAPlayer3.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 - } - - - // プロパティ - - // 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; +using System.Text; +using FDK; + +namespace TJAPlayer3 { + // グローバル定数 + + 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 // システムサウンド総数の計算用 + } + + internal class CSkin : IDisposable { + // クラス + + public class CSystemSound : IDisposable { + // static フィールド + + public static CSkin.CSystemSound r最後に再生した排他システムサウンド; + + 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; + + return this.rSound[1 - this.nNextPlayingSoundNumber].IsPlaying; + } + } + public int nPosition_CurrentlyPlayingSound { + get { + CSound sound = this.rSound[1 - this.nNextPlayingSoundNumber]; + if (sound == null) + return 0; + + 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; + + 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; + } + } + } + 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++ ) // #27790 2012.3.10 yyagi 2回読み出しを、1回読みだし+1回メモリコピーに変更 + //// { + // try + // { + // this.rSound[ 0 ] = CDTXMania.Sound管理.tサウンドを生成する( CSkin.Path( this.strファイル名 ) ); + // } + // catch + // { + // this.rSound[ 0 ] = null; + // throw; + // } + // if ( this.rSound[ 0 ] == null ) // #28243 2012.5.3 yyagi "this.rSound[ 0 ].bストリーム再生する"時もCloneするようにし、rSound[1]がnullにならないよう修正→rSound[1]の再生正常化 + // { + // this.rSound[ 1 ] = null; + // } + // else + // { + // this.rSound[ 1 ] = ( CSound ) this.rSound[ 0 ].Clone(); // #27790 2012.3.10 yyagi add: to accelerate loading chip sounds + // CDTXMania.Sound管理.tサウンドを登録する( this.rSound[ 1 ] ); // #28243 2012.5.3 yyagi add (登録漏れによりストリーム再生処理が発生していなかった) + // } + + //// } + + for (int i = 0; i < 2; i++) // 一旦Cloneを止めてASIO対応に専念 + { + try { + this.rSound[i] = TJAPlayer3.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 (TJAPlayer3.SoundManager.GetCurrentSoundDeviceType() != "DirectShow") { + for (int i = 0; i < 2; i++) { + if (this.rSound[i] != null) { + TJAPlayer3.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) { + TJAPlayer3.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 + } + + + // プロパティ + + // 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 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 SoundBanapas = null; - public CSystemSound soundDanSongSelectIn = 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 soundDanSelectBGM = null; - public CSystemSound soundDanSongSelect = null; + public CSystemSound soundDanSongSelectIn = null; - public CSystemSound soundHeyaBGM = null; - public CSystemSound soundOnlineLoungeBGM = null; - public CSystemSound soundEncyclopediaBGM = null; - public CSystemSound soundTowerSelectBGM = null; + public CSystemSound soundDanSelectBGM = null; + public CSystemSound soundDanSongSelect = null; - public CSystemSound[] soundExToExtra = null; - public CSystemSound[] soundExtraToEx = null; + public CSystemSound soundHeyaBGM = null; + public CSystemSound soundOnlineLoungeBGM = null; + public CSystemSound soundEncyclopediaBGM = null; + public CSystemSound soundTowerSelectBGM = null; - public CSystemSound calibrationTick = null; + public CSystemSound[] soundExToExtra = null; + public CSystemSound[] soundExtraToEx = null; - public CSystemSound[] soundModal = null; + public CSystemSound calibrationTick = null; - public CSystemSound soundCrownIn = null; - public CSystemSound soundRankIn = null; + public CSystemSound[] soundModal = null; - public CSystemSound soundSelectAnnounce = null; + public CSystemSound soundCrownIn = null; + public CSystemSound soundRankIn = null; - // Tower Sfx - public CSystemSound soundTowerMiss = null; - public CSystemSound bgmTowerResult = null; + public CSystemSound soundSelectAnnounce = 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; + // Tower Sfx + public CSystemSound soundTowerMiss = null; + public CSystemSound bgmTowerResult = null; - case Eシステムサウンド.SOUND歓声音: - return this.sound歓声音; + //public Cシステムサウンド soundRed = null; + //public Cシステムサウンド soundBlue = null; + public CSystemSound soundBalloon = null; + public CSystemSound soundKusudama = null; + public CSystemSound soundKusudamaMiss = null; - case Eシステムサウンド.SOUNDステージ失敗音: - return this.soundSTAGEFAILED音; - case Eシステムサウンド.SOUNDゲーム開始音: - return this.soundゲーム開始音; + 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.soundゲーム終了音; + case Eシステムサウンド.SOUND決定音: + return this.soundDecideSFX; - case Eシステムサウンド.SOUNDステージクリア音: - return this.soundステージクリア音; + case Eシステムサウンド.SOUND変更音: + return this.soundChangeSFX; - case Eシステムサウンド.SOUNDフルコンボ音: - return this.soundフルコンボ音; + case Eシステムサウンド.SOUND取消音: + return this.soundCancelSFX; - case Eシステムサウンド.SOUND曲読込開始音: - return this.sound曲読込開始音; + case Eシステムサウンド.SOUND歓声音: + return this.sound歓声音; - case Eシステムサウンド.SOUNDタイトル音: - return this.bgmタイトル; + case Eシステムサウンド.SOUNDステージ失敗音: + return this.soundSTAGEFAILED音; - case Eシステムサウンド.BGM起動画面: - return this.bgm起動画面; + case Eシステムサウンド.SOUNDゲーム開始音: + return this.soundゲーム開始音; - case Eシステムサウンド.BGMオプション画面: - return this.bgmオプション画面; + case Eシステムサウンド.SOUNDゲーム終了音: + return this.soundゲーム終了音; - case Eシステムサウンド.BGMコンフィグ画面: - return this.bgmコンフィグ画面; + case Eシステムサウンド.SOUNDステージクリア音: + return this.soundステージクリア音; - case Eシステムサウンド.BGM選曲画面: - return this.bgm選曲画面; + case Eシステムサウンド.SOUNDフルコンボ音: + return this.soundフルコンボ音; - //case Eシステムサウンド.SOUND赤: - // return this.soundRed; + case Eシステムサウンド.SOUND曲読込開始音: + return this.sound曲読込開始音; - //case Eシステムサウンド.SOUND青: - // return this.soundBlue; + case Eシステムサウンド.SOUNDタイトル音: + return this.bgmタイトル; - case Eシステムサウンド.SOUND風船: - return this.soundBalloon; + case Eシステムサウンド.BGM起動画面: + return this.bgm起動画面; - case Eシステムサウンド.SOUND曲決定音: - return this.sound曲決定音; + case Eシステムサウンド.BGMオプション画面: + return this.bgmオプション画面; - case Eシステムサウンド.SOUND成績発表: - return this.bgmリザルトイン音; + case Eシステムサウンド.BGMコンフィグ画面: + return this.bgmコンフィグ画面; - case Eシステムサウンド.SOUND特訓再生: - return this.sound特訓再生音; + case Eシステムサウンド.BGM選曲画面: + return this.bgm選曲画面; - case Eシステムサウンド.SOUND特訓停止: - return this.sound特訓停止音; + //case Eシステムサウンド.SOUND赤: + // return this.soundRed; - case Eシステムサウンド.sound特訓ジャンプポイント: - return this.soundTrainingToggleBookmarkSFX; + //case Eシステムサウンド.SOUND青: + // return this.soundBlue; - case Eシステムサウンド.sound特訓スキップ音: - return this.sound特訓スキップ音; + case Eシステムサウンド.SOUND風船: + return this.soundBalloon; - case Eシステムサウンド.SOUND特訓スクロール: - return this.soundTrainingModeScrollSFX; + case Eシステムサウンド.SOUND曲決定音: + return this.sound曲決定音; - } - throw new IndexOutOfRangeException(); - } - } - public CSystemSound this[int index] - { - get - { - switch (index) - { - case 0: - return this.soundカーソル移動音; + case Eシステムサウンド.SOUND成績発表: + return this.bgmリザルトイン音; - case 1: - return this.soundDecideSFX; + case Eシステムサウンド.SOUND特訓再生: + return this.sound特訓再生音; - case 2: - return this.soundChangeSFX; + case Eシステムサウンド.SOUND特訓停止: + return this.sound特訓停止音; - case 3: - return this.soundCancelSFX; + case Eシステムサウンド.sound特訓ジャンプポイント: + return this.soundTrainingToggleBookmarkSFX; - case 4: - return this.sound歓声音; + case Eシステムサウンド.sound特訓スキップ音: + return this.sound特訓スキップ音; - case 5: - return this.soundSTAGEFAILED音; + case Eシステムサウンド.SOUND特訓スクロール: + return this.soundTrainingModeScrollSFX; - case 6: - return this.soundゲーム開始音; + } + throw new IndexOutOfRangeException(); + } + } + public CSystemSound this[int index] { + get { + switch (index) { + case 0: + return this.soundカーソル移動音; - case 7: - return this.soundゲーム終了音; + case 1: + return this.soundDecideSFX; - case 8: - return this.soundステージクリア音; + case 2: + return this.soundChangeSFX; - case 9: - return this.soundフルコンボ音; + case 3: + return this.soundCancelSFX; - 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; - } - } - - - // コンストラクタ - 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(TJAPlayer3.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 (!TJAPlayer3.bコンパクトモード || 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/ (従来互換) - #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; - } - 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 = E難易度表示タイプ.mtaikoに画像で表示; - 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(TJAPlayer3.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; - } - //case "FontName": - //{ - // strParam = strParam.Replace('/', System.IO.Path.DirectorySeparatorChar); - // strParam = strParam.Replace('\\', System.IO.Path.DirectorySeparatorChar); - // if (HPrivateFastFont.FontExists(strParam)) FontName = strParam; - // strParam = Path(strParam); - // if (HPrivateFastFont.FontExists(strParam)) FontName = strParam; - // break; - //} - //case "BoxFontName": - //{ - // strParam = strParam.Replace('/', System.IO.Path.DirectorySeparatorChar); - // strParam = strParam.Replace('\\', System.IO.Path.DirectorySeparatorChar); - // if (HPrivateFastFont.FontExists(strParam)) BoxFontName = strParam; - // strParam = Path(strParam); - // if (HPrivateFastFont.FontExists(Path(strParam))) BoxFontName = strParam; - // 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 = (E難易度表示タイプ)CConversion.n値を文字列から取得して範囲内に丸めて返す(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] - - - /* + 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; + } + } + + + // コンストラクタ + 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(TJAPlayer3.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 (!TJAPlayer3.bコンパクトモード || 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/ (従来互換) + #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; + } + 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 = E難易度表示タイプ.mtaikoに画像で表示; + 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(TJAPlayer3.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; + } + //case "FontName": + //{ + // strParam = strParam.Replace('/', System.IO.Path.DirectorySeparatorChar); + // strParam = strParam.Replace('\\', System.IO.Path.DirectorySeparatorChar); + // if (HPrivateFastFont.FontExists(strParam)) FontName = strParam; + // strParam = Path(strParam); + // if (HPrivateFastFont.FontExists(strParam)) FontName = strParam; + // break; + //} + //case "BoxFontName": + //{ + // strParam = strParam.Replace('/', System.IO.Path.DirectorySeparatorChar); + // strParam = strParam.Replace('\\', System.IO.Path.DirectorySeparatorChar); + // if (HPrivateFastFont.FontExists(strParam)) BoxFontName = strParam; + // strParam = Path(strParam); + // if (HPrivateFastFont.FontExists(Path(strParam))) BoxFontName = strParam; + // 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 = (E難易度表示タイプ)CConversion.n値を文字列から取得して範囲内に丸めて返す(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; - } + 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 + #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]; + #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_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_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_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; - } + 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_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_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_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_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(','); - for (int i = 0; i < 5; i++) - { - SongSelect_Difficulty_Number_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Number_Y": - { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) - { - SongSelect_Difficulty_Number_Y[i] = int.Parse(strSplit[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_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(','); + for (int i = 0; i < 5; i++) { + SongSelect_Difficulty_Number_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Number_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_Difficulty_Number_Y[i] = int.Parse(strSplit[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 + 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 - /* + #region DaniSelect + /* case "DaniSelect_Dan_Text_X": { string[] strSplit = strParam.Split(','); @@ -3573,7662 +2939,6439 @@ namespace TJAPlayer3 } } */ - 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 + 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; - } + #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 + 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; - } + #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; - } + 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 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; - } + #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 + 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 + // 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 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; - } + #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_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; - } + 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 + #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; - } + #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_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_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_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 + 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; - } + #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 + 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; - } + #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_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_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; - } + 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 + #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; - } + #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; - } + 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 + #endregion - #region Lane + #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_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 + 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 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; - } + #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_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_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_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_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_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_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_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_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_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_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_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_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; - } + 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 + #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 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 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 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 + #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 + #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; - } + #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 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 "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 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 < 2; i++) - // { - //Result_UIMove_4P[i] = int.Parse(strSplit[i]); - // } + case "Result_UIMove_4P": { + string[] strSplit = strParam.Split(','); + // for (int i = 0; i < 2; i++) + // { + //Result_UIMove_4P[i] = int.Parse(strSplit[i]); + // } - for (int i = 0; i < 4; i++) - { - int moveX = int.Parse(strSplit[0]); - Result_UIMove_4P_X[i] = moveX * i; + 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 < 2; i++) - // { - //Result_UIMove_5P[i] = int.Parse(strSplit[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 < 2; i++) + // { + //Result_UIMove_5P[i] = int.Parse(strSplit[i]); + // } - for (int i = 0; i < 5; i++) - { - int moveX = int.Parse(strSplit[0]); - Result_UIMove_5P_X[i] = moveX * i; + 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; - } + 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 + #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 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 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 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 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 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]; + #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_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 + 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 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 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 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 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 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; + #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; - } - } - } - } + #endregion + } + } + continue; + } catch (Exception exception) { + Trace.TraceError(exception.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (6a32cc37-1527-412e-968a-512c1f0135cd)"); + continue; + } + } + } + } - private void t座標の追従設定() - { - // - if (bFieldBgPointOverride == true) - { + 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(); + #region [ IDisposable 実装 ] + //----------------- + public void Dispose() { + if (!this.bDisposed済み) { + for (int i = 0; i < this.nシステムサウンド数; i++) + this[i].Dispose(); - this.bDisposed済み = true; - } - } - //----------------- - #endregion + this.bDisposed済み = true; + } + } + //----------------- + #endregion - // その他 + // その他 - #region [ private ] - //----------------- - private bool bDisposed済み; - //----------------- - #endregion + #region [ private ] + //----------------- + private bool bDisposed済み; + //----------------- + #endregion - #region 背景(スクロール) - public int[] Background_Scroll_Y = new int[] { 0, 536 }; - #endregion + #region 背景(スクロール) + public int[] Background_Scroll_Y = new int[] { 0, 536 }; + #endregion - #region[ 座標 ] - //2017.08.11 kairera0467 DP実用化に向けてint配列に変更 + #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 }; + //フィールド位置 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[] 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 }; + //中心座標指定 + public int[] nJudgePointX = new int[] { 413, 413, 413, 413 }; + public int[] nJudgePointY = new int[] { 256, 433, 0, 0 }; - //フィールド背景画像 - //ScrollField座標への追従設定が可能。 - //分岐背景、ゴーゴー背景が連動する。(全て同じ大きさ、位置で作成すること。) - //左上基準描画 - public bool bFieldBgPointOverride = false; - /* + //フィールド背景画像 + //ScrollField座標への追従設定が可能。 + //分岐背景、ゴーゴー背景が連動する。(全て同じ大きさ、位置で作成すること。) + //左上基準描画 + public bool bFieldBgPointOverride = false; + /* public int[] nScrollFieldBGX = new int[] { 333, 333, 333, 333 }; public int[] nScrollFieldBGY = new int[] { 192, 368, 0, 0 }; */ - //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 E難易度表示タイプ 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_NamePlate_Ptn_Title; - public int[] Config_NamePlate_Ptn_Title_Boxes; - - 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 }; + //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 E難易度表示タイプ 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_NamePlate_Ptn_Title; + public int[] Config_NamePlate_Ptn_Title_Boxes; + + 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_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_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 int[] Title_ModeSelect_Bar_Center_BoxText = new int[] { 640, 397 }; - public bool Title_VerticalText = false; - public bool Title_VerticalBar = false; + public bool Title_VerticalText = false; + public bool Title_VerticalBar = false; - #endregion + #endregion - #region SongSelect - //public int SongSelect_Overall_Y = 123; - public string[] SongSelect_GenreName = { "ポップス", "アニメ", "ゲームバラエティ", "ナムコオリジナル", "クラシック", "バラエティ", "キッズ", "ボーカロイド", "最近遊んだ曲" }; + #region SongSelect + //public int SongSelect_Overall_Y = 123; + public string[] SongSelect_GenreName = { "ポップス", "アニメ", "ゲームバラエティ", "ナムコオリジナル", "クラシック", "バラエティ", "キッズ", "ボーカロイド", "最近遊んだ曲" }; - public int SongSelect_Bar_Count = 9; + 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 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 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_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_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_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_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_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_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_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_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 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_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_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 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_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_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_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 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 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_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 }; - public int[] SongSelect_Difficulty_Number_Y = new int[] { 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_Dan_Text_X = new int[] { 300, 980, 300, 980 }; - //public int[] DaniSelect_Dan_Text_Y = new int[] { 198, 198, 522, 522 }; - - 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_Ptn = 0; - //public int Game_Dancer_Beat = 8; - 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; - public int[] Game_Tower_Ptn_Don_Standing, - Game_Tower_Ptn_Don_Jump, - Game_Tower_Ptn_Don_Climbing, - Game_Tower_Ptn_Don_Running; - - #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 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 }; + public int[] SongSelect_Difficulty_Number_Y = new int[] { 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_Dan_Text_X = new int[] { 300, 980, 300, 980 }; + //public int[] DaniSelect_Dan_Text_Y = new int[] { 198, 198, 522, 522 }; + + 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_Ptn = 0; + //public int Game_Dancer_Beat = 8; + 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; + public int[] Game_Tower_Ptn_Don_Standing, + Game_Tower_Ptn_Don_Jump, + Game_Tower_Ptn_Don_Climbing, + Game_Tower_Ptn_Don_Running; + + #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_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_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_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_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_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 + public int[] Game_AIBattle_Judge_Number_Interval = new int[] { 10, 0 }; + #endregion - #endregion - #region Result - /* + #endregion + #region Result + /* public int[] Result_UIMove_4P = new int[] { 320, 0 }; public int[] Result_UIMove_5P = new int[] { 256, 0 }; */ - 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 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_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_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_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 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 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 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 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_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_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_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_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_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_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_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_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_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_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 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_StageText_ForeColor_Red = ColorTranslator.FromHtml("#FFFFFF"); - public Color Result_MusicName_BackColor = ColorTranslator.FromHtml("#000000"); - public Color Result_StageText_BackColor = ColorTranslator.FromHtml("#000000"); - //public Color Result_StageText_BackColor_Red = ColorTranslator.FromHtml("#FF0000"); + public Color Result_MusicName_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + public Color Result_StageText_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + //public Color Result_StageText_ForeColor_Red = ColorTranslator.FromHtml("#FFFFFF"); + public Color Result_MusicName_BackColor = ColorTranslator.FromHtml("#000000"); + public Color Result_StageText_BackColor = ColorTranslator.FromHtml("#000000"); + //public Color Result_StageText_BackColor_Red = ColorTranslator.FromHtml("#FF0000"); - 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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_4P = new int[] { 0, 0 }; - public int[] Result_Speech_Bubble_V2_5P = 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_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_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 + public int[] Result_ModIcons_4P = new int[] { 15, 678 }; + public int[] Result_ModIcons_5P = new int[] { -17, 678 }; + #endregion - #region AIResult + #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_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_SectionText_Offset = new int[] { 110, 27 }; + public int Result_AIBattle_SectionText_Scale = 13; - public int[] Result_AIBattle_WinFlag = new int[] { 946, 526 }; + public int[] Result_AIBattle_WinFlag = new int[] { 946, 526 }; - #endregion + #endregion - #region DanResult + #region DanResult - public int[] DanResult_StatePanel = new int[] { 0, -4 }; + 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_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_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_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_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_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_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_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_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_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_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_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_Rank = new int[] { 130, 380 }; - public int DanResult_Font_DanTitles_Size = 24; + public int DanResult_Font_DanTitles_Size = 24; - #endregion + #endregion - #region TowerResult + #region TowerResult - public int[] TowerResult_ScoreRankEffect = new int[] { 1000, 220 }; + 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_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_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_Gauge_Soul = new int[] { 248, 474 }; - public int TowerResult_Font_TowerText = 28; - public int TowerResult_Font_TowerText48 = 48; - public int TowerResult_Font_TowerText72 = 72; + public int TowerResult_Font_TowerText = 28; + public int TowerResult_Font_TowerText48 = 48; + public int TowerResult_Font_TowerText72 = 72; - #endregion + #endregion - #region Heya + #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; + 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 + #endregion - #region OnlineLounge + #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_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_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_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_Downloading = new int[] { 640, 605 }; - public int OnlineLounge_Font_OLFont = 14; - public int OnlineLounge_Font_OLFontLarge = 28; + public int OnlineLounge_Font_OLFont = 14; + public int OnlineLounge_Font_OLFontLarge = 28; - #endregion + #endregion - #region TowerSelect + #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 }; + 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 + #endregion - #region OpenEncyclopedia + #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; + 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 + #endregion - #region Exit - public int Exit_Duration = 3000; - #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 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; + #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 + 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 + #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_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_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_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_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_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_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_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 }; + public int[] Modal_Text_Half_Move_4P = new int[] { 0, 59 }; + public int[] Modal_Text_Half_Move_5P = new int[] { 0, 40 }; - #endregion + #endregion - #region PopupMenu + #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; + 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 - #endregion - } -} \ No newline at end of file + #endregion + } +} diff --git a/OpenTaiko/src/Common/CSongDict.cs b/OpenTaiko/src/Common/CSongDict.cs index caed0ca5..6b28ea8b 100644 --- a/OpenTaiko/src/Common/CSongDict.cs +++ b/OpenTaiko/src/Common/CSongDict.cs @@ -1,309 +1,269 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Drawing; - -namespace TJAPlayer3 -{ - 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 TJAPlayer3.Favorites.data.favorites[TJAPlayer3.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 TJAPlayer3.RecentlyPlayedSongs.data.recentlyplayedsongs[TJAPlayer3.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 = TJAPlayer3.SaveFileInstances[TJAPlayer3.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 - } +using System.Drawing; + +namespace TJAPlayer3 { + 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 TJAPlayer3.Favorites.data.favorites[TJAPlayer3.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 TJAPlayer3.RecentlyPlayedSongs.data.recentlyplayedsongs[TJAPlayer3.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 = TJAPlayer3.SaveFileInstances[TJAPlayer3.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 2a317d12..6d1727d2 100644 --- a/OpenTaiko/src/Common/CTextConsole.cs +++ b/OpenTaiko/src/Common/CTextConsole.cs @@ -1,17 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; +using System.Drawing; using FDK; -namespace TJAPlayer3 -{ - internal class CTextConsole : CActivity - { +namespace TJAPlayer3 { + internal class CTextConsole : CActivity { // 定数 - public enum EFontType - { + public enum EFontType { White, Cyan, Gray, @@ -22,31 +16,21 @@ namespace TJAPlayer3 // メソッド - public void tPrint( int x, int y, EFontType font, string strAlphanumericString ) - { - if( !base.IsDeActivated && !string.IsNullOrEmpty( strAlphanumericString ) ) - { + public void tPrint(int x, int y, EFontType font, string strAlphanumericString) { + if (!base.IsDeActivated && !string.IsNullOrEmpty(strAlphanumericString)) { int BOL = x; - for( int i = 0; i < strAlphanumericString.Length; i++ ) - { - char ch = strAlphanumericString[ i ]; - if( ch == '\n' ) - { + for (int i = 0; i < strAlphanumericString.Length; i++) { + char ch = strAlphanumericString[i]; + if (ch == '\n') { x = BOL; y += nFontHeight; - } - else - { - int index = str表記可能文字.IndexOf( ch ); - if( index < 0 ) - { + } else { + int index = str表記可能文字.IndexOf(ch); + if (index < 0) { x += nFontWidth; - } - else - { - if( this.txフォント8x16[ (int) ( (int) font / (int) EFontType.WhiteSlim ) ] != null ) - { - this.txフォント8x16[ (int) ( (int) font / (int) EFontType.WhiteSlim ) ].t2D描画( x, y, this.rc文字の矩形領域[ (int) ( (int) font % (int) EFontType.WhiteSlim ), index ] ); + } else { + if (this.txフォント8x16[(int)((int)font / (int)EFontType.WhiteSlim)] != null) { + this.txフォント8x16[(int)((int)font / (int)EFontType.WhiteSlim)].t2D描画(x, y, this.rc文字の矩形領域[(int)((int)font % (int)EFontType.WhiteSlim), index]); } x += nFontWidth; } @@ -58,32 +42,26 @@ namespace TJAPlayer3 // CActivity 実装 - public override void Activate() - { + public override void Activate() { base.Activate(); } - public override void DeActivate() - { - if( this.rc文字の矩形領域 != null ) + public override void DeActivate() { + if (this.rc文字の矩形領域 != null) this.rc文字の矩形領域 = null; base.DeActivate(); } - public override void CreateManagedResource() - { - if( !base.IsDeActivated ) - { - this.txフォント8x16[ 0 ] = TJAPlayer3.Tx.TxC(@"Console_Font.png"); - this.txフォント8x16[ 1 ] = TJAPlayer3.Tx.TxC(@"Console_Font_Small.png"); + public override void CreateManagedResource() { + if (!base.IsDeActivated) { + this.txフォント8x16[0] = TJAPlayer3.Tx.TxC(@"Console_Font.png"); + this.txフォント8x16[1] = TJAPlayer3.Tx.TxC(@"Console_Font_Small.png"); nFontWidth = this.txフォント8x16[0].szTextureSize.Width / 32; nFontHeight = this.txフォント8x16[0].szTextureSize.Height / 16; this.rc文字の矩形領域 = new Rectangle[3, str表記可能文字.Length]; - for (int i = 0; i < 3; i++) - { - for (int j = 0; j < str表記可能文字.Length; j++) - { + for (int i = 0; i < 3; i++) { + for (int j = 0; j < str表記可能文字.Length; j++) { int regionX = nFontWidth * 16, regionY = nFontHeight * 8; this.rc文字の矩形領域[i, j].X = ((i / 2) * regionX) + ((j % 16) * nFontWidth); this.rc文字の矩形領域[i, j].Y = ((i % 2) * regionY) + ((j / 16) * nFontHeight); @@ -95,16 +73,12 @@ namespace TJAPlayer3 base.CreateManagedResource(); } } - public override void ReleaseManagedResource() - { - if( !base.IsDeActivated ) - { - for( int i = 0; i < 2; i++ ) - { - if( this.txフォント8x16[ i ] != null ) - { - this.txフォント8x16[ i ].Dispose(); - this.txフォント8x16[ i ] = null; + public override void ReleaseManagedResource() { + if (!base.IsDeActivated) { + for (int i = 0; i < 2; i++) { + if (this.txフォント8x16[i] != null) { + this.txフォント8x16[i].Dispose(); + this.txフォント8x16[i] = null; } } base.ReleaseManagedResource(); @@ -119,7 +93,7 @@ namespace TJAPlayer3 private Rectangle[,] rc文字の矩形領域; private const string str表記可能文字 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ "; public int nFontWidth = 8, nFontHeight = 16; - private CTexture[] txフォント8x16 = new CTexture[ 2 ]; + private CTexture[] txフォント8x16 = new CTexture[2]; //----------------- #endregion } diff --git a/OpenTaiko/src/Common/CVersionList.cs b/OpenTaiko/src/Common/CVersionList.cs index 1e59ff35..988d8d2c 100644 --- a/OpenTaiko/src/Common/CVersionList.cs +++ b/OpenTaiko/src/Common/CVersionList.cs @@ -1,38 +1,30 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace TJAPlayer3 -{ - class CVersionList - { - public static string[] VersionList = { - "0.1.0", - "0.2.0", - "0.3.0", - "0.3.1", - "0.3.2", - "0.3.3", - "0.3.4", - "0.3.4.1", - "0.3.4.2", - "0.4.0", - "0.4.1", - "0.4.2", - "0.4.3", - "0.5.0", - "0.5.1", - "0.5.2", - "0.5.2.1", - "Pre 0.5.3", - "0.5.3", - "0.5.3.1", - "0.5.3.2", - "0.5.4", - "Pre 0.6.0 b1", - "Pre 0.6.0 b2", - }; - } +namespace TJAPlayer3 { + class CVersionList { + public static string[] VersionList = { + "0.1.0", + "0.2.0", + "0.3.0", + "0.3.1", + "0.3.2", + "0.3.3", + "0.3.4", + "0.3.4.1", + "0.3.4.2", + "0.4.0", + "0.4.1", + "0.4.2", + "0.4.3", + "0.5.0", + "0.5.1", + "0.5.2", + "0.5.2.1", + "Pre 0.5.3", + "0.5.3", + "0.5.3.1", + "0.5.3.2", + "0.5.4", + "Pre 0.6.0 b1", + "Pre 0.6.0 b2", + }; + } } diff --git a/OpenTaiko/src/Common/ConfigIniToSongGainControllerBinder.cs b/OpenTaiko/src/Common/ConfigIniToSongGainControllerBinder.cs index 2e2e604f..cb36ecfa 100644 --- a/OpenTaiko/src/Common/ConfigIniToSongGainControllerBinder.cs +++ b/OpenTaiko/src/Common/ConfigIniToSongGainControllerBinder.cs @@ -1,38 +1,33 @@ using FDK; -namespace TJAPlayer3 -{ - /// - /// 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 TJAPlayer3 { + /// + /// 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; - } - }; - } - } -} \ No newline at end of file + 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 01f597fe..0033861e 100644 --- a/OpenTaiko/src/Common/ConfigIniToSoundGroupLevelControllerBinder.cs +++ b/OpenTaiko/src/Common/ConfigIniToSoundGroupLevelControllerBinder.cs @@ -1,67 +1,59 @@ -using System; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - /// - /// 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 TJAPlayer3 { + /// + /// 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); - 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; - } - }; + 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(); - } - }; - } - } + 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 3323cb7a..40eaddaa 100644 --- a/OpenTaiko/src/Common/ConfigManager.cs +++ b/OpenTaiko/src/Common/ConfigManager.cs @@ -1,60 +1,50 @@ -using System.IO; -using System.Text; +using System.Text; using Newtonsoft.Json; using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Serialization; -namespace TJAPlayer3 -{ - /// - /// 設定ファイル入出力クラス。 - /// - public static class ConfigManager - { - private static readonly JsonSerializerSettings Settings = - new JsonSerializerSettings() - { - ObjectCreationHandling = ObjectCreationHandling.Auto, - DefaultValueHandling = DefaultValueHandling.Include, - // ContractResolver = new CamelCasePropertyNamesContractResolver(), - NullValueHandling = NullValueHandling.Ignore, - MissingMemberHandling = MissingMemberHandling.Ignore, - Converters = new StringEnumConverter[] { new StringEnumConverter() } - }; +namespace TJAPlayer3 { + /// + /// 設定ファイル入出力クラス。 + /// + public static class ConfigManager { + private static readonly JsonSerializerSettings Settings = + new JsonSerializerSettings() { + ObjectCreationHandling = ObjectCreationHandling.Auto, + DefaultValueHandling = DefaultValueHandling.Include, + // ContractResolver = new CamelCasePropertyNamesContractResolver(), + NullValueHandling = NullValueHandling.Ignore, + MissingMemberHandling = MissingMemberHandling.Ignore, + Converters = new StringEnumConverter[] { new StringEnumConverter() } + }; - /// - /// 設定ファイルの読み込みを行います。ファイルが存在しなかった場合、そのクラスの新規インスタンスを返します。 - /// - /// シリアライズしたクラス。 - /// ファイル名。 - /// デシリアライズ結果。 - 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); - } + /// + /// 設定ファイルの読み込みを行います。ファイルが存在しなかった場合、そのクラスの新規インスタンスを返します。 + /// + /// シリアライズしたクラス。 + /// ファイル名。 + /// デシリアライズ結果。 + 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); + } - /// - /// 設定ファイルの書き込みを行います。 - /// - /// シリアライズするインスタンス。 - /// ファイル名。 - 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)); - } - } - } + /// + /// 設定ファイルの書き込みを行います。 + /// + /// シリアライズするインスタンス。 + /// ファイル名。 + 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/C定数.cs b/OpenTaiko/src/Common/C定数.cs index b1e8a6d4..821db53c 100644 --- a/OpenTaiko/src/Common/C定数.cs +++ b/OpenTaiko/src/Common/C定数.cs @@ -1,77 +1,69 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; -namespace TJAPlayer3 -{ +namespace TJAPlayer3 { - /// - /// 難易度。 - /// - 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, - 完走叩ききりまショー = 1, - 完走叩ききりまショー激辛 = 2 - } - public enum E難易度表示タイプ - { - OFF = 0, - n曲目に表示 = 1, - mtaikoに画像で表示 = 2, - } + public enum EGame { + OFF = 0, + 完走叩ききりまショー = 1, + 完走叩ききりまショー激辛 = 2 + } + public enum E難易度表示タイプ { + OFF = 0, + n曲目に表示 = 1, + mtaikoに画像で表示 = 2, + } - public enum EPad // 演奏用のenum。ここを修正するときは、次に出てくる EKeyConfigPad と EパッドFlag もセットで修正すること。 + 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, + 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, @@ -88,48 +80,48 @@ namespace TJAPlayer3 LBlue5P = 30, RBlue5P = 31, - CLAP = 32, - CLAP2P = 33, + CLAP = 32, + CLAP2P = 33, CLAP3P = 34, CLAP4P = 35, CLAP5P = 36, LeftChange = 37, RightChange = 38, - MAX, // 門番用として定義 + MAX, // 門番用として定義 UNKNOWN = 99 } - public enum EKeyConfigPad // #24609 キーコンフィグで使うenum。capture要素あり。 + 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, + 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, + 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, @@ -146,7 +138,7 @@ namespace TJAPlayer3 LBlue5P = EPad.LBlue5P, RBlue5P = EPad.RBlue5P, - Clap = EPad.CLAP, + Clap = EPad.CLAP, Clap2P = EPad.CLAP2P, Clap3P = EPad.CLAP3P, Clap4P = EPad.CLAP4P, @@ -170,9 +162,9 @@ namespace TJAPlayer3 #endregion #region [Gameplay/Training only] CycleVideoDisplayMode, - #endregion - #endregion - #region [Training Keys] + #endregion + #endregion + #region [Training Keys] TrainingIncreaseScrollSpeed, TrainingDecreaseScrollSpeed, TrainingIncreaseSongSpeed, @@ -189,121 +181,113 @@ namespace TJAPlayer3 TrainingSkipBackMeasure, TrainingJumpToFirstMeasure, TrainingJumpToLastMeasure, - #endregion - MAX, + #endregion + MAX, UNKNOWN = EPad.UNKNOWN } [Flags] - public enum EPadFlag // #24063 2011.1.16 yyagi コマンド入力用 パッド入力のフラグ化 + 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, + 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 - { + public enum ERandomMode { OFF, RANDOM, - MIRROR, + MIRROR, SUPERRANDOM, MIRRORRANDOM } - public enum EFunMods - { + public enum EFunMods { NONE, AVALANCHE, MINESWEEPER, TOTAL, - } + } - public enum EGameType - { + 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楽器パート + + public enum EInstrumentPad // ここを修正するときは、セットで次の EKeyConfigPart も修正すること。 { - DRUMS = EInstrumentPad.DRUMS, - GUITAR = EInstrumentPad.GUITAR, - BASS = EInstrumentPad.BASS, - TAIKO = EInstrumentPad.TAIKO, + 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 + UNKNOWN = EInstrumentPad.UNKNOWN } - internal enum EInputDevice - { - Keyboard = 0, - MIDIInput = 1, - Joypad = 2, - Mouse = 3, + internal enum EInputDevice { + Keyboard = 0, + MIDIInput = 1, + Joypad = 2, + Mouse = 3, Gamepad = 4, - Unknown = -1 + Unknown = -1 } - public enum ENoteJudge - { - Perfect = 0, - Great = 1, - Good = 2, - Poor = 3, - Miss = 4, - Bad = 5, - Auto = 6, - ADLIB = 7, - Mine = 8, + public enum ENoteJudge { + Perfect = 0, + Great = 1, + Good = 2, + Poor = 3, + Miss = 4, + Bad = 5, + Auto = 6, + ADLIB = 7, + Mine = 8, } - internal enum E判定文字表示位置 - { + internal enum E判定文字表示位置 { 表示OFF, レーン上, 判定ライン上, コンボ下 } - internal enum EFIFOモード - { + internal enum EFIFOモード { フェードイン, フェードアウト } - internal enum E演奏画面の戻り値 - { + internal enum E演奏画面の戻り値 { 継続, 演奏中断, ステージ失敗, @@ -311,46 +295,41 @@ namespace TJAPlayer3 再読込_再演奏, 再演奏 } - internal enum E曲読込画面の戻り値 - { + internal enum E曲読込画面の戻り値 { 継続 = 0, 読込完了, 読込中止 } - public enum ENoteState - { - none, - wait, - perfect, - grade, - bad - } + public enum ENoteState { + none, + wait, + perfect, + grade, + bad + } - public enum E連打State - { - none, - roll, - rollB, - balloon, - potato - } + public enum E連打State { + 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 // チップを常に透明化する } /// @@ -358,58 +337,53 @@ namespace TJAPlayer3 /// /// 値の型。 [Serializable] - [StructLayout( LayoutKind.Sequential )] - public struct STDGBVALUE // indexはE楽器パートと一致させること + [StructLayout(LayoutKind.Sequential)] + public struct STDGBVALUE // indexはE楽器パートと一致させること { public T Drums; public T Guitar; public T Bass; - public T Taiko; + public T Taiko; public T Unknown; - public T this[ int index ] - { - get - { - switch( index ) - { - case (int) EInstrumentPad.DRUMS: + public T this[int index] { + get { + switch (index) { + case (int)EInstrumentPad.DRUMS: return this.Drums; - case (int) EInstrumentPad.GUITAR: + case (int)EInstrumentPad.GUITAR: return this.Guitar; - case (int) EInstrumentPad.BASS: + case (int)EInstrumentPad.BASS: return this.Bass; - case (int) EInstrumentPad.TAIKO: - return this.Taiko; + case (int)EInstrumentPad.TAIKO: + return this.Taiko; - case (int) EInstrumentPad.UNKNOWN: + case (int)EInstrumentPad.UNKNOWN: return this.Unknown; } throw new IndexOutOfRangeException(); } - set - { - switch( index ) - { - case (int) EInstrumentPad.DRUMS: + set { + switch (index) { + case (int)EInstrumentPad.DRUMS: this.Drums = value; return; - case (int) EInstrumentPad.GUITAR: + case (int)EInstrumentPad.GUITAR: this.Guitar = value; return; - case (int) EInstrumentPad.BASS: + case (int)EInstrumentPad.BASS: this.Bass = value; return; - case (int) EInstrumentPad.TAIKO: - this.Taiko = value; - return; + case (int)EInstrumentPad.TAIKO: + this.Taiko = value; + return; - case (int) EInstrumentPad.UNKNOWN: + case (int)EInstrumentPad.UNKNOWN: this.Unknown = value; return; } @@ -418,34 +392,30 @@ namespace TJAPlayer3 } } - public enum EReturnValue : int - { + public enum EReturnValue : int { Continuation, ReturnToTitle, SongChoosen } #region[Ver.K追加] - public enum Eレーンタイプ - { - TypeA, - TypeB, - TypeC, - TypeD - } - public enum Eミラー - { - TypeA, - TypeB - } - public enum EClipDispType - { - 背景のみ = 1, - ウィンドウのみ = 2, - 両方 = 3, - OFF = 0 - } - #endregion + public enum Eレーンタイプ { + TypeA, + TypeB, + TypeC, + TypeD + } + public enum Eミラー { + TypeA, + TypeB + } + public enum EClipDispType { + 背景のみ = 1, + ウィンドウのみ = 2, + 両方 = 3, + OFF = 0 + } + #endregion } diff --git a/OpenTaiko/src/Common/Easing.cs b/OpenTaiko/src/Common/Easing.cs index 48f2e207..96f9773e 100644 --- a/OpenTaiko/src/Common/Easing.cs +++ b/OpenTaiko/src/Common/Easing.cs @@ -1,208 +1,188 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using TJAPlayer3; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - 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 TJAPlayer3 { + 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; - 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; - } + 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; + } - 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; + 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; - } + 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; + 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; - } + 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; - } + 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 - } - } -} \ No newline at end of file + 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 f1201057..5076c9d3 100644 --- a/OpenTaiko/src/Common/Favorites.cs +++ b/OpenTaiko/src/Common/Favorites.cs @@ -1,62 +1,47 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; +namespace TJAPlayer3 { + internal class Favorites { + public void tFavorites() { + if (!File.Exists("Favorite.json")) + tSaveFile(); -namespace TJAPlayer3 -{ - internal class Favorites - { - public void tFavorites() { - if (!File.Exists("Favorite.json")) - tSaveFile(); + tLoadFile(); + } - tLoadFile(); - } + #region [Auxiliary methods] - #region [Auxiliary methods] + public void tToggleFavorite(string chartID) { + if (tIsFavorite(chartID)) + data.favorites[TJAPlayer3.SaveFile].Remove(chartID); + else + data.favorites[TJAPlayer3.SaveFile].Add(chartID); - public void tToggleFavorite(string chartID) - { - if (tIsFavorite(chartID)) - data.favorites[TJAPlayer3.SaveFile].Remove(chartID); - else - data.favorites[TJAPlayer3.SaveFile].Add(chartID); + tSaveFile(); + } - tSaveFile(); - } + public bool tIsFavorite(string chartID) { + return (data.favorites[TJAPlayer3.SaveFile].Contains(chartID)); + } - public bool tIsFavorite(string chartID) - { - return (data.favorites[TJAPlayer3.SaveFile].Contains(chartID)); - } - - #endregion + #endregion - public class Data - { - public HashSet[] favorites = new HashSet[2] { new HashSet(), new HashSet() }; - } + public class Data { + public HashSet[] favorites = new HashSet[2] { new HashSet(), new HashSet() }; + } - public Data data = new Data(); + public Data data = new Data(); - #region [private] + #region [private] - private void tSaveFile() - { - ConfigManager.SaveConfig(data, "Favorite.json"); - } + private void tSaveFile() { + ConfigManager.SaveConfig(data, "Favorite.json"); + } - private void tLoadFile() - { - data = ConfigManager.GetConfig(@"Favorite.json"); - } + private void tLoadFile() { + data = ConfigManager.GetConfig(@"Favorite.json"); + } - #endregion - } + #endregion + } } diff --git a/OpenTaiko/src/Common/KeyboardSoundGroupLevelControlHandler.cs b/OpenTaiko/src/Common/KeyboardSoundGroupLevelControlHandler.cs index 6bef55bc..3603f15d 100644 --- a/OpenTaiko/src/Common/KeyboardSoundGroupLevelControlHandler.cs +++ b/OpenTaiko/src/Common/KeyboardSoundGroupLevelControlHandler.cs @@ -1,58 +1,50 @@ using FDK; -namespace TJAPlayer3 -{ - /// - /// 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 = TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.SongVolIncrease); - bool isAdjustmentNegative = TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.SongVolDecrease); +namespace TJAPlayer3 { + /// + /// 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 = TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.SongVolIncrease); + bool isAdjustmentNegative = TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.SongVolDecrease); - if (!(isAdjustmentPositive || isAdjustmentNegative)) return; + if (!(isAdjustmentPositive || isAdjustmentNegative)) return; - ESoundGroup soundGroup; - CSkin.CSystemSound システムサウンド = null; + ESoundGroup soundGroup; + CSkin.CSystemSound システムサウンド = null; - 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; - } + 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(); - } - } + soundGroupLevelController.AdjustLevel(soundGroup, isAdjustmentPositive); + システムサウンド?.tPlay(); + } + } } diff --git a/OpenTaiko/src/Common/LogNotification.cs b/OpenTaiko/src/Common/LogNotification.cs index 29cb8dc7..828e9aa8 100644 --- a/OpenTaiko/src/Common/LogNotification.cs +++ b/OpenTaiko/src/Common/LogNotification.cs @@ -1,67 +1,52 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Diagnostics; using FDK; -namespace TJAPlayer3 -{ - internal class LogNotification - { - private static Queue Notifications = new Queue(); +namespace TJAPlayer3 { + internal class LogNotification { + private static Queue Notifications = new Queue(); - public enum ENotificationType - { - EINFO, - ESUCCESS, - EWARNING, - EERROR, - } + 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, TJAPlayer3.Timer); - } + public ENotificationType NotificationType = ENotificationType.EINFO; + public string Message = ""; + public CCounter LifeTime = new CCounter(0, 1000, 1, TJAPlayer3.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 c552b9be..8b6b00c9 100644 --- a/OpenTaiko/src/Common/Modal.cs +++ b/OpenTaiko/src/Common/Modal.cs @@ -1,47 +1,37 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Drawing; using FDK; -using System.Drawing; using static TJAPlayer3.CActSelect曲リスト; -namespace TJAPlayer3 -{ - internal class Modal - { - public Modal(EModalType mt, int ra, params object[] re) - { - modalType = mt; - rarity = ra; - reference = re; - _isSet = false; - // TODO: Add an int (?) or string to find the Puchichara/Character/Song asset to display it - } +namespace TJAPlayer3 { + internal class Modal { + public Modal(EModalType mt, int ra, params object[] re) { + modalType = mt; + rarity = ra; + reference = re; + _isSet = false; + // TODO: Add an int (?) or string to find the Puchichara/Character/Song asset to display it + } - public void tSetupModal() - { - CTexture[] arrRef; + public void tSetupModal() { + CTexture[] arrRef; - if (modalFormat == EModalFormat.Half) - arrRef = TJAPlayer3.Tx.Modal_Half; - else if (modalFormat == EModalFormat.Half_4P) - arrRef = TJAPlayer3.Tx.Modal_Half_4P; - else if (modalFormat == EModalFormat.Half_5P) - arrRef = TJAPlayer3.Tx.Modal_Half_5P; - else - arrRef = TJAPlayer3.Tx.Modal_Full; + if (modalFormat == EModalFormat.Half) + arrRef = TJAPlayer3.Tx.Modal_Half; + else if (modalFormat == EModalFormat.Half_4P) + arrRef = TJAPlayer3.Tx.Modal_Half_4P; + else if (modalFormat == EModalFormat.Half_5P) + arrRef = TJAPlayer3.Tx.Modal_Half_5P; + else + arrRef = TJAPlayer3.Tx.Modal_Full; - if (modalType == EModalType.Coin) - _box = arrRef[arrRef.Length - 1]; - else - { - int usedTex = Math.Max(0, Math.Min(arrRef.Length - 2, rarity)); - _box = arrRef[usedTex]; - } + if (modalType == EModalType.Coin) + _box = arrRef[arrRef.Length - 1]; + else { + int usedTex = Math.Max(0, Math.Min(arrRef.Length - 2, rarity)); + _box = arrRef[usedTex]; + } - /* + /* _boxRect = new Rectangle( (modalFormat == EModalFormat.Full || player == 0) ? 0 @@ -53,76 +43,68 @@ namespace TJAPlayer3 _box.szテクスチャサイズ.Height); */ - _boxRect = new Rectangle( - (modalFormat == EModalFormat.Full || player == 0) ? 0 : _box.szTextureSize.Width / 2, - 0, - (modalFormat == EModalFormat.Full) ? _box.szTextureSize.Width : _box.szTextureSize.Width / 2, - _box.szTextureSize.Height / (((TJAPlayer3.ConfigIni.nPlayerCount - 1) / 2) + 1)); + _boxRect = new Rectangle( + (modalFormat == EModalFormat.Full || player == 0) ? 0 : _box.szTextureSize.Width / 2, + 0, + (modalFormat == EModalFormat.Full) ? _box.szTextureSize.Width : _box.szTextureSize.Width / 2, + _box.szTextureSize.Height / (((TJAPlayer3.ConfigIni.nPlayerCount - 1) / 2) + 1)); - tGenerateTextures(); + tGenerateTextures(); - _isSet = true; - } + _isSet = true; + } - public void tDisplayModal() - { - if (_isSet == true) - { - _box?.t2D描画(_boxRect.Width * (player % 2), _boxRect.Height * (player / 2), _boxRect); + public void tDisplayModal() { + if (_isSet == true) { + _box?.t2D描画(_boxRect.Width * (player % 2), _boxRect.Height * (player / 2), _boxRect); - int[] title_x; - int[] title_y; - int[] text_x; - int[] text_y; - int moveX; - int moveY; + int[] title_x; + int[] title_y; + int[] text_x; + int[] text_y; + int moveX; + int moveY; - if (modalFormat == EModalFormat.Full) - { - title_x = new int[] { TJAPlayer3.Skin.Modal_Title_Full[0] }; - title_y = new int[] { TJAPlayer3.Skin.Modal_Title_Full[1] }; + if (modalFormat == EModalFormat.Full) { + title_x = new int[] { TJAPlayer3.Skin.Modal_Title_Full[0] }; + title_y = new int[] { TJAPlayer3.Skin.Modal_Title_Full[1] }; - text_x = new int[] { TJAPlayer3.Skin.Modal_Text_Full[0] }; - text_y = new int[] { TJAPlayer3.Skin.Modal_Text_Full[1] }; + text_x = new int[] { TJAPlayer3.Skin.Modal_Text_Full[0] }; + text_y = new int[] { TJAPlayer3.Skin.Modal_Text_Full[1] }; - moveX = TJAPlayer3.Skin.Modal_Text_Full_Move[0]; - moveY = TJAPlayer3.Skin.Modal_Text_Full_Move[1]; - } - else if (modalFormat == EModalFormat.Half) - { - title_x = TJAPlayer3.Skin.Modal_Title_Half_X; - title_y = TJAPlayer3.Skin.Modal_Title_Half_Y; + moveX = TJAPlayer3.Skin.Modal_Text_Full_Move[0]; + moveY = TJAPlayer3.Skin.Modal_Text_Full_Move[1]; + } else if (modalFormat == EModalFormat.Half) { + title_x = TJAPlayer3.Skin.Modal_Title_Half_X; + title_y = TJAPlayer3.Skin.Modal_Title_Half_Y; - text_x = TJAPlayer3.Skin.Modal_Text_Half_X; - text_y = TJAPlayer3.Skin.Modal_Text_Half_Y; + text_x = TJAPlayer3.Skin.Modal_Text_Half_X; + text_y = TJAPlayer3.Skin.Modal_Text_Half_Y; - moveX = TJAPlayer3.Skin.Modal_Text_Half_Move[0]; - moveY = TJAPlayer3.Skin.Modal_Text_Half_Move[1]; - } - else if (modalFormat == EModalFormat.Half_4P) - { - title_x = TJAPlayer3.Skin.Modal_Title_Half_X_4P; - title_y = TJAPlayer3.Skin.Modal_Title_Half_Y_4P; + moveX = TJAPlayer3.Skin.Modal_Text_Half_Move[0]; + moveY = TJAPlayer3.Skin.Modal_Text_Half_Move[1]; + } else if (modalFormat == EModalFormat.Half_4P) { + title_x = TJAPlayer3.Skin.Modal_Title_Half_X_4P; + title_y = TJAPlayer3.Skin.Modal_Title_Half_Y_4P; - text_x = TJAPlayer3.Skin.Modal_Text_Half_X_4P; - text_y = TJAPlayer3.Skin.Modal_Text_Half_Y_4P; + text_x = TJAPlayer3.Skin.Modal_Text_Half_X_4P; + text_y = TJAPlayer3.Skin.Modal_Text_Half_Y_4P; - moveX = TJAPlayer3.Skin.Modal_Text_Half_Move_4P[0]; - moveY = TJAPlayer3.Skin.Modal_Text_Half_Move_4P[1]; - } - else// 5P - { - title_x = TJAPlayer3.Skin.Modal_Title_Half_X_5P; - title_y = TJAPlayer3.Skin.Modal_Title_Half_Y_5P; + moveX = TJAPlayer3.Skin.Modal_Text_Half_Move_4P[0]; + moveY = TJAPlayer3.Skin.Modal_Text_Half_Move_4P[1]; + } else// 5P + { + title_x = TJAPlayer3.Skin.Modal_Title_Half_X_5P; + title_y = TJAPlayer3.Skin.Modal_Title_Half_Y_5P; - text_x = TJAPlayer3.Skin.Modal_Text_Half_X_5P; - text_y = TJAPlayer3.Skin.Modal_Text_Half_Y_5P; + text_x = TJAPlayer3.Skin.Modal_Text_Half_X_5P; + text_y = TJAPlayer3.Skin.Modal_Text_Half_Y_5P; - moveX = TJAPlayer3.Skin.Modal_Text_Half_Move_5P[0]; - moveY = TJAPlayer3.Skin.Modal_Text_Half_Move_5P[1]; - } + moveX = TJAPlayer3.Skin.Modal_Text_Half_Move_5P[0]; + moveY = TJAPlayer3.Skin.Modal_Text_Half_Move_5P[1]; + } - /* + /* Point[] Pos = new Point[] { (modalFormat == EModalFormat.Full) ? new Point(TJAPlayer3.Skin.Modal_Title_Full[0], TJAPlayer3.Skin.Modal_Title_Full[1]) : new Point(TJAPlayer3.Skin.Modal_Title_Half_X[player], TJAPlayer3.Skin.Modal_Title_Half_Y[player]), // title @@ -135,172 +117,156 @@ namespace TJAPlayer3 }; */ - Point[] Pos = new Point[] - { - new Point(title_x[player], title_y[player]), - new Point(text_x[player] + (tTextCentered () ? moveX : 0), - text_y[player] + (tTextCentered () ? moveY : 0)), // content + Point[] Pos = new Point[] + { + new Point(title_x[player], title_y[player]), + new Point(text_x[player] + (tTextCentered () ? moveX : 0), + text_y[player] + (tTextCentered () ? moveY : 0)), // content }; - _ModalTitle?.t2D中心基準描画(Pos[0].X, Pos[0].Y); - _ModalText?.t2D中心基準描画(Pos[1].X, Pos[1].Y); + _ModalTitle?.t2D中心基準描画(Pos[0].X, Pos[0].Y); + _ModalText?.t2D中心基準描画(Pos[1].X, Pos[1].Y); - // Extra texture for Puchichara, Character and Titles next - } - } + // Extra texture for Puchichara, Character and Titles next + } + } - public void tPlayModalSfx() - { - if (modalType == EModalType.Coin) - TJAPlayer3.Skin.soundModal[TJAPlayer3.Skin.soundModal.Length - 1].tPlay(); - else - TJAPlayer3.Skin.soundModal[Math.Max(0, Math.Min(TJAPlayer3.Skin.soundModal.Length - 2, rarity))].tPlay(); - } + public void tPlayModalSfx() { + if (modalType == EModalType.Coin) + TJAPlayer3.Skin.soundModal[TJAPlayer3.Skin.soundModal.Length - 1].tPlay(); + else + TJAPlayer3.Skin.soundModal[Math.Max(0, Math.Min(TJAPlayer3.Skin.soundModal.Length - 2, rarity))].tPlay(); + } - public static void tInitModalFonts() - { - if (_pfModalContentHalf != null - && _pfModalTitleHalf != null - && _pfModalContentFull != null - && _pfModalTitleFull != null) - return; + public static void tInitModalFonts() { + if (_pfModalContentHalf != null + && _pfModalTitleHalf != null + && _pfModalContentFull != null + && _pfModalTitleFull != null) + return; - _pfModalContentHalf = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Modal_Font_ModalContentHalf_Size); - _pfModalTitleHalf = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Modal_Font_ModalTitleHalf_Size); - _pfModalContentFull = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Modal_Font_ModalContentFull_Size); - _pfModalTitleFull = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Modal_Font_ModalTitleFull_Size); - } + _pfModalContentHalf = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Modal_Font_ModalContentHalf_Size); + _pfModalTitleHalf = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Modal_Font_ModalTitleHalf_Size); + _pfModalContentFull = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Modal_Font_ModalContentFull_Size); + _pfModalTitleFull = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Modal_Font_ModalTitleFull_Size); + } - #region [Enum definitions] + #region [Enum definitions] - public enum EModalType - { - Coin = 0, - Character = 1, - Puchichara = 2, - Title = 3, - Song = 4, - Total = 5, - } + 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, - } + // Full : 1P standard modal, Half : Splitted screen modal + public enum EModalFormat { + Full, + Half, + Half_4P, + Half_5P, + } - #endregion + #endregion - #region [Public variables] + #region [Public variables] - // Coin number for coin; database/unlockable asset for puchichara, character and title; no effect on text, confirm - public object[] reference; + // 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; + public int rarity; + public EModalType modalType; + public EModalFormat modalFormat; - // For modalFormat = Half only - public int player; + // For modalFormat = Half only + public int player; - #endregion + #endregion - #region [private] + #region [private] - // Check if the text is vertically centered or slightly up (to let enough space for the unlocked unit texture) - private bool tTextCentered() - { - if (modalType == EModalType.Coin) - return true; - return false; - } + // Check if the text is vertically centered or slightly up (to let enough space for the unlocked unit texture) + private bool tTextCentered() { + if (modalType == EModalType.Coin) + return true; + return false; + } - // Generate the modal title and content text textures - private void tGenerateTextures() - { - string modalKey = "MODAL_TITLE_COIN"; - switch (modalType) - { - case EModalType.Character: - modalKey = "MODAL_TITLE_CHARA"; - break; - case EModalType.Puchichara: - modalKey = "MODAL_TITLE_PUCHI"; - break; - case EModalType.Title: - modalKey = "MODAL_TITLE_NAMEPLATE"; - break; - case EModalType.Song: - modalKey = "MODAL_TITLE_SONG"; - break; - } - TitleTextureKey _title = new TitleTextureKey( - CLangManager.LangInstance.GetString(modalKey), - (modalFormat == EModalFormat.Full) - ? _pfModalTitleFull - : _pfModalTitleHalf, - Color.White, - Color.Black, - 1800); + // Generate the modal title and content text textures + private void tGenerateTextures() { + string modalKey = "MODAL_TITLE_COIN"; + switch (modalType) { + case EModalType.Character: + modalKey = "MODAL_TITLE_CHARA"; + break; + case EModalType.Puchichara: + modalKey = "MODAL_TITLE_PUCHI"; + break; + case EModalType.Title: + modalKey = "MODAL_TITLE_NAMEPLATE"; + break; + case EModalType.Song: + modalKey = "MODAL_TITLE_SONG"; + break; + } + TitleTextureKey _title = new TitleTextureKey( + CLangManager.LangInstance.GetString(modalKey), + (modalFormat == EModalFormat.Full) + ? _pfModalTitleFull + : _pfModalTitleHalf, + Color.White, + Color.Black, + 1800); - string content = ""; + string content = ""; - if (modalType == EModalType.Coin) - { - content = CLangManager.LangInstance.GetString("MODAL_MESSAGE_COIN", reference[0].ToString(), TJAPlayer3.SaveFileInstances[player].data.Medals.ToString()); - //content = String.Format("+{0} {1} ({2}: {3})", - // (int)reference[0], - // CLangManager.LangInstance.GetString(306), - // CLangManager.LangInstance.GetString(307), - // TJAPlayer3.SaveFileInstances[player].data.Medals - // ); - } - else if (modalType == EModalType.Title) - { - content = ((string)reference[0]).RemoveTags(); - } - else if (modalType == EModalType.Character) - { - content = ((string)reference[0]).RemoveTags(); - } - else if (modalType == EModalType.Puchichara) - { - content = ((string)reference[0]).RemoveTags(); - } - else if (modalType == EModalType.Song) - { - content = ((string)reference[0]).RemoveTags(); - } + if (modalType == EModalType.Coin) { + content = CLangManager.LangInstance.GetString("MODAL_MESSAGE_COIN", reference[0].ToString(), TJAPlayer3.SaveFileInstances[player].data.Medals.ToString()); + //content = String.Format("+{0} {1} ({2}: {3})", + // (int)reference[0], + // CLangManager.LangInstance.GetString(306), + // CLangManager.LangInstance.GetString(307), + // TJAPlayer3.SaveFileInstances[player].data.Medals + // ); + } else if (modalType == EModalType.Title) { + content = ((string)reference[0]).RemoveTags(); + } else if (modalType == EModalType.Character) { + content = ((string)reference[0]).RemoveTags(); + } else if (modalType == EModalType.Puchichara) { + content = ((string)reference[0]).RemoveTags(); + } else if (modalType == EModalType.Song) { + content = ((string)reference[0]).RemoveTags(); + } - TitleTextureKey _content = new TitleTextureKey( - content, - (modalFormat == EModalFormat.Full) - ? _pfModalContentFull - : _pfModalContentHalf, - Color.White, - Color.Black, - 1800); + TitleTextureKey _content = new TitleTextureKey( + content, + (modalFormat == EModalFormat.Full) + ? _pfModalContentFull + : _pfModalContentHalf, + Color.White, + Color.Black, + 1800); - _ModalText = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(_content); - _ModalTitle = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(_title); - } + _ModalText = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(_content); + _ModalTitle = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(_title); + } - private CTexture _box; - private Rectangle _boxRect; + private CTexture _box; + private Rectangle _boxRect; - private bool _isSet; + private bool _isSet; - private static CCachedFontRenderer _pfModalTitleHalf; - private static CCachedFontRenderer _pfModalContentHalf; - private static CCachedFontRenderer _pfModalTitleFull; - private static CCachedFontRenderer _pfModalContentFull; + private static CCachedFontRenderer _pfModalTitleHalf; + private static CCachedFontRenderer _pfModalContentHalf; + private static CCachedFontRenderer _pfModalTitleFull; + private static CCachedFontRenderer _pfModalContentFull; - private CTexture _ModalTitle; - private CTexture _ModalText; + private CTexture _ModalTitle; + private CTexture _ModalText; - #endregion - } + #endregion + } } diff --git a/OpenTaiko/src/Common/ModalQueue.cs b/OpenTaiko/src/Common/ModalQueue.cs index c709bf84..40493c5b 100644 --- a/OpenTaiko/src/Common/ModalQueue.cs +++ b/OpenTaiko/src/Common/ModalQueue.cs @@ -1,82 +1,68 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +namespace TJAPlayer3 { + internal class ModalQueue { + public ModalQueue(Modal.EModalFormat mf) { + _modalQueues = new Queue[] { new Queue(), new Queue(), new Queue(), new Queue(), new Queue() }; + _modalFormat = mf; + } -namespace TJAPlayer3 -{ - internal class ModalQueue - { - public ModalQueue(Modal.EModalFormat mf) - { - _modalQueues = new Queue[] { new Queue(), new Queue(), new Queue(), new Queue(), new Queue() }; - _modalFormat = mf; - } + // Add two modals (one per player) at the same time + public void tAddModal(Modal mp1, Modal mp2, Modal mp3, Modal mp4, Modal mp5) { + mp1.modalFormat = _modalFormat; + mp2.modalFormat = _modalFormat; + mp3.modalFormat = _modalFormat; + mp4.modalFormat = _modalFormat; + mp5.modalFormat = _modalFormat; + mp1.player = 0; + mp2.player = 1; + mp3.player = 2; + mp4.player = 3; + mp5.player = 4; + mp1.tSetupModal(); + mp2.tSetupModal(); + mp3.tSetupModal(); + mp4.tSetupModal(); + mp5.tSetupModal(); - // Add two modals (one per player) at the same time - public void tAddModal(Modal mp1, Modal mp2, Modal mp3, Modal mp4, Modal mp5) - { - mp1.modalFormat = _modalFormat; - mp2.modalFormat = _modalFormat; - mp3.modalFormat = _modalFormat; - mp4.modalFormat = _modalFormat; - mp5.modalFormat = _modalFormat; - mp1.player = 0; - mp2.player = 1; - mp3.player = 2; - mp4.player = 3; - mp5.player = 4; - mp1.tSetupModal(); - mp2.tSetupModal(); - mp3.tSetupModal(); - mp4.tSetupModal(); - mp5.tSetupModal(); + if (mp1 != null) + _modalQueues[0].Enqueue(mp1); + if (mp2 != null) + _modalQueues[1].Enqueue(mp2); + if (mp3 != null) + _modalQueues[2].Enqueue(mp3); + if (mp4 != null) + _modalQueues[3].Enqueue(mp4); + if (mp5 != null) + _modalQueues[4].Enqueue(mp5); + } - if (mp1 != null) - _modalQueues[0].Enqueue(mp1); - if (mp2 != null) - _modalQueues[1].Enqueue(mp2); - if (mp3 != null) - _modalQueues[2].Enqueue(mp3); - if (mp4 != null) - _modalQueues[3].Enqueue(mp4); - if (mp5 != null) - _modalQueues[4].Enqueue(mp5); - } + // Add a single modal + public void tAddModal(Modal mp, int player) { + mp.modalFormat = _modalFormat; + mp.player = player; + mp.tSetupModal(); - // Add a single modal - public void tAddModal(Modal mp, int player) - { - mp.modalFormat = _modalFormat; - mp.player = player; - mp.tSetupModal(); + if (mp != null && player >= 0 && player < TJAPlayer3.ConfigIni.nPlayerCount) + _modalQueues[player].Enqueue(mp); + } - if (mp != null && player >= 0 && player < TJAPlayer3.ConfigIni.nPlayerCount) - _modalQueues[player].Enqueue(mp); - } + public Modal tPopModal(int player) { + if (!tIsQueueEmpty(player)) + return _modalQueues[player].Dequeue(); + return null; + } - public Modal tPopModal(int player) - { - if (!tIsQueueEmpty(player)) - return _modalQueues[player].Dequeue(); - return null; - } + public bool tIsQueueEmpty(int player) { + if (player < 0 || player >= TJAPlayer3.ConfigIni.nPlayerCount) + return true; - public bool tIsQueueEmpty(int player) - { - if (player < 0 || player >= TJAPlayer3.ConfigIni.nPlayerCount) - return true; + return _modalQueues[player].Count < 1; + } - return _modalQueues[player].Count < 1; - } + public bool tAreBothQueuesEmpty() { + return tIsQueueEmpty(0) && tIsQueueEmpty(1) && tIsQueueEmpty(2) && tIsQueueEmpty(3) && tIsQueueEmpty(4); + } - public bool tAreBothQueuesEmpty() - { - return tIsQueueEmpty(0) && tIsQueueEmpty(1) && tIsQueueEmpty(2) && tIsQueueEmpty(3) && tIsQueueEmpty(4); - } - - private Modal.EModalFormat _modalFormat; - private Queue[] _modalQueues; - } + private Modal.EModalFormat _modalFormat; + private Queue[] _modalQueues; + } } diff --git a/OpenTaiko/src/Common/NamePlateConfig.cs b/OpenTaiko/src/Common/NamePlateConfig.cs index b1e573eb..70b2f3f7 100644 --- a/OpenTaiko/src/Common/NamePlateConfig.cs +++ b/OpenTaiko/src/Common/NamePlateConfig.cs @@ -1,249 +1,223 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; +using Newtonsoft.Json; -namespace TJAPlayer3 -{ - class NamePlateConfig - { - public void tNamePlateConfig() - { - // Deprecated, only converts to new format - /* +namespace TJAPlayer3 { + class NamePlateConfig { + public void tNamePlateConfig() { + // Deprecated, only converts to new format + /* if (!File.Exists("NamePlate.json")) tSaveFile(); */ - tLoadFile(); - } + tLoadFile(); + } - #region [Medals] + #region [Medals] - public void tEarnCoins(int[] amounts) - { - if (amounts.Length < 2) - return; + public void tEarnCoins(int[] amounts) { + if (amounts.Length < 2) + return; - for (int i = 0; i < 5; i++) - { - int p = TJAPlayer3.GetActualPlayer(i); + for (int i = 0; i < 5; i++) { + int p = TJAPlayer3.GetActualPlayer(i); - data.Medals[p] += amounts[i]; - } - tSaveFile(); - } + 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; + // 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; + if (data.Medals[player] < amount) + return false; - data.Medals[player] -= amount; + data.Medals[player] -= amount; - tSaveFile(); + tSaveFile(); - return true; - } + return true; + } - #endregion + #endregion - #region [Dan titles] + #region [Dan titles] - public bool tUpdateDanTitle(string title, bool isGold, int clearStatus, int player) - { - bool changed = false; + public bool tUpdateDanTitle(string title, bool isGold, int clearStatus, int player) { + bool changed = false; - bool iG = isGold; - int cs = clearStatus; + bool iG = isGold; + int cs = clearStatus; - if (TJAPlayer3.NamePlateConfig.data.DanTitles[player] == null) - TJAPlayer3.NamePlateConfig.data.DanTitles[player] = new Dictionary(); + if (TJAPlayer3.NamePlateConfig.data.DanTitles[player] == null) + TJAPlayer3.NamePlateConfig.data.DanTitles[player] = new Dictionary(); - if (TJAPlayer3.NamePlateConfig.data.DanTitles[player].ContainsKey(title)) - { - if (TJAPlayer3.NamePlateConfig.data.DanTitles[player][title].clearStatus > cs) - cs = TJAPlayer3.NamePlateConfig.data.DanTitles[player][title].clearStatus; - if (TJAPlayer3.NamePlateConfig.data.DanTitles[player][title].isGold) - iG = true; - } + if (TJAPlayer3.NamePlateConfig.data.DanTitles[player].ContainsKey(title)) { + if (TJAPlayer3.NamePlateConfig.data.DanTitles[player][title].clearStatus > cs) + cs = TJAPlayer3.NamePlateConfig.data.DanTitles[player][title].clearStatus; + if (TJAPlayer3.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 + // Automatically set the dan to nameplate if new + // Add a function within the NamePlate.cs file to update the title texture - if (!TJAPlayer3.NamePlateConfig.data.DanTitles[player].ContainsKey(title) || cs != clearStatus || iG != isGold) - { - changed = true; - /* + if (!TJAPlayer3.NamePlateConfig.data.DanTitles[player].ContainsKey(title) || cs != clearStatus || iG != isGold) { + changed = true; + /* TJAPlayer3.NamePlateConfig.data.Dan[player] = title; TJAPlayer3.NamePlateConfig.data.DanGold[player] = iG; TJAPlayer3.NamePlateConfig.data.DanType[player] = cs; */ - } + } - SaveFile.CDanTitle danTitle = new SaveFile.CDanTitle(iG, cs); + SaveFile.CDanTitle danTitle = new SaveFile.CDanTitle(iG, cs); - TJAPlayer3.NamePlateConfig.data.DanTitles[player][title] = danTitle; + TJAPlayer3.NamePlateConfig.data.DanTitles[player][title] = danTitle; - tSaveFile(); + tSaveFile(); - return changed; - } + return changed; + } - #endregion + #endregion - #region [Auxilliary classes] + #region [Auxilliary classes] - public class CDanTitle - { - public CDanTitle(bool iG, int cs) - { - isGold = iG; - clearStatus = cs; - } + public class CDanTitle { + public CDanTitle(bool iG, int cs) { + isGold = iG; + clearStatus = cs; + } - [JsonProperty("isGold")] - public bool isGold; + [JsonProperty("isGold")] + public bool isGold; - [JsonProperty("clearStatus")] - public int clearStatus; - } + [JsonProperty("clearStatus")] + public int clearStatus; + } - public class CNamePlateTitle - { - public CNamePlateTitle(int type) - { - iType = type; - } + public class CNamePlateTitle { + public CNamePlateTitle(int type) { + iType = type; + } - [JsonProperty("iType")] - public int iType; - } + [JsonProperty("iType")] + public int iType; + } - #endregion + #endregion - #region [Heya] + #region [Heya] - public void tReindexCharacter(int p, string[] characterNamesList) - { - string character = this.data.CharacterName[p]; + 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); + 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 tUpdateCharacterName(int p, string newChara) { + this.data.CharacterName[p] = newChara; + } - public void tApplyHeyaChanges() - { - this.tSaveFile(); - } + public void tApplyHeyaChanges() { + this.tSaveFile(); + } - #endregion + #endregion - public class Data - { - [JsonProperty("name")] - public string[] Name = { "プレイヤー1", "プレイヤー2", "プレイヤー3", "プレイヤー4", "プレイヤー5" }; + public class Data { + [JsonProperty("name")] + public string[] Name = { "プレイヤー1", "プレイヤー2", "プレイヤー3", "プレイヤー4", "プレイヤー5" }; - [JsonProperty("title")] - public string[] Title = { "初心者", "初心者", "初心者", "初心者", "初心者" }; + [JsonProperty("title")] + public string[] Title = { "初心者", "初心者", "初心者", "初心者", "初心者" }; - [JsonProperty("dan")] - public string[] Dan = { "新人", "新人", "新人", "新人", "新人" }; + [JsonProperty("dan")] + public string[] Dan = { "新人", "新人", "新人", "新人", "新人" }; - [JsonProperty("danGold")] - public bool[] DanGold = { false, false, false, false, false }; + [JsonProperty("danGold")] + public bool[] DanGold = { false, false, false, false, false }; - [JsonProperty("danType")] - public int[] DanType = { 0, 0, 0, 0, 0 }; + [JsonProperty("danType")] + public int[] DanType = { 0, 0, 0, 0, 0 }; - [JsonProperty("titleType")] - public int[] TitleType = { 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("puchiChara")] + public string[] PuchiChara = { "0", "0", "0", "0", "0" }; - [JsonProperty("medals")] - public int[] Medals = { 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("character")] + public int[] Character = { 0, 0, 0, 0, 0 }; - [JsonProperty("characterName")] - public string[] CharacterName = { "0", "0", "0", "0", "0" }; + [JsonProperty("characterName")] + public string[] CharacterName = { "0", "0", "0", "0", "0" }; - [JsonProperty("danTitles")] - public Dictionary[] DanTitles = new Dictionary[5]; + [JsonProperty("danTitles")] + public Dictionary[] DanTitles = new Dictionary[5]; - [JsonProperty("namePlateTitles")] - public Dictionary[] NamePlateTitles = 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() - }; + [JsonProperty("unlockedPuchicharas")] + public List[] UnlockedPuchicharas = new List[5] + { + new List(), + new List(), + new List(), + new List(), + new List() + }; - } + } - public Data data = new Data(); + public Data data = new Data(); - #region [private] + #region [private] - private void tSaveFile() - { - ConfigManager.SaveConfig(data, "NamePlate.json"); - } + private void tSaveFile() { + ConfigManager.SaveConfig(data, "NamePlate.json"); + } - private void tLoadFile() - { - //data = ConfigManager.GetConfig(@"NamePlate.json"); + private void tLoadFile() { + //data = ConfigManager.GetConfig(@"NamePlate.json"); - if (!File.Exists("NamePlate.json")) - return; + if (!File.Exists("NamePlate.json")) + return; - var _data = ConfigManager.GetConfig(@"NamePlate.json"); + 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(); - } + 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"); - } + System.IO.File.Move(@"NamePlate.json", @"NamePlate_old.json"); + } - #endregion - } + #endregion + } } diff --git a/OpenTaiko/src/Common/Program.cs b/OpenTaiko/src/Common/Program.cs index 391671b8..6da677ae 100644 --- a/OpenTaiko/src/Common/Program.cs +++ b/OpenTaiko/src/Common/Program.cs @@ -1,79 +1,63 @@ -using System; -using System.Collections.Generic; +using System.Diagnostics; using System.Globalization; -using System.Text; -using System.Runtime.InteropServices; -using System.Threading; -using System.Diagnostics; -using System.IO; -using FDK; using System.Reflection; +using System.Runtime.InteropServices; +using System.Text; -namespace TJAPlayer3 -{ - internal class Program - { +namespace TJAPlayer3 { + 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" ) ? + 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 ) - { + if (bLoadDllCheck) { + IntPtr hModule = LoadLibrary(strDll名); // 実際にLoadDll()してチェックする + if (hModule == IntPtr.Zero) { //MessageBox.Show( str存在しないときに表示するエラー文字列, "DTXMania runtime error", MessageBoxButtons.OK, MessageBoxIcon.Hand ); return false; } - FreeLibrary( hModule ); - } - else - { // 単純にファイルの存在有無をチェックするだけ (プロジェクトで「参照」していたり、アンマネージドなDLLが暗黙リンクされるものはこちら) - string path = Path.Combine( System.IO.Directory.GetCurrentDirectory(), strDll名 ); - if ( !File.Exists( path ) ) - { + FreeLibrary(hModule); + } else { // 単純にファイルの存在有無をチェックするだけ (プロジェクトで「参照」していたり、アンマネージドなDLLが暗黙リンクされるものはこちら) + string path = Path.Combine(System.IO.Directory.GetCurrentDirectory(), strDll名); + if (!File.Exists(path)) { //MessageBox.Show( str存在しないときに表示するエラー文字列, "DTXMania runtime error", MessageBoxButtons.OK, MessageBoxIcon.Hand ); return false; } } return true; } - private static bool tDLLの存在チェック( string strDll名, string str存在しないときに表示するエラー文字列jp, string str存在しないときに表示するエラー文字列en ) - { + private static bool tDLLの存在チェック(string strDll名, string str存在しないときに表示するエラー文字列jp, string str存在しないときに表示するエラー文字列en) { return true; //return tDLLの存在チェック( strDll名, str存在しないときに表示するエラー文字列jp, str存在しないときに表示するエラー文字列en, false ); } #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 void FreeLibrary(IntPtr hModule); - [DllImport( "kernel32", CharSet = CharSet.Unicode, SetLastError = true )] - internal static extern IntPtr LoadLibrary( string lpFileName ); + [DllImport("kernel32", CharSet = CharSet.Unicode, SetLastError = true)] + internal static extern IntPtr LoadLibrary(string lpFileName); #endregion //----------------------------- #endregion - [STAThread] - static void Main() - { + [STAThread] + static void Main() { Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); - - mutex二重起動防止用 = new Mutex( false, "DTXManiaMutex" ); - if ( mutex二重起動防止用.WaitOne( 0, false ) ) - { + mutex二重起動防止用 = new Mutex(false, "DTXManiaMutex"); + + if (mutex二重起動防止用.WaitOne(0, false)) { string newLine = Environment.NewLine; bool bDLLnotfound = false; - Trace.WriteLine( "Current Directory: " + Environment.CurrentDirectory ); + Trace.WriteLine("Current Directory: " + Environment.CurrentDirectory); //Trace.WriteLine( "EXEのあるフォルダ: " + Path.GetDirectoryName( Application.ExecutablePath ) ); - Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; + Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; { @@ -83,7 +67,7 @@ namespace TJAPlayer3 try #endif { - + string osplatform = ""; if (OperatingSystem.IsWindows()) osplatform = "win"; @@ -96,8 +80,7 @@ namespace TJAPlayer3 string platform = ""; - switch (RuntimeInformation.ProcessArchitecture) - { + switch (RuntimeInformation.ProcessArchitecture) { case Architecture.X64: platform = "x64"; break; @@ -114,20 +97,19 @@ namespace TJAPlayer3 throw new PlatformNotSupportedException($"TJAPlayer3 does not support this Architecture. ({RuntimeInformation.ProcessArchitecture})"); } - FFmpeg.AutoGen.ffmpeg.RootPath = AppContext.BaseDirectory + @"FFmpeg/" + osplatform + "-" + platform + "/"; + FFmpeg.AutoGen.ffmpeg.RootPath = AppContext.BaseDirectory + @"FFmpeg/" + osplatform + "-" + platform + "/"; DirectoryInfo info = new DirectoryInfo(AppContext.BaseDirectory + @"Libs/" + osplatform + "-" + platform + "/"); //実行ファイルの階層にライブラリをコピー - foreach (FileInfo fileinfo in info.GetFiles()) - { + foreach (FileInfo fileinfo in info.GetFiles()) { fileinfo.CopyTo(AppContext.BaseDirectory + fileinfo.Name, true); } - using ( var mania = new TJAPlayer3() ) + using (var mania = new TJAPlayer3()) mania.Run(); - Trace.WriteLine( "" ); - Trace.WriteLine( "遊んでくれてありがとう!" ); + Trace.WriteLine(""); + Trace.WriteLine("遊んでくれてありがとう!"); } #if !DEBUG catch( Exception e ) @@ -144,8 +126,8 @@ namespace TJAPlayer3 // 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 のリリースが必要である。 @@ -154,14 +136,13 @@ namespace TJAPlayer3 mutex二重起動防止用 = null; // END #24615 2011.03.09 from - } - else // DTXManiaが既に起動中 - { - + } else // DTXManiaが既に起動中 + { + // → 引数が0個の時はそのまま終了 // 1個( コンパクトモード or DTXV -S) か2個 (DTXV -Nxxx ファイル名)のときは、そのプロセスにコマンドラインを丸々投げて終了する - for ( int i = 0; i < 5; i++ ) // 検索結果のハンドルがZeroになることがあるので、200ms間隔で5回リトライする + for (int i = 0; i < 5; i++) // 検索結果のハンドルがZeroになることがあるので、200ms間隔で5回リトライする { #region [ 既に起動中のDTXManiaプロセスを検索する。] // このやり方だと、ShowInTaskbar=falseでタスクバーに表示されないパターンの時に検索に失敗するようだが @@ -169,16 +150,14 @@ namespace TJAPlayer3 // FindWindowを使えばこのパターンにも対応できるが、C#でビルドするアプリはウインドウクラス名を自前指定できないので、これは使わない。 Process current = Process.GetCurrentProcess(); - Process[] running = Process.GetProcessesByName( current.ProcessName ); + Process[] running = Process.GetProcessesByName(current.ProcessName); Process target = null; //IntPtr hWnd = FindWindow( null, "DTXMania .NET style release " + CDTXMania.VERSION ); - foreach ( Process p in running ) - { - if ( p.Id != current.Id ) // プロセス名は同じでかつ、プロセスIDが自分自身とは異なるものを探す + foreach (Process p in running) { + if (p.Id != current.Id) // プロセス名は同じでかつ、プロセスIDが自分自身とは異なるものを探す { - if ( p.MainModule.FileName == current.MainModule.FileName && p.MainWindowHandle != IntPtr.Zero ) - { + if (p.MainModule.FileName == current.MainModule.FileName && p.MainWindowHandle != IntPtr.Zero) { target = p; break; } @@ -187,31 +166,24 @@ namespace TJAPlayer3 #endregion #region [ 起動中のDTXManiaがいれば、そのプロセスにコマンドラインを投げる ] - if ( target != null ) - { + if (target != null) { string[] commandLineArgs = Environment.GetCommandLineArgs(); - if ( commandLineArgs != null && commandLineArgs.Length > 1 ) - { + 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 ] + "\""; + 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 ); + else { + Trace.TraceInformation("メッセージ送信先のプロセスが見つからず。5回リトライします。"); + Thread.Sleep(200); } } } diff --git a/OpenTaiko/src/Common/RecentlyPlayedSongs.cs b/OpenTaiko/src/Common/RecentlyPlayedSongs.cs index 62f11f63..1d9de304 100644 --- a/OpenTaiko/src/Common/RecentlyPlayedSongs.cs +++ b/OpenTaiko/src/Common/RecentlyPlayedSongs.cs @@ -1,57 +1,43 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; +namespace TJAPlayer3 { + internal class RecentlyPlayedSongs { + public void tRecentlyPlayedSongs() { + if (!File.Exists("RecentlyPlayedSongs.json")) + tSaveFile(); -namespace TJAPlayer3 -{ - internal class RecentlyPlayedSongs - { - public void tRecentlyPlayedSongs() { - if (!File.Exists("RecentlyPlayedSongs.json")) - tSaveFile(); + tLoadFile(); + } - tLoadFile(); - } + #region [Auxiliary methods] - #region [Auxiliary methods] + public void tAddChart(string chartID) { + if (!data.recentlyplayedsongs[TJAPlayer3.SaveFile].Contains(chartID)) + data.recentlyplayedsongs[TJAPlayer3.SaveFile].Enqueue(chartID); - public void tAddChart(string chartID) - { - if (!data.recentlyplayedsongs[TJAPlayer3.SaveFile].Contains(chartID)) - data.recentlyplayedsongs[TJAPlayer3.SaveFile].Enqueue(chartID); + while (data.recentlyplayedsongs[TJAPlayer3.SaveFile].Count > TJAPlayer3.ConfigIni.nRecentlyPlayedMax) + data.recentlyplayedsongs[TJAPlayer3.SaveFile].Dequeue(); - while (data.recentlyplayedsongs[TJAPlayer3.SaveFile].Count > TJAPlayer3.ConfigIni.nRecentlyPlayedMax) - data.recentlyplayedsongs[TJAPlayer3.SaveFile].Dequeue(); + tSaveFile(); + } - tSaveFile(); - } + #endregion - #endregion + public class Data { + public Queue[] recentlyplayedsongs = new Queue[2] { new Queue(), new Queue() }; + } - public class Data - { - public Queue[] recentlyplayedsongs = new Queue[2] { new Queue(), new Queue() }; - } + public Data data = new Data(); - public Data data = new Data(); + #region [private] - #region [private] + private void tSaveFile() { + ConfigManager.SaveConfig(data, "RecentlyPlayedSongs.json"); + } - private void tSaveFile() - { - ConfigManager.SaveConfig(data, "RecentlyPlayedSongs.json"); - } + private void tLoadFile() { + data = ConfigManager.GetConfig(@"RecentlyPlayedSongs.json"); + } - private void tLoadFile() - { - data = ConfigManager.GetConfig(@"RecentlyPlayedSongs.json"); - } - - #endregion - } + #endregion + } } diff --git a/OpenTaiko/src/Common/SaveFile.cs b/OpenTaiko/src/Common/SaveFile.cs index 4488b829..7f42bd1d 100644 --- a/OpenTaiko/src/Common/SaveFile.cs +++ b/OpenTaiko/src/Common/SaveFile.cs @@ -1,405 +1,359 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Security.Policy; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; +using Newtonsoft.Json; -namespace TJAPlayer3 -{ - internal class SaveFile - { +namespace TJAPlayer3 { + internal class SaveFile { - public void tSaveFile(string filename) - { - path = @$"Saves{Path.DirectorySeparatorChar}" + filename + @".json"; - name = filename; + public void tSaveFile(string filename) { + path = @$"Saves{Path.DirectorySeparatorChar}" + filename + @".json"; + name = filename; - if (!File.Exists(path)) - { - this.data.Name = filename; - tSaveFile(); - } - - tLoadFile(); + if (!File.Exists(path)) { + this.data.Name = filename; + tSaveFile(); + } - tInitSaveFile(); - } + tLoadFile(); - public void tInitSaveFile() - { - data.bestPlays = DBSaves.GetBestPlaysAsDict(data.SaveId); - data.tFactorizeBestPlays(); - } + tInitSaveFile(); + } - 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); - } - + public void tInitSaveFile() { + data.bestPlays = DBSaves.GetBestPlaysAsDict(data.SaveId); + data.tFactorizeBestPlays(); + } - #region [Medals and PlayCount] + 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); + } - 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); - //tSaveFile(); - } + #region [Medals and PlayCount] - // Return false if the current amount of coins is to low - public bool tSpendCoins(int amount) - { - if (data.Medals < amount) - return false; + public void tEarnCoins(int amount) { + data.Medals += amount; + data.TotalEarnedMedals += amount; - data.Medals -= amount; - DBSaves.AlterCoinsAndTotalPlayCount(data.SaveId, -amount, 0); - //tSaveFile(); + // 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); + //tSaveFile(); + } - return true; - } + // Return false if the current amount of coins is to low + public bool tSpendCoins(int amount) { + if (data.Medals < amount) + return false; - public void tRegisterAIBattleModePlay(bool IsWon) - { - data.AIBattleModePlaycount++; - if (IsWon) data.AIBattleModeWins++; - DBSaves.RegisterAIBattleModePlay(data.SaveId, IsWon); - } + data.Medals -= amount; + DBSaves.AlterCoinsAndTotalPlayCount(data.SaveId, -amount, 0); + //tSaveFile(); - #endregion + return true; + } - #region [Dan titles] + public void tRegisterAIBattleModePlay(bool IsWon) { + data.AIBattleModePlaycount++; + if (IsWon) data.AIBattleModeWins++; + DBSaves.RegisterAIBattleModePlay(data.SaveId, IsWon); + } - public bool tUpdateDanTitle(string title, bool isGold, int clearStatus) - { - bool changed = false; + #endregion - bool iG = isGold; - int cs = clearStatus; + #region [Dan titles] - if (this.data.DanTitles == null) - this.data.DanTitles = new Dictionary(); + public bool tUpdateDanTitle(string title, bool isGold, int clearStatus) { + bool changed = false; - 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; - } + bool iG = isGold; + int cs = clearStatus; - // 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 == null) + this.data.DanTitles = new Dictionary(); - if (!this.data.DanTitles.ContainsKey(title) || cs != clearStatus || iG != isGold) - { - DBSaves.RegisterDanTitle(data.SaveId, title, clearStatus, isGold); - changed = true; - /* + 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 + + if (!this.data.DanTitles.ContainsKey(title) || cs != clearStatus || iG != isGold) { + DBSaves.RegisterDanTitle(data.SaveId, title, clearStatus, isGold); + changed = true; + /* TJAPlayer3.NamePlateConfig.data.Dan[player] = title; TJAPlayer3.NamePlateConfig.data.DanGold[player] = iG; TJAPlayer3.NamePlateConfig.data.DanType[player] = cs; */ - } + } - CDanTitle danTitle = new CDanTitle(iG, cs); + CDanTitle danTitle = new CDanTitle(iG, cs); - this.data.DanTitles[title] = danTitle; + this.data.DanTitles[title] = danTitle; - //tSaveFile(); + //tSaveFile(); - return changed; - } + return changed; + } - #endregion + #endregion - #region [Auxilliary classes] + #region [Auxilliary classes] - public class CDanTitle - { - public CDanTitle(bool iG, int cs) - { - isGold = iG; - clearStatus = cs; - } + public class CDanTitle { + public CDanTitle(bool iG, int cs) { + isGold = iG; + clearStatus = cs; + } - public CDanTitle() - { - isGold = false; - clearStatus = 0; - } + public CDanTitle() { + isGold = false; + clearStatus = 0; + } - [JsonProperty("isGold")] - public bool isGold; + [JsonProperty("isGold")] + public bool isGold; - [JsonProperty("clearStatus")] - public int clearStatus; - } + [JsonProperty("clearStatus")] + public int clearStatus; + } - public class CNamePlateTitle - { - public CNamePlateTitle(int type) - { - iType = type; - cld = new CLocalizationData(); - } + public class CNamePlateTitle { + public CNamePlateTitle(int type) { + iType = type; + cld = new CLocalizationData(); + } - [JsonProperty("iType")] - public int iType; + [JsonProperty("iType")] + public int iType; - [JsonProperty("Localization")] - public CLocalizationData cld; - } + [JsonProperty("Localization")] + public CLocalizationData cld; + } - public class CPassStatus - { - public CPassStatus() - { - d = new int[5] { -1, -1, -1, -1, -1 }; - } + public class CPassStatus { + public CPassStatus() { + d = new int[5] { -1, -1, -1, -1, -1 }; + } - public int[] d; - } + public int[] d; + } - #endregion + #endregion - #region [Heya] + #region [Heya] - public void tReindexCharacter(string[] characterNamesList) - { - string character = this.data.CharacterName; + public void tReindexCharacter(string[] characterNamesList) { + string character = this.data.CharacterName; - if (characterNamesList.Contains(character)) - this.data.Character = characterNamesList.ToList().IndexOf(character); + if (characterNamesList.Contains(character)) + this.data.Character = characterNamesList.ToList().IndexOf(character); - } + } - public void tUpdateCharacterName(string newChara) - { - this.data.CharacterName = newChara; - } + public void tUpdateCharacterName(string newChara) { + this.data.CharacterName = newChara; + } - public void tApplyHeyaChanges() - { - DBSaves.ApplyChangesFromMyRoom(this); - //this.tSaveFile(); - } + public void tApplyHeyaChanges() { + DBSaves.ApplyChangesFromMyRoom(this); + //this.tSaveFile(); + } - #endregion + #endregion - public class Data - { - [JsonProperty("saveId")] - public Int64 SaveId = 0; + public class Data { + [JsonProperty("saveId")] + public Int64 SaveId = 0; - [JsonProperty("name")] - public string Name = "プレイヤー1"; + [JsonProperty("name")] + public string Name = "プレイヤー1"; - [JsonProperty("title")] - public string Title = "初心者"; + [JsonProperty("title")] + public string Title = "初心者"; - [JsonProperty("dan")] - public string Dan = "新人"; + [JsonProperty("dan")] + public string Dan = "新人"; - [JsonProperty("danGold")] - public bool DanGold = false; + [JsonProperty("danGold")] + public bool DanGold = false; - [JsonProperty("danType")] - public int DanType = 0; + [JsonProperty("danType")] + public int DanType = 0; - [JsonProperty("titleType")] - public int TitleType = 0; + [JsonProperty("titleType")] + public int TitleType = 0; - [JsonIgnore] - public int TitleRarityInt = 1; + [JsonIgnore] + public int TitleRarityInt = 1; - [JsonIgnore] - public int TitleId = -1; + [JsonIgnore] + public int TitleId = -1; - [JsonProperty("puchiChara")] - public string PuchiChara = "0"; + [JsonProperty("puchiChara")] + public string PuchiChara = "0"; - [JsonProperty("medals")] - public Int64 Medals = 0; - [JsonIgnore] - public Int64 TotalEarnedMedals = 0; + [JsonProperty("medals")] + public Int64 Medals = 0; - [JsonIgnore] - public int TotalPlaycount = 0; + [JsonIgnore] + public Int64 TotalEarnedMedals = 0; - [JsonIgnore] - public int AIBattleModePlaycount = 0; + [JsonIgnore] + public int TotalPlaycount = 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); - } - } - - 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 - } - - 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 - } + [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); + } + } + + 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 + } + + 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/TJAPlayer3.cs b/OpenTaiko/src/Common/TJAPlayer3.cs index d1ac3a6d..1f4c3f79 100644 --- a/OpenTaiko/src/Common/TJAPlayer3.cs +++ b/OpenTaiko/src/Common/TJAPlayer3.cs @@ -1,44 +1,31 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Text; +using System.Diagnostics; using System.Drawing; -using System.Diagnostics; -using System.IO; -using System.Threading; +using System.Globalization; using System.Net.NetworkInformation; +using System.Reflection; +using System.Runtime.InteropServices; using System.Runtime.Serialization.Formatters.Binary; +using System.Text; +using DiscordRPC; using FDK; using SampleFramework; -using System.Reflection; -using System.Threading.Tasks; -using System.Linq; using Silk.NET.Maths; using SkiaSharp; -using DiscordRPC; - using Rectangle = System.Drawing.Rectangle; -using Point = System.Drawing.Point; -using Color = System.Drawing.Color; -using System.Runtime.InteropServices; -namespace TJAPlayer3 -{ - internal class TJAPlayer3 : Game - { +namespace TJAPlayer3 { + internal class TJAPlayer3 : Game { // プロパティ #region [ properties ] public static readonly string VERSION = Assembly.GetExecutingAssembly().GetName().Version.ToString();//.Substring(0, Assembly.GetExecutingAssembly().GetName().Version.ToString().Length - 2); public static readonly string AppDisplayThreePartVersion = GetAppDisplayThreePartVersion(); public static readonly string AppNumericThreePartVersion = GetAppNumericThreePartVersion(); - private static string GetAppDisplayThreePartVersion() - { + private static string GetAppDisplayThreePartVersion() { return $"v{GetAppNumericThreePartVersion()}"; } - private static string GetAppNumericThreePartVersion() - { + private static string GetAppNumericThreePartVersion() { var version = Assembly.GetExecutingAssembly().GetName().Version; return $"{version.Major}.{version.Minor}.{version.Build}"; @@ -53,159 +40,126 @@ namespace TJAPlayer3 ?.InformationalVersion ?? $"{GetAppDisplayThreePartVersion()} (unknown informational version)"; public static readonly string SLIMDXDLL = "c_net20x86_Jun2010"; - public static readonly string D3DXDLL = "d3dx9_43.dll"; // June 2010 - //public static readonly string D3DXDLL = "d3dx9_42.dll"; // February 2010 - //public static readonly string D3DXDLL = "d3dx9_41.dll"; // March 2009 + public static readonly string D3DXDLL = "d3dx9_43.dll"; // June 2010 + //public static readonly string D3DXDLL = "d3dx9_42.dll"; // February 2010 + //public static readonly string D3DXDLL = "d3dx9_41.dll"; // March 2009 - public static CStage latestSongSelect - { + public static CStage latestSongSelect { get; private set; - } - - public static TJAPlayer3 app - { - get; - private set; - } - public static CTextConsole actTextConsole - { - get; - private set; - } - public static bool bコンパクトモード - { - get; - private set; - } - public static CConfigIni ConfigIni - { - get; - private set; } - public static CVisualLogManager VisualLogManager - { + public static TJAPlayer3 app { get; private set; - } + } + public static CTextConsole actTextConsole { + get; + private set; + } + public static bool bコンパクトモード { + get; + private set; + } + public static CConfigIni ConfigIni { + get; + private set; + } - #region [DTX instances] - public static CDTX DTX - { - get - { - return dtx[ 0 ]; + 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 - { + public static CDTX DTX_3P { + get { return dtx[2]; } - set - { - if ((dtx[2] != null) && (app != null)) - { + 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)) - { + if ((dtx[2] != null) && (app != null)) { app.listトップレベルActivities.Add(dtx[2]); } } } - public static CDTX DTX_4P - { - get - { + public static CDTX DTX_4P { + get { return dtx[3]; } - set - { - if ((dtx[3] != null) && (app != null)) - { + 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)) - { + if ((dtx[3] != null) && (app != null)) { app.listトップレベルActivities.Add(dtx[3]); } } } - public static CDTX DTX_5P - { - get - { + public static CDTX DTX_5P { + get { return dtx[4]; } - set - { - if ((dtx[4] != null) && (app != null)) - { + 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)) - { + if ((dtx[4] != null) && (app != null)) { app.listトップレベルActivities.Add(dtx[4]); } } } - public static CDTX GetDTX(int player) - { - switch (player) - { + public static CDTX GetDTX(int player) { + switch (player) { case 0: return TJAPlayer3.DTX; case 1: @@ -218,7 +172,7 @@ namespace TJAPlayer3 return TJAPlayer3.DTX_5P; } return null; - } + } #endregion @@ -226,71 +180,53 @@ namespace TJAPlayer3 public static bool IsPerformingCalibration; - public static CFPS FPS - { - get; + public static CFPS FPS { + get; private set; } - public static CInputManager InputManager - { + public static CInputManager InputManager { get; private set; } #region [ 入力範囲ms ] - public static int nPerfect範囲ms - { - get - { - if( stageSongSelect.rChoosenSong != null ) - { + 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 ) ) - { + if (((c曲リストノード != null) && (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX)) && (c曲リストノード.nPerfect範囲ms >= 0)) { return c曲リストノード.nPerfect範囲ms; } } return ConfigIni.nヒット範囲ms.Perfect; } } - public static int nGreat範囲ms - { - get - { - if( stageSongSelect.rChoosenSong != null ) - { + 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 ) ) - { + if (((c曲リストノード != null) && (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX)) && (c曲リストノード.nGreat範囲ms >= 0)) { return c曲リストノード.nGreat範囲ms; } } return ConfigIni.nヒット範囲ms.Great; } } - public static int nGood範囲ms - { - get - { - if( stageSongSelect.rChoosenSong != null ) - { + 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 ) ) - { + if (((c曲リストノード != null) && (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX)) && (c曲リストノード.nGood範囲ms >= 0)) { return c曲リストノード.nGood範囲ms; } } return ConfigIni.nヒット範囲ms.Good; } } - public static int nPoor範囲ms - { - get - { - if( stageSongSelect.rChoosenSong != null ) - { + 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 ) ) - { + if (((c曲リストノード != null) && (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX)) && (c曲リストノード.nPoor範囲ms >= 0)) { return c曲リストノード.nPoor範囲ms; } } @@ -298,215 +234,179 @@ namespace TJAPlayer3 } } #endregion - public static CPad Pad - { + public static CPad Pad { get; private set; } - public static Random Random - { + 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 - { + public static CSkin Skin { get; private set; } - public static CActEnumSongs actEnumSongs - { + public static CSongs管理 Songs管理 { + get; + set; // 2012.1.26 yyagi private解除 CStage起動でのdesirialize読み込みのため + } + public static CEnumSongs EnumSongs { get; private set; } - public static CActScanningLoudness actScanningLoudness - { + public static CActEnumSongs actEnumSongs { + get; + private set; + } + public static CActScanningLoudness actScanningLoudness { get; private set; } - public static SoundManager SoundManager - { + 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 - { + public static SongGainController SongGainController { 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コンフィグ stageコンフィグ - { - get; - private set; - } - public static CStage選曲 stageSongSelect - { - get; - private set; - } - public static CStage段位選択 stage段位選択 - { - get; - private set; - } - public static CStageHeya stageHeya - { + public static SoundGroupLevelController SoundGroupLevelController { get; private set; } - public static CStageOnlineLounge stageOnlineLounge - { + public static CNamePlate NamePlate { get; private set; } - public static CStageTowerSelect stageTowerSelect - { + public static NamePlateConfig NamePlateConfig { get; private set; } - public static COpenEncyclopedia stageOpenEncyclopedia - { + public static Favorites Favorites { get; private set; } - public static CStage曲読み込み stage曲読み込み - { + + public static RecentlyPlayedSongs RecentlyPlayedSongs { get; private set; } - public static CStage演奏ドラム画面 stage演奏ドラム画面 - { + + public static Databases Databases { get; private set; } - public static CStage結果 stage結果 - { + + public static CStage起動 stage起動 { get; private set; } - public static CStageChangeSkin stageChangeSkin - { + public static CStageタイトル stageタイトル { get; private set; } - public static CStage終了 stage終了 - { + // 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 COpenEncyclopedia stageOpenEncyclopedia { + 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のあるフォルダ - { + public static string strEXEのあるフォルダ { get; private set; } - public static string strコンパクトモードファイル - { - get; + public static string strコンパクトモードファイル { + get; private set; } - public static CTimer Timer - { + public static CTimer Timer { get; private set; } internal static IPluginActivity act現在入力を占有中のプラグイン = null; - public bool b次のタイミングで垂直帰線同期切り替えを行う - { - get; - set; - } - public bool b次のタイミングで全画面_ウィンドウ切り替えを行う - { + public bool b次のタイミングで垂直帰線同期切り替えを行う { get; set; } - public CPluginHost PluginHost - { + public bool b次のタイミングで全画面_ウィンドウ切り替えを行う { + get; + set; + } + public CPluginHost PluginHost { get; private set; } public List PluginList = new List(); - public struct STPlugin - { + public struct STPlugin { public IPluginActivity plugin; public string pluginDirectory; public string assemblyName; public Version Version; } - private static Size currentClientSize // #23510 2010.10.27 add yyagi to keep current window size + private static Size currentClientSize // #23510 2010.10.27 add yyagi to keep current window size { get; set; } - public static CDTXVmode DTXVmode // #28821 2014.1.23 yyagi + public static CDTXVmode DTXVmode // #28821 2014.1.23 yyagi { get; set; @@ -521,56 +421,49 @@ namespace TJAPlayer3 // 0 : Hidari, 1 : Migi (1P only) public static int PlayerSide = 0; - public static int GetActualPlayer(int player) - { + public static int GetActualPlayer(int player) { if (SaveFile == 0 || player > 1) return player; if (player == 0) return 1; return 0; - } + } - public static bool P1IsBlue() - { + public static bool P1IsBlue() { return (TJAPlayer3.PlayerSide == 1 && TJAPlayer3.ConfigIni.nPlayerCount == 1); } - #endregion + #endregion - // コンストラクタ + // コンストラクタ - public TJAPlayer3() : base("OpenTaiko.ico") - { + public TJAPlayer3() : base("OpenTaiko.ico") { TJAPlayer3.app = this; } public static string sEncType = "Shift_JIS"; - public static string LargeImageKey - { - get - { + public static string LargeImageKey { + get { return "opentaiko"; } } - - public static string LargeImageText - { - get - { + + 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; + /// + /// 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; + - // メソッド @@ -580,78 +473,63 @@ namespace TJAPlayer3 /// リザルト画像のキャプチャと保存。 ///
/// 保存するファイル名(フルパス) - public bool SaveResultScreen( string strFullPath ) - { + 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 - { + 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)" ); + Trace.TraceError("例外が発生しましたが処理を継続します。 (0bfe6bff-2a56-4df4-9333-2df26d9b765b)"); success = false; } } - if (!File.Exists(strFullPath)) - { + 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() - { + + protected override void Configuration() { #region [ strEXEのあるフォルダを決定する ] //----------------- - strEXEのあるフォルダ = Environment.CurrentDirectory + Path.DirectorySeparatorChar; + 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 - { + if (File.Exists(path)) { + try { // Load config info - ConfigIni.tファイルから読み込み( path ); - } - catch (Exception e) - { + ConfigIni.tファイルから読み込み(path); + } catch (Exception e) { //ConfigIni = new CConfigIni(); // 存在してなければ新規生成 - Trace.TraceError( e.ToString() ); - Trace.TraceError( "例外が発生しましたが処理を継続します。 (b8d93255-bbe4-4ca3-8264-7ee5175b19f3)" ); + Trace.TraceError(e.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (b8d93255-bbe4-4ca3-8264-7ee5175b19f3)"); } - } - else - { + } else { ConfigIsNew = true; } - switch(ConfigIni.nGraphicsDeviceType) - { + switch (ConfigIni.nGraphicsDeviceType) { case 0: - GraphicsDeviceType_ = Silk.NET.GLFW.AnglePlatformType.OpenGL; - break; + GraphicsDeviceType_ = Silk.NET.GLFW.AnglePlatformType.OpenGL; + break; /* case 1: GraphicsDeviceType_ = Silk.NET.GLFW.AnglePlatformType.D3D9; @@ -667,14 +545,14 @@ namespace TJAPlayer3 break; */ case 1: - GraphicsDeviceType_ = Silk.NET.GLFW.AnglePlatformType.D3D11; - break; + GraphicsDeviceType_ = Silk.NET.GLFW.AnglePlatformType.D3D11; + break; case 2: - GraphicsDeviceType_ = Silk.NET.GLFW.AnglePlatformType.Vulkan; - break; + GraphicsDeviceType_ = Silk.NET.GLFW.AnglePlatformType.Vulkan; + break; case 3: - GraphicsDeviceType_ = Silk.NET.GLFW.AnglePlatformType.Metal; - break; + GraphicsDeviceType_ = Silk.NET.GLFW.AnglePlatformType.Metal; + break; } WindowPosition = new Silk.NET.Maths.Vector2D(ConfigIni.nWindowBaseXPosition, ConfigIni.nWindowBaseYPosition); @@ -682,12 +560,11 @@ namespace TJAPlayer3 FullScreen = ConfigIni.bFullScreen; VSync = ConfigIni.bEnableVSync; Framerate = 0; - - base.Configuration(); - } - protected override void Initialize() - { + base.Configuration(); + } + + protected override void Initialize() { this.t起動処理(); @@ -706,53 +583,42 @@ namespace TJAPlayer3 } */ } - - protected override void LoadContent() - { - if ( ConfigIni.bウィンドウモード ) - { - if( !this.bマウスカーソル表示中 ) - { + + protected override void LoadContent() { + if (ConfigIni.bウィンドウモード) { + if (!this.bマウスカーソル表示中) { //Cursor.Show(); this.bマウスカーソル表示中 = true; } - } - else if( this.bマウスカーソル表示中 ) - { + } else if (this.bマウスカーソル表示中) { //Cursor.Hide(); this.bマウスカーソル表示中 = false; } - if( this.listトップレベルActivities != null ) - { - foreach( CActivity activity in this.listトップレベルActivities ) + if (this.listトップレベルActivities != null) { + foreach (CActivity activity in this.listトップレベルActivities) activity.CreateUnmanagedResource(); } - foreach( STPlugin st in this.PluginList ) - { - Directory.SetCurrentDirectory( st.pluginDirectory ); + foreach (STPlugin st in this.PluginList) { + Directory.SetCurrentDirectory(st.pluginDirectory); st.plugin.OnUnmanagedリソースの作成(); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); } } - protected override void UnloadContent() - { - if( this.listトップレベルActivities != null ) - { - foreach( CActivity activity in this.listトップレベルActivities ) + protected override void UnloadContent() { + if (this.listトップレベルActivities != null) { + foreach (CActivity activity in this.listトップレベルActivities) activity.ReleaseUnmanagedResource(); } - foreach( STPlugin st in this.PluginList ) - { - Directory.SetCurrentDirectory( st.pluginDirectory ); + foreach (STPlugin st in this.PluginList) { + Directory.SetCurrentDirectory(st.pluginDirectory); st.plugin.OnUnmanagedリソースの解放(); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); } } - protected override void OnExiting() - { + protected override void OnExiting() { ConfigIni.nWindowBaseXPosition = WindowPosition.X; ConfigIni.nWindowBaseYPosition = WindowPosition.Y; ConfigIni.nWindowWidth = WindowSize.X; @@ -760,91 +626,89 @@ namespace TJAPlayer3 ConfigIni.bFullScreen = FullScreen; ConfigIni.bEnableVSync = VSync; Framerate = 0; - + this.t終了処理(); base.OnExiting(); } - protected override void Update() - { - InputManager?.Polling( TJAPlayer3.ConfigIni.bBufferedInputs ); + protected override void Update() { + InputManager?.Polling(TJAPlayer3.ConfigIni.bBufferedInputs); } - protected override void Draw() - { - #if !DEBUG + protected override void Draw() { +#if !DEBUG try - #endif +#endif { - // Sound管理?.t再生中の処理をする(); - Timer?.Update(); - SoundManager.PlayTimer?.Update(); - FPS?.Update(); + // Sound管理?.t再生中の処理をする(); + 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; - } + 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; + } - //CameraTest - /* - Camera *= Matrix4X4.CreateScale(1.0f / ScreenAspect, 1.0f, 1.0f) * - Matrix4X4.CreateRotationZ(MathF.PI / 4.0f) * - Matrix4X4.CreateScale(1.0f * ScreenAspect, 1.0f, 1.0f); - */ + //CameraTest + /* + Camera *= Matrix4X4.CreateScale(1.0f / ScreenAspect, 1.0f, 1.0f) * + Matrix4X4.CreateRotationZ(MathF.PI / 4.0f) * + Matrix4X4.CreateScale(1.0f * ScreenAspect, 1.0f, 1.0f); + */ - // #xxxxx 2013.4.8 yyagi; sleepの挿入位置を、EndScnene~Present間から、BeginScene前に移動。描画遅延を小さくするため。 + // #xxxxx 2013.4.8 yyagi; sleepの挿入位置を、EndScnene~Present間から、BeginScene前に移動。描画遅延を小さくするため。 - #region [ DTXCreatorからの指示 ] - /* - if ( this.Window.IsReceivedMessage ) // ウインドウメッセージで、 - { - string strMes = this.Window.strMessage; - this.Window.IsReceivedMessage = false; - - if ( strMes != null ) + #region [ DTXCreatorからの指示 ] + /* + if ( this.Window.IsReceivedMessage ) // ウインドウメッセージで、 { - DTXVmode.ParseArguments( strMes ); + string strMes = this.Window.strMessage; + this.Window.IsReceivedMessage = false; - if ( DTXVmode.Enabled ) + if ( strMes != null ) { - bコンパクトモード = true; - strコンパクトモードファイル = DTXVmode.filename; - if ( DTXVmode.Command == CDTXVmode.ECommand.Preview ) + DTXVmode.ParseArguments( strMes ); + + if ( DTXVmode.Enabled ) { - // preview soundの再生 - string strPreviewFilename = DTXVmode.previewFilename; -//Trace.TraceInformation( "Preview Filename=" + DTXVmode.previewFilename ); - try + bコンパクトモード = true; + strコンパクトモードファイル = DTXVmode.filename; + if ( DTXVmode.Command == CDTXVmode.ECommand.Preview ) { - if ( this.previewSound != null ) + // preview soundの再生 + string strPreviewFilename = DTXVmode.previewFilename; + //Trace.TraceInformation( "Preview Filename=" + DTXVmode.previewFilename ); + try { - this.previewSound.tサウンドを停止する(); - this.previewSound.Dispose(); + if ( this.previewSound != null ) + { + this.previewSound.tサウンドを停止する(); + this.previewSound.Dispose(); + this.previewSound = null; + } + this.previewSound = TJAPlayer3.Sound管理.tサウンドを生成する( strPreviewFilename, ESoundGroup.SongPreview ); + + // 2018-08-23 twopointzero: DTXVmode previewVolume will always set + // Gain since in this mode it should override the application of + // SONGVOL or any other Gain source regardless of configuration. + this.previewSound.SetGain(DTXVmode.previewVolume); + + this.previewSound.n位置 = DTXVmode.previewPan; + this.previewSound.t再生を開始する(); + Trace.TraceInformation( "DTXCからの指示で、サウンドを生成しました。({0})", strPreviewFilename ); + } + catch + { + Trace.TraceError(ToString()); + Trace.TraceError( "DTXCからの指示での、サウンドの生成に失敗しました。({0})", strPreviewFilename ); + if ( this.previewSound != null ) + { + this.previewSound.Dispose(); + } this.previewSound = null; } - this.previewSound = TJAPlayer3.Sound管理.tサウンドを生成する( strPreviewFilename, ESoundGroup.SongPreview ); - - // 2018-08-23 twopointzero: DTXVmode previewVolume will always set - // Gain since in this mode it should override the application of - // SONGVOL or any other Gain source regardless of configuration. - this.previewSound.SetGain(DTXVmode.previewVolume); - - this.previewSound.n位置 = DTXVmode.previewPan; - this.previewSound.t再生を開始する(); - Trace.TraceInformation( "DTXCからの指示で、サウンドを生成しました。({0})", strPreviewFilename ); - } - catch - { - Trace.TraceError(ToString()); - Trace.TraceError( "DTXCからの指示での、サウンドの生成に失敗しました。({0})", strPreviewFilename ); - if ( this.previewSound != null ) - { - this.previewSound.Dispose(); - } - this.previewSound = null; } } } @@ -874,835 +738,775 @@ namespace TJAPlayer3 //--------------------- #endregion + if (r現在のステージ != null) { + this.n進行描画の戻り値 = (r現在のステージ != null) ? r現在のステージ.Draw() : 0; - CScoreIni scoreIni = null; + #region [ プラグインの進行描画 ] + //--------------------- + foreach (STPlugin sp in this.PluginList) { + Directory.SetCurrentDirectory(sp.pluginDirectory); - #region [ 曲検索スレッドの起動/終了 ] // ここに"Enumerating Songs..."表示を集約 - if ( !TJAPlayer3.bコンパクトモード ) - { - 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(); + if (TJAPlayer3.act現在入力を占有中のプラグイン == null || TJAPlayer3.act現在入力を占有中のプラグイン == sp.plugin) + sp.plugin.On進行描画(TJAPlayer3.Pad, TJAPlayer3.InputManager.Keyboard); + else + sp.plugin.On進行描画(null, null); + + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + //--------------------- + #endregion + + + CScoreIni scoreIni = null; + + #region [ 曲検索スレッドの起動/終了 ] // ここに"Enumerating Songs..."表示を集約 + if (!TJAPlayer3.bコンパクトモード) { + 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(); + } + TJAPlayer3.stageSongSelect.bIsEnumeratingSongs = true; + EnumSongs.Init(); // 取得した曲数を、新インスタンスにも与える + EnumSongs.StartEnumFromDisk(); // 曲検索スレッドの起動_開始 } - TJAPlayer3.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; + + 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(); + } + TJAPlayer3.stageSongSelect.bIsEnumeratingSongs = false; + + bool bRemakeSongTitleBar = (r現在のステージ.eStageID == CStage.EStage.SongSelect) ? true : false; + TJAPlayer3.stageSongSelect.Refresh(EnumSongs.Songs管理, bRemakeSongTitleBar); + EnumSongs.SongListEnumCompletelyDone(); + } + #endregion } - #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; + break; + } + #endregion - case 2: // 曲決定 - EnumSongs.Suspend(); // #27060 バックグラウンドの曲検索を一時停止 - actEnumSongs.DeActivate(); - if (!ConfigIni.PreAssetsLoading) - { - actEnumSongs.ReleaseManagedResource(); - actEnumSongs.ReleaseUnmanagedResource(); - } - break; - } - } - #endregion + switch (r現在のステージ.eStageID) { + case CStage.EStage.None: + break; - #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(); - } - TJAPlayer3.stageSongSelect.bIsEnumeratingSongs = false; - - bool bRemakeSongTitleBar = ( r現在のステージ.eStageID == CStage.EStage.SongSelect ) ? true : false; - TJAPlayer3.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 ) - { - if( !bコンパクトモード ) - { - 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タイトル; - } - else - { - 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曲読み込み; - } - foreach( STPlugin pg in this.PluginList ) - { - Directory.SetCurrentDirectory( pg.pluginDirectory ); - pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); - } - - 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; - - TJAPlayer3.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段位選択; - TJAPlayer3.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戻り値.ENCYCLOPEDIA: - #region [Online Lounge] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) - { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Open Encyclopedia"); - stageOpenEncyclopedia.Activate(); - if (!ConfigIni.PreAssetsLoading) - { - stageOpenEncyclopedia.CreateManagedResource(); - stageOpenEncyclopedia.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stageOpenEncyclopedia; - //----------------------------- - #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; - - TJAPlayer3.latestSongSelect = stageSongSelect; - ConfigIni.nPreviousPlayerCount = ConfigIni.nPlayerCount; - ConfigIni.nPlayerCount = 2; - ConfigIni.bAIBattleMode = true; - ConfigIni.tInitializeAILevel(); - //----------------------------- - #endregion - break; - - } - - foreach ( STPlugin pg in this.PluginList ) - { - Directory.SetCurrentDirectory( pg.pluginDirectory ); - pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); - } - - //this.tガベージコレクションを実行する(); // #31980 2013.9.3 yyagi タイトル画面でだけ、毎フレームGCを実行して重くなっていた問題の修正 - //----------------------------- - #endregion - break; - - case CStage.EStage.Config: - #region [ *** ] - //----------------------------- - if( this.n進行描画の戻り値 != 0 ) - { - switch( r直前のステージ.eStageID ) - { - case CStage.EStage.Title: - #region [ *** ] - //----------------------------- + case CStage.EStage.StartUp: + #region [ *** ] + //----------------------------- + if (this.n進行描画の戻り値 != 0) { + if (!bコンパクトモード) { r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) - { + if (!ConfigIni.PreAssetsLoading) { r現在のステージ.ReleaseManagedResource(); r現在のステージ.ReleaseUnmanagedResource(); } - Trace.TraceInformation( "----------------------" ); - Trace.TraceInformation( "■ Title" ); + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Title"); stageタイトル.Activate(); - if (!ConfigIni.PreAssetsLoading) - { + if (!ConfigIni.PreAssetsLoading) { stageタイトル.CreateManagedResource(); stageタイトル.CreateUnmanagedResource(); } - stageタイトル.tReloadMenus(); r直前のステージ = r現在のステージ; r現在のステージ = stageタイトル; - - foreach( STPlugin pg in this.PluginList ) - { - Directory.SetCurrentDirectory( pg.pluginDirectory ); - pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); - } - - this.tガベージコレクションを実行する(); - break; - //----------------------------- - #endregion - - case CStage.EStage.SongSelect: - #region [ *** ] - //----------------------------- + } else { r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) - { + if (!ConfigIni.PreAssetsLoading) { r現在のステージ.ReleaseManagedResource(); r現在のステージ.ReleaseUnmanagedResource(); } - Trace.TraceInformation( "----------------------" ); - Trace.TraceInformation( "■ Song Select" ); + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Song Loading"); + stage曲読み込み.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stage曲読み込み.CreateManagedResource(); + stage曲読み込み.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stage曲読み込み; + } + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.Onステージ変更(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + + 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) - { + if (!ConfigIni.PreAssetsLoading) { stageSongSelect.CreateManagedResource(); stageSongSelect.CreateUnmanagedResource(); } r直前のステージ = r現在のステージ; r現在のステージ = stageSongSelect; - foreach( STPlugin pg in this.PluginList ) - { - Directory.SetCurrentDirectory( pg.pluginDirectory ); + TJAPlayer3.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段位選択; + TJAPlayer3.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戻り値.ENCYCLOPEDIA: + #region [Online Lounge] + //----------------------------- + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Open Encyclopedia"); + stageOpenEncyclopedia.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stageOpenEncyclopedia.CreateManagedResource(); + stageOpenEncyclopedia.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stageOpenEncyclopedia; + //----------------------------- + #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; + + TJAPlayer3.latestSongSelect = stageSongSelect; + ConfigIni.nPreviousPlayerCount = ConfigIni.nPlayerCount; + ConfigIni.nPlayerCount = 2; + ConfigIni.bAIBattleMode = true; + ConfigIni.tInitializeAILevel(); + //----------------------------- + #endregion + break; + + } + + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.Onステージ変更(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + + //this.tガベージコレクションを実行する(); // #31980 2013.9.3 yyagi タイトル画面でだけ、毎フレームGCを実行して重くなっていた問題の修正 + //----------------------------- + #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タイトル; + + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.Onステージ変更(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + + 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; + + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.Onステージ変更(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + + 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(); + 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; + } + /* + Skin.bgm選曲画面イン.t停止する(); + Skin.bgm選曲画面.t停止する(); + */ + + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); } 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(); + + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.Onステージ変更(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + + 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(); + + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.Onステージ変更(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + + 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 } - return; - } - //----------------------------- - #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; - } - /* - Skin.bgm選曲画面イン.t停止する(); - Skin.bgm選曲画面.t停止する(); - */ - - foreach ( STPlugin pg in this.PluginList ) - { - Directory.SetCurrentDirectory( pg.pluginDirectory ); - pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); - } - - 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(); - - foreach ( STPlugin pg in this.PluginList ) - { - Directory.SetCurrentDirectory( pg.pluginDirectory ); - pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); - } - - 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(); - - foreach ( STPlugin pg in this.PluginList ) - { - Directory.SetCurrentDirectory( pg.pluginDirectory ); - pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); - } - - 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(); - - foreach (STPlugin pg in this.PluginList) - { - Directory.SetCurrentDirectory(pg.pluginDirectory); - pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); - } - - this.tガベージコレクションを実行する(); - break; //----------------------------- #endregion + break; - case (int)CStage選曲.E戻り値.選曲した: - #region [ *** ] - //----------------------------- + 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タイトル; - 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(); - foreach (STPlugin pg in this.PluginList) - { - Directory.SetCurrentDirectory(pg.pluginDirectory); - pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); - } + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.Onステージ変更(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } - 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(); - - foreach (STPlugin pg in this.PluginList) - { - Directory.SetCurrentDirectory(pg.pluginDirectory); - pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); - } - - this.tガベージコレクションを実行する(); - break; + this.tガベージコレクションを実行する(); + break; //----------------------------- #endregion - } - #endregion - break; - case CStage.EStage.SongLoading: - #region [ *** ] - //----------------------------- - DTXVmode.Refreshed = false; // 曲のリロード中に発生した再リロードは、無視する。 - if( this.n進行描画の戻り値 != 0 ) - { - TJAPlayer3.Pad.st検知したデバイス.Clear(); // 入力デバイスフラグクリア(2010.9.11) - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) - { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - #region [ ESC押下時は、曲の読み込みを中止して選曲画面に戻る ] - if ( this.n進行描画の戻り値 == (int) E曲読込画面の戻り値.読込中止 ) - { - //DTX.t全チップの再生停止(); - if( DTX != null ) - { - DTX.DeActivate(); - DTX.ReleaseManagedResource(); - DTX.ReleaseUnmanagedResource(); - } + case (int)CStage選曲.E戻り値.選曲した: + #region [ *** ] + //----------------------------- - // ??? - - /* - if (stage選曲.n確定された曲の難易度[0] == (int)Difficulty.Dan) - { + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ 段位選択"); - stage段位選択.On活性化(); + Trace.TraceInformation("■ Song Loading"); + stage曲読み込み.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stage曲読み込み.CreateManagedResource(); + stage曲読み込み.CreateUnmanagedResource(); + } r直前のステージ = r現在のステージ; - r現在のステージ = stage段位選択; - } - else - { - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ 選曲"); - stage選曲.On活性化(); - r直前のステージ = r現在のステージ; - r現在のステージ = stage選曲; - } - */ + r現在のステージ = stage曲読み込み; - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Return to song select menu"); - TJAPlayer3.latestSongSelect.Activate(); - if (!ConfigIni.PreAssetsLoading) - { - TJAPlayer3.latestSongSelect.CreateManagedResource(); - TJAPlayer3.latestSongSelect.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.Onステージ変更(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } - // Seek latest registered song select screen - r現在のステージ = TJAPlayer3.latestSongSelect; - - foreach ( STPlugin pg in this.PluginList ) - { - Directory.SetCurrentDirectory( pg.pluginDirectory ); - pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); - } - - break; + this.tガベージコレクションを実行する(); + break; + //----------------------------- + #endregion } #endregion + break; - Trace.TraceInformation( "----------------------" ); - Trace.TraceInformation( "■ Gameplay (Drum Screen)" ); -#if false // #23625 2011.1.11 Config.iniからダメージ/回復値の定数変更を行う場合はここを有効にする 087リリースに合わせ機能無効化 + 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(); + + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.Onステージ変更(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + + this.tガベージコレクションを実行する(); + break; + //----------------------------- + #endregion + } + #endregion + break; + + case CStage.EStage.SongLoading: + #region [ *** ] + //----------------------------- + DTXVmode.Refreshed = false; // 曲のリロード中に発生した再リロードは、無視する。 + if (this.n進行描画の戻り値 != 0) { + TJAPlayer3.Pad.st検知したデバイス.Clear(); // 入力デバイスフラグクリア(2010.9.11) + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + #region [ ESC押下時は、曲の読み込みを中止して選曲画面に戻る ] + if (this.n進行描画の戻り値 == (int)E曲読込画面の戻り値.読込中止) { + //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"); + TJAPlayer3.latestSongSelect.Activate(); + if (!ConfigIni.PreAssetsLoading) { + TJAPlayer3.latestSongSelect.CreateManagedResource(); + TJAPlayer3.latestSongSelect.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + + // Seek latest registered song select screen + r現在のステージ = TJAPlayer3.latestSongSelect; + + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.Onステージ変更(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + + 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++) @@ -1712,153 +1516,138 @@ for (int i = 0; i < 5; i++) } for (int i = 0; i < 3; i++) { stage演奏ドラム画面.fDamageLevelFactor[i] = ConfigIni.fDamageLevelFactor[i]; -} +} #endif - r直前のステージ = r現在のステージ; - r現在のステージ = stage演奏ドラム画面; - foreach( STPlugin pg in this.PluginList ) - { - Directory.SetCurrentDirectory( pg.pluginDirectory ); - pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); - } - - this.tガベージコレクションを実行する(); - } - //----------------------------- - #endregion - break; - - case CStage.EStage.Game: - #region [ *** ] - - #region [ DTXVモード中にDTXCreatorから指示を受けた場合の処理 ] - if ( DTXVmode.Enabled && DTXVmode.Refreshed ) - { - DTXVmode.Refreshed = false; - - if ( DTXVmode.Command == CDTXVmode.ECommand.Stop ) - { - TJAPlayer3.stage演奏ドラム画面.t停止(); - if ( previewSound != null ) - { - this.previewSound.tStopSound(); - this.previewSound.Dispose(); - this.previewSound = null; + r直前のステージ = r現在のステージ; + r現在のステージ = stage演奏ドラム画面; + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.Onステージ変更(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); } - //{ - // int lastd = 0; - // int f = 0; - // for ( int i = 0; i < swlist1.Count; i++ ) - // { - // int d1 = swlist1[ i ]; - // int d2 = swlist2[ i ]; - // int d3 = swlist3[ i ]; - // int d4 = swlist4[ i ]; - // int d5 = swlist5[ i ]; - // int dif = d1 - lastd; - // string s = ""; - // if ( 16 <= dif && dif <= 17 ) - // { - // } - // else - // { - // s = "★"; - // } - // Trace.TraceInformation( "frame {0:D4}: {1:D3} ( {2:D3}, {3:D3} - {7:D3}, {4:D3} ) {5}, n現在時刻={6}", f, dif, d1, d2, d3, s, d4, d5 ); - // lastd = d1; - // f++; - // } - // swlist1.Clear(); - // swlist2.Clear(); - // swlist3.Clear(); - // swlist4.Clear(); - // swlist5.Clear(); - - //} + this.tガベージコレクションを実行する(); } - else if ( DTXVmode.Command == CDTXVmode.ECommand.Play ) - { - if ( DTXVmode.NeedReload ) - { - TJAPlayer3.stage演奏ドラム画面.t再読込(); + //----------------------------- + #endregion + break; - TJAPlayer3.ConfigIni.bTimeStretch = DTXVmode.TimeStretch; - SoundManager.bIsTimeStretch = DTXVmode.TimeStretch; - if ( TJAPlayer3.ConfigIni.bEnableVSync != DTXVmode.VSyncWait ) - { - TJAPlayer3.ConfigIni.bEnableVSync = DTXVmode.VSyncWait; - TJAPlayer3.app.b次のタイミングで垂直帰線同期切り替えを行う = true; + case CStage.EStage.Game: + #region [ *** ] + + #region [ DTXVモード中にDTXCreatorから指示を受けた場合の処理 ] + if (DTXVmode.Enabled && DTXVmode.Refreshed) { + DTXVmode.Refreshed = false; + + if (DTXVmode.Command == CDTXVmode.ECommand.Stop) { + TJAPlayer3.stage演奏ドラム画面.t停止(); + if (previewSound != null) { + this.previewSound.tStopSound(); + this.previewSound.Dispose(); + this.previewSound = null; + } + //{ + // int lastd = 0; + // int f = 0; + // for ( int i = 0; i < swlist1.Count; i++ ) + // { + // int d1 = swlist1[ i ]; + // int d2 = swlist2[ i ]; + // int d3 = swlist3[ i ]; + // int d4 = swlist4[ i ]; + // int d5 = swlist5[ i ]; + + // int dif = d1 - lastd; + // string s = ""; + // if ( 16 <= dif && dif <= 17 ) + // { + // } + // else + // { + // s = "★"; + // } + // Trace.TraceInformation( "frame {0:D4}: {1:D3} ( {2:D3}, {3:D3} - {7:D3}, {4:D3} ) {5}, n現在時刻={6}", f, dif, d1, d2, d3, s, d4, d5 ); + // lastd = d1; + // f++; + // } + // swlist1.Clear(); + // swlist2.Clear(); + // swlist3.Clear(); + // swlist4.Clear(); + // swlist5.Clear(); + + //} + } else if (DTXVmode.Command == CDTXVmode.ECommand.Play) { + if (DTXVmode.NeedReload) { + TJAPlayer3.stage演奏ドラム画面.t再読込(); + + TJAPlayer3.ConfigIni.bTimeStretch = DTXVmode.TimeStretch; + SoundManager.bIsTimeStretch = DTXVmode.TimeStretch; + if (TJAPlayer3.ConfigIni.bEnableVSync != DTXVmode.VSyncWait) { + TJAPlayer3.ConfigIni.bEnableVSync = DTXVmode.VSyncWait; + TJAPlayer3.app.b次のタイミングで垂直帰線同期切り替えを行う = true; + } + } else { + TJAPlayer3.stage演奏ドラム画面.t演奏位置の変更(TJAPlayer3.DTXVmode.nStartBar, 0); } } - else - { - TJAPlayer3.stage演奏ドラム画面.t演奏位置の変更( TJAPlayer3.DTXVmode.nStartBar, 0 ); - } } - } - #endregion - - switch( this.n進行描画の戻り値 ) - { - case (int) E演奏画面の戻り値.再読込_再演奏: - #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) E演奏画面の戻り値.継続: - break; - - case (int) E演奏画面の戻り値.演奏中断: - #region [ 演奏キャンセル ] - //----------------------------- - - #region [ プラグイン On演奏キャンセル() の呼び出し ] - //--------------------- - foreach( STPlugin pg in this.PluginList ) - { - Directory.SetCurrentDirectory( pg.pluginDirectory ); - pg.plugin.On演奏キャンセル( scoreIni ); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); - } - //--------------------- + switch (this.n進行描画の戻り値) { + case (int)E演奏画面の戻り値.再読込_再演奏: + #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 - DTX.t全チップの再生停止(); - DTX.DeActivate(); - DTX.ReleaseManagedResource(); - DTX.ReleaseUnmanagedResource(); - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) - { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } + //case (int) E演奏画面の戻り値.再演奏: + #region [ 再読み込み無しで、再演奏 ] + #endregion + // break; + + case (int)E演奏画面の戻り値.継続: + break; + + case (int)E演奏画面の戻り値.演奏中断: + #region [ 演奏キャンセル ] + //----------------------------- + + #region [ プラグイン On演奏キャンセル() の呼び出し ] + //--------------------- + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.On演奏キャンセル(scoreIni); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + //--------------------- + #endregion + + DTX.t全チップの再生停止(); + DTX.DeActivate(); + DTX.ReleaseManagedResource(); + DTX.ReleaseUnmanagedResource(); + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } // Play cancelled return screen @@ -1884,8 +1673,7 @@ for (int i = 0; i < 3; i++) { Trace.TraceInformation("----------------------"); Trace.TraceInformation("■ Return to song select menu"); TJAPlayer3.latestSongSelect.Activate(); - if (!ConfigIni.PreAssetsLoading) - { + if (!ConfigIni.PreAssetsLoading) { TJAPlayer3.latestSongSelect.CreateManagedResource(); TJAPlayer3.latestSongSelect.CreateUnmanagedResource(); } @@ -1896,447 +1684,406 @@ for (int i = 0; i < 3; i++) { #region [ プラグイン Onステージ変更() の呼び出し ] //--------------------- - foreach ( STPlugin pg in this.PluginList ) - { - Directory.SetCurrentDirectory( pg.pluginDirectory ); + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); } //--------------------- #endregion this.tガベージコレクションを実行する(); - this.tガベージコレクションを実行する(); - break; + this.tガベージコレクションを実行する(); + break; //----------------------------- #endregion - case (int) E演奏画面の戻り値.ステージ失敗: - #region [ 演奏失敗(StageFailed) ] - //----------------------------- + case (int)E演奏画面の戻り値.ステージ失敗: + #region [ 演奏失敗(StageFailed) ] + //----------------------------- - #region [ プラグイン On演奏失敗() の呼び出し ] - //--------------------- - foreach( STPlugin pg in this.PluginList ) - { - Directory.SetCurrentDirectory( pg.pluginDirectory ); - pg.plugin.On演奏失敗( scoreIni ); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); - } - //--------------------- + #region [ プラグイン On演奏失敗() の呼び出し ] + //--------------------- + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.On演奏失敗(scoreIni); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + //--------------------- + #endregion + + 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; + + #region [ プラグイン Onステージ変更() の呼び出し ] + //--------------------- + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.Onステージ変更(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + //--------------------- + #endregion + + this.tガベージコレクションを実行する(); + break; + //----------------------------- #endregion - DTX.t全チップの再生停止(); + case (int)E演奏画面の戻り値.ステージクリア: + #region [ 演奏クリア ] + //----------------------------- + + // Fetch the results of the finished play + CScoreIni.C演奏記録 c演奏記録_Drums; + stage演奏ドラム画面.t演奏結果を格納する(out c演奏記録_Drums); + + + #region [ プラグイン On演奏クリア() の呼び出し ] + //--------------------- + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.On演奏クリア(scoreIni); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + //--------------------- + #endregion + + 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結果; + + #region [ プラグイン Onステージ変更() の呼び出し ] + //--------------------- + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.Onステージ変更(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + //--------------------- + #endregion + + 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) - { + if (!ConfigIni.PreAssetsLoading) { r現在のステージ.ReleaseManagedResource(); r現在のステージ.ReleaseUnmanagedResource(); } + 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"); + TJAPlayer3.latestSongSelect.Activate(); + if (!ConfigIni.PreAssetsLoading) { + TJAPlayer3.latestSongSelect.CreateManagedResource(); + TJAPlayer3.latestSongSelect.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + + // Seek latest registered song select screen + r現在のステージ = TJAPlayer3.latestSongSelect; + + stageSongSelect.NowSong++; + + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.Onステージ変更(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + + this.tガベージコレクションを実行する(); + } + //----------------------------- + #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(); + + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.Onステージ変更(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + + 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曲読み込み; + + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.Onステージ変更(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + + 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) - { + if (!ConfigIni.PreAssetsLoading) { stageSongSelect.CreateManagedResource(); stageSongSelect.CreateUnmanagedResource(); } r直前のステージ = r現在のステージ; r現在のステージ = stageSongSelect; - - #region [ プラグイン Onステージ変更() の呼び出し ] - //--------------------- - foreach (STPlugin pg in this.PluginList) - { - Directory.SetCurrentDirectory(pg.pluginDirectory); - pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); - } - //--------------------- - #endregion - this.tガベージコレクションを実行する(); - break; - //----------------------------- - #endregion - - case (int) E演奏画面の戻り値.ステージクリア: - #region [ 演奏クリア ] - //----------------------------- - - // Fetch the results of the finished play - CScoreIni.C演奏記録 c演奏記録_Drums; - stage演奏ドラム画面.t演奏結果を格納する( out c演奏記録_Drums ); - - - #region [ プラグイン On演奏クリア() の呼び出し ] - //--------------------- - foreach( STPlugin pg in this.PluginList ) - { - Directory.SetCurrentDirectory( pg.pluginDirectory ); - pg.plugin.On演奏クリア( scoreIni ); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); - } - //--------------------- - #endregion - - 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結果; - - #region [ プラグイン Onステージ変更() の呼び出し ] - //--------------------- - foreach( STPlugin pg in this.PluginList ) - { - Directory.SetCurrentDirectory( pg.pluginDirectory ); - pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); - } - //--------------------- - #endregion - - 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 - - /* - 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"); - TJAPlayer3.latestSongSelect.Activate(); - if (!ConfigIni.PreAssetsLoading) - { - TJAPlayer3.latestSongSelect.CreateManagedResource(); - TJAPlayer3.latestSongSelect.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - - // Seek latest registered song select screen - r現在のステージ = TJAPlayer3.latestSongSelect; - - stageSongSelect.NowSong++; - - foreach (STPlugin pg in this.PluginList) - { - Directory.SetCurrentDirectory(pg.pluginDirectory); - pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); - } - - this.tガベージコレクションを実行する(); - } - //----------------------------- - #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(); - - foreach (STPlugin pg in this.PluginList) - { - Directory.SetCurrentDirectory(pg.pluginDirectory); - pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); - } - - this.tガベージコレクションを実行する(); - break; //----------------------------- #endregion + break; - 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.End: + #region [ *** ] + //----------------------------- + if (this.n進行描画の戻り値 != 0) { + base.Exit(); + return; + } + //----------------------------- + #endregion + break; - foreach (STPlugin pg in this.PluginList) - { - Directory.SetCurrentDirectory(pg.pluginDirectory); - pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); - } + 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タイトル; - this.tガベージコレクションを実行する(); - break; - //----------------------------- - #endregion + CSongSelectSongManager.stopSong(); + CSongSelectSongManager.enable(); + + foreach (STPlugin pg in this.PluginList) { + Directory.SetCurrentDirectory(pg.pluginDirectory); + pg.plugin.Onステージ変更(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + + this.tガベージコレクションを実行する(); + break; + //----------------------------- + #endregion + } + #endregion + break; + } + + actScanningLoudness?.Draw(); + + if (!ConfigIni.bTokkunMode) { + float screen_ratiox = TJAPlayer3.Skin.Resolution[0] / 1280.0f; + float screen_ratioy = TJAPlayer3.Skin.Resolution[1] / 720.0f; + /* + var mat = Matrix.LookAtLH(new Vector3(-fCamXOffset * screen_ratiox, fCamYOffset * screen_ratioy, (float)(-SampleFramework.GameWindowSize.Height / (fCamZoomFactor * 2) * Math.Sqrt(3.0))), new Vector3(-fCamXOffset * screen_ratiox, fCamYOffset * screen_ratioy, 0f), new Vector3(0f, 1f, 0f)); + mat *= Matrix.RotationYawPitchRoll(0, 0, C変換.DegreeToRadian(fCamRotation)); + mat *= Matrix.Scaling(fCamXScale, fCamYScale, 1f); + this.Device.SetTransform(TransformState.View, mat); + */ + + 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 (TJAPlayer3.DTX != null) { + //object rendering + foreach (KeyValuePair pair in TJAPlayer3.DTX.listObj) { + pair.Value.tDraw(); + } } - #endregion - break; - case CStage.EStage.ChangeSkin: - #region [ *** ] - //----------------------------- - if ( this.n進行描画の戻り値 != 0 ) - { + Camera = Matrix4X4.Identity; + } + + if (r現在のステージ != null && r現在のステージ.eStageID != CStage.EStage.StartUp && TJAPlayer3.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; + }); + } + TJAPlayer3.Tx.Network_Connection.t2D描画(GameWindowSize.Width - (TJAPlayer3.Tx.Network_Connection.szTextureSize.Width / 2), GameWindowSize.Height - TJAPlayer3.Tx.Network_Connection.szTextureSize.Height, new Rectangle((TJAPlayer3.Tx.Network_Connection.szTextureSize.Width / 2) * (this.bネットワークに接続中 ? 0 : 1), 0, TJAPlayer3.Tx.Network_Connection.szTextureSize.Width / 2, TJAPlayer3.Tx.Network_Connection.szTextureSize.Height)); + } + // オーバレイを描画する(テクスチャの生成されていない起動ステージは例外 + + // Display log cards + VisualLogManager.Display(); + + if (r現在のステージ != null && r現在のステージ.eStageID != CStage.EStage.StartUp && TJAPlayer3.Tx.Overlay != null) { + TJAPlayer3.Tx.Overlay.t2D描画(0, 0); + } + } + + //foreach(var capture in ConfigIni.KeyAssign.System.Capture) + //{ + //if (TJAPlayer3.Input管理.Keyboard.KeyPressed(capture.コード) && capture.コード != 0) + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.Capture)) { +#if DEBUG + if (TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftControl)) { + if (r現在のステージ.eStageID != CStage.EStage.Game) { + RefreshSkin(); r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) - { + 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(); - - foreach (STPlugin pg in this.PluginList) - { - Directory.SetCurrentDirectory(pg.pluginDirectory); - pg.plugin.Onステージ変更(); - Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); - } - - this.tガベージコレクションを実行する(); - break; - //----------------------------- - #endregion - } - #endregion - break; - } - - actScanningLoudness?.Draw(); - - if (!ConfigIni.bTokkunMode) - { - float screen_ratiox = TJAPlayer3.Skin.Resolution[0] / 1280.0f; - float screen_ratioy = TJAPlayer3.Skin.Resolution[1] / 720.0f; - /* - var mat = Matrix.LookAtLH(new Vector3(-fCamXOffset * screen_ratiox, fCamYOffset * screen_ratioy, (float)(-SampleFramework.GameWindowSize.Height / (fCamZoomFactor * 2) * Math.Sqrt(3.0))), new Vector3(-fCamXOffset * screen_ratiox, fCamYOffset * screen_ratioy, 0f), new Vector3(0f, 1f, 0f)); - mat *= Matrix.RotationYawPitchRoll(0, 0, C変換.DegreeToRadian(fCamRotation)); - mat *= Matrix.Scaling(fCamXScale, fCamYScale, 1f); - this.Device.SetTransform(TransformState.View, mat); - */ - - 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 (TJAPlayer3.DTX != null) - { - //object rendering - foreach (KeyValuePair pair in TJAPlayer3.DTX.listObj) - { - pair.Value.tDraw(); - } - } - - Camera = Matrix4X4.Identity; - } - - if (r現在のステージ != null && r現在のステージ.eStageID != CStage.EStage.StartUp && TJAPlayer3.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; - }); - } - TJAPlayer3.Tx.Network_Connection.t2D描画(GameWindowSize.Width - (TJAPlayer3.Tx.Network_Connection.szTextureSize.Width / 2), GameWindowSize.Height - TJAPlayer3.Tx.Network_Connection.szTextureSize.Height, new Rectangle((TJAPlayer3.Tx.Network_Connection.szTextureSize.Width / 2) * (this.bネットワークに接続中 ? 0 : 1), 0, TJAPlayer3.Tx.Network_Connection.szTextureSize.Width / 2, TJAPlayer3.Tx.Network_Connection.szTextureSize.Height)); - } - // オーバレイを描画する(テクスチャの生成されていない起動ステージは例外 - - // Display log cards - VisualLogManager.Display(); - - if (r現在のステージ != null && r現在のステージ.eStageID != CStage.EStage.StartUp && TJAPlayer3.Tx.Overlay != null) - { - TJAPlayer3.Tx.Overlay.t2D描画(0, 0); - } - } - - //foreach(var capture in ConfigIni.KeyAssign.System.Capture) - //{ - //if (TJAPlayer3.Input管理.Keyboard.KeyPressed(capture.コード) && capture.コード != 0) - if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.Capture)) - { -#if DEBUG - if (TJAPlayer3.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(); - } + 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(TJAPlayer3.strEXEのあるフォルダ, "Capture_img"); - strFullPath = Path.Combine(strFullPath, DateTime.Now.ToString("yyyyMMddHHmmss") + ".png"); - SaveResultScreen(strFullPath); - } + } else { + // Debug.WriteLine( "capture: " + string.Format( "{0:2x}", (int) e.KeyCode ) + " " + (int) e.KeyCode ); + string strFullPath = + Path.Combine(TJAPlayer3.strEXEのあるフォルダ, "Capture_img"); + strFullPath = Path.Combine(strFullPath, DateTime.Now.ToString("yyyyMMddHHmmss") + ".png"); + SaveResultScreen(strFullPath); + } #else string strFullPath = Path.Combine(TJAPlayer3.strEXEのあるフォルダ, "Capture_img"); @@ -2345,30 +2092,28 @@ for (int i = 0; i < 3; i++) { #endif } - //} + //} - /* - if ( Sound管理?.GetCurrentSoundDeviceType() != "DirectSound" ) - { - Sound管理?.t再生中の処理をする(); // サウンドバッファの更新; 画面描画と同期させることで、スクロールをスムーズにする - } - */ + /* + if ( Sound管理?.GetCurrentSoundDeviceType() != "DirectSound" ) + { + Sound管理?.t再生中の処理をする(); // サウンドバッファの更新; 画面描画と同期させることで、スクロールをスムーズにする + } + */ - #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 catch( Exception e ) @@ -2387,118 +2132,90 @@ for (int i = 0; i < 3; i++) { #region [ 汎用ヘルパー ] //----------------- - public static CTexture tテクスチャの生成( string fileName ) - { - return tテクスチャの生成( fileName, false ); + public static CTexture tテクスチャの生成(string fileName) { + return tテクスチャの生成(fileName, false); } - public static CTexture tテクスチャの生成( string fileName, bool b黒を透過する) - { - if ( app == 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 ); + 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 ); + } catch (FileNotFoundException) { + Trace.TraceWarning("Could not find specified texture file. ({0})", fileName); return null; } } - public static void tテクスチャの解放(ref CTexture tx ) - { - TJAPlayer3.tDisposeSafely( ref tx ); + public static void tテクスチャの解放(ref CTexture tx) { + TJAPlayer3.tDisposeSafely(ref tx); } - public static void tテクスチャの解放( ref CTextureAf tx ) - { - TJAPlayer3.tDisposeSafely( ref tx ); + public static void tテクスチャの解放(ref CTextureAf tx) { + TJAPlayer3.tDisposeSafely(ref tx); } - public static CTexture tテクスチャの生成( SKBitmap bitmap ) - { - return tテクスチャの生成( bitmap, false ); + public static CTexture tテクスチャの生成(SKBitmap bitmap) { + return tテクスチャの生成(bitmap, false); } - public static CTexture tテクスチャの生成( SKBitmap bitmap, bool b黒を透過する ) - { - if ( app == 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黒を透過する ); + if (bitmap == null) { + Trace.TraceError("Texture generation has failed. (bitmap==null)"); + return null; } - catch ( CTextureCreateFailedException e ) - { - Trace.TraceError( e.ToString() ); - Trace.TraceError( "Texture generation has failed. (txData)" ); + 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) { + return tテクスチャの生成Af(fileName, false); } - public static CTextureAf tテクスチャの生成Af( string fileName, bool b黒を透過する ) - { - if ( app == 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 ); + 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 ); + } 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; + /// プロパティ、インデクサには ref は使用できないので注意。 + public static void tDisposeSafely(ref T obj) { + if (obj == null) + return; - var d = obj as IDisposable; + var d = obj as IDisposable; - if (d != null) - d.Dispose(); + if (d != null) + d.Dispose(); - obj = default(T); - } + obj = default(T); + } public static void t安全にDisposeする(ref T[] array) where T : class, IDisposable //2020.08.01 Mr-Ojii twopointzero氏のソースコードをもとに追加 { - if (array == null) - { + if (array == null) { return; } - for (var i = 0; i < array.Length; i++) - { + for (var i = 0; i < array.Length; i++) { array[i]?.Dispose(); array[i] = null; } @@ -2507,15 +2224,13 @@ for (int i = 0; i < 3; i++) { /// /// そのフォルダの連番画像の最大値を返す。 /// - public static int t連番画像の枚数を数える(string ディレクトリ名, string プレフィックス = "", string 拡張子 = ".png") - { - int num = 0; - while(File.Exists(ディレクトリ名 + プレフィックス + num + 拡張子)) - { - num++; - } - return num; - } + public static int t連番画像の枚数を数える(string ディレクトリ名, string プレフィックス = "", string 拡張子 = ".png") { + int num = 0; + while (File.Exists(ディレクトリ名 + プレフィックス + num + 拡張子)) { + num++; + } + return num; + } /// /// 曲名テクスチャの縮小倍率を返す。 @@ -2523,82 +2238,73 @@ for (int i = 0; i < 3; i++) { /// 曲名テクスチャ。 /// 等倍で表示するピクセル数の最大値(デフォルト値: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; - } + 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マウスカーソル表示中 = true; private bool b終了処理完了済み; - public bool bネットワークに接続中 { get; private set; } = false; - private long 前回のシステム時刻ms = long.MinValue; + 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 static TextureLoader Tx = new TextureLoader(); public List listトップレベルActivities; private int n進行描画の戻り値; private string strWindowTitle // ayo komi isn't this useless code? - tfd500 { - get - { - if ( DTXVmode.Enabled ) - { + get { + if (DTXVmode.Enabled) { return "DTXViewer release " + VERSION; - } - else - { + } else { return "OpenTaiko"; } } } private CSound previewSound; - public static DateTime StartupTime - { - get; - private set; - } + public static DateTime StartupTime { + get; + private set; + } - private void t起動処理() - { + private void t起動処理() { #region [ Read Config.ini and Database files ] //--------------------- @@ -2620,8 +2326,8 @@ for (int i = 0; i < 3; i++) { // Add a condition here (if old Saves\ format save files exist) to port them to database (?) - SaveFileInstances = DBSaves.FetchSaveInstances(); - /* + SaveFileInstances = DBSaves.FetchSaveInstances(); + /* for (int i = 0; i < 5; i++) { SaveFileInstances[i] = new SaveFile(); @@ -2630,21 +2336,18 @@ for (int i = 0; i < 3; i++) { */ - //--------------------- - #endregion + //--------------------- + #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(TJAPlayer3.sEncType) ) ) ); - } - catch ( System.UnauthorizedAccessException ) // #24481 2011.2.20 yyagi - { - int c = (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja")? 0 : 1; + #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(TJAPlayer3.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." @@ -2654,29 +2357,26 @@ for (int i = 0; i < 3; i++) { } } 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() ); + 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 - + #region [ DTXVmodeクラス の初期化 ] //--------------------- //Trace.TraceInformation( "Initialize DTXV mode." ); //Trace.Indent(); - try - { + try { DTXVmode = new CDTXVmode(); DTXVmode.Enabled = false; //Trace.TraceInformation( "DTXV initialization complete." ); - } - finally - { + } finally { //Trace.Unindent(); } //--------------------- @@ -2687,18 +2387,18 @@ for (int i = 0; i < 3; i++) { #region [ Skin の初期化 ] //--------------------- - Trace.TraceInformation( "Initializing skin..." ); + Trace.TraceInformation("Initializing skin..."); Trace.Indent(); #if !DEBUG try #endif { - Skin = new CSkin( TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName, false); - TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName = TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName( true ); // 旧指定のSkinフォルダが消滅していた場合に備える + Skin = new CSkin(TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName, false); + TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName = TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName(true); // 旧指定のSkinフォルダが消滅していた場合に備える ChangeResolution(TJAPlayer3.Skin.Resolution[0], TJAPlayer3.Skin.Resolution[1]); - Trace.TraceInformation( "Skin successfully initialized." ); + Trace.TraceInformation("Skin successfully initialized."); } #if !DEBUG catch (Exception e) @@ -2720,15 +2420,12 @@ for (int i = 0; i < 3; i++) { //----------- #region [ Timer の初期化 ] //--------------------- - Trace.TraceInformation( "Initializing timer..." ); + Trace.TraceInformation("Initializing timer..."); Trace.Indent(); - try - { - Timer = new CTimer( CTimer.TimerType.MultiMedia ); - Trace.TraceInformation( "Timer successfully initialized." ); - } - finally - { + try { + Timer = new CTimer(CTimer.TimerType.MultiMedia); + Trace.TraceInformation("Timer successfully initialized."); + } finally { Trace.Unindent(); } //--------------------- @@ -2737,145 +2434,111 @@ for (int i = 0; i < 3; i++) { #region [ FPS カウンタの初期化 ] //--------------------- - Trace.TraceInformation( "Initializing FPS counter..." ); + Trace.TraceInformation("Initializing FPS counter..."); Trace.Indent(); - try - { + try { FPS = new CFPS(); - Trace.TraceInformation( "FPS counter initialized." ); - } - finally - { + Trace.TraceInformation("FPS counter initialized."); + } finally { Trace.Unindent(); } //--------------------- #endregion #region [ act文字コンソールの初期化 ] //--------------------- - Trace.TraceInformation( "Initializing console..." ); + Trace.TraceInformation("Initializing console..."); Trace.Indent(); - try - { + try { actTextConsole = new CTextConsole(); - Trace.TraceInformation( "Console initialized." ); + Trace.TraceInformation("Console initialized."); actTextConsole.Activate(); - //if (!ConfigIni.PreAssetsLoading) + //if (!ConfigIni.PreAssetsLoading) { 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.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.TraceInformation("Initializing DirectInput and MIDI input..."); Trace.Indent(); - try - { + try { bool bUseMIDIIn = !DTXVmode.Enabled; InputManager = new CInputManager(Window_); - foreach( IInputDevice device in InputManager.InputDevices ) - { - if( ( device.CurrentType == InputDeviceType.Joystick ) && !ConfigIni.dicJoystick.ContainsValue( device.GUID ) ) - { + foreach (IInputDevice device in InputManager.InputDevices) { + if ((device.CurrentType == InputDeviceType.Joystick) && !ConfigIni.dicJoystick.ContainsValue(device.GUID)) { int key = 0; - while( ConfigIni.dicJoystick.ContainsKey( key ) ) - { + while (ConfigIni.dicJoystick.ContainsKey(key)) { key++; } - ConfigIni.dicJoystick.Add( key, device.GUID ); - } - else if( ( device.CurrentType == InputDeviceType.Gamepad ) && !ConfigIni.dicGamepad.ContainsValue( device.GUID ) ) - { + 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 ) ) - { + while (ConfigIni.dicGamepad.ContainsKey(key)) { key++; } - ConfigIni.dicGamepad.Add( key, device.GUID ); + 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 ); + 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 ); + } 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." ); + Trace.TraceInformation("DirectInput has been initialized."); + } catch (Exception exception2) { + Trace.TraceError("DirectInput and MIDI input failed to initialize."); throw; - } - finally - { + } finally { Trace.Unindent(); } //--------------------- #endregion #region [ Pad の初期化 ] //--------------------- - Trace.TraceInformation( "Initialize 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 - { + 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.TraceInformation("Initializing sound device..."); Trace.Indent(); - try - { + try { ESoundDeviceType soundDeviceType; - switch (TJAPlayer3.ConfigIni.nSoundDeviceType) - { + switch (TJAPlayer3.ConfigIni.nSoundDeviceType) { case 0: soundDeviceType = ESoundDeviceType.Bass; break; @@ -2896,7 +2559,7 @@ for (int i = 0; i < 3; i++) { soundDeviceType, TJAPlayer3.ConfigIni.nBassBufferSizeMs, TJAPlayer3.ConfigIni.nWASAPIBufferSizeMs, - // CDTXMania.ConfigIni.nASIOBufferSizeMs, + // CDTXMania.ConfigIni.nASIOBufferSizeMs, 0, TJAPlayer3.ConfigIni.nASIODevice, TJAPlayer3.ConfigIni.bUseOSTimer @@ -2907,27 +2570,23 @@ for (int i = 0; i < 3; i++) { Trace.TraceInformation("Initializing loudness scanning, song gain control, and sound group level control..."); Trace.Indent(); - try - { - actScanningLoudness = new CActScanningLoudness(); - actScanningLoudness.Activate(); - if (!ConfigIni.PreAssetsLoading) - { + try { + actScanningLoudness = new CActScanningLoudness(); + actScanningLoudness.Activate(); + if (!ConfigIni.PreAssetsLoading) { actScanningLoudness.CreateManagedResource(); actScanningLoudness.CreateUnmanagedResource(); } - LoudnessMetadataScanner.ScanningStateChanged += - (_, args) => actScanningLoudness.bIsActivelyScanning = args.IsActivelyScanning; - LoudnessMetadataScanner.StartBackgroundScanning(); + 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 - { + } finally { Trace.Unindent(); Trace.TraceInformation("Initialized loudness scanning, song gain control, and sound group level control."); } @@ -2936,37 +2595,28 @@ for (int i = 0; i < 3; i++) { FDK.SoundManager.bIsTimeStretch = TJAPlayer3.ConfigIni.bTimeStretch; SoundManager.nMasterVolume = TJAPlayer3.ConfigIni.nMasterVolume; //FDK.CSound管理.bIsMP3DecodeByWindowsCodec = CDTXMania.ConfigIni.bNoMP3Streaming; - Trace.TraceInformation( "サウンドデバイスの初期化を完了しました。" ); - } - catch (Exception e) - { - throw new NullReferenceException("No sound devices are enabled. Please check your audio settings.", e); - } - finally - { + 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.TraceInformation("Initializing song list..."); Trace.Indent(); - try - { + try { Songs管理 = new CSongs管理(); -// 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.TraceInformation("Song list initialized."); + } catch (Exception e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("Song list failed to initialize."); + } finally { Trace.Unindent(); } //--------------------- @@ -2982,7 +2632,7 @@ for (int i = 0; i < 3; i++) { r直前のステージ = null; stage起動 = new CStage起動(); stageタイトル = new CStageタイトル(); -// stageオプション = new CStageオプション(); + // stageオプション = new CStageオプション(); stageコンフィグ = new CStageコンフィグ(); stageSongSelect = new CStage選曲(); stage段位選択 = new CStage段位選択(); @@ -2998,85 +2648,73 @@ for (int i = 0; i < 3; i++) { 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( stageコンフィグ ); - this.listトップレベルActivities.Add( stageSongSelect ); - this.listトップレベルActivities.Add( stage段位選択 ); - this.listトップレベルActivities.Add( stageHeya ); + 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(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( stageOpenEncyclopedia ); - 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終了 ); + this.listトップレベルActivities.Add(stageOpenEncyclopedia); + 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 [ プラグインの検索と生成 ] //--------------------- PluginHost = new CPluginHost(); - Trace.TraceInformation( "Initializing and generating plugins..." ); + Trace.TraceInformation("Initializing and generating plugins..."); Trace.Indent(); - try - { + try { this.tプラグイン検索と生成(); - Trace.TraceInformation( "Plugin generation and initialization complete." ); - } - finally - { + Trace.TraceInformation("Plugin generation and initialization complete."); + } finally { Trace.Unindent(); } //--------------------- #endregion #region [ プラグインの初期化 ] //--------------------- - if( this.PluginList != null && this.PluginList.Count > 0 ) - { - Trace.TraceInformation( "Initializing plugin(s)..." ); + if (this.PluginList != null && this.PluginList.Count > 0) { + Trace.TraceInformation("Initializing plugin(s)..."); Trace.Indent(); - try - { - foreach( STPlugin st in this.PluginList ) - { - Directory.SetCurrentDirectory( st.pluginDirectory ); - st.plugin.On初期化( this.PluginHost ); + try { + foreach (STPlugin st in this.PluginList) { + Directory.SetCurrentDirectory(st.pluginDirectory); + st.plugin.On初期化(this.PluginHost); st.plugin.OnManagedリソースの作成(); st.plugin.OnUnmanagedリソースの作成(); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); } - Trace.TraceInformation( "All plugins have been initialized." ); - } - catch - { - Trace.TraceError( "Plugins could not be initialized." ); + Trace.TraceInformation("All plugins have been initialized."); + } catch { + Trace.TraceError("Plugins could not be initialized."); throw; - } - finally - { + } finally { Trace.Unindent(); } } - //--------------------- + //--------------------- #endregion #region Discordの処理 DiscordClient = new DiscordRpcClient("939341030141096007"); DiscordClient?.Initialize(); StartupTime = DateTime.UtcNow; - DiscordClient?.SetPresence(new RichPresence() - { + DiscordClient?.SetPresence(new RichPresence() { Details = "", State = "Startup", Timestamps = new Timestamps(TJAPlayer3.StartupTime), - Assets = new Assets() - { + Assets = new Assets() { LargeImageKey = TJAPlayer3.LargeImageKey, LargeImageText = TJAPlayer3.LargeImageText, } @@ -3084,25 +2722,21 @@ for (int i = 0; i < 3; i++) { #endregion - Trace.TraceInformation( "Application successfully started." ); + Trace.TraceInformation("Application successfully started."); #region [ 最初のステージの起動 ] - //--------------------- - Trace.TraceInformation( "----------------------" ); - Trace.TraceInformation( "■ Startup" ); + //--------------------- + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Startup"); - if ( TJAPlayer3.bコンパクトモード ) - { + if (TJAPlayer3.bコンパクトモード) { r現在のステージ = stage曲読み込み; - } - else - { + } else { r現在のステージ = stage起動; } r現在のステージ.Activate(); - if (!ConfigIni.PreAssetsLoading) - { + if (!ConfigIni.PreAssetsLoading) { r現在のステージ.CreateManagedResource(); r現在のステージ.CreateUnmanagedResource(); } @@ -3111,43 +2745,33 @@ for (int i = 0; i < 3; i++) { #endregion } - public void ShowWindowTitleWithSoundType() - { + public void ShowWindowTitleWithSoundType() { string delay = ""; - if ( SoundManager.GetCurrentSoundDeviceType() != "DirectSound" ) - { + if (SoundManager.GetCurrentSoundDeviceType() != "DirectSound") { delay = "(" + SoundManager.GetSoundDelay() + "ms)"; } - AssemblyName asmApp = Assembly.GetExecutingAssembly().GetName(); - base.Text = asmApp.Name + " Ver." + VERSION + " (" + SoundManager.GetCurrentSoundDeviceType() + delay + ")"; + 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" ); + private void t終了処理() { + if (!this.b終了処理完了済み) { + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Shutdown"); #region [ 曲検索の終了処理 ] //--------------------- - - if ( actEnumSongs != null ) - { - Trace.TraceInformation( "Ending enumeration of songs..." ); + + if (actEnumSongs != null) { + Trace.TraceInformation("Ending enumeration of songs..."); Trace.Indent(); - try - { + 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 - { + 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(); } } @@ -3155,22 +2779,18 @@ for (int i = 0; i < 3; i++) { #endregion #region [ 現在のステージの終了処理 ] //--------------------- - if( TJAPlayer3.r現在のステージ != null && TJAPlayer3.r現在のステージ.IsActivated ) // #25398 2011.06.07 MODIFY FROM + if (TJAPlayer3.r現在のステージ != null && TJAPlayer3.r現在のステージ.IsActivated) // #25398 2011.06.07 MODIFY FROM { - Trace.TraceInformation( "Exiting stage..." ); + Trace.TraceInformation("Exiting stage..."); Trace.Indent(); - try - { + try { r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) - { + if (!ConfigIni.PreAssetsLoading) { r現在のステージ.ReleaseManagedResource(); r現在のステージ.ReleaseUnmanagedResource(); } - Trace.TraceInformation( "Stage exited." ); - } - finally - { + Trace.TraceInformation("Stage exited."); + } finally { Trace.Unindent(); } } @@ -3178,44 +2798,36 @@ for (int i = 0; i < 3; i++) { #endregion #region [ プラグインの終了処理 ] //--------------------- from this point this is where i gave up - tfd500 - if (this.PluginList != null && this.PluginList.Count > 0) - { - Trace.TraceInformation( "Ending all plugins..." ); + if (this.PluginList != null && this.PluginList.Count > 0) { + Trace.TraceInformation("Ending all plugins..."); Trace.Indent(); - try - { - foreach( STPlugin st in this.PluginList ) - { - Directory.SetCurrentDirectory( st.pluginDirectory ); + try { + foreach (STPlugin st in this.PluginList) { + Directory.SetCurrentDirectory(st.pluginDirectory); st.plugin.OnUnmanagedリソースの解放(); st.plugin.OnManagedリソースの解放(); st.plugin.On終了(); - Directory.SetCurrentDirectory( TJAPlayer3.strEXEのあるフォルダ ); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); } PluginHost = null; - Trace.TraceInformation( "All plugins have been terminated." ); - } - finally - { + Trace.TraceInformation("All plugins have been terminated."); + } finally { Trace.Unindent(); } } - //--------------------- + //--------------------- #endregion #region Discordの処理 DiscordClient?.Dispose(); #endregion #region [ 曲リストの終了処理 ] - //--------------------- - if (Songs管理 != null) - { - Trace.TraceInformation( "Ending song list..." ); + //--------------------- + if (Songs管理 != null) { + Trace.TraceInformation("Ending song list..."); Trace.Indent(); - try - { + try { #pragma warning disable SYSLIB0011 - if (EnumSongs.IsSongListEnumCompletelyDone) - { + if (EnumSongs.IsSongListEnumCompletelyDone) { BinaryFormatter songlistdb_ = new BinaryFormatter(); using Stream songlistdb = File.OpenWrite($"{TJAPlayer3.strEXEのあるフォルダ}songlist.db"); songlistdb_.Serialize(songlistdb, Songs管理.listSongsDB); @@ -3223,42 +2835,32 @@ for (int i = 0; i < 3; i++) { #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.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(); + Tx.DisposeTexture(); #endregion #region [ スキンの終了処理 ] - //--------------------- - if (Skin != null) - { - Trace.TraceInformation( "Terminating skin..." ); + //--------------------- + if (Skin != null) { + Trace.TraceInformation("Terminating skin..."); Trace.Indent(); - try - { + 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.TraceInformation("Skin has been terminated."); + } catch (Exception exception2) { + Trace.TraceError(exception2.ToString()); + Trace.TraceError("Skin failed to terminate."); + } finally { Trace.Unindent(); } } @@ -3266,23 +2868,17 @@ for (int i = 0; i < 3; i++) { #endregion #region [ DirectSoundの終了処理 ] //--------------------- - if (SoundManager != null) - { - Trace.TraceInformation( "Ending DirectSound devices..." ); + if (SoundManager != null) { + Trace.TraceInformation("Ending DirectSound devices..."); Trace.Indent(); - try - { + 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.TraceInformation("DirectSound devices have been terminated."); + } catch (Exception exception3) { + Trace.TraceError(exception3.ToString()); + Trace.TraceError("DirectSound devices failed to terminate."); + } finally { Trace.Unindent(); } } @@ -3290,22 +2886,16 @@ for (int i = 0; i < 3; i++) { #endregion #region [ パッドの終了処理 ] //--------------------- - if (Pad != null) - { - Trace.TraceInformation( "Ending pads..." ); + if (Pad != null) { + Trace.TraceInformation("Ending pads..."); Trace.Indent(); - try - { + try { Pad = null; - Trace.TraceInformation( "Pads have been terminated." ); - } - catch( Exception exception4 ) - { - Trace.TraceError( exception4.ToString() ); - Trace.TraceError( "Pads failed to terminate。" ); - } - finally - { + Trace.TraceInformation("Pads have been terminated."); + } catch (Exception exception4) { + Trace.TraceError(exception4.ToString()); + Trace.TraceError("Pads failed to terminate。"); + } finally { Trace.Unindent(); } } @@ -3313,23 +2903,17 @@ for (int i = 0; i < 3; i++) { #endregion #region [ DirectInput, MIDI入力の終了処理 ] //--------------------- - if (InputManager != null) - { - Trace.TraceInformation( "Ending DirectInput and MIDI devices..." ); + if (InputManager != null) { + Trace.TraceInformation("Ending DirectInput and MIDI devices..."); Trace.Indent(); - try - { + 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.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(); } } @@ -3337,28 +2921,22 @@ for (int i = 0; i < 3; i++) { #endregion #region [ 文字コンソールの終了処理 ] //--------------------- - if (actTextConsole != null) - { - Trace.TraceInformation( "Ending console..." ); + if (actTextConsole != null) { + Trace.TraceInformation("Ending console..."); Trace.Indent(); - try - { + try { actTextConsole.DeActivate(); - //if (!ConfigIni.PreAssetsLoading) + //if (!ConfigIni.PreAssetsLoading) { 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.TraceInformation("Console terminated."); + } catch (Exception exception6) { + Trace.TraceError(exception6.ToString()); + Trace.TraceError("Console failed to terminate."); + } finally { Trace.Unindent(); } } @@ -3368,16 +2946,12 @@ for (int i = 0; i < 3; i++) { //--------------------- Trace.TraceInformation("Ending FPS counter..."); Trace.Indent(); - try - { - if( FPS != null ) - { + try { + if (FPS != null) { FPS = null; } - Trace.TraceInformation( "FPS counter terminated." ); - } - finally - { + Trace.TraceInformation("FPS counter terminated."); + } finally { Trace.Unindent(); } //--------------------- @@ -3386,21 +2960,15 @@ for (int i = 0; i < 3; i++) { //--------------------- Trace.TraceInformation("Ending timer..."); Trace.Indent(); - try - { - if( Timer != null ) - { + try { + if (Timer != null) { Timer.Dispose(); Timer = null; - Trace.TraceInformation( "Timer terminated." ); + Trace.TraceInformation("Timer terminated."); + } else { + Trace.TraceInformation("There are no existing timers."); } - else - { - Trace.TraceInformation( "There are no existing timers." ); - } - } - finally - { + } finally { Trace.Unindent(); } //--------------------- @@ -3409,54 +2977,42 @@ for (int i = 0; i < 3; i++) { //--------------------- Trace.TraceInformation("Outputting Config.ini..."); Trace.TraceInformation("This only needs to be done once, unless you have deleted the file!"); -// if ( ConfigIni.bIsSwappedGuitarBass ) // #24063 2011.1.16 yyagi ギターベースがスワップしているときは元に戻す + // if ( ConfigIni.bIsSwappedGuitarBass ) // #24063 2011.1.16 yyagi ギターベースがスワップしているときは元に戻す string str = strEXEのあるフォルダ + "Config.ini"; Trace.Indent(); - try - { - if ( DTXVmode.Enabled ) - { + try { + if (DTXVmode.Enabled) { DTXVmode.tUpdateConfigIni(); - Trace.TraceInformation( "Configuration information for DTXV mode has been saved in Config.ini." ); + Trace.TraceInformation("Configuration information for DTXV mode has been saved in Config.ini."); + } else { + ConfigIni.t書き出し(str); + Trace.TraceInformation("Saved succesfully. ({0})", str); } - else - { - 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 - { + } 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) - { + 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."); - } + actScanningLoudness = null; + } finally { + Trace.Unindent(); + Trace.TraceInformation("Deinitialized loudness scanning, song gain control, and sound group level control."); + } - ConfigIni = null; + ConfigIni = null; //--------------------- #endregion @@ -3464,69 +3020,59 @@ for (int i = 0; i < 3; i++) { //--------------------- //Trace.TraceInformation( "DTXVモードの終了処理を行います。" ); //Trace.Indent(); - try - { - if ( DTXVmode != null ) - { + try { + if (DTXVmode != null) { DTXVmode = null; //Trace.TraceInformation( "DTXVモードの終了処理を完了しました。" ); - } - else - { + } else { //Trace.TraceInformation( "DTXVモードは使用されていません。" ); } - } - finally - { + } finally { //Trace.Unindent(); } //--------------------- #endregion - Trace.TraceInformation( "OpenTaiko has closed down successfully." ); + Trace.TraceInformation("OpenTaiko has closed down successfully."); this.b終了処理完了済み = true; } } - private void tガベージコレクションを実行する() - { + private void tガベージコレクションを実行する() { GC.Collect(GC.MaxGeneration); GC.WaitForPendingFinalizers(); GC.Collect(GC.MaxGeneration); } - private void tプラグイン検索と生成() - { + private void tプラグイン検索と生成() { this.PluginList = new List(); - string PluginActivityName = typeof( IPluginActivity ).FullName; + string PluginActivityName = typeof(IPluginActivity).FullName; string PluginFolderPath = strEXEのあるフォルダ + "Plugins" + Path.DirectorySeparatorChar; - this.SearchAndGeneratePluginsInFolder( PluginFolderPath, PluginActivityName ); + this.SearchAndGeneratePluginsInFolder(PluginFolderPath, PluginActivityName); - if( this.PluginList.Count > 0 ) - Trace.TraceInformation( this.PluginList.Count + "Plugins loaded." ); + if (this.PluginList.Count > 0) + Trace.TraceInformation(this.PluginList.Count + "Plugins loaded."); } - private void ChangeResolution(int nWidth, int nHeight) - { + 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:" + TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName(false)); + public void RefreshSkin() { + Trace.TraceInformation("Skin Change:" + TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName(false)); - TJAPlayer3.actTextConsole.DeActivate(); + TJAPlayer3.actTextConsole.DeActivate(); actTextConsole.ReleaseManagedResource(); actTextConsole.ReleaseUnmanagedResource(); - TJAPlayer3.Skin.Dispose(); - TJAPlayer3.Skin = null; - TJAPlayer3.Skin = new CSkin(TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName, false); + TJAPlayer3.Skin.Dispose(); + TJAPlayer3.Skin = null; + TJAPlayer3.Skin = new CSkin(TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName, false); TJAPlayer3.Tx.DisposeTexture(); @@ -3534,7 +3080,7 @@ for (int i = 0; i < 3; i++) { TJAPlayer3.Tx.LoadTexture(); - TJAPlayer3.actTextConsole.Activate(); + TJAPlayer3.actTextConsole.Activate(); actTextConsole.CreateManagedResource(); actTextConsole.CreateUnmanagedResource(); TJAPlayer3.NamePlate.RefleshSkin(); @@ -3542,55 +3088,47 @@ for (int i = 0; i < 3; i++) { CActSelect段位リスト.RefleshSkin(); } #region [ Windowイベント処理 ] - private void SearchAndGeneratePluginsInFolder( string PluginFolderPath, string PluginTypeName ) - { + private void SearchAndGeneratePluginsInFolder(string PluginFolderPath, string PluginTypeName) { // 指定されたパスが存在しないとエラー - if( !Directory.Exists( PluginFolderPath ) ) - { - Trace.TraceWarning( "The plugin folder does not exist. (" + PluginFolderPath + ")" ); + if (!Directory.Exists(PluginFolderPath)) { + Trace.TraceWarning("The plugin folder does not exist. (" + PluginFolderPath + ")"); return; } // (1) すべての *.dll について… - string[] strDLLs = System.IO.Directory.GetFiles( PluginFolderPath, "*.dll" ); - foreach( string dllName in strDLLs ) - { - try - { + string[] strDLLs = System.IO.Directory.GetFiles(PluginFolderPath, "*.dll"); + foreach (string dllName in strDLLs) { + try { // (1-1) dll をアセンブリとして読み込む。 - System.Reflection.Assembly asm = System.Reflection.Assembly.LoadFrom( dllName ); + System.Reflection.Assembly asm = System.Reflection.Assembly.LoadFrom(dllName); // (1-2) アセンブリ内のすべての型について、プラグインとして有効か調べる - foreach( Type t in asm.GetTypes() ) - { + foreach (Type t in asm.GetTypes()) { // (1-3) ↓クラスであり↓Publicであり↓抽象クラスでなく↓IPlugin型のインスタンスが作れる 型を持っていれば有効 - if( t.IsClass && t.IsPublic && !t.IsAbstract && t.GetInterface( PluginTypeName ) != null ) - { + if (t.IsClass && t.IsPublic && !t.IsAbstract && t.GetInterface(PluginTypeName) != null) { // (1-4) クラス名からインスタンスを作成する var st = new STPlugin() { - plugin = (IPluginActivity) asm.CreateInstance( t.FullName ), - pluginDirectory = Path.GetDirectoryName( dllName ), + plugin = (IPluginActivity)asm.CreateInstance(t.FullName), + pluginDirectory = Path.GetDirectoryName(dllName), assemblyName = asm.GetName().Name, Version = asm.GetName().Version, }; // (1-5) プラグインリストへ登録 - this.PluginList.Add( st ); - Trace.TraceInformation( "Plugin {0} ({1}, {2}, {3}) has been loaded.", t.FullName, Path.GetFileName( dllName ), st.assemblyName, st.Version.ToString() ); + this.PluginList.Add(st); + Trace.TraceInformation("Plugin {0} ({1}, {2}, {3}) has been loaded.", t.FullName, Path.GetFileName(dllName), st.assemblyName, st.Version.ToString()); } } - } - catch (Exception e) - { - Trace.TraceError( e.ToString() ); - Trace.TraceInformation( dllName + "could not be used to generate a plugin. Skipping plugin." ); + } catch (Exception e) { + Trace.TraceError(e.ToString()); + Trace.TraceInformation(dllName + "could not be used to generate a plugin. Skipping plugin."); } } // (2) サブフォルダがあれば再帰する - string[] strDirs = Directory.GetDirectories( PluginFolderPath, "*" ); - foreach( string dir in strDirs ) - this.SearchAndGeneratePluginsInFolder( dir + Path.DirectorySeparatorChar, PluginTypeName ); + string[] strDirs = Directory.GetDirectories(PluginFolderPath, "*"); + foreach (string dir in strDirs) + this.SearchAndGeneratePluginsInFolder(dir + Path.DirectorySeparatorChar, PluginTypeName); } //----------------- /* diff --git a/OpenTaiko/src/Components/CGimmickValue.cs b/OpenTaiko/src/Components/CGimmickValue.cs index 75228e2b..244c0867 100644 --- a/OpenTaiko/src/Components/CGimmickValue.cs +++ b/OpenTaiko/src/Components/CGimmickValue.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace TJAPlayer3 -{ - internal class CGimmickValue - { - } +namespace TJAPlayer3 { + internal class CGimmickValue { + } } diff --git a/OpenTaiko/src/Components/CLocalizationData.cs b/OpenTaiko/src/Components/CLocalizationData.cs index df8eb07c..ddf2cf4c 100644 --- a/OpenTaiko/src/Components/CLocalizationData.cs +++ b/OpenTaiko/src/Components/CLocalizationData.cs @@ -1,36 +1,26 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; +using Newtonsoft.Json; -namespace TJAPlayer3 -{ - [Serializable] - internal class CLocalizationData - { - [JsonProperty("strings")] - private Dictionary Strings = new Dictionary(); +namespace TJAPlayer3 { + [Serializable] + internal class CLocalizationData { + [JsonProperty("strings")] + private Dictionary Strings = new Dictionary(); - public CLocalizationData() - { - Strings = new Dictionary(); - } + public CLocalizationData() { + 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 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; - } - } + 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 85f32edf..0949dab8 100644 --- a/OpenTaiko/src/Components/CSongReplay.cs +++ b/OpenTaiko/src/Components/CSongReplay.cs @@ -1,16 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.IO; -using static SevenZip.Compression.LZMA.SevenZipHelper; - -namespace TJAPlayer3 -{ - class CSongReplay - { - /* Game version used for the replay +namespace TJAPlayer3 { + class CSongReplay { + /* Game version used for the replay * 521 = 0.5.2.1 * 530 = 0.5.3 * 531 = 0.5.3.1 @@ -19,10 +9,10 @@ namespace TJAPlayer3 * 700 = 0.7.0 * 1000 = 1.0.0 */ - public int STORED_GAME_VERSION = 600; - public string REPLAY_FOLDER_NAME = "Replay"; + public int STORED_GAME_VERSION = 600; + public string REPLAY_FOLDER_NAME = "Replay"; - /* Mod Flags + /* Mod Flags * Bit Offsets (Values) : * - 0 (1) : Mirror * - 1 (2) : Random (Kimagure) @@ -34,292 +24,262 @@ namespace TJAPlayer3 * - 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 - } + [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() { + replayFolder = ""; + storedPlayer = 0; + } - public CSongReplay(string ChartPath, int player) - { - string _chartFolder = Path.GetDirectoryName(ChartPath); - replayFolder = Path.Combine(_chartFolder, REPLAY_FOLDER_NAME); + public CSongReplay(string ChartPath, int player) { + string _chartFolder = Path.GetDirectoryName(ChartPath); + replayFolder = Path.Combine(_chartFolder, REPLAY_FOLDER_NAME); - try - { - Directory.CreateDirectory(replayFolder); + try { + Directory.CreateDirectory(replayFolder); - Console.WriteLine("Folder Path: " + replayFolder); - } - catch (Exception ex) - { - Console.WriteLine("An error occurred: " + ex.Message); - } + Console.WriteLine("Folder Path: " + replayFolder); + } catch (Exception ex) { + Console.WriteLine("An error occurred: " + ex.Message); + } - storedPlayer = player; - } + storedPlayer = player; + } - public void tRegisterInput(double timestamp, byte keypress) - { - allInputs.Add(Tuple.Create(timestamp, keypress)); - } + 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]; - } + #region [Dan methods] - public void tDanInputSongResults(int songNo) - { - if (songNo >= DanSongCount) return; - if (songNo < 0) return; - IndividualGoodCount[songNo] = TJAPlayer3.stage演奏ドラム画面.n良[songNo]; - IndividualOkCount[songNo] = TJAPlayer3.stage演奏ドラム画面.n可[songNo]; - IndividualBadCount[songNo] = TJAPlayer3.stage演奏ドラム画面.n不可[songNo]; - IndividualRollCount[songNo] = TJAPlayer3.stage演奏ドラム画面.n連打[songNo]; - IndividualMaxCombo[songNo] = TJAPlayer3.stage演奏ドラム画面.nHighestCombo[songNo]; - IndividualBoomCount[songNo] = TJAPlayer3.stage演奏ドラム画面.nMine[songNo]; - IndividualADLibCount[songNo] = TJAPlayer3.stage演奏ドラム画面.nADLIB[songNo]; - danAccumulatedScore = 0; - for (int acc = 0; acc < songNo; acc++) danAccumulatedScore += IndividualScore[acc]; - IndividualScore[songNo] = (int)TJAPlayer3.stage演奏ドラム画面.actScore.GetScore(0) - danAccumulatedScore; - } + 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]; + } - #endregion + public void tDanInputSongResults(int songNo) { + if (songNo >= DanSongCount) return; + if (songNo < 0) return; + IndividualGoodCount[songNo] = TJAPlayer3.stage演奏ドラム画面.n良[songNo]; + IndividualOkCount[songNo] = TJAPlayer3.stage演奏ドラム画面.n可[songNo]; + IndividualBadCount[songNo] = TJAPlayer3.stage演奏ドラム画面.n不可[songNo]; + IndividualRollCount[songNo] = TJAPlayer3.stage演奏ドラム画面.n連打[songNo]; + IndividualMaxCombo[songNo] = TJAPlayer3.stage演奏ドラム画面.nHighestCombo[songNo]; + IndividualBoomCount[songNo] = TJAPlayer3.stage演奏ドラム画面.nMine[songNo]; + IndividualADLibCount[songNo] = TJAPlayer3.stage演奏ドラム画面.nADLIB[songNo]; + danAccumulatedScore = 0; + for (int acc = 0; acc < songNo; acc++) danAccumulatedScore += IndividualScore[acc]; + IndividualScore[songNo] = (int)TJAPlayer3.stage演奏ドラム画面.actScore.GetScore(0) - danAccumulatedScore; + } - #region [Load methods] + #endregion - private List> ConvertByteArrayToTupleList(byte[] byteArray) - { - List> tupleList = new List>(); + #region [Load methods] - 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)); - } + private List> ConvertByteArrayToTupleList(byte[] byteArray) { + List> tupleList = new List>(); - return tupleList; - } + 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)); + } - 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) - { + 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] + #endregion - private byte[] ConvertTupleListToByteArray(List> tupleList) - { - List byteArray = new List(); + #region [Save methods] - foreach (var tuple in tupleList) - { - byte[] doubleBytes = BitConverter.GetBytes(tuple.Item1); - byteArray.AddRange(doubleBytes); - byteArray.Add(tuple.Item2); - } + private byte[] ConvertTupleListToByteArray(List> tupleList) { + List byteArray = new List(); - return byteArray.ToArray(); - } + foreach (var tuple in tupleList) { + byte[] doubleBytes = BitConverter.GetBytes(tuple.Item1); + byteArray.AddRange(doubleBytes); + byteArray.Add(tuple.Item2); + } - public void tSaveReplayFile() - { - string _path = replayFolder + @"/Replay_" + ChartUniqueID + @"_" + PlayerName + @"_" + Timestamp.ToString() + @".optkr"; + return byteArray.ToArray(); + } - 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 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 = TJAPlayer3.GetActualPlayer(storedPlayer); + } + } - // Game mode - switch (TJAPlayer3.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 = TJAPlayer3.SaveFileInstances[actualPlayer].data.Name; - // Performance informations - GoodCount = TJAPlayer3.stage演奏ドラム画面.CChartScore[storedPlayer].nGreat; - OkCount = TJAPlayer3.stage演奏ドラム画面.CChartScore[storedPlayer].nGood; - BadCount = TJAPlayer3.stage演奏ドラム画面.CChartScore[storedPlayer].nMiss; - RollCount = TJAPlayer3.stage演奏ドラム画面.GetRoll(storedPlayer); - MaxCombo = TJAPlayer3.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[storedPlayer]; - BoomCount = TJAPlayer3.stage演奏ドラム画面.CChartScore[storedPlayer].nMine; - ADLibCount = TJAPlayer3.stage演奏ドラム画面.CChartScore[storedPlayer].nADLIB; - Score = TJAPlayer3.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 = TJAPlayer3.ConfigIni.nScrollSpeed[actualPlayer]; - // Song speed value (as on ConfigIni, 20 is x1) - SongSpeedValue = TJAPlayer3.ConfigIni.nSongSpeed; - // Just strictess adjust mod value (as on ConfigIni, between -2 for lenient and 2 for rigorous) - JudgeStrictnessAdjust = TJAPlayer3.ConfigIni.nTimingZones[actualPlayer]; + public void tResultsRegisterReplayInformations(int Coins, int Clear, int SRank) { + // Actual player (Used for saved informations) + int actualPlayer = TJAPlayer3.GetActualPlayer(storedPlayer); - /* Mod Flags + // Game mode + switch (TJAPlayer3.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 = TJAPlayer3.SaveFileInstances[actualPlayer].data.Name; + // Performance informations + GoodCount = TJAPlayer3.stage演奏ドラム画面.CChartScore[storedPlayer].nGreat; + OkCount = TJAPlayer3.stage演奏ドラム画面.CChartScore[storedPlayer].nGood; + BadCount = TJAPlayer3.stage演奏ドラム画面.CChartScore[storedPlayer].nMiss; + RollCount = TJAPlayer3.stage演奏ドラム画面.GetRoll(storedPlayer); + MaxCombo = TJAPlayer3.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[storedPlayer]; + BoomCount = TJAPlayer3.stage演奏ドラム画面.CChartScore[storedPlayer].nMine; + ADLibCount = TJAPlayer3.stage演奏ドラム画面.CChartScore[storedPlayer].nADLIB; + Score = TJAPlayer3.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 = TJAPlayer3.ConfigIni.nScrollSpeed[actualPlayer]; + // Song speed value (as on ConfigIni, 20 is x1) + SongSpeedValue = TJAPlayer3.ConfigIni.nSongSpeed; + // Just strictess adjust mod value (as on ConfigIni, between -2 for lenient and 2 for rigorous) + JudgeStrictnessAdjust = TJAPlayer3.ConfigIni.nTimingZones[actualPlayer]; + + /* Mod Flags * Bit Offsets (Values) : * - 0 (1) : Mirror * - 1 (2) : Random (Kimagure) @@ -331,72 +291,72 @@ namespace TJAPlayer3 * - 7 (128) : Just (Ok => Bad) * - 8 (256) : Safe (Bad => Ok) */ - ModFlags = (int)EModFlag.None; - if (TJAPlayer3.ConfigIni.eRandom[actualPlayer] == ERandomMode.MIRROR) ModFlags |= (int)EModFlag.Mirror; - if (TJAPlayer3.ConfigIni.eRandom[actualPlayer] == ERandomMode.RANDOM) ModFlags |= (int)EModFlag.Random; - if (TJAPlayer3.ConfigIni.eRandom[actualPlayer] == ERandomMode.SUPERRANDOM) ModFlags |= (int)EModFlag.SuperRandom; - if (TJAPlayer3.ConfigIni.eRandom[actualPlayer] == ERandomMode.MIRRORRANDOM) ModFlags |= ((int)EModFlag.Random | (int)EModFlag.Mirror); - if (TJAPlayer3.ConfigIni.eSTEALTH[actualPlayer] == EStealthMode.DORON) ModFlags |= (int)EModFlag.Invisible; - if (TJAPlayer3.ConfigIni.eSTEALTH[actualPlayer] == EStealthMode.STEALTH) ModFlags |= (int)EModFlag.PerfectMemory; - if (TJAPlayer3.ConfigIni.nFunMods[actualPlayer] == EFunMods.AVALANCHE) ModFlags |= (int)EModFlag.Avalanche; - if (TJAPlayer3.ConfigIni.nFunMods[actualPlayer] == EFunMods.MINESWEEPER) ModFlags |= (int)EModFlag.Minesweeper; - if (TJAPlayer3.ConfigIni.bJust[actualPlayer] == 1) ModFlags |= (int)EModFlag.Just; - if (TJAPlayer3.ConfigIni.bJust[actualPlayer] == 2) ModFlags |= (int)EModFlag.Safe; - /* Gauge type + ModFlags = (int)EModFlag.None; + if (TJAPlayer3.ConfigIni.eRandom[actualPlayer] == ERandomMode.MIRROR) ModFlags |= (int)EModFlag.Mirror; + if (TJAPlayer3.ConfigIni.eRandom[actualPlayer] == ERandomMode.RANDOM) ModFlags |= (int)EModFlag.Random; + if (TJAPlayer3.ConfigIni.eRandom[actualPlayer] == ERandomMode.SUPERRANDOM) ModFlags |= (int)EModFlag.SuperRandom; + if (TJAPlayer3.ConfigIni.eRandom[actualPlayer] == ERandomMode.MIRRORRANDOM) ModFlags |= ((int)EModFlag.Random | (int)EModFlag.Mirror); + if (TJAPlayer3.ConfigIni.eSTEALTH[actualPlayer] == EStealthMode.DORON) ModFlags |= (int)EModFlag.Invisible; + if (TJAPlayer3.ConfigIni.eSTEALTH[actualPlayer] == EStealthMode.STEALTH) ModFlags |= (int)EModFlag.PerfectMemory; + if (TJAPlayer3.ConfigIni.nFunMods[actualPlayer] == EFunMods.AVALANCHE) ModFlags |= (int)EModFlag.Avalanche; + if (TJAPlayer3.ConfigIni.nFunMods[actualPlayer] == EFunMods.MINESWEEPER) ModFlags |= (int)EModFlag.Minesweeper; + if (TJAPlayer3.ConfigIni.bJust[actualPlayer] == 1) ModFlags |= (int)EModFlag.Just; + if (TJAPlayer3.ConfigIni.bJust[actualPlayer] == 2) ModFlags |= (int)EModFlag.Safe; + /* Gauge type * - 0 : Normal * - 1 : Hard * - 2 : Extreme */ - var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[actualPlayer].data.Character]; - GaugeType = (byte)HGaugeMethods.tGetGaugeTypeEnum(chara.effect.tGetGaugeType()); - // Gauge fill value - GaugeFill = (float)TJAPlayer3.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 = TJAPlayer3.stageSongSelect.rChoosenSong.uniqueId.data.id; - ChartDifficulty = (byte)TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[storedPlayer]; - ChartLevel = (byte)Math.Min(255, TJAPlayer3.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 = ""; - } + var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[actualPlayer].data.Character]; + GaugeType = (byte)HGaugeMethods.tGetGaugeTypeEnum(chara.effect.tGetGaugeType()); + // Gauge fill value + GaugeFill = (float)TJAPlayer3.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 = TJAPlayer3.stageSongSelect.rChoosenSong.uniqueId.data.id; + ChartDifficulty = (byte)TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[storedPlayer]; + ChartLevel = (byte)Math.Min(255, TJAPlayer3.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 + #endregion - #region [Helper variables] + #region [Helper variables] - private string chartPath; - private string replayFolder; - private int storedPlayer; - private int danAccumulatedScore = 0; + private string chartPath; + private string replayFolder; + private int storedPlayer; + private int danAccumulatedScore = 0; - private List> allInputs = new List>(); + private List> allInputs = new List>(); - #endregion + #endregion - #region [Replay file variables] + #region [Replay file variables] - /* Game mode of the replay + /* 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 + 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) @@ -407,32 +367,32 @@ namespace TJAPlayer3 * - 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) + 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 + 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) @@ -460,8 +420,8 @@ namespace TJAPlayer3 * > 7 : Red perfect - Dan title * > 8 : Gold perfect - Dan title */ - public byte ClearStatus; - /* Score Rank (Regular only) + 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) @@ -471,14 +431,14 @@ namespace TJAPlayer3 * - 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 + 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) @@ -490,32 +450,32 @@ namespace TJAPlayer3 * - 7 (128) : Just (Ok => Bad) * - 8 (256) : Safe (Bad => Ok) */ - public int ModFlags; - /* Gauge type + 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 + 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; + 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 - } + #endregion + } } diff --git a/OpenTaiko/src/Components/CVisualLogManager.cs b/OpenTaiko/src/Components/CVisualLogManager.cs index dcd8496a..c739e4ef 100644 --- a/OpenTaiko/src/Components/CVisualLogManager.cs +++ b/OpenTaiko/src/Components/CVisualLogManager.cs @@ -1,64 +1,50 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - class CVisualLogManager - { - public enum ELogCardType - { - LogInfo, - LogWarning, - LogError - } +namespace TJAPlayer3 { + 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, TJAPlayer3.Timer); - } + class LogCard { + public LogCard(ELogCardType type, string message) { + lct = type; + msg = message; + timeSinceCreation = new CCounter(0, 10000, 1, TJAPlayer3.Timer); + } - public void Display(int screenPosition) - { - timeSinceCreation.Tick(); + public void Display(int screenPosition) { + timeSinceCreation.Tick(); - // Display stuff here + // Display stuff here - int x = 0; - int y = 0 + (40 * screenPosition); + int x = 0; + int y = 0 + (40 * screenPosition); - TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.Cyan, msg); - } + TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.Cyan, msg); + } - public bool IsExpired() - { - return timeSinceCreation.IsEnded; - } + public bool IsExpired() { + return timeSinceCreation.IsEnded; + } - private CCounter timeSinceCreation; - private ELogCardType lct; - private string msg; - } + private CCounter timeSinceCreation; + private ELogCardType lct; + private string msg; + } - public void PushCard(ELogCardType lct, string msg) - { - cards.Add(new LogCard(lct, 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()); - } + 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(); - } + private List cards = new List(); + } } diff --git a/OpenTaiko/src/Databases/DBCDN.cs b/OpenTaiko/src/Databases/DBCDN.cs index 28c51dda..07fac50b 100644 --- a/OpenTaiko/src/Databases/DBCDN.cs +++ b/OpenTaiko/src/Databases/DBCDN.cs @@ -1,68 +1,56 @@ -using System.Collections.Generic; -using System.IO; -using Newtonsoft.Json; +using Newtonsoft.Json; -namespace TJAPlayer3 -{ - class DBCDN : CSavableT> - { - public DBCDN() - { - _fn = @$"{TJAPlayer3.strEXEのあるフォルダ}Databases{Path.DirectorySeparatorChar}CDN.json"; - base.tDBInitSavable(); - } +namespace TJAPlayer3 { + class DBCDN : CSavableT> { + public DBCDN() { + _fn = @$"{TJAPlayer3.strEXEのあるフォルダ}Databases{Path.DirectorySeparatorChar}CDN.json"; + base.tDBInitSavable(); + } - #region [Auxiliary classes] + #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 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 string charter = "charter"; + } - public class CDNData - { + public class CDNData { - [JsonProperty("baseUrl")] - public string BaseUrl; + [JsonProperty("baseUrl")] + public string BaseUrl; - [JsonProperty("download")] - public Dictionary Download = new Dictionary() - { - ["default"] = "download/", - }; + [JsonProperty("download")] + public Dictionary Download = new Dictionary() { + ["default"] = "download/", + }; - [JsonProperty("songList")] - public string SongList; + [JsonProperty("songList")] + public string SongList; - [JsonProperty("hooks")] - public CDNHooks Hooks; - } + [JsonProperty("hooks")] + public CDNHooks Hooks; + } - #endregion + #endregion - } -} \ No newline at end of file + } +} diff --git a/OpenTaiko/src/Databases/DBCharacter.cs b/OpenTaiko/src/Databases/DBCharacter.cs index ecd4ed0d..9de8a503 100644 --- a/OpenTaiko/src/Databases/DBCharacter.cs +++ b/OpenTaiko/src/Databases/DBCharacter.cs @@ -1,106 +1,92 @@ -using System.Collections.Generic; -using System.IO; -using Newtonsoft.Json; +using Newtonsoft.Json; -namespace TJAPlayer3 -{ - class DBCharacter - { - public class CharacterEffect - { - public CharacterEffect() - { - Gauge = "Normal"; - BombFactor = 20; - FuseRollFactor = 0; - } +namespace TJAPlayer3 { + class DBCharacter { + public class CharacterEffect { + public CharacterEffect() { + Gauge = "Normal"; + BombFactor = 20; + FuseRollFactor = 0; + } - public float GetCoinMultiplier() - { - float mult = 1f; + public float GetCoinMultiplier() { + float mult = 1f; - if (Gauge == "Hard" && !TJAPlayer3.ConfigIni.bForceNormalGauge) mult *= 1.5f; - if (Gauge == "Extreme" && !TJAPlayer3.ConfigIni.bForceNormalGauge) mult *= 1.8f; + if (Gauge == "Hard" && !TJAPlayer3.ConfigIni.bForceNormalGauge) mult *= 1.5f; + if (Gauge == "Extreme" && !TJAPlayer3.ConfigIni.bForceNormalGauge) mult *= 1.8f; - return mult; - } + return mult; + } - public string tGetGaugeType() - { - return TJAPlayer3.ConfigIni.bForceNormalGauge || TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] >= 5 ? "Normal" : Gauge; - } + public string tGetGaugeType() { + return TJAPlayer3.ConfigIni.bForceNormalGauge || TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] >= 5 ? "Normal" : Gauge; + } - [JsonProperty("gauge")] - public string Gauge; + [JsonProperty("gauge")] + public string Gauge; - [JsonProperty("bombFactor")] - public int BombFactor; + [JsonProperty("bombFactor")] + public int BombFactor; - [JsonProperty("fuseRollFactor")] - public int FuseRollFactor; - } + [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 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 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 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 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 ""; - } + 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; + // String or CLocalizationData + [JsonProperty("name")] + [JsonConverter(typeof(LocalizedStringConverter))] + public object Name; - [JsonProperty("rarity")] - public string Rarity; + [JsonProperty("rarity")] + public string Rarity; - // String or CLocalizationData - [JsonProperty("author")] - [JsonConverter(typeof(LocalizedStringConverter))] - public object Author; + // String or CLocalizationData + [JsonProperty("author")] + [JsonConverter(typeof(LocalizedStringConverter))] + public object Author; - // String or CLocalizationData - [JsonProperty("description")] - [JsonConverter(typeof(LocalizedStringConverter))] - public object Description; + // String or CLocalizationData + [JsonProperty("description")] + [JsonConverter(typeof(LocalizedStringConverter))] + public object Description; - [JsonProperty("speechtext")] - public CLocalizationData[] SpeechText; - } + [JsonProperty("speechtext")] + public CLocalizationData[] SpeechText; + } - } -} \ No newline at end of file + } +} diff --git a/OpenTaiko/src/Databases/DBEncyclopediaMenus.cs b/OpenTaiko/src/Databases/DBEncyclopediaMenus.cs index e2b96233..0dfe77f9 100644 --- a/OpenTaiko/src/Databases/DBEncyclopediaMenus.cs +++ b/OpenTaiko/src/Databases/DBEncyclopediaMenus.cs @@ -1,31 +1,21 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.IO; -using Newtonsoft.Json; +using Newtonsoft.Json; -namespace TJAPlayer3 -{ - class DBEncyclopediaMenus : CSavableT - { - public DBEncyclopediaMenus() - { - _fn = @$"{TJAPlayer3.strEXEのあるフォルダ}Encyclopedia{Path.DirectorySeparatorChar}Menus.json"; - base.tDBInitSavable(); - } +namespace TJAPlayer3 { + class DBEncyclopediaMenus : CSavableT { + public DBEncyclopediaMenus() { + _fn = @$"{TJAPlayer3.strEXEのあるフォルダ}Encyclopedia{Path.DirectorySeparatorChar}Menus.json"; + base.tDBInitSavable(); + } - #region [Auxiliary classes] - public class EncyclopediaMenu - { - [JsonProperty("menus")] - public KeyValuePair[] Menus; + #region [Auxiliary classes] + public class EncyclopediaMenu { + [JsonProperty("menus")] + public KeyValuePair[] Menus; - [JsonProperty("pages")] - public int[] Pages; - } + [JsonProperty("pages")] + public int[] Pages; + } - #endregion - } + #endregion + } } diff --git a/OpenTaiko/src/Databases/DBNameplateUnlockables.cs b/OpenTaiko/src/Databases/DBNameplateUnlockables.cs index 6ca935b3..ad144d80 100644 --- a/OpenTaiko/src/Databases/DBNameplateUnlockables.cs +++ b/OpenTaiko/src/Databases/DBNameplateUnlockables.cs @@ -1,108 +1,95 @@ -using System.Collections.Generic; -using FFmpeg.AutoGen; -using Microsoft.Data.Sqlite; +using Microsoft.Data.Sqlite; using Newtonsoft.Json; -using Newtonsoft.Json.Linq; using static TJAPlayer3.DBNameplateUnlockables; -namespace TJAPlayer3 -{ - internal class DBNameplateUnlockables : CSavableT> - { - public DBNameplateUnlockables() - { - //_fn = @$"{TJAPlayer3.strEXEのあるフォルダ}Databases{Path.DirectorySeparatorChar}NameplateUnlockables.json"; - //base.tDBInitSavable(); +namespace TJAPlayer3 { + internal class DBNameplateUnlockables : CSavableT> { + public DBNameplateUnlockables() { + //_fn = @$"{TJAPlayer3.strEXEのあるフォルダ}Databases{Path.DirectorySeparatorChar}NameplateUnlockables.json"; + //base.tDBInitSavable(); - _fn = @$"{TJAPlayer3.strEXEのあるフォルダ}Databases{Path.DirectorySeparatorChar}NameplateUnlockables.db3"; + _fn = @$"{TJAPlayer3.strEXEのあるフォルダ}Databases{Path.DirectorySeparatorChar}NameplateUnlockables.db3"; - using (var connection = new SqliteConnection(@$"Data Source={_fn}")) - { - connection.Open(); + using (var connection = new SqliteConnection(@$"Data Source={_fn}")) { + connection.Open(); - // Get existing languages - List _translations = HDatabaseHelpers.GetAvailableLanguage(connection, "translation"); + // Get existing languages + List _translations = HDatabaseHelpers.GetAvailableLanguage(connection, "translation"); - // Get nameplates - var command = connection.CreateCommand(); - command.CommandText = - @$" + // 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"]); - } + 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; - } - reader.Close(); - } - } - public class NameplateUnlockable - { - [JsonProperty("NameplateInfo")] - public SaveFile.CNamePlateTitle nameplateInfo; + data[((Int64)reader["NameplateId"])] = nu; + } + reader.Close(); + } + } + public class NameplateUnlockable { + [JsonProperty("NameplateInfo")] + public SaveFile.CNamePlateTitle nameplateInfo; - [JsonProperty("Rarity")] - public string rarity; + [JsonProperty("Rarity")] + public string rarity; - [JsonProperty("UnlockCondition")] - public DBUnlockables.CUnlockConditions unlockConditions; - } + [JsonProperty("UnlockCondition")] + public DBUnlockables.CUnlockConditions unlockConditions; + } - public void tGetUnlockedItems(int _player, ModalQueue mq) - { - int player = TJAPlayer3.GetActualPlayer(_player); - //var _sf = TJAPlayer3.SaveFileInstances[player].data.NamePlateTitles; - var _sf = TJAPlayer3.SaveFileInstances[player].data.UnlockedNameplateIds; - bool _edited = false; + public void tGetUnlockedItems(int _player, ModalQueue mq) { + int player = TJAPlayer3.GetActualPlayer(_player); + //var _sf = TJAPlayer3.SaveFileInstances[player].data.NamePlateTitles; + var _sf = TJAPlayer3.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; + 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, item.Value.nameplateInfo); - _sf.Add(_npvKey); - _edited = true; - mq.tAddModal( - new Modal( - Modal.EModalType.Title, - HRarity.tRarityToModalInt(item.Value.rarity), - item.Value.nameplateInfo.cld.GetString("") // Cannot be null on database - ), - _player); + if (_fulfilled) { + //_sf.Add(_npvKey, item.Value.nameplateInfo); + _sf.Add(_npvKey); + _edited = true; + mq.tAddModal( + new Modal( + Modal.EModalType.Title, + HRarity.tRarityToModalInt(item.Value.rarity), + item.Value.nameplateInfo.cld.GetString("") // Cannot be null on database + ), + _player); - DBSaves.RegisterUnlockedNameplate(TJAPlayer3.SaveFileInstances[player].data.SaveId, _npvKey); - } - } - } + DBSaves.RegisterUnlockedNameplate(TJAPlayer3.SaveFileInstances[player].data.SaveId, _npvKey); + } + } + } - if (_edited) - TJAPlayer3.SaveFileInstances[player].tApplyHeyaChanges(); - } - } + if (_edited) + TJAPlayer3.SaveFileInstances[player].tApplyHeyaChanges(); + } + } } diff --git a/OpenTaiko/src/Databases/DBPuchichara.cs b/OpenTaiko/src/Databases/DBPuchichara.cs index 9021d957..4f0f7f9a 100644 --- a/OpenTaiko/src/Databases/DBPuchichara.cs +++ b/OpenTaiko/src/Databases/DBPuchichara.cs @@ -1,100 +1,87 @@ -using System.Collections.Generic; -using System.IO; -using Newtonsoft.Json; +using Newtonsoft.Json; -namespace TJAPlayer3 -{ - class DBPuchichara - { - public class PuchicharaEffect - { - public PuchicharaEffect() - { - AllPurple = false; - Autoroll = 0; - ShowAdlib = false; - SplitLane = false; - } +namespace TJAPlayer3 { + class DBPuchichara { + public class PuchicharaEffect { + public PuchicharaEffect() { + AllPurple = false; + Autoroll = 0; + ShowAdlib = false; + SplitLane = false; + } - public float GetCoinMultiplier() - { - float mult = 1f; + public float GetCoinMultiplier() { + float mult = 1f; - if (Autoroll > 0) mult *= 0f; - if (ShowAdlib == true) mult *= 0.9f; - //if (AllPurple == true) mult *= 1.1f; + if (Autoroll > 0) mult *= 0f; + if (ShowAdlib == true) mult *= 0.9f; + //if (AllPurple == true) mult *= 1.1f; - return mult; - } + return mult; + } - [JsonProperty("allpurple")] - public bool AllPurple; + [JsonProperty("allpurple")] + public bool AllPurple; - [JsonProperty("AutoRoll")] - public int Autoroll; + [JsonProperty("AutoRoll")] + public int Autoroll; - [JsonProperty("showadlib")] - public bool ShowAdlib; + [JsonProperty("showadlib")] + public bool ShowAdlib; - [JsonProperty("splitlane")] - public bool SplitLane; - } + [JsonProperty("splitlane")] + public bool SplitLane; + } - public class PuchicharaData - { - public PuchicharaData() - { - Name = "(None)"; - Rarity = "Common"; - Author = "(None)"; - } + 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 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 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 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 ""; - } + 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; + // String or CLocalizationData + [JsonProperty("name")] + [JsonConverter(typeof(LocalizedStringConverter))] + public object Name; - [JsonProperty("rarity")] - public string Rarity; + [JsonProperty("rarity")] + public string Rarity; - // String or CLocalizationData - [JsonProperty("author")] - [JsonConverter(typeof(LocalizedStringConverter))] - public object Author; + // String or CLocalizationData + [JsonProperty("author")] + [JsonConverter(typeof(LocalizedStringConverter))] + public object Author; - // String or CLocalizationData - [JsonProperty("description")] - [JsonConverter(typeof(LocalizedStringConverter))] - public object Description; - } + // String or CLocalizationData + [JsonProperty("description")] + [JsonConverter(typeof(LocalizedStringConverter))] + public object Description; + } - } -} \ No newline at end of file + } +} diff --git a/OpenTaiko/src/Databases/DBSaves.cs b/OpenTaiko/src/Databases/DBSaves.cs index 37e4e4ea..60f13511 100644 --- a/OpenTaiko/src/Databases/DBSaves.cs +++ b/OpenTaiko/src/Databases/DBSaves.cs @@ -1,74 +1,59 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Data; using Microsoft.Data.Sqlite; using Newtonsoft.Json; -namespace TJAPlayer3 -{ - internal class DBSaves - { - private static string _savesDBFilename = $@"Saves.db3"; - private static string _savesDBPath = @$"{TJAPlayer3.strEXEのあるフォルダ}{_savesDBFilename}"; - private static SqliteConnection SavesDBConnection = new SqliteConnection(@$"Data Source={_savesDBPath}"); +namespace TJAPlayer3 { + internal class DBSaves { + private static string _savesDBFilename = $@"Saves.db3"; + private static string _savesDBPath = @$"{TJAPlayer3.strEXEのあるフォルダ}{_savesDBFilename}"; + private static SqliteConnection SavesDBConnection = new SqliteConnection(@$"Data Source={_savesDBPath}"); - private static string _DBNotFoundError = @$"The database {_savesDBFilename} was not found or the connection failed"; + 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 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 TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.SaveId; - } + public static Int64 GetPlayerSaveId(int player) { + return TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.SaveId; + } - #region [Unlocked Dan Titles] + #region [Unlocked Dan Titles] - public static Dictionary FetchUnlockedDanTitles(Int64 sid) - { - Dictionary _dans = new Dictionary(); - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return _dans; + 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(); + 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(); + 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; - } + return _dans; + } - public static void RegisterDanTitle(Int64 SaveId, string DanTitle, int DanClearStatus, bool DanIsGold) - { - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return; + public static void RegisterDanTitle(Int64 SaveId, string DanTitle, int DanClearStatus, bool DanIsGold) { + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return; - var command = connection.CreateCommand(); + 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}, @@ -80,90 +65,82 @@ namespace TJAPlayer3 DanIsGold = MAX(DanIsGold, EXCLUDED.DanIsGold), SaveId = EXCLUDED.SaveId ;"; - command.ExecuteNonQuery(); - } + command.ExecuteNonQuery(); + } - #endregion + #endregion - #region [Unlocked Nameplates] + #region [Unlocked Nameplates] - public static List FetchUnlockedNameplateIds(Int64 sid) - { - List _nps = new List(); - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return _nps; + 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(); + 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(); - return _nps; - } + return _nps; + } - public static void RegisterUnlockedNameplate(Int64 SaveId, Int64 NameplateId) - { - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return; + public static void RegisterUnlockedNameplate(Int64 SaveId, Int64 NameplateId) { + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return; - var command = connection.CreateCommand(); - command.CommandText = @$"INSERT INTO nameplate_titles(NameplateId,SaveId) VALUES({NameplateId}, {SaveId});"; - command.ExecuteNonQuery(); - } + var command = connection.CreateCommand(); + command.CommandText = @$"INSERT INTO nameplate_titles(NameplateId,SaveId) VALUES({NameplateId}, {SaveId});"; + command.ExecuteNonQuery(); + } - #endregion + #endregion - #region [Characters and Puchicharas] + #region [Characters and Puchicharas] - public static List FetchStringUnlockedAsset(Int64 sid, string table) - { - List _chara = new List(); - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return _chara; + 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(); + 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(); - return _chara; - } + return _chara; + } - public static void RegisterStringUnlockedAsset(Int64 SaveId, string table, string asset) - { - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return; + 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(); - } + var command = connection.CreateCommand(); + command.CommandText = @$"INSERT INTO {table}(Asset,SaveId) VALUES('{asset.EscapeSingleQuotes()}', {SaveId});"; + command.ExecuteNonQuery(); + } - #endregion + #endregion - #region [saves Table] + #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; + 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(); + 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"]; @@ -185,48 +162,45 @@ namespace TJAPlayer3 sf.tInitSaveFile(); sf.tLoadUnlockables(); - _instances[_file] = sf; - _file++; - if (_file >= 5) break; - } - reader.Close(); + _instances[_file] = sf; + _file++; + if (_file >= 5) break; + } + reader.Close(); - return _instances; - } + return _instances; + } - public static void AlterCoinsAndTotalPlayCount(Int64 SaveId, Int64 CoinsDelta, int PlayCountDelta) - { - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return; + public static void AlterCoinsAndTotalPlayCount(Int64 SaveId, Int64 CoinsDelta, int PlayCountDelta) { + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return; - Int64 TotalEarnedCoinsDelta = Math.Max(0, CoinsDelta); + 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(); - } + 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; + public static void RegisterAIBattleModePlay(Int64 SaveId, bool IsWon) { + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return; - Int64 AIBattleWinsDelta = (IsWon) ? 1 : 0; + 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(); - } + 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; + public static void ApplyChangesFromMyRoom(SaveFile File) { + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return; - SaveFile.Data SaveData = File.data; + 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()}', @@ -240,215 +214,195 @@ namespace TJAPlayer3 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(); + string key = record.ChartUniqueId + record.ChartDifficulty.ToString() + record.PlayMods.ToString(); + _bestPlays[key] = record; + } + reader.Close(); - return _bestPlays; - } + return _bestPlays; + } - public static void RegisterPlay(int player, int clearStatus, int scoreRank) - { - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return; + public static void RegisterPlay(int player, int clearStatus, int scoreRank) { + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return; - SaveFile.Data saveData = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data; - BestPlayRecords.CBestPlayRecord currentPlay = new BestPlayRecords.CBestPlayRecord(); - var choosenSong = TJAPlayer3.stageSongSelect.rChoosenSong; - var choosenDifficulty = TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[player]; - var chartScore = TJAPlayer3.stage演奏ドラム画面.CChartScore[player]; - List[] danResults = new List[7] { new List(), new List(), new List(), new List(), new List(), new List(), new List() }; + SaveFile.Data saveData = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data; + BestPlayRecords.CBestPlayRecord currentPlay = new BestPlayRecords.CBestPlayRecord(); + var choosenSong = TJAPlayer3.stageSongSelect.rChoosenSong; + var choosenDifficulty = TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[player]; + var chartScore = TJAPlayer3.stage演奏ドラム画面.CChartScore[player]; + List[] danResults = new List[7] { new List(), new List(), new List(), new List(), new List(), new List(), new List() }; - // 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; + // 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; - // 1st step: Init best play record class + // 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 < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count; i++) - { - for (int j = 0; j < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C.Length; j++) - { - if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C[j] != null) - { - int amount = TJAPlayer3.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 = TJAPlayer3.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[player]; - currentPlay.HighScoreRollCount = chartScore.nRoll; - currentPlay.HighScoreADLibCount = chartScore.nADLIB; - currentPlay.HighScoreBoomCount = chartScore.nMine; - } + { + 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 < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count; i++) { + for (int j = 0; j < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C.Length; j++) { + if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C[j] != null) { + int amount = TJAPlayer3.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 = TJAPlayer3.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 < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count; i++) - { - for (int j = 0; j < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C.Length; j++) - { - if (TJAPlayer3.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 < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count; i++) { + for (int j = 0; j < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C.Length; j++) { + if (TJAPlayer3.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 (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C[j].GetExamRange() == Exam.Range.More) - { - danResults[j][i] = Math.Max(amount, current); - } - else if (TJAPlayer3.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 (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C[j].GetExamRange() == Exam.Range.More) { + danResults[j][i] = Math.Max(amount, current); + } else if (TJAPlayer3.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()}', @@ -500,10 +454,10 @@ namespace TJAPlayer3 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 cec0b728..422b940c 100644 --- a/OpenTaiko/src/Databases/DBSkinPreset.cs +++ b/OpenTaiko/src/Databases/DBSkinPreset.cs @@ -1,67 +1,56 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; +using Newtonsoft.Json; -namespace TJAPlayer3 -{ - internal class DBSkinPreset - { - public class SkinScene - { - public SkinScene() - { - UpperBackground = null; - LowerBackground = null; - DancerSet = null; - FooterSet = null; - MobSet = null; - RunnerSet = null; - } +namespace TJAPlayer3 { + internal class DBSkinPreset { + public class SkinScene { + public SkinScene() { + UpperBackground = null; + LowerBackground = null; + DancerSet = null; + FooterSet = null; + MobSet = null; + RunnerSet = null; + } - [JsonProperty("UP")] - public string[] UpperBackground; + [JsonProperty("UP")] + public string[] UpperBackground; - [JsonProperty("DOWN")] - public string[] LowerBackground; + [JsonProperty("DOWN")] + public string[] LowerBackground; - [JsonProperty("DANCER")] - public string[] DancerSet; + [JsonProperty("DANCER")] + public string[] DancerSet; - [JsonProperty("FOOTER")] - public string[] FooterSet; + [JsonProperty("FOOTER")] + public string[] FooterSet; - [JsonProperty("MOB")] - public string[] MobSet; + [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("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("Regular")] + public Dictionary Regular; - [JsonProperty("Dan")] - public Dictionary Dan; + [JsonProperty("Dan")] + public Dictionary Dan; - [JsonProperty("Tower")] - public Dictionary Tower; + [JsonProperty("Tower")] + public Dictionary Tower; - [JsonProperty("AI")] - public Dictionary AI; + [JsonProperty("AI")] + public Dictionary AI; - } - } + } + } } diff --git a/OpenTaiko/src/Databases/DBSongUnlockables.cs b/OpenTaiko/src/Databases/DBSongUnlockables.cs index 36a94101..5e1bc979 100644 --- a/OpenTaiko/src/Databases/DBSongUnlockables.cs +++ b/OpenTaiko/src/Databases/DBSongUnlockables.cs @@ -1,136 +1,119 @@ -using System.Collections.Generic; -using Microsoft.Data.Sqlite; -using Microsoft.EntityFrameworkCore.Metadata.Internal; +using Microsoft.Data.Sqlite; using Newtonsoft.Json; -using static TJAPlayer3.DBNameplateUnlockables; using static TJAPlayer3.DBSongUnlockables; -namespace TJAPlayer3 -{ - internal class DBSongUnlockables : CSavableT> - { - /* DISPLAYED : Song displayed in song select, only a lock appearing on the side, audio preview plays +namespace TJAPlayer3 { + 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 * HIDDEN : Song not appears on the song select list until being unlocked */ - public enum EHiddenIndex - { - DISPLAYED = 0, - GRAYED = 1, - HIDDEN = 2 - } + public enum EHiddenIndex { + DISPLAYED = 0, + GRAYED = 1, + HIDDEN = 2 + } - public DBSongUnlockables() - { - //_fn = @$"{TJAPlayer3.strEXEのあるフォルダ}Databases{Path.DirectorySeparatorChar}SongUnlockables.json"; - //base.tDBInitSavable(); + public DBSongUnlockables() { + //_fn = @$"{TJAPlayer3.strEXEのあるフォルダ}Databases{Path.DirectorySeparatorChar}SongUnlockables.json"; + //base.tDBInitSavable(); - _fn = @$"{TJAPlayer3.strEXEのあるフォルダ}Databases{Path.DirectorySeparatorChar}SongUnlockables.db3"; - - - using (var connection = new SqliteConnection(@$"Data Source={_fn}")) - { - connection.Open(); + _fn = @$"{TJAPlayer3.strEXEのあるフォルダ}Databases{Path.DirectorySeparatorChar}SongUnlockables.db3"; - // Get songs info - var command = connection.CreateCommand(); - command.CommandText = - @$" + 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[] { "" }; - - data[((string)reader["SongUniqueId"])] = su; - } - reader.Close(); - } - - } - public class SongUnlockable - { - [JsonProperty("HiddenIndex")] - public EHiddenIndex hiddenIndex; + 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[] { "" }; - [JsonProperty("Rarity")] - public string rarity; + data[((string)reader["SongUniqueId"])] = su; + } + reader.Close(); + } - [JsonProperty("UnlockCondition")] - public DBUnlockables.CUnlockConditions unlockConditions; - } + } + public class SongUnlockable { + [JsonProperty("HiddenIndex")] + public EHiddenIndex hiddenIndex; - public void tGetUnlockedItems(int _player, ModalQueue mq) - { - int player = TJAPlayer3.GetActualPlayer(_player); - var _sf = TJAPlayer3.SaveFileInstances[player].data.UnlockedSongs; - bool _edited = false; + [JsonProperty("Rarity")] + public string rarity; - foreach (KeyValuePair item in data) - { - string _npvKey = item.Key; - string? _songName = CSongDict.tGetNodeFromID(_npvKey)?.ldTitle.GetString(""); - string _songSubtitle = CSongDict.tGetNodeFromID(_npvKey)?.ldSubtitle.GetString("") ?? ""; + [JsonProperty("UnlockCondition")] + public DBUnlockables.CUnlockConditions unlockConditions; + } - if (!_sf.Contains(_npvKey) && _songName != null) - { - var _fulfilled = item.Value.unlockConditions.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1; + public void tGetUnlockedItems(int _player, ModalQueue mq) { + int player = TJAPlayer3.GetActualPlayer(_player); + var _sf = TJAPlayer3.SaveFileInstances[player].data.UnlockedSongs; + bool _edited = false; - if (_fulfilled) - { - //_sf.Add(_npvKey, item.Value.nameplateInfo); - _sf.Add(_npvKey); - _edited = true; + foreach (KeyValuePair item in data) { + string _npvKey = item.Key; + string? _songName = CSongDict.tGetNodeFromID(_npvKey)?.ldTitle.GetString(""); + string _songSubtitle = CSongDict.tGetNodeFromID(_npvKey)?.ldSubtitle.GetString("") ?? ""; + + if (!_sf.Contains(_npvKey) && _songName != null) { + var _fulfilled = item.Value.unlockConditions.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1; + + if (_fulfilled) { + //_sf.Add(_npvKey, item.Value.nameplateInfo); + _sf.Add(_npvKey); + _edited = true; - mq.tAddModal( - new Modal( - Modal.EModalType.Song, - HRarity.tRarityToModalInt(item.Value.rarity), - _songName, - _songSubtitle - ), - _player); + mq.tAddModal( + new Modal( + Modal.EModalType.Song, + HRarity.tRarityToModalInt(item.Value.rarity), + _songName, + _songSubtitle + ), + _player); - DBSaves.RegisterStringUnlockedAsset(TJAPlayer3.SaveFileInstances[player].data.SaveId, "unlocked_songs", _npvKey); - - } - } - } + DBSaves.RegisterStringUnlockedAsset(TJAPlayer3.SaveFileInstances[player].data.SaveId, "unlocked_songs", _npvKey); - if (_edited) - TJAPlayer3.SaveFileInstances[player].tApplyHeyaChanges(); - } + } + } + } - public bool tIsSongLocked(CSongListNode? song) - { - if (song == null) return false; - return !TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.UnlockedSongs.Contains(song.tGetUniqueId()) - && data.ContainsKey(song.tGetUniqueId()); - } + if (_edited) + TJAPlayer3.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) return false; + return !TJAPlayer3.SaveFileInstances[TJAPlayer3.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 834a4c4f..8fd34128 100644 --- a/OpenTaiko/src/Databases/DBUnlockables.cs +++ b/OpenTaiko/src/Databases/DBUnlockables.cs @@ -1,73 +1,62 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Runtime.InteropServices; -using Newtonsoft.Json; +using Newtonsoft.Json; using static TJAPlayer3.BestPlayRecords; -namespace TJAPlayer3 -{ - class DBUnlockables - { - public static Dictionary RequiredArgs = new Dictionary() - { - ["ch"] = 1, - ["cs"] = 1, - ["dp"] = 3, - ["lp"] = 3, - ["sp"] = 2, - ["sg"] = 2, +namespace TJAPlayer3 { + class DBUnlockables { + public static Dictionary RequiredArgs = new Dictionary() { + ["ch"] = 1, + ["cs"] = 1, + ["dp"] = 3, + ["lp"] = 3, + ["sp"] = 2, + ["sg"] = 2, - ["sc"] = 2, - ["ce"] = 1, - ["tp"] = 1, - ["ap"] = 1, - ["aw"] = 1, - ["ig"] = 0, - }; + ["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; - } + 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 type + [JsonProperty("condition")] + public string Condition; - // Condition values - [JsonProperty("values")] - public int[] Values; + // Condition values + [JsonProperty("values")] + public int[] Values; - // Condition type - [JsonProperty("type")] - public string Type; + // Condition type + [JsonProperty("type")] + public string Type; - // Referenced charts - [JsonProperty("references")] - public string[] Reference; + // Referenced charts + [JsonProperty("references")] + public string[] Reference; - [JsonIgnore] - private int RequiredArgCount = -1; + [JsonIgnore] + private int RequiredArgCount = -1; - public bool tHasCondition() - { - return Condition != ""; - } + 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" @@ -77,46 +66,42 @@ namespace TJAPlayer3 * 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 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"); - case (int)EClearStatus.NONE: - default: - return CLangManager.LangInstance.GetString(exact ? "UNLOCK_CONDITION_REQUIRE_PLAY" : "UNLOCK_CONDITION_REQUIRE_PLAY_MORE"); - } - } + 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"); + case (int)EClearStatus.NONE: + 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 @@ -133,446 +118,403 @@ namespace TJAPlayer3 * 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?) 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)TJAPlayer3.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)TJAPlayer3.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)TJAPlayer3.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)TJAPlayer3.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)TJAPlayer3.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, ""); - } + switch (this.Condition) { + case "ch": + case "cs": + case "cm": + if (this.Values.Length == 1) + return tConditionMet(new int[] { (int)TJAPlayer3.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)TJAPlayer3.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)TJAPlayer3.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)TJAPlayer3.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)TJAPlayer3.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, ""); + } - return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); - } + 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) - { + 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")); - } - } + 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")); + } + } - return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); - } + 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]; + // 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); + 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 = TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data; - var ChartStats = SaveData.bestPlaysStats; + // Only the player loaded as 1P can check unlockables in real time + var SaveData = TJAPlayer3.SaveFileInstances[TJAPlayer3.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]; + 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")); + 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 _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]; + 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")); + 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; + 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 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 _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]"; + 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)); + _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++; + // 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; - } - } - } - } + } 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; + // 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]; + 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; + 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++; + if (_satifsiedCount >= _songCount) _count++; - var statusString = GetRequiredClearStatus(_aimedStatus); - _rows.Add(CLangManager.LangInstance.GetString("UNLOCK_CONDITION_CHALLENGE_PLAYGENRE", statusString, _songCount, _genreName, _satifsiedCount)); - } + 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; + _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]; + 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; + 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++; + if (_satifsiedCount >= _songCount) _count++; - var statusString = GetRequiredClearStatus(_aimedStatus); - _rows.Add(CLangManager.LangInstance.GetString("UNLOCK_CONDITION_CHALLENGE_PLAYCHARTER", statusString, _songCount, _charterName, _satifsiedCount)); - } + 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); - } + _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")); - } + } + // 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 - } + public enum EScreen { + MyRoom, + Shop, + SongSelect, + Internal + } - #region [private calls] + #region [private calls] - private int tGetCountChartsPassingCondition(int player) - { - int _aimedDifficulty = 0; - int _aimedStatus = 0; + 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]; + 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; - } + // 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 = TJAPlayer3.SaveFileInstances[player].data.bestPlaysDistinctCharts; - var chartStats = TJAPlayer3.SaveFileInstances[player].data.bestPlaysStats; + var bpDistinctCharts = TJAPlayer3.SaveFileInstances[player].data.bestPlaysDistinctCharts; + var chartStats = TJAPlayer3.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]; + 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++; + 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]; + } 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; + 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]; + 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; + 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; - } + if (_satifsiedCount >= _songCount) _count++; + } + return _count; + } + return -1; + } - #endregion + #endregion - } + } - } + } -} \ No newline at end of file +} diff --git a/OpenTaiko/src/Databases/Databases.cs b/OpenTaiko/src/Databases/Databases.cs index 1dd45e64..43b5afd8 100644 --- a/OpenTaiko/src/Databases/Databases.cs +++ b/OpenTaiko/src/Databases/Databases.cs @@ -1,21 +1,15 @@ -using System.Collections.Generic; -using System.IO; - -namespace TJAPlayer3 -{ - class Databases - { - public void tDatabases() - { - DBCDN = new DBCDN(); - DBEncyclopediaMenus = new DBEncyclopediaMenus(); - DBNameplateUnlockables = new DBNameplateUnlockables(); - DBSongUnlockables = new DBSongUnlockables(); - } +namespace TJAPlayer3 { + 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; - } -} \ No newline at end of file + 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 4979b565..6b672f21 100644 --- a/OpenTaiko/src/Helpers/HDatabaseHelpers.cs +++ b/OpenTaiko/src/Helpers/HDatabaseHelpers.cs @@ -1,34 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.Data.Sqlite; -using Newtonsoft.Json; +using Microsoft.Data.Sqlite; -namespace TJAPlayer3 -{ - 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 TJAPlayer3 { + 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); - } - } - return _translations; - } - } + SqliteDataReader chkreader = chk.ExecuteReader(); + while (chkreader.Read()) { + if (chkreader.GetInt32(0) > 0) + _translations.Add(cd); + } + } + return _translations; + } + } } diff --git a/OpenTaiko/src/Helpers/HEasingMethods.cs b/OpenTaiko/src/Helpers/HEasingMethods.cs index 0116d4f9..ea9014db 100644 --- a/OpenTaiko/src/Helpers/HEasingMethods.cs +++ b/OpenTaiko/src/Helpers/HEasingMethods.cs @@ -1,138 +1,113 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +namespace TJAPlayer3 { + internal class HEasingMethods { + public enum EEaseType { + IN = 0, + OUT, + INOUT, + OUTIN + } -namespace TJAPlayer3 -{ - internal class HEasingMethods - { - public enum EEaseType - { - IN = 0, - OUT, - INOUT, - OUTIN - } - - public enum EEaseFunction - { - LINEAR = 0, - SINE, - QUAD, - CUBIC, - QUART, - QUINT, - EXPO, - CIRC, - ELASTIC, - BACK, - BOUNCE - } + public enum EEaseFunction { + LINEAR = 0, + SINE, + QUAD, + CUBIC, + QUART, + QUINT, + EXPO, + CIRC, + ELASTIC, + BACK, + BOUNCE + } - 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 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 _easeOut(Func f, double x) - { - return 1.0 - f(1 - x); - } + private static double _easeOut(Func f, double x) { + return 1.0 - f(1 - x); + } - 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 _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 _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 _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 _easeLinear(double x) - { - return x; - } + private static double _easeLinear(double x) { + return x; + } - private static double _easeQuad(double x) - { - return x * x; - } + private static double _easeQuad(double x) { + return x * x; + } - private static double _easeCubic(double x) - { - return x * x * x; - } + private static double _easeCubic(double x) { + return x * x * x; + } - private static double _easeQuart(double x) - { - return x * x * x * x; - } + private static double _easeQuart(double x) { + return x * x * x * x; + } - private static double _easeQuint(double x) - { - return x * x * x * x * x; - } + private static double _easeQuint(double x) { + return x * x * x * x * x; + } - private static double _easeExpo(double x) - { - return x == 0 ? 0 : Math.Pow(2, 10 * (x - 1)); - } + private static double _easeExpo(double x) { + return x == 0 ? 0 : Math.Pow(2, 10 * (x - 1)); + } - private static double _easeSine(double x) - { - return 1.0 - Math.Cos((x * Math.PI) / 2.0); - } + private static double _easeSine(double x) { + return 1.0 - Math.Cos((x * Math.PI) / 2.0); + } - private static double _easeCirc(double x) - { - return 1.0 - Math.Sqrt(1 - Math.Pow(x, 2)); - } + private static double _easeCirc(double x) { + return 1.0 - Math.Sqrt(1 - Math.Pow(x, 2)); + } - private static double _easeBack(double x) - { - return x * x * (2.7 * x - 1.7); - } + private static double _easeBack(double x) { + return x * x * (2.7 * x - 1.7); + } - private static double _easeElastic(double x) - { - if (x == 0 || x == 1) return x; + private static double _easeElastic(double x) { + if (x == 0 || x == 1) return x; - const double c4 = (2 * Math.PI) / 3; - - 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) { @@ -340,30 +315,27 @@ namespace TJAPlayer3 } */ - #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 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 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 1861bd6a..3b06e9ef 100644 --- a/OpenTaiko/src/Helpers/HGaugeMethods.cs +++ b/OpenTaiko/src/Helpers/HGaugeMethods.cs @@ -1,847 +1,745 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Drawing; +using System.Drawing; using FDK; -namespace TJAPlayer3 -{ - class HGaugeMethods - { - public enum EGaugeType - { - NORMAL = 0, - HARD, - EXTREME - } - - public static float BombDamage = 4f; - public static float FuserollDamage = 4f; - public static float HardGaugeFillRatio = 1f; - public static float ExtremeGaugeFillRatio = 1f; - - 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 DifficultyToExtremeGaugeDamage = 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 LevelExtraToExtremeGaugeDamage = 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 DifficultyToNorma = new Dictionary - { - [Difficulty.Easy] = 60f, - [Difficulty.Normal] = 70f, - [Difficulty.Hard] = 70f, - [Difficulty.Oni] = 80f, - [Difficulty.Edit] = 80f - }; - - private static Dictionary LevelExtraToNorma = new Dictionary - { - [11] = 88f, - [12] = 92f, - [13] = 96f - }; - - #region [General calculation] - - public static float tHardGaugeGetDamage(Difficulty diff, int level) - { - float damage = 6.5f; - - if (DifficultyToHardGaugeDamage.ContainsKey(diff)) - damage = DifficultyToHardGaugeDamage[diff]; - - int levelCaped = Math.Min(13, level); - if (LevelExtraToHardGaugeDamage.ContainsKey(levelCaped)) - damage = LevelExtraToHardGaugeDamage[levelCaped]; - - return damage; - } - - public static float tExtremeGaugeGetDamage(Difficulty diff, int level) - { - float damage = 6.5f; - - if (DifficultyToExtremeGaugeDamage.ContainsKey(diff)) - damage = DifficultyToExtremeGaugeDamage[diff]; - - int levelCaped = Math.Min(13, level); - if (LevelExtraToExtremeGaugeDamage.ContainsKey(levelCaped)) - damage = LevelExtraToExtremeGaugeDamage[levelCaped]; - - return damage; - } - - public static float tHardGaugeGetKillscreenRatio(Difficulty diff, int level, EGaugeType gaugeType, int perfectHits, int totalNotes) - { - if (gaugeType != EGaugeType.EXTREME) return 0f; - - float norma = tGetCurrentGaugeNorma(diff, level); - float ratio = Math.Min(1f, Math.Max(0f, perfectHits / (float)totalNotes)); - - return ratio * norma; - } - - 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); - } - - public static float tGetCurrentGaugeNorma(Difficulty diff, int level) - { - float norma = 80f; - - if (DifficultyToNorma.ContainsKey(diff)) - norma = DifficultyToNorma[diff]; - - int levelCaped = Math.Min(13, level); - if (LevelExtraToNorma.ContainsKey(levelCaped)) - norma = LevelExtraToNorma[levelCaped]; - - return norma; - } - - public static EGaugeType tGetGaugeTypeEnum(string gaugeType) - { - EGaugeType gt = EGaugeType.NORMAL; - - if (GaugeTypeStringToEnum.ContainsKey(gaugeType)) - gt = GaugeTypeStringToEnum[gaugeType]; - - return gt; - } - - 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); - - if ((gaugeType == EGaugeType.HARD || gaugeType == EGaugeType.EXTREME) && percent > killZonePercent) return true; - if (gaugeType == EGaugeType.NORMAL && percent >= norma) return true; - - return false; - } - - #endregion - - #region [Displayables] - - 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; - - 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); - - 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)); - - 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); - - // 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( - GaugeBox[0], - GaugeBox[1], - Math.Min(closestTwo, closestNorma), - GaugeBox[3]) - ); - } - - 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); - - yellowTexture.vcScaleRatio.X = scale_x; - yellowTexture.vcScaleRatio.Y = scale_y; - - 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]) - ); - } - - } - } - - 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( - 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 (!TJAPlayer3.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 = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character]; - var _dif = TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[player]; - return tNormaCheck( - (Difficulty)_dif, - TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[_dif].譜面情報.nレベル[_dif], - tGetGaugeTypeEnum(chara.effect.tGetGaugeType()), - (float)TJAPlayer3.stage演奏ドラム画面.actGauge.db現在のゲージ値[player], - UNSAFE_KillZonePercent(player) - ); - } - - public static bool UNSAFE_IsRainbow(int player) - { - var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character]; - if (tGetGaugeTypeEnum(chara.effect.tGetGaugeType()) != EGaugeType.NORMAL) return false; - return (float)TJAPlayer3.stage演奏ドラム画面.actGauge.db現在のゲージ値[player] >= 100f; - } - - public static float UNSAFE_KillZonePercent(int player) - { - var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character]; - CDTX[] dtxs = - { - TJAPlayer3.DTX, - TJAPlayer3.DTX_2P, - TJAPlayer3.DTX_3P, - TJAPlayer3.DTX_4P, - TJAPlayer3.DTX_5P - }; - - // Total hits and perfect hits - int perfectHits = TJAPlayer3.stage演奏ドラム画面.CChartScore[player].nGreat; - int totalHits = dtxs[player].nノーツ数[3]; - - // Difficulty - int _dif = TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[player]; - Difficulty difficulty = (Difficulty)_dif; - int level = TJAPlayer3.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 = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character]; - CDTX[] dtxs = - { - TJAPlayer3.DTX, - TJAPlayer3.DTX_2P, - TJAPlayer3.DTX_3P, - TJAPlayer3.DTX_4P, - TJAPlayer3.DTX_5P - }; - - // Set box - GaugeBox = new int[]{ TJAPlayer3.Skin.Game_Gauge_Rect[0], TJAPlayer3.Skin.Game_Gauge_Rect[1], TJAPlayer3.Skin.Game_Gauge_Rect[2], TJAPlayer3.Skin.Game_Gauge_Rect[3] }; - - // Gauge pos - int gauge_x = 0; - int gauge_y = 0; - - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - gauge_x = TJAPlayer3.Skin.Game_Gauge_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * player); - gauge_y = TJAPlayer3.Skin.Game_Gauge_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * player); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - gauge_x = TJAPlayer3.Skin.Game_Gauge_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * player); - gauge_y = TJAPlayer3.Skin.Game_Gauge_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * player); - } - else if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - gauge_x = TJAPlayer3.Skin.Game_Gauge_X_AI; - gauge_y = TJAPlayer3.Skin.Game_Gauge_Y_AI; - } - else - { - gauge_x = TJAPlayer3.Skin.Game_Gauge_X[player]; - gauge_y = TJAPlayer3.Skin.Game_Gauge_Y[player]; - } - - // Text pos - int text_x = 0; - int text_y = 0; - if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) - { - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - text_x = TJAPlayer3.Skin.Game_Gauge_ClearText_X_AI; - text_y = TJAPlayer3.Skin.Game_Gauge_ClearText_Y_AI; - } - else - { - text_x = TJAPlayer3.Skin.Game_Gauge_ClearText_X[player]; - text_y = TJAPlayer3.Skin.Game_Gauge_ClearText_Y[player]; - } - } - - // Soul pos - int soul_x = 0; - int soul_y = 0; - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - soul_x = TJAPlayer3.Skin.Gauge_Soul_X_AI; - soul_y = TJAPlayer3.Skin.Gauge_Soul_Y_AI; - } - else - { - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - soul_x = TJAPlayer3.Skin.Gauge_Soul_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * player); - soul_y = TJAPlayer3.Skin.Gauge_Soul_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * player); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - soul_x = TJAPlayer3.Skin.Gauge_Soul_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * player); - soul_y = TJAPlayer3.Skin.Gauge_Soul_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * player); - } - else - { - soul_x = TJAPlayer3.Skin.Gauge_Soul_X[player]; - soul_y = TJAPlayer3.Skin.Gauge_Soul_Y[player]; - } - } - - // Fire pos - int fire_x = 0; - int fire_y = 0; - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - fire_x = TJAPlayer3.Skin.Gauge_Soul_Fire_X_AI; - fire_y = TJAPlayer3.Skin.Gauge_Soul_Fire_Y_AI; - } - else - { - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - fire_x = TJAPlayer3.Skin.Gauge_Soul_Fire_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * player); - fire_y = TJAPlayer3.Skin.Gauge_Soul_Fire_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * player); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - fire_x = TJAPlayer3.Skin.Gauge_Soul_Fire_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * player); - fire_y = TJAPlayer3.Skin.Gauge_Soul_Fire_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * player); - } - else - { - fire_x = TJAPlayer3.Skin.Gauge_Soul_Fire_X[player]; - fire_y = TJAPlayer3.Skin.Gauge_Soul_Fire_Y[player]; - } - } - - // Total hits and perfect hits - int perfectHits = TJAPlayer3.stage演奏ドラム画面.CChartScore[player].nGreat; - int totalHits = dtxs[player].nノーツ数[3]; - - // Scale - float scale = 1.0f; - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - scale = 0.8f; - } - - // Difficulty - int _dif = TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[player]; - Difficulty difficulty = (Difficulty)_dif; - int level = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[_dif].譜面情報.nレベル[_dif]; - - // Current percent - float currentPercent = (float)TJAPlayer3.stage演奏ドラム画面.actGauge.db現在のゲージ値[player]; - - // Gauge type - EGaugeType gaugeType = tGetGaugeTypeEnum(chara.effect.tGetGaugeType()); - - // Textures - int _4pGaugeIDX = (TJAPlayer3.ConfigIni.nPlayerCount >= 3) ? 1 : 0; - int _usedGauge = player + 3 * _4pGaugeIDX; - if (TJAPlayer3.P1IsBlue()) _usedGauge = 2; - _4pGaugeIDX = (TJAPlayer3.ConfigIni.nPlayerCount >= 3) ? 2 - : (player == 1) ? 1 - : 0; - - CTexture baseTexture = TJAPlayer3.Tx.Gauge_Base[_usedGauge]; - CTexture fillTexture = TJAPlayer3.Tx.Gauge[_usedGauge]; - - CTexture[] rainbowTextureArr = (new CTexture[][]{ TJAPlayer3.Tx.Gauge_Rainbow , TJAPlayer3.Tx.Gauge_Rainbow_2PGauge, TJAPlayer3.Tx.Gauge_Rainbow_Flat })[_4pGaugeIDX]; - CTexture yellowTexture = TJAPlayer3.Tx.Gauge_Clear[_4pGaugeIDX]; - CTexture baseNormaTexture = TJAPlayer3.Tx.Gauge_Base_Norma[_4pGaugeIDX]; - CTexture killzoneTexture = TJAPlayer3.Tx.Gauge_Killzone[_4pGaugeIDX]; - - CTexture flashTexture = yellowTexture; - CTexture clearIcon = (_4pGaugeIDX == 2) - ? null - : (gaugeType != EGaugeType.NORMAL) - ? TJAPlayer3.Tx.Gauge_Killzone[0] - : TJAPlayer3.Tx.Gauge[0]; - CTexture soulLetter = TJAPlayer3.Tx.Gauge_Soul; - CTexture soulFlame = TJAPlayer3.Tx.Gauge_Soul_Fire; - - // Rectangles - Rectangle clearRectHighlight = new Rectangle( - TJAPlayer3.Skin.Game_Gauge_ClearText_Rect[0], - TJAPlayer3.Skin.Game_Gauge_ClearText_Rect[1], - TJAPlayer3.Skin.Game_Gauge_ClearText_Rect[2], - TJAPlayer3.Skin.Game_Gauge_ClearText_Rect[3] - ); - - Rectangle clearRect = new Rectangle( - TJAPlayer3.Skin.Game_Gauge_ClearText_Clear_Rect[0], - TJAPlayer3.Skin.Game_Gauge_ClearText_Clear_Rect[1], - TJAPlayer3.Skin.Game_Gauge_ClearText_Clear_Rect[2], - TJAPlayer3.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 = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character]; - CDTX[] dtxs = - { - TJAPlayer3.DTX, - TJAPlayer3.DTX_2P, - TJAPlayer3.DTX_3P, - TJAPlayer3.DTX_4P, - TJAPlayer3.DTX_5P - }; - - // Set box - GaugeBox = new int[] { TJAPlayer3.Skin.Result_Gauge_Rect[0], TJAPlayer3.Skin.Result_Gauge_Rect[1], TJAPlayer3.Skin.Result_Gauge_Rect[2], TJAPlayer3.Skin.Result_Gauge_Rect[3] }; - - // Total hits and perfect hits - int perfectHits = TJAPlayer3.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 (TJAPlayer3.ConfigIni.nPlayerCount >= 3) - { - scale_x = 0.5f; - } - - // Difficulty - int _dif = TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[player]; - Difficulty difficulty = (Difficulty)_dif; - int level = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[_dif].譜面情報.nレベル[_dif]; - - int gauge_x; - int gauge_y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - gauge_x = TJAPlayer3.Skin.Result_Gauge_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; - gauge_y = TJAPlayer3.Skin.Result_Gauge_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - gauge_x = TJAPlayer3.Skin.Result_Gauge_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[pos]; - gauge_y = TJAPlayer3.Skin.Result_Gauge_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[pos]; - } - else - { - gauge_x = TJAPlayer3.Skin.Result_Gauge_X[pos] + uioffset_x; - gauge_y = TJAPlayer3.Skin.Result_Gauge_Y[pos]; - } - - int gauge_rainbow_x; - int gauge_rainbow_y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - gauge_rainbow_x = TJAPlayer3.Skin.Result_Gauge_Rainbow_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; - gauge_rainbow_y = TJAPlayer3.Skin.Result_Gauge_Rainbow_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - gauge_rainbow_x = TJAPlayer3.Skin.Result_Gauge_Rainbow_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[pos]; - gauge_rainbow_y = TJAPlayer3.Skin.Result_Gauge_Rainbow_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[pos]; - } - else - { - gauge_rainbow_x = TJAPlayer3.Skin.Result_Gauge_Rainbow_X[pos] + uioffset_x; - gauge_rainbow_y = TJAPlayer3.Skin.Result_Gauge_Rainbow_Y[pos]; - } - - // Flame and soul - int soulText_x; - int soulText_y; - int soulFire_x; - int soulFire_y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - soulText_x = TJAPlayer3.Skin.Result_Soul_Text_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; - soulText_y = TJAPlayer3.Skin.Result_Soul_Text_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; - soulFire_x = TJAPlayer3.Skin.Result_Soul_Fire_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; - soulFire_y = TJAPlayer3.Skin.Result_Soul_Fire_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - soulText_x = TJAPlayer3.Skin.Result_Soul_Text_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[0]; - soulText_y = TJAPlayer3.Skin.Result_Soul_Text_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[1]; - soulFire_x = TJAPlayer3.Skin.Result_Soul_Fire_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[0]; - soulFire_y = TJAPlayer3.Skin.Result_Soul_Fire_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[1]; - } - else - { - soulText_x = TJAPlayer3.Skin.Result_Soul_Text_X[pos] + uioffset_x; - soulText_y = TJAPlayer3.Skin.Result_Soul_Text_Y[pos]; - soulFire_x = TJAPlayer3.Skin.Result_Soul_Fire_X[pos] + uioffset_x; - soulFire_y = TJAPlayer3.Skin.Result_Soul_Fire_Y[pos]; - } - - // Clear text - int clearText_x; - int clearText_y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - clearText_x = TJAPlayer3.Skin.Result_Gauge_ClearText_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; - clearText_y = TJAPlayer3.Skin.Result_Gauge_ClearText_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - clearText_x = TJAPlayer3.Skin.Result_Gauge_ClearText_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[pos]; - clearText_y = TJAPlayer3.Skin.Result_Gauge_ClearText_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[pos]; - } - else - { - clearText_x = TJAPlayer3.Skin.Result_Gauge_ClearText_X[pos] + uioffset_x; - clearText_y = TJAPlayer3.Skin.Result_Gauge_ClearText_Y[pos]; - } - - // Textures - int _usedGauge = shiftPos; - CTexture baseTexture = TJAPlayer3.Tx.Result_Gauge_Base[_usedGauge]; - CTexture fillTexture = TJAPlayer3.Tx.Result_Gauge[_usedGauge]; - - CTexture[] rainbowTextureArr = TJAPlayer3.Tx.Result_Rainbow; - CTexture yellowTexture = TJAPlayer3.Tx.Result_Gauge_Clear; - CTexture baseNormaTexture = TJAPlayer3.Tx.Result_Gauge_Clear_Base; - CTexture killzoneTexture = TJAPlayer3.Tx.Result_Gauge_Killzone; - - CTexture flashTexture = null; - CTexture clearIcon = (gaugeType != EGaugeType.NORMAL) - ? TJAPlayer3.Tx.Result_Gauge_Killzone - : TJAPlayer3.Tx.Result_Gauge[0]; - - CTexture soulLetter = TJAPlayer3.Tx.Result_Soul_Text; - CTexture soulFlame = TJAPlayer3.Tx.Result_Soul_Fire; - - // Rectangles - Rectangle clearRectHighlight = new Rectangle( - TJAPlayer3.Skin.Result_Gauge_ClearText_Clear_Rect[0], - TJAPlayer3.Skin.Result_Gauge_ClearText_Clear_Rect[1], - TJAPlayer3.Skin.Result_Gauge_ClearText_Clear_Rect[2], - TJAPlayer3.Skin.Result_Gauge_ClearText_Clear_Rect[3] - ); - - Rectangle clearRect = new Rectangle( - TJAPlayer3.Skin.Result_Gauge_ClearText_Rect[0], - TJAPlayer3.Skin.Result_Gauge_ClearText_Rect[1], - TJAPlayer3.Skin.Result_Gauge_ClearText_Rect[2], - TJAPlayer3.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 = { TJAPlayer3.Skin.Game_Gauge_Rect[0], TJAPlayer3.Skin.Game_Gauge_Rect[1], TJAPlayer3.Skin.Game_Gauge_Rect[2], TJAPlayer3.Skin.Game_Gauge_Rect[3] }; - - } +namespace TJAPlayer3 { + class HGaugeMethods { + public enum EGaugeType { + NORMAL = 0, + HARD, + EXTREME + } + + public static float BombDamage = 4f; + public static float FuserollDamage = 4f; + public static float HardGaugeFillRatio = 1f; + public static float ExtremeGaugeFillRatio = 1f; + + 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 DifficultyToExtremeGaugeDamage = 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 LevelExtraToExtremeGaugeDamage = 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 DifficultyToNorma = new Dictionary { + [Difficulty.Easy] = 60f, + [Difficulty.Normal] = 70f, + [Difficulty.Hard] = 70f, + [Difficulty.Oni] = 80f, + [Difficulty.Edit] = 80f + }; + + private static Dictionary LevelExtraToNorma = new Dictionary { + [11] = 88f, + [12] = 92f, + [13] = 96f + }; + + #region [General calculation] + + public static float tHardGaugeGetDamage(Difficulty diff, int level) { + float damage = 6.5f; + + if (DifficultyToHardGaugeDamage.ContainsKey(diff)) + damage = DifficultyToHardGaugeDamage[diff]; + + int levelCaped = Math.Min(13, level); + if (LevelExtraToHardGaugeDamage.ContainsKey(levelCaped)) + damage = LevelExtraToHardGaugeDamage[levelCaped]; + + return damage; + } + + public static float tExtremeGaugeGetDamage(Difficulty diff, int level) { + float damage = 6.5f; + + if (DifficultyToExtremeGaugeDamage.ContainsKey(diff)) + damage = DifficultyToExtremeGaugeDamage[diff]; + + int levelCaped = Math.Min(13, level); + if (LevelExtraToExtremeGaugeDamage.ContainsKey(levelCaped)) + damage = LevelExtraToExtremeGaugeDamage[levelCaped]; + + return damage; + } + + public static float tHardGaugeGetKillscreenRatio(Difficulty diff, int level, EGaugeType gaugeType, int perfectHits, int totalNotes) { + if (gaugeType != EGaugeType.EXTREME) return 0f; + + float norma = tGetCurrentGaugeNorma(diff, level); + float ratio = Math.Min(1f, Math.Max(0f, perfectHits / (float)totalNotes)); + + return ratio * norma; + } + + 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); + } + + public static float tGetCurrentGaugeNorma(Difficulty diff, int level) { + float norma = 80f; + + if (DifficultyToNorma.ContainsKey(diff)) + norma = DifficultyToNorma[diff]; + + int levelCaped = Math.Min(13, level); + if (LevelExtraToNorma.ContainsKey(levelCaped)) + norma = LevelExtraToNorma[levelCaped]; + + return norma; + } + + public static EGaugeType tGetGaugeTypeEnum(string gaugeType) { + EGaugeType gt = EGaugeType.NORMAL; + + if (GaugeTypeStringToEnum.ContainsKey(gaugeType)) + gt = GaugeTypeStringToEnum[gaugeType]; + + return gt; + } + + 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); + + if ((gaugeType == EGaugeType.HARD || gaugeType == EGaugeType.EXTREME) && percent > killZonePercent) return true; + if (gaugeType == EGaugeType.NORMAL && percent >= norma) return true; + + return false; + } + + #endregion + + #region [Displayables] + + 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; + + 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); + + 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)); + + 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); + + // 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( + GaugeBox[0], + GaugeBox[1], + Math.Min(closestTwo, closestNorma), + GaugeBox[3]) + ); + } + + 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); + + yellowTexture.vcScaleRatio.X = scale_x; + yellowTexture.vcScaleRatio.Y = scale_y; + + 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]) + ); + } + + } + } + + 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( + 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 (!TJAPlayer3.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 = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character]; + var _dif = TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[player]; + return tNormaCheck( + (Difficulty)_dif, + TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[_dif].譜面情報.nレベル[_dif], + tGetGaugeTypeEnum(chara.effect.tGetGaugeType()), + (float)TJAPlayer3.stage演奏ドラム画面.actGauge.db現在のゲージ値[player], + UNSAFE_KillZonePercent(player) + ); + } + + public static bool UNSAFE_IsRainbow(int player) { + var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character]; + if (tGetGaugeTypeEnum(chara.effect.tGetGaugeType()) != EGaugeType.NORMAL) return false; + return (float)TJAPlayer3.stage演奏ドラム画面.actGauge.db現在のゲージ値[player] >= 100f; + } + + public static float UNSAFE_KillZonePercent(int player) { + var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character]; + CDTX[] dtxs = + { + TJAPlayer3.DTX, + TJAPlayer3.DTX_2P, + TJAPlayer3.DTX_3P, + TJAPlayer3.DTX_4P, + TJAPlayer3.DTX_5P + }; + + // Total hits and perfect hits + int perfectHits = TJAPlayer3.stage演奏ドラム画面.CChartScore[player].nGreat; + int totalHits = dtxs[player].nノーツ数[3]; + + // Difficulty + int _dif = TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[player]; + Difficulty difficulty = (Difficulty)_dif; + int level = TJAPlayer3.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 = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character]; + CDTX[] dtxs = + { + TJAPlayer3.DTX, + TJAPlayer3.DTX_2P, + TJAPlayer3.DTX_3P, + TJAPlayer3.DTX_4P, + TJAPlayer3.DTX_5P + }; + + // Set box + GaugeBox = new int[] { TJAPlayer3.Skin.Game_Gauge_Rect[0], TJAPlayer3.Skin.Game_Gauge_Rect[1], TJAPlayer3.Skin.Game_Gauge_Rect[2], TJAPlayer3.Skin.Game_Gauge_Rect[3] }; + + // Gauge pos + int gauge_x = 0; + int gauge_y = 0; + + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + gauge_x = TJAPlayer3.Skin.Game_Gauge_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * player); + gauge_y = TJAPlayer3.Skin.Game_Gauge_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * player); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + gauge_x = TJAPlayer3.Skin.Game_Gauge_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * player); + gauge_y = TJAPlayer3.Skin.Game_Gauge_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * player); + } else if (TJAPlayer3.ConfigIni.bAIBattleMode) { + gauge_x = TJAPlayer3.Skin.Game_Gauge_X_AI; + gauge_y = TJAPlayer3.Skin.Game_Gauge_Y_AI; + } else { + gauge_x = TJAPlayer3.Skin.Game_Gauge_X[player]; + gauge_y = TJAPlayer3.Skin.Game_Gauge_Y[player]; + } + + // Text pos + int text_x = 0; + int text_y = 0; + if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) { + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + text_x = TJAPlayer3.Skin.Game_Gauge_ClearText_X_AI; + text_y = TJAPlayer3.Skin.Game_Gauge_ClearText_Y_AI; + } else { + text_x = TJAPlayer3.Skin.Game_Gauge_ClearText_X[player]; + text_y = TJAPlayer3.Skin.Game_Gauge_ClearText_Y[player]; + } + } + + // Soul pos + int soul_x = 0; + int soul_y = 0; + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + soul_x = TJAPlayer3.Skin.Gauge_Soul_X_AI; + soul_y = TJAPlayer3.Skin.Gauge_Soul_Y_AI; + } else { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + soul_x = TJAPlayer3.Skin.Gauge_Soul_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * player); + soul_y = TJAPlayer3.Skin.Gauge_Soul_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * player); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + soul_x = TJAPlayer3.Skin.Gauge_Soul_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * player); + soul_y = TJAPlayer3.Skin.Gauge_Soul_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * player); + } else { + soul_x = TJAPlayer3.Skin.Gauge_Soul_X[player]; + soul_y = TJAPlayer3.Skin.Gauge_Soul_Y[player]; + } + } + + // Fire pos + int fire_x = 0; + int fire_y = 0; + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + fire_x = TJAPlayer3.Skin.Gauge_Soul_Fire_X_AI; + fire_y = TJAPlayer3.Skin.Gauge_Soul_Fire_Y_AI; + } else { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + fire_x = TJAPlayer3.Skin.Gauge_Soul_Fire_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * player); + fire_y = TJAPlayer3.Skin.Gauge_Soul_Fire_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * player); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + fire_x = TJAPlayer3.Skin.Gauge_Soul_Fire_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * player); + fire_y = TJAPlayer3.Skin.Gauge_Soul_Fire_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * player); + } else { + fire_x = TJAPlayer3.Skin.Gauge_Soul_Fire_X[player]; + fire_y = TJAPlayer3.Skin.Gauge_Soul_Fire_Y[player]; + } + } + + // Total hits and perfect hits + int perfectHits = TJAPlayer3.stage演奏ドラム画面.CChartScore[player].nGreat; + int totalHits = dtxs[player].nノーツ数[3]; + + // Scale + float scale = 1.0f; + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + scale = 0.8f; + } + + // Difficulty + int _dif = TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[player]; + Difficulty difficulty = (Difficulty)_dif; + int level = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[_dif].譜面情報.nレベル[_dif]; + + // Current percent + float currentPercent = (float)TJAPlayer3.stage演奏ドラム画面.actGauge.db現在のゲージ値[player]; + + // Gauge type + EGaugeType gaugeType = tGetGaugeTypeEnum(chara.effect.tGetGaugeType()); + + // Textures + int _4pGaugeIDX = (TJAPlayer3.ConfigIni.nPlayerCount >= 3) ? 1 : 0; + int _usedGauge = player + 3 * _4pGaugeIDX; + if (TJAPlayer3.P1IsBlue()) _usedGauge = 2; + _4pGaugeIDX = (TJAPlayer3.ConfigIni.nPlayerCount >= 3) ? 2 + : (player == 1) ? 1 + : 0; + + CTexture baseTexture = TJAPlayer3.Tx.Gauge_Base[_usedGauge]; + CTexture fillTexture = TJAPlayer3.Tx.Gauge[_usedGauge]; + + CTexture[] rainbowTextureArr = (new CTexture[][] { TJAPlayer3.Tx.Gauge_Rainbow, TJAPlayer3.Tx.Gauge_Rainbow_2PGauge, TJAPlayer3.Tx.Gauge_Rainbow_Flat })[_4pGaugeIDX]; + CTexture yellowTexture = TJAPlayer3.Tx.Gauge_Clear[_4pGaugeIDX]; + CTexture baseNormaTexture = TJAPlayer3.Tx.Gauge_Base_Norma[_4pGaugeIDX]; + CTexture killzoneTexture = TJAPlayer3.Tx.Gauge_Killzone[_4pGaugeIDX]; + + CTexture flashTexture = yellowTexture; + CTexture clearIcon = (_4pGaugeIDX == 2) + ? null + : (gaugeType != EGaugeType.NORMAL) + ? TJAPlayer3.Tx.Gauge_Killzone[0] + : TJAPlayer3.Tx.Gauge[0]; + CTexture soulLetter = TJAPlayer3.Tx.Gauge_Soul; + CTexture soulFlame = TJAPlayer3.Tx.Gauge_Soul_Fire; + + // Rectangles + Rectangle clearRectHighlight = new Rectangle( + TJAPlayer3.Skin.Game_Gauge_ClearText_Rect[0], + TJAPlayer3.Skin.Game_Gauge_ClearText_Rect[1], + TJAPlayer3.Skin.Game_Gauge_ClearText_Rect[2], + TJAPlayer3.Skin.Game_Gauge_ClearText_Rect[3] + ); + + Rectangle clearRect = new Rectangle( + TJAPlayer3.Skin.Game_Gauge_ClearText_Clear_Rect[0], + TJAPlayer3.Skin.Game_Gauge_ClearText_Clear_Rect[1], + TJAPlayer3.Skin.Game_Gauge_ClearText_Clear_Rect[2], + TJAPlayer3.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 = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character]; + CDTX[] dtxs = + { + TJAPlayer3.DTX, + TJAPlayer3.DTX_2P, + TJAPlayer3.DTX_3P, + TJAPlayer3.DTX_4P, + TJAPlayer3.DTX_5P + }; + + // Set box + GaugeBox = new int[] { TJAPlayer3.Skin.Result_Gauge_Rect[0], TJAPlayer3.Skin.Result_Gauge_Rect[1], TJAPlayer3.Skin.Result_Gauge_Rect[2], TJAPlayer3.Skin.Result_Gauge_Rect[3] }; + + // Total hits and perfect hits + int perfectHits = TJAPlayer3.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 (TJAPlayer3.ConfigIni.nPlayerCount >= 3) { + scale_x = 0.5f; + } + + // Difficulty + int _dif = TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[player]; + Difficulty difficulty = (Difficulty)_dif; + int level = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[_dif].譜面情報.nレベル[_dif]; + + int gauge_x; + int gauge_y; + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + gauge_x = TJAPlayer3.Skin.Result_Gauge_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; + gauge_y = TJAPlayer3.Skin.Result_Gauge_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + gauge_x = TJAPlayer3.Skin.Result_Gauge_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[pos]; + gauge_y = TJAPlayer3.Skin.Result_Gauge_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[pos]; + } else { + gauge_x = TJAPlayer3.Skin.Result_Gauge_X[pos] + uioffset_x; + gauge_y = TJAPlayer3.Skin.Result_Gauge_Y[pos]; + } + + int gauge_rainbow_x; + int gauge_rainbow_y; + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + gauge_rainbow_x = TJAPlayer3.Skin.Result_Gauge_Rainbow_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; + gauge_rainbow_y = TJAPlayer3.Skin.Result_Gauge_Rainbow_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + gauge_rainbow_x = TJAPlayer3.Skin.Result_Gauge_Rainbow_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[pos]; + gauge_rainbow_y = TJAPlayer3.Skin.Result_Gauge_Rainbow_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[pos]; + } else { + gauge_rainbow_x = TJAPlayer3.Skin.Result_Gauge_Rainbow_X[pos] + uioffset_x; + gauge_rainbow_y = TJAPlayer3.Skin.Result_Gauge_Rainbow_Y[pos]; + } + + // Flame and soul + int soulText_x; + int soulText_y; + int soulFire_x; + int soulFire_y; + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + soulText_x = TJAPlayer3.Skin.Result_Soul_Text_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; + soulText_y = TJAPlayer3.Skin.Result_Soul_Text_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; + soulFire_x = TJAPlayer3.Skin.Result_Soul_Fire_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; + soulFire_y = TJAPlayer3.Skin.Result_Soul_Fire_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + soulText_x = TJAPlayer3.Skin.Result_Soul_Text_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[0]; + soulText_y = TJAPlayer3.Skin.Result_Soul_Text_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[1]; + soulFire_x = TJAPlayer3.Skin.Result_Soul_Fire_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[0]; + soulFire_y = TJAPlayer3.Skin.Result_Soul_Fire_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[1]; + } else { + soulText_x = TJAPlayer3.Skin.Result_Soul_Text_X[pos] + uioffset_x; + soulText_y = TJAPlayer3.Skin.Result_Soul_Text_Y[pos]; + soulFire_x = TJAPlayer3.Skin.Result_Soul_Fire_X[pos] + uioffset_x; + soulFire_y = TJAPlayer3.Skin.Result_Soul_Fire_Y[pos]; + } + + // Clear text + int clearText_x; + int clearText_y; + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + clearText_x = TJAPlayer3.Skin.Result_Gauge_ClearText_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; + clearText_y = TJAPlayer3.Skin.Result_Gauge_ClearText_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + clearText_x = TJAPlayer3.Skin.Result_Gauge_ClearText_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[pos]; + clearText_y = TJAPlayer3.Skin.Result_Gauge_ClearText_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[pos]; + } else { + clearText_x = TJAPlayer3.Skin.Result_Gauge_ClearText_X[pos] + uioffset_x; + clearText_y = TJAPlayer3.Skin.Result_Gauge_ClearText_Y[pos]; + } + + // Textures + int _usedGauge = shiftPos; + CTexture baseTexture = TJAPlayer3.Tx.Result_Gauge_Base[_usedGauge]; + CTexture fillTexture = TJAPlayer3.Tx.Result_Gauge[_usedGauge]; + + CTexture[] rainbowTextureArr = TJAPlayer3.Tx.Result_Rainbow; + CTexture yellowTexture = TJAPlayer3.Tx.Result_Gauge_Clear; + CTexture baseNormaTexture = TJAPlayer3.Tx.Result_Gauge_Clear_Base; + CTexture killzoneTexture = TJAPlayer3.Tx.Result_Gauge_Killzone; + + CTexture flashTexture = null; + CTexture clearIcon = (gaugeType != EGaugeType.NORMAL) + ? TJAPlayer3.Tx.Result_Gauge_Killzone + : TJAPlayer3.Tx.Result_Gauge[0]; + + CTexture soulLetter = TJAPlayer3.Tx.Result_Soul_Text; + CTexture soulFlame = TJAPlayer3.Tx.Result_Soul_Fire; + + // Rectangles + Rectangle clearRectHighlight = new Rectangle( + TJAPlayer3.Skin.Result_Gauge_ClearText_Clear_Rect[0], + TJAPlayer3.Skin.Result_Gauge_ClearText_Clear_Rect[1], + TJAPlayer3.Skin.Result_Gauge_ClearText_Clear_Rect[2], + TJAPlayer3.Skin.Result_Gauge_ClearText_Clear_Rect[3] + ); + + Rectangle clearRect = new Rectangle( + TJAPlayer3.Skin.Result_Gauge_ClearText_Rect[0], + TJAPlayer3.Skin.Result_Gauge_ClearText_Rect[1], + TJAPlayer3.Skin.Result_Gauge_ClearText_Rect[2], + TJAPlayer3.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 = { TJAPlayer3.Skin.Game_Gauge_Rect[0], TJAPlayer3.Skin.Game_Gauge_Rect[1], TJAPlayer3.Skin.Game_Gauge_Rect[2], TJAPlayer3.Skin.Game_Gauge_Rect[3] }; + + } } diff --git a/OpenTaiko/src/Helpers/HGenreBar.cs b/OpenTaiko/src/Helpers/HGenreBar.cs index d0dee6b7..b521d58c 100644 --- a/OpenTaiko/src/Helpers/HGenreBar.cs +++ b/OpenTaiko/src/Helpers/HGenreBar.cs @@ -1,33 +1,18 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Drawing; using FDK; -namespace TJAPlayer3 -{ - 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 - { - return null; - } - } - } - } -} \ No newline at end of file +namespace TJAPlayer3 { + 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 { + return null; + } + } + } + } +} diff --git a/OpenTaiko/src/Helpers/HLocalizedPath.cs b/OpenTaiko/src/Helpers/HLocalizedPath.cs index 3c913dff..105811b1 100644 --- a/OpenTaiko/src/Helpers/HLocalizedPath.cs +++ b/OpenTaiko/src/Helpers/HLocalizedPath.cs @@ -1,35 +1,23 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; -using System.Runtime.InteropServices; +namespace TJAPlayer3 { + 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 TJAPlayer3 -{ - 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)); - } + public static String GetLocalizedPath(String ogPath, String langCode = null) { + if (String.IsNullOrEmpty(langCode)) + langCode = CLangManager.fetchLang(); - public static String GetLocalizedPath(String ogPath, String langCode = null) - { - if (String.IsNullOrEmpty(langCode)) - langCode = CLangManager.fetchLang(); - - String ext = System.IO.Path.GetExtension(ogPath); - String fp = HLocalizedPath.GetFullPathWithoutExtension(ogPath); - return (fp + "_" + langCode + ext); - } + String ext = System.IO.Path.GetExtension(ogPath); + String fp = HLocalizedPath.GetFullPathWithoutExtension(ogPath); + return (fp + "_" + langCode + ext); + } - public static String GetAvailableLocalizedPath(String ogPath, String langCode = null) - { - string path = GetLocalizedPath(ogPath, langCode); + public static String GetAvailableLocalizedPath(String ogPath, String langCode = null) { + string path = GetLocalizedPath(ogPath, langCode); - if (File.Exists(path)) return path; - return ogPath; - } - } -} \ No newline at end of file + if (File.Exists(path)) return path; + return ogPath; + } + } +} diff --git a/OpenTaiko/src/Helpers/HPrivateFastFont.cs b/OpenTaiko/src/Helpers/HPrivateFastFont.cs index 3d8b887f..985c4b35 100644 --- a/OpenTaiko/src/Helpers/HPrivateFastFont.cs +++ b/OpenTaiko/src/Helpers/HPrivateFastFont.cs @@ -1,45 +1,33 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - internal class HPrivateFastFont - { - static string DefaultFont = CFontRenderer.DefaultFontName; +namespace TJAPlayer3 { + internal class HPrivateFastFont { + static string DefaultFont = CFontRenderer.DefaultFontName; - public static bool FontExists(string fontpath) - { - return CFontRenderer.FontExists(fontpath); - } + public static bool FontExists(string fontpath) { + return CFontRenderer.FontExists(fontpath); + } - 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 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 tInstantiateMainFont(int scale, CFontRenderer.FontStyle style = CFontRenderer.FontStyle.Regular) - { - if (FontExists(TJAPlayer3.Skin.FontName)) - return (new CCachedFontRenderer(TJAPlayer3.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 tInstantiateMainFont(int scale, CFontRenderer.FontStyle style = CFontRenderer.FontStyle.Regular) { + if (FontExists(TJAPlayer3.Skin.FontName)) + return (new CCachedFontRenderer(TJAPlayer3.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(TJAPlayer3.Skin.BoxFontName)) - return (new CCachedFontRenderer(TJAPlayer3.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 tInstantiateBoxFont(int scale, CFontRenderer.FontStyle style = CFontRenderer.FontStyle.Regular) { + if (FontExists(TJAPlayer3.Skin.BoxFontName)) + return (new CCachedFontRenderer(TJAPlayer3.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 be87c777..d193b24d 100644 --- a/OpenTaiko/src/Helpers/HRarity.cs +++ b/OpenTaiko/src/Helpers/HRarity.cs @@ -1,100 +1,85 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Color = System.Drawing.Color; +using Color = System.Drawing.Color; -namespace TJAPlayer3 -{ - internal class HRarity - { - private static Dictionary RarityToColor = new Dictionary - { - ["Poor"] = Color.Gray, - ["Common"] = Color.White, - ["Uncommon"] = Color.Lime, - ["Rare"] = Color.Blue, - ["Epic"] = Color.Purple, - ["Legendary"] = Color.Orange, - ["Mythical"] = Color.Pink, - }; +namespace TJAPlayer3 { + internal class HRarity { + private static Dictionary RarityToColor = new Dictionary { + ["Poor"] = Color.Gray, + ["Common"] = Color.White, + ["Uncommon"] = Color.Lime, + ["Rare"] = Color.Blue, + ["Epic"] = Color.Purple, + ["Legendary"] = Color.Orange, + ["Mythical"] = Color.Pink, + }; - private static Dictionary RarityToModalInt = new Dictionary - { - ["Poor"] = 0, - ["Common"] = 0, - ["Uncommon"] = 1, - ["Rare"] = 2, - ["Epic"] = 3, - ["Legendary"] = 4, - ["Mythical"] = 4, - }; + private static Dictionary RarityToModalInt = new Dictionary { + ["Poor"] = 0, + ["Common"] = 0, + ["Uncommon"] = 1, + ["Rare"] = 2, + ["Epic"] = 3, + ["Legendary"] = 4, + ["Mythical"] = 4, + }; - private static Dictionary RarityToLangInt = new Dictionary - { - ["Poor"] = 0, - ["Common"] = 1, - ["Uncommon"] = 2, - ["Rare"] = 3, - ["Epic"] = 4, - ["Legendary"] = 5, - ["Mythical"] = 6, - }; + private static Dictionary RarityToLangInt = new Dictionary { + ["Poor"] = 0, + ["Common"] = 1, + ["Uncommon"] = 2, + ["Rare"] = 3, + ["Epic"] = 4, + ["Legendary"] = 5, + ["Mythical"] = 6, + }; - private static Dictionary RarityToCoinMultiplier = new Dictionary - { - ["Poor"] = 1f, - ["Common"] = 1f, - ["Uncommon"] = 1f, - ["Rare"] = 1f, - ["Epic"] = 1f, - ["Legendary"] = 1f, - ["Mythical"] = 1f, - }; + private static Dictionary RarityToCoinMultiplier = new Dictionary { + ["Poor"] = 1f, + ["Common"] = 1f, + ["Uncommon"] = 1f, + ["Rare"] = 1f, + ["Epic"] = 1f, + ["Legendary"] = 1f, + ["Mythical"] = 1f, + }; - public static Color tRarityToColor(string rarity) - { + public static Color tRarityToColor(string rarity) { - Color textColor = Color.White; + Color textColor = Color.White; - if (RarityToColor.ContainsKey(rarity)) - textColor = RarityToColor[rarity]; + if (RarityToColor.ContainsKey(rarity)) + textColor = RarityToColor[rarity]; - return textColor; + return textColor; - } + } - public static int tRarityToModalInt(string rarity) - { - int modalInt = 0; + public static int tRarityToModalInt(string rarity) { + int modalInt = 0; - if (RarityToModalInt.ContainsKey(rarity)) - modalInt = RarityToModalInt[rarity]; + if (RarityToModalInt.ContainsKey(rarity)) + modalInt = RarityToModalInt[rarity]; - return modalInt; - } + return modalInt; + } - public static int tRarityToLangInt(string rarity) - { - int modalInt = 1; + public static int tRarityToLangInt(string rarity) { + int modalInt = 1; - if (RarityToLangInt.ContainsKey(rarity)) - modalInt = RarityToLangInt[rarity]; + if (RarityToLangInt.ContainsKey(rarity)) + modalInt = RarityToLangInt[rarity]; - return modalInt; - } + return modalInt; + } - public static float tRarityToRarityToCoinMultiplier(string rarity) - { - float coinMult = 1f; + public static float tRarityToRarityToCoinMultiplier(string rarity) { + float coinMult = 1f; - if (RarityToCoinMultiplier.ContainsKey(rarity)) - coinMult = RarityToCoinMultiplier[rarity]; + if (RarityToCoinMultiplier.ContainsKey(rarity)) + coinMult = RarityToCoinMultiplier[rarity]; - return coinMult; - } + return coinMult; + } - } + } } diff --git a/OpenTaiko/src/Helpers/HScenePreset.cs b/OpenTaiko/src/Helpers/HScenePreset.cs index 90ebe425..627f64eb 100644 --- a/OpenTaiko/src/Helpers/HScenePreset.cs +++ b/OpenTaiko/src/Helpers/HScenePreset.cs @@ -1,89 +1,63 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Drawing; -using FDK; +namespace TJAPlayer3 { + class HScenePreset { + public static DBSkinPreset.SkinScene GetBGPreset() { + string presetSection = ""; + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + presetSection = "Tower"; + } else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + presetSection = "Dan"; + } else if (TJAPlayer3.ConfigIni.bAIBattleMode) { + presetSection = "AI"; + } else { + presetSection = "Regular"; + } + object _ps = null; -namespace TJAPlayer3 -{ - class HScenePreset - { - public static DBSkinPreset.SkinScene GetBGPreset() - { - string presetSection = ""; - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - { - presetSection = "Tower"; - } - else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - { - presetSection = "Dan"; - } - else if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - presetSection = "AI"; - } - else - { - presetSection = "Regular"; - } + switch (presetSection) { + case "Regular": + _ps = TJAPlayer3.Skin.Game_SkinScenes.Regular; + break; + case "Dan": + _ps = TJAPlayer3.Skin.Game_SkinScenes.Dan; + break; + case "Tower": + _ps = TJAPlayer3.Skin.Game_SkinScenes.Tower; + break; + case "AI": + _ps = TJAPlayer3.Skin.Game_SkinScenes.AI; + break; + default: + break; + }; - object _ps = null; + bool sectionIsValid = _ps != null ? ((Dictionary)_ps).Count > 0 : false; - switch (presetSection) - { - case "Regular": - _ps = TJAPlayer3.Skin.Game_SkinScenes.Regular; - break; - case "Dan": - _ps = TJAPlayer3.Skin.Game_SkinScenes.Dan; - break; - case "Tower": - _ps = TJAPlayer3.Skin.Game_SkinScenes.Tower; - break; - case "AI": - _ps = TJAPlayer3.Skin.Game_SkinScenes.AI; - break; - default: - break; - }; + var preset = (sectionIsValid + && TJAPlayer3.stageSongSelect.rChoosenSong.strScenePreset != null + && ((Dictionary)_ps).ContainsKey(TJAPlayer3.stageSongSelect.rChoosenSong.strScenePreset)) + ? ((Dictionary)_ps)[TJAPlayer3.stageSongSelect.rChoosenSong.strScenePreset] + : null; - bool sectionIsValid = _ps != null ? ((Dictionary)_ps).Count > 0 : false; + if (sectionIsValid + && TJAPlayer3.DTX.scenePreset != null + && ((Dictionary)_ps).ContainsKey(TJAPlayer3.DTX.scenePreset)) // If currently selected song has valid SCENEPRESET metadata within TJA + { + preset = ((Dictionary)_ps)[TJAPlayer3.DTX.scenePreset]; + } else if (sectionIsValid + && TJAPlayer3.stageSongSelect.rChoosenSong.strScenePreset != null + && ((Dictionary)_ps).ContainsKey(TJAPlayer3.stageSongSelect.rChoosenSong.strScenePreset)) { + preset = ((Dictionary)_ps)[TJAPlayer3.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; + } - var preset = (sectionIsValid - && TJAPlayer3.stageSongSelect.rChoosenSong.strScenePreset != null - && ((Dictionary)_ps).ContainsKey(TJAPlayer3.stageSongSelect.rChoosenSong.strScenePreset)) - ? ((Dictionary)_ps)[TJAPlayer3.stageSongSelect.rChoosenSong.strScenePreset] - : null; - - if (sectionIsValid - && TJAPlayer3.DTX.scenePreset != null - && ((Dictionary)_ps).ContainsKey(TJAPlayer3.DTX.scenePreset)) // If currently selected song has valid SCENEPRESET metadata within TJA - { - preset = ((Dictionary)_ps)[TJAPlayer3.DTX.scenePreset]; - } - else if (sectionIsValid - && TJAPlayer3.stageSongSelect.rChoosenSong.strScenePreset != null - && ((Dictionary)_ps).ContainsKey(TJAPlayer3.stageSongSelect.rChoosenSong.strScenePreset)) - { - preset = ((Dictionary)_ps)[TJAPlayer3.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; - } - } -} \ No newline at end of file + return preset; + } + } +} diff --git a/OpenTaiko/src/Helpers/HSongTraverse.cs b/OpenTaiko/src/Helpers/HSongTraverse.cs index 5a63d536..8674be5c 100644 --- a/OpenTaiko/src/Helpers/HSongTraverse.cs +++ b/OpenTaiko/src/Helpers/HSongTraverse.cs @@ -1,33 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +namespace TJAPlayer3 { + class HSongTraverse { + public static List SpecialFolders = new List { "Favorite", "最近遊んだ曲", "SearchD" }; -namespace TJAPlayer3 -{ - 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 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; - } - 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; + } - 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 a29ede3d..cb5609c3 100644 --- a/OpenTaiko/src/Helpers/LocalizedStringConverter.cs +++ b/OpenTaiko/src/Helpers/LocalizedStringConverter.cs @@ -1,34 +1,23 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using Newtonsoft.Json; -namespace TJAPlayer3 -{ - internal class LocalizedStringConverter : JsonConverter - { - public override bool CanConvert(Type objectType) - { - // CanConvert is not called when the [JsonConverter] attribute is used - return false; - } +namespace TJAPlayer3 { + internal class LocalizedStringConverter : JsonConverter { + public override bool CanConvert(Type objectType) { + // CanConvert is not called when the [JsonConverter] attribute is used + return false; + } - 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 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); - } - } + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { + serializer.Serialize(writer, value); + } + } } diff --git a/OpenTaiko/src/Helpers/ObjectExtensions.cs b/OpenTaiko/src/Helpers/ObjectExtensions.cs index c79b7282..9bf72554 100644 --- a/OpenTaiko/src/Helpers/ObjectExtensions.cs +++ b/OpenTaiko/src/Helpers/ObjectExtensions.cs @@ -1,259 +1,203 @@ -using System.Collections.Generic; -using System.Reflection; -using System.ArrayExtensions; +using System.ArrayExtensions; using System.Globalization; +using System.Reflection; using System.Text.RegularExpressions; using TJAPlayer3; // https://github.com/Burtsev-Alexey/net-object-deep-copy/blob/master/ObjectExtensions.cs -namespace System -{ - public static class ObjectExtensions - { - private static readonly MethodInfo CloneMethod = typeof(Object).GetMethod("MemberwiseClone", BindingFlags.NonPublic | BindingFlags.Instance); +namespace System { + public static class ObjectExtensions { + private static readonly MethodInfo CloneMethod = typeof(Object).GetMethod("MemberwiseClone", BindingFlags.NonPublic | BindingFlags.Instance); - public static bool IsPrimitive(this Type type) - { - if (type == typeof(String)) return true; - return (type.IsValueType & type.IsPrimitive); - } + public static bool IsPrimitive(this Type type) { + if (type == typeof(String)) return true; + return (type.IsValueType & type.IsPrimitive); + } - public static Object Copy(this Object originalObject) - { - return InternalCopy(originalObject, new Dictionary(new ReferenceEqualityComparer())); - } - private static Object InternalCopy(Object originalObject, IDictionary visited) - { - if (originalObject == null) return null; - var typeToReflect = originalObject.GetType(); - if (IsPrimitive(typeToReflect)) return originalObject; - if (visited.ContainsKey(originalObject)) return visited[originalObject]; - if (typeof(Delegate).IsAssignableFrom(typeToReflect)) return null; - var cloneObject = CloneMethod.Invoke(originalObject, null); - if (typeToReflect.IsArray) - { - var arrayType = typeToReflect.GetElementType(); - if (IsPrimitive(arrayType) == false) - { - Array clonedArray = (Array)cloneObject; - clonedArray.ForEach((array, indices) => array.SetValue(InternalCopy(clonedArray.GetValue(indices), visited), indices)); - } + public static Object Copy(this Object originalObject) { + return InternalCopy(originalObject, new Dictionary(new ReferenceEqualityComparer())); + } + private static Object InternalCopy(Object originalObject, IDictionary visited) { + if (originalObject == null) return null; + var typeToReflect = originalObject.GetType(); + if (IsPrimitive(typeToReflect)) return originalObject; + if (visited.ContainsKey(originalObject)) return visited[originalObject]; + if (typeof(Delegate).IsAssignableFrom(typeToReflect)) return null; + var cloneObject = CloneMethod.Invoke(originalObject, null); + if (typeToReflect.IsArray) { + var arrayType = typeToReflect.GetElementType(); + if (IsPrimitive(arrayType) == false) { + Array clonedArray = (Array)cloneObject; + clonedArray.ForEach((array, indices) => array.SetValue(InternalCopy(clonedArray.GetValue(indices), visited), indices)); + } - } - visited.Add(originalObject, cloneObject); - CopyFields(originalObject, visited, cloneObject, typeToReflect); - RecursiveCopyBaseTypePrivateFields(originalObject, visited, cloneObject, typeToReflect); - return cloneObject; - } + } + visited.Add(originalObject, cloneObject); + CopyFields(originalObject, visited, cloneObject, typeToReflect); + RecursiveCopyBaseTypePrivateFields(originalObject, visited, cloneObject, typeToReflect); + return cloneObject; + } - private static void RecursiveCopyBaseTypePrivateFields(object originalObject, IDictionary visited, object cloneObject, Type typeToReflect) - { - if (typeToReflect.BaseType != null) - { - RecursiveCopyBaseTypePrivateFields(originalObject, visited, cloneObject, typeToReflect.BaseType); - CopyFields(originalObject, visited, cloneObject, typeToReflect.BaseType, BindingFlags.Instance | BindingFlags.NonPublic, info => info.IsPrivate); - } - } + private static void RecursiveCopyBaseTypePrivateFields(object originalObject, IDictionary visited, object cloneObject, Type typeToReflect) { + if (typeToReflect.BaseType != null) { + RecursiveCopyBaseTypePrivateFields(originalObject, visited, cloneObject, typeToReflect.BaseType); + CopyFields(originalObject, visited, cloneObject, typeToReflect.BaseType, BindingFlags.Instance | BindingFlags.NonPublic, info => info.IsPrivate); + } + } - private static void CopyFields(object originalObject, IDictionary visited, object cloneObject, Type typeToReflect, BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.FlattenHierarchy, Func filter = null) - { - foreach (FieldInfo fieldInfo in typeToReflect.GetFields(bindingFlags)) - { - if (filter != null && filter(fieldInfo) == false) continue; - if (IsPrimitive(fieldInfo.FieldType)) continue; - var originalFieldValue = fieldInfo.GetValue(originalObject); - var clonedFieldValue = InternalCopy(originalFieldValue, visited); - fieldInfo.SetValue(cloneObject, clonedFieldValue); - } - } - public static T Copy(this T original) - { - return (T)Copy((Object)original); - } - } + private static void CopyFields(object originalObject, IDictionary visited, object cloneObject, Type typeToReflect, BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.FlattenHierarchy, Func filter = null) { + foreach (FieldInfo fieldInfo in typeToReflect.GetFields(bindingFlags)) { + if (filter != null && filter(fieldInfo) == false) continue; + if (IsPrimitive(fieldInfo.FieldType)) continue; + var originalFieldValue = fieldInfo.GetValue(originalObject); + var clonedFieldValue = InternalCopy(originalFieldValue, visited); + fieldInfo.SetValue(cloneObject, clonedFieldValue); + } + } + public static T Copy(this T original) { + return (T)Copy((Object)original); + } + } - public class ReferenceEqualityComparer : EqualityComparer - { - public override bool Equals(object x, object y) - { - return ReferenceEquals(x, y); - } - public override int GetHashCode(object obj) - { - if (obj == null) return 0; - return obj.GetHashCode(); - } - } + public class ReferenceEqualityComparer : EqualityComparer { + public override bool Equals(object x, object y) { + return ReferenceEquals(x, y); + } + public override int GetHashCode(object obj) { + if (obj == null) return 0; + return obj.GetHashCode(); + } + } - namespace ArrayExtensions - { - public static class ArrayExtensions - { - public static void ForEach(this Array array, Action action) - { - if (array.LongLength == 0) return; - ArrayTraverse walker = new ArrayTraverse(array); - do action(array, walker.Position); - while (walker.Step()); - } - } + namespace ArrayExtensions { + public static class ArrayExtensions { + public static void ForEach(this Array array, Action action) { + if (array.LongLength == 0) return; + ArrayTraverse walker = new ArrayTraverse(array); + do action(array, walker.Position); + while (walker.Step()); + } + } - internal class ArrayTraverse - { - public int[] Position; - private int[] maxLengths; + internal class ArrayTraverse { + public int[] Position; + private int[] maxLengths; - public ArrayTraverse(Array array) - { - maxLengths = new int[array.Rank]; - for (int i = 0; i < array.Rank; ++i) - { - maxLengths[i] = array.GetLength(i) - 1; - } - Position = new int[array.Rank]; - } + public ArrayTraverse(Array array) { + maxLengths = new int[array.Rank]; + for (int i = 0; i < array.Rank; ++i) { + maxLengths[i] = array.GetLength(i) - 1; + } + Position = new int[array.Rank]; + } - public bool Step() - { - for (int i = 0; i < Position.Length; ++i) - { - if (Position[i] < maxLengths[i]) - { - Position[i]++; - for (int j = 0; j < i; j++) - { - Position[j] = 0; - } - return true; - } - } - return false; - } - } - } + public bool Step() { + for (int i = 0; i < Position.Length; ++i) { + if (Position[i] < maxLengths[i]) { + Position[i]++; + for (int j = 0; j < i; j++) { + Position[j] = 0; + } + return true; + } + } + return false; + } + } + } - // Below methods are added by 0AuBSQ + // Below methods are added by 0AuBSQ - public static class StringExtensions - { - // TagRegex and RemoveTags are copies of TagRegex and Purify from the CSkiaSharpTextRenderer class (Have two instances because of both being in 2 different projects) + public static class StringExtensions { + // TagRegex and RemoveTags are copies of TagRegex and Purify from the CSkiaSharpTextRenderer class (Have two instances because of both being in 2 different projects) - private const string TagRegex = @"<(/?)([gc](?:\.#[0-9a-fA-F]{6})*?)>"; + private const string TagRegex = @"<(/?)([gc](?:\.#[0-9a-fA-F]{6})*?)>"; - public static string RemoveTags(this string input) - { - return Regex.Replace(input, TagRegex, ""); - } + public static string RemoveTags(this string input) { + return Regex.Replace(input, TagRegex, ""); + } - public static string EscapeSingleQuotes(this string input) - { - return input.Replace(@"'", @"''"); - } + public static string EscapeSingleQuotes(this string input) { + return input.Replace(@"'", @"''"); + } - public static string SafeFormat(this string format, params object?[] args) - { - try - { - return String.Format(format, args); - } - catch - { - return format; - } - } + public static string SafeFormat(this string format, params object?[] args) { + try { + return String.Format(format, args); + } catch { + return format; + } + } - public static string[] SplitByCommas(this string input) - { - // Regular expression to split by commas, but not by escaped commas (\,) - var pattern = @"(? !string.IsNullOrEmpty(part)).ToArray(); + // Filter out empty strings + var filteredParts = parts.Where(part => !string.IsNullOrEmpty(part)).ToArray(); - return filteredParts; - } + return filteredParts; + } - public static double[] ParseComplex(this string input) - { - try - { - // Removing all spaces from the input for easier processing - input = input.Replace(" ", "").ToLower(); + public static double[] ParseComplex(this string input) { + try { + // Removing all spaces from the input for easier processing + input = input.Replace(" ", "").ToLower(); - double real = 0; - double imaginary = 0; + double real = 0; + double imaginary = 0; - // If the input contains 'i', we need to handle the imaginary part - if (input.Contains("i")) - { - // Special cases for 'i', '-i', '1+i', '1-i' - if (input == "i") - { - imaginary = 1; - } - else if (input == "-i") - { - imaginary = -1; - } - else - { - // Remove 'i' for further processing - input = input.Replace("i", ""); + // If the input contains 'i', we need to handle the imaginary part + if (input.Contains("i")) { + // Special cases for 'i', '-i', '1+i', '1-i' + if (input == "i") { + imaginary = 1; + } else if (input == "-i") { + imaginary = -1; + } else { + // Remove 'i' for further processing + input = input.Replace("i", ""); - // Check if input ends with '+' or '-', meaning it was something like '1+i' or '1-i' - if (input.EndsWith("+") || input.EndsWith("-")) - { - real = double.Parse(input.TrimEnd('+', '-'), CultureInfo.InvariantCulture); - imaginary = input.EndsWith("+") ? 1 : -1; - } - else - { - // Split the input into real and imaginary parts - string[] parts = input.Split(new[] { '+', '-' }, StringSplitOptions.RemoveEmptyEntries); + // Check if input ends with '+' or '-', meaning it was something like '1+i' or '1-i' + if (input.EndsWith("+") || input.EndsWith("-")) { + real = double.Parse(input.TrimEnd('+', '-'), CultureInfo.InvariantCulture); + imaginary = input.EndsWith("+") ? 1 : -1; + } else { + // Split the input into real and imaginary parts + string[] parts = input.Split(new[] { '+', '-' }, StringSplitOptions.RemoveEmptyEntries); - if (input.Contains("+")) - { - real = double.Parse(parts[0], CultureInfo.InvariantCulture); - imaginary = double.Parse(parts[1], CultureInfo.InvariantCulture); - } - else if (input.LastIndexOf('-') > 0) // handling cases like "1-2i" - { - real = double.Parse(parts[0], CultureInfo.InvariantCulture); - imaginary = -double.Parse(parts[1], CultureInfo.InvariantCulture); - } - else if (input.StartsWith("-")) - { - imaginary = -double.Parse(parts[0], CultureInfo.InvariantCulture); - } - else - { - imaginary = double.Parse(parts[0], CultureInfo.InvariantCulture); - } - } - } - } - else - { - // If there is no 'i', it is purely a real number - real = double.Parse(input, CultureInfo.InvariantCulture); - } + if (input.Contains("+")) { + real = double.Parse(parts[0], CultureInfo.InvariantCulture); + imaginary = double.Parse(parts[1], CultureInfo.InvariantCulture); + } else if (input.LastIndexOf('-') > 0) // handling cases like "1-2i" + { + real = double.Parse(parts[0], CultureInfo.InvariantCulture); + imaginary = -double.Parse(parts[1], CultureInfo.InvariantCulture); + } else if (input.StartsWith("-")) { + imaginary = -double.Parse(parts[0], CultureInfo.InvariantCulture); + } else { + imaginary = double.Parse(parts[0], CultureInfo.InvariantCulture); + } + } + } + } else { + // If there is no 'i', it is purely a real number + real = double.Parse(input, CultureInfo.InvariantCulture); + } - return new double[] { real, imaginary }; - } - catch (Exception ex) - { - LogNotification.PopWarning($"'{input}': Incorrect complex number formatting, defaulting to 0"); - return new double[] { 0, 0 }; // Return default value in case of error - } - } - } -} \ No newline at end of file + return new double[] { real, imaginary }; + } catch (Exception ex) { + LogNotification.PopWarning($"'{input}': Incorrect complex number formatting, defaulting to 0"); + return new double[] { 0, 0 }; // Return default value in case of error + } + } + } +} diff --git a/OpenTaiko/src/Helpers/SevenZipHelper.cs b/OpenTaiko/src/Helpers/SevenZipHelper.cs index 4713ddab..0bf08095 100644 --- a/OpenTaiko/src/Helpers/SevenZipHelper.cs +++ b/OpenTaiko/src/Helpers/SevenZipHelper.cs @@ -1,245 +1,222 @@ // http://www.nullskull.com/a/768/7zip-lzma-inmemory-compression-with-c.aspx // http://www.7-zip.org/sdk.html -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; - - static bool eos = false; - - static CoderPropID[] propIDs = - { - CoderPropID.DictionarySize, - CoderPropID.PosStateBits, - CoderPropID.LitContextBits, - CoderPropID.LitPosBits, - CoderPropID.Algorithm, - CoderPropID.NumFastBytes, - CoderPropID.MatchFinder, - CoderPropID.EndMarker - }; +namespace SevenZip.Compression.LZMA { - // 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 - }; - - - public static byte[] Compress(byte[] inputBytes) - { - byte[] retVal = null; - SevenZip.Compression.LZMA.Encoder encoder = new SevenZip.Compression.LZMA.Encoder(); - encoder.SetCoderProperties(propIDs, properties); - 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))); + public static class SevenZipHelper { - encoder.Code(strmInStream, strmOutStream, -1, -1, null); - retVal = strmOutStream.ToArray(); - } // End Using outStream + static int dictionary = 1 << 23; - } // End Using inStream + // 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; - return retVal; - } // End Function Compress + 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(string inFileName) - { - 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.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(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 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 byte[] Compress(string inFileName) { + byte[] retVal = null; + 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)) { + 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))); - strmOutStream.Flush(); - strmOutStream.Close(); - } // End Using outStream + encoder.Code(strmInStream, strmOutStream, -1, -1, null); + retVal = strmOutStream.ToArray(); + } // End Using outStream - } // End Using inStream + } // End Using inStream - } // End Function Compress + return retVal; + } // End Function Compress + public static void Compress(string inFileName, string outFileName) { + SevenZip.Compression.LZMA.Encoder encoder = new SevenZip.Compression.LZMA.Encoder(); + encoder.SetCoderProperties(propIDs, properties); + using (System.IO.Stream strmInStream = new System.IO.FileStream(inFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)) { - public static byte[] Decompress(string inFileName) - { - byte[] retVal = null; + 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))); - SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder(); + 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)) - { - strmInStream.Seek(0, 0); + strmOutStream.Flush(); + strmOutStream.Close(); + } // End Using outStream - 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")); + } // End Using inStream - 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 + } // End Function Compress - decoder.SetDecoderProperties(properties2); - long compressedSize = strmInStream.Length - strmInStream.Position; - decoder.Code(strmInStream, strmOutStream, compressedSize, outSize, null); - retVal = strmOutStream.ToArray(); - } // End Using newOutStream - } // End Using newInStream + public static byte[] Decompress(string inFileName) { + byte[] retVal = null; - return retVal; - } // End Function Decompress + 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 void Decompress(string inFileName, string outFileName) - { - SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder(); + 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")); - using (System.IO.Stream strmInStream = new System.IO.FileStream(inFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)) - { - strmInStream.Seek(0, 0); + 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 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")); + decoder.SetDecoderProperties(properties2); - 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 + long compressedSize = strmInStream.Length - strmInStream.Position; + decoder.Code(strmInStream, strmOutStream, compressedSize, outSize, null); - decoder.SetDecoderProperties(properties2); + retVal = strmOutStream.ToArray(); + } // End Using newOutStream - long compressedSize = strmInStream.Length - strmInStream.Position; - decoder.Code(strmInStream, strmOutStream, compressedSize, outSize, null); + } // End Using newInStream - strmOutStream.Flush(); - strmOutStream.Close(); - } // End Using newOutStream + return retVal; + } // End Function Decompress - } // End Using newInStream - } // End Function Decompress + public static void Decompress(string inFileName, string outFileName) { + 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(byte[] inputBytes) - { - byte[] retVal = null; + 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")); - 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 + 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 - retVal = strmOutStream.ToArray(); - } // End Using newOutStream - } // End Using newInStream + public static byte[] Decompress(byte[] inputBytes) { + byte[] retVal = null; - return retVal; - } // 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); - } // End Class SevenZipHelper + 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 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 -} // End Namespace SevenZip.Compression.LZMA \ No newline at end of file + decoder.SetDecoderProperties(properties2); + + long compressedSize = strmInStream.Length - strmInStream.Position; + decoder.Code(strmInStream, strmOutStream, compressedSize, outSize, null); + + retVal = strmOutStream.ToArray(); + } // End Using newOutStream + + } // End Using newInStream + + return retVal; + } // End Function Decompress + + + } // End Class SevenZipHelper + + +} // End Namespace SevenZip.Compression.LZMA diff --git a/OpenTaiko/src/I18N/CLang.cs b/OpenTaiko/src/I18N/CLang.cs index 3a53c9c8..5b6958dd 100644 --- a/OpenTaiko/src/I18N/CLang.cs +++ b/OpenTaiko/src/I18N/CLang.cs @@ -1,143 +1,119 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; +using System.Diagnostics; using System.Text.Json; using System.Text.Json.Nodes; -using System.Threading.Tasks; using FDK; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -namespace TJAPlayer3 -{ - 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 TJAPlayer3 { + 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}"; - 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 @$"{TJAPlayer3.strEXEのあるフォルダ}Lang{Path.DirectorySeparatorChar}{Id}{Path.DirectorySeparatorChar}"; } } + 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 @$"{TJAPlayer3.strEXEのあるフォルダ}Lang{Path.DirectorySeparatorChar}{Id}{Path.DirectorySeparatorChar}"; } } - private string _fontName = CFontRenderer.DefaultFontName; - private string _boxFontName = CFontRenderer.DefaultFontName; + private string _fontName = CFontRenderer.DefaultFontName; + private string _boxFontName = CFontRenderer.DefaultFontName; - 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); + 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); - JsonNodeOptions options = new JsonNodeOptions() { PropertyNameCaseInsensitive = false }; - JsonDocumentOptions doc = new JsonDocumentOptions() { CommentHandling = JsonCommentHandling.Skip, AllowTrailingCommas = true }; - JsonNode node = JsonNode.Parse(data, options, doc); + JsonNodeOptions options = new JsonNodeOptions() { PropertyNameCaseInsensitive = false }; + JsonDocumentOptions doc = new JsonDocumentOptions() { CommentHandling = JsonCommentHandling.Skip, AllowTrailingCommas = true }; + JsonNode node = JsonNode.Parse(data, options, doc); - 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(); + 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(); - 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); - } + 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 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 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(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; + } + } + } } diff --git a/OpenTaiko/src/I18N/ILang.cs b/OpenTaiko/src/I18N/ILang.cs index cba445de..85a6f524 100644 --- a/OpenTaiko/src/I18N/ILang.cs +++ b/OpenTaiko/src/I18N/ILang.cs @@ -1,149 +1,128 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +namespace TJAPlayer3 { + internal interface ILang { + string GetString(int idx); + } -namespace TJAPlayer3 -{ - internal interface ILang - { - string GetString(int idx); - } + static internal class CLangManager { + // Cheap factory-like design pattern - 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); - 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); + //switch (lang) { + // case "zh": + // CLangManager.LangInstance = new CLang_zh(); + // break; + // case "es": + // CLangManager.LangInstance = new CLang_es(); + // break; + // case "fr": + // CLangManager.LangInstance = new CLang_fr(); + // break; + // case "nl": + // CLangManager.LangInstance = new CLang_nl(); + // break; + // case "ko": + // CLangManager.LangInstance = new CLang_ko(); + // break; + // case "en": + // CLangManager.LangInstance = new CLang_en(); + // break; + // case "ja": + // default: + // CLangManager.LangInstance = new CLang_jp(); + // break; + //} + CLuaScript.tReloadLanguage(lang); + } - //switch (lang) { - // case "zh": - // CLangManager.LangInstance = new CLang_zh(); - // break; - // case "es": - // CLangManager.LangInstance = new CLang_es(); - // break; - // case "fr": - // CLangManager.LangInstance = new CLang_fr(); - // break; - // case "nl": - // CLangManager.LangInstance = new CLang_nl(); - // break; - // case "ko": - // CLangManager.LangInstance = new CLang_ko(); - // break; - // case "en": - // CLangManager.LangInstance = new CLang_en(); - // break; - // case "ja": - // default: - // CLangManager.LangInstance = new CLang_jp(); - // break; - //} - CLuaScript.tReloadLanguage(lang); - } + public static int langToInt(string lang) { + return Array.IndexOf(Langcodes, lang); + } - public static int langToInt(string lang) - { - return Array.IndexOf(Langcodes, lang); - } + public static string fetchLang() { + //if (LangInstance is CLang_jp) + // return "ja"; + //else if (LangInstance is CLang_en) + // return "en"; + //else if (LangInstance is CLang_fr) + // return "fr"; + //else if (LangInstance is CLang_es) + // return "es"; + //else if (LangInstance is CLang_zh) + // return "zh"; + //else if (LangInstance is CLang_nl) + // return "nl"; + //else if (LangInstance is CLang_ko) + // return "ko"; + //return DefaultLanguage.Item1; + return LangInstance.Id; + } - public static string fetchLang() - { - //if (LangInstance is CLang_jp) - // return "ja"; - //else if (LangInstance is CLang_en) - // return "en"; - //else if (LangInstance is CLang_fr) - // return "fr"; - //else if (LangInstance is CLang_es) - // return "es"; - //else if (LangInstance is CLang_zh) - // return "zh"; - //else if (LangInstance is CLang_nl) - // return "nl"; - //else if (LangInstance is CLang_ko) - // return "ko"; - //return DefaultLanguage.Item1; - return LangInstance.Id; - } + public static string intToLang(int idx) { + return Langcodes[idx]; + } - public static string intToLang(int idx) - { - return Langcodes[idx]; - } + //public static readonly string[] Languages = new string[] { "日本語 (Japanese)", "English", "Français (French)", "Español (Spanish)", "中文 (Chinese)", "nl (WIP)", "ko (WIP)" }; + //public static readonly string[] Langcodes = new string[] { "ja", "en", "fr", "es", "zh", "nl", "ko" }; + // temporary garbage code + public static string[] Langcodes { + get { + if (_langCodes == null) + _langCodes = Directory.GetDirectories(Path.Combine(TJAPlayer3.strEXEのあるフォルダ, "Lang"), "*", SearchOption.TopDirectoryOnly) + .Select(result => Path.GetRelativePath(Path.Combine(TJAPlayer3.strEXEのあるフォルダ, "Lang"), result)) + .ToArray(); - //public static readonly string[] Languages = new string[] { "日本語 (Japanese)", "English", "Français (French)", "Español (Spanish)", "中文 (Chinese)", "nl (WIP)", "ko (WIP)" }; - //public static readonly string[] Langcodes = new string[] { "ja", "en", "fr", "es", "zh", "nl", "ko" }; - // temporary garbage code - public static string[] Langcodes - { - get - { - if (_langCodes == null) - _langCodes = Directory.GetDirectories(Path.Combine(TJAPlayer3.strEXEのあるフォルダ, "Lang"), "*", SearchOption.TopDirectoryOnly) - .Select(result => Path.GetRelativePath(Path.Combine(TJAPlayer3.strEXEのあるフォルダ, "Lang"), result)) - .ToArray(); + return _langCodes; + } + } + public static string[] Languages { + get { + if (_languages == null) + _languages = Langcodes.Select(result => CLang.GetLanguage(result)).ToArray(); - return _langCodes; - } - } - public static string[] Languages - { - get - { - if (_languages == null) - _languages = Langcodes.Select(result => CLang.GetLanguage(result)).ToArray(); + return _languages; + } + } - return _languages; - } - } + public static CLocalizationData GetAllStringsAsLocalizationData(string key) { + if (_cachedLocs.ContainsKey(key)) return _cachedLocs[key]; - public static CLocalizationData GetAllStringsAsLocalizationData(string key) - { - if (_cachedLocs.ContainsKey(key)) return _cachedLocs[key]; + CLocalizationData loc = new CLocalizationData(); + loc.SetString("default", "?"); - CLocalizationData loc = new CLocalizationData(); - loc.SetString("default", "?"); + foreach (string lang in Langcodes) { + CLang _inst = CLang.GetCLang(lang); - foreach (string lang in Langcodes) - { - CLang _inst = CLang.GetCLang(lang); + loc.SetString(lang, _inst.GetString(key)); + } - loc.SetString(lang, _inst.GetString(key)); - } + _cachedLocs[key] = loc; + return loc; + } - _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]; - 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", "?"); - CLocalizationData loc = new CLocalizationData(); - loc.SetString("default", "?"); + foreach (string lang in Langcodes) { + CLang _inst = CLang.GetCLang(lang); - foreach (string lang in Langcodes) - { - CLang _inst = CLang.GetCLang(lang); + loc.SetString(lang, _inst.GetString(key, values)); + } - loc.SetString(lang, _inst.GetString(key, values)); - } + _cachedLocs[key + keySalt] = loc; + return loc; + } - _cachedLocs[key + keySalt] = loc; - return loc; - } + private static string[] _langCodes; + private static string[] _languages; - private static string[] _langCodes; - private static string[] _languages; - - private static Dictionary _cachedLocs = new Dictionary(); - //public static ILang LangInstance { get; private set; } = new CLang_jp(); - } -} \ No newline at end of file + private static Dictionary _cachedLocs = new Dictionary(); + //public static ILang LangInstance { get; private set; } = new CLang_jp(); + } +} diff --git a/OpenTaiko/src/Items/CItemBase.cs b/OpenTaiko/src/Items/CItemBase.cs index 21746431..25f7cf0e 100644 --- a/OpenTaiko/src/Items/CItemBase.cs +++ b/OpenTaiko/src/Items/CItemBase.cs @@ -1,28 +1,20 @@ -using System; -using System.Globalization; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; +using System.Globalization; -namespace TJAPlayer3 -{ +namespace TJAPlayer3 { /// /// すべてのアイテムの基本クラス。 /// - internal class CItemBase - { + internal class CItemBase { // プロパティ public EPanelType eパネル種別; - public enum EPanelType - { + public enum EPanelType { Normal, Other } public E種別 e種別; - public enum E種別 - { + public enum E種別 { 基本形, ONorOFFトグル, ONorOFFor不定スリーステート, @@ -54,29 +46,26 @@ namespace TJAPlayer3 // コンストラクタ - public CItemBase() - { + public CItemBase() { this.str項目名 = ""; this.str説明文 = ""; } - public CItemBase( string str項目名 ) - : this() - { - this.t初期化( 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) + 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パネル種別 ); + : this() { + this.t初期化(str項目名, eパネル種別); } public CItemBase(string str項目名, EPanelType eパネル種別, string str説明文jp) : this() { @@ -87,21 +76,17 @@ namespace TJAPlayer3 this.t初期化(str項目名, eパネル種別, str説明文jp, str説明文en); } - + // メソッド;子クラスで実装する - public virtual void tEnter押下() - { + public virtual void tEnter押下() { } - public virtual void t項目値を次へ移動() - { + public virtual void t項目値を次へ移動() { } - 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項目名) { + this.t初期化(str項目名, EPanelType.Normal); } public virtual void t初期化(string str項目名, string str説明文jp) { this.t初期化(str項目名, EPanelType.Normal, str説明文jp, str説明文jp); @@ -110,8 +95,7 @@ namespace TJAPlayer3 this.t初期化(str項目名, EPanelType.Normal, str説明文jp, str説明文en); } - public virtual void t初期化( string str項目名, EPanelType eパネル種別 ) - { + public virtual void t初期化(string str項目名, EPanelType eパネル種別) { this.t初期化(str項目名, eパネル種別, "", ""); } public virtual void t初期化(string str項目名, EPanelType eパネル種別, string str説明文jp) { @@ -122,8 +106,7 @@ namespace TJAPlayer3 this.eパネル種別 = eパネル種別; this.str説明文 = (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja") ? str説明文jp : str説明文en; } - public virtual object obj現在値() - { + public virtual object obj現在値() { return null; } @@ -136,8 +119,7 @@ namespace TJAPlayer3 { return 0; } - public virtual void SetIndex( int index ) - { + public virtual void SetIndex(int index) { } } } diff --git a/OpenTaiko/src/Items/CItemInteger.cs b/OpenTaiko/src/Items/CItemInteger.cs index 0f3e1382..11f1b430 100644 --- a/OpenTaiko/src/Items/CItemInteger.cs +++ b/OpenTaiko/src/Items/CItemInteger.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace TJAPlayer3 -{ +namespace TJAPlayer3 { /// /// 「整数」を表すアイテム。 /// - internal class CItemInteger : CItemBase - { + internal class CItemInteger : CItemBase { // プロパティ public int n現在の値; @@ -17,18 +11,16 @@ namespace TJAPlayer3 // コンストラクタ - public CItemInteger() - { + 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初期値) + : this() { + this.t初期化(str項目名, n最小値, n最大値, n初期値); } public CItemInteger(string str項目名, int n最小値, int n最大値, int n初期値, string str説明文jp) : this() { @@ -39,11 +31,10 @@ namespace TJAPlayer3 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パネル種別) + : 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() { @@ -57,27 +48,21 @@ namespace TJAPlayer3 // CItemBase 実装 - public override void tEnter押下() - { + public override void tEnter押下() { this.b値がフォーカスされている = !this.b値がフォーカスされている; } - public override void t項目値を次へ移動() - { - if( ++this.n現在の値 > this.n最大値 ) - { + public override void t項目値を次へ移動() { + if (++this.n現在の値 > this.n最大値) { this.n現在の値 = this.n最大値; } } - public override void t項目値を前へ移動() - { - if( --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初期値) { + 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); @@ -86,10 +71,9 @@ namespace TJAPlayer3 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パネル種別) { + 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); @@ -101,16 +85,13 @@ namespace TJAPlayer3 this.n現在の値 = n初期値; this.b値がフォーカスされている = false; } - public override object obj現在値() - { + public override object obj現在値() { return this.n現在の値; } - public override int GetIndex() - { + public override int GetIndex() { return this.n現在の値; } - public override void SetIndex( int index ) - { + public override void SetIndex(int index) { this.n現在の値 = index; } // その他 diff --git a/OpenTaiko/src/Items/CItemList.cs b/OpenTaiko/src/Items/CItemList.cs index b6768f4d..f76c2f1a 100644 --- a/OpenTaiko/src/Items/CItemList.cs +++ b/OpenTaiko/src/Items/CItemList.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace TJAPlayer3 -{ +namespace TJAPlayer3 { /// /// 「リスト」(複数の固定値からの1つを選択可能)を表すアイテム。 /// - internal class CItemList : CItemBase - { + internal class CItemList : CItemBase { // プロパティ public List list項目値; @@ -17,26 +11,22 @@ namespace TJAPlayer3 // コンストラクタ - public CItemList() - { + 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項目名) + : this() { + this.t初期化(str項目名); } - public CItemList( string str項目名, CItemBase.EPanelType eパネル種別 ) - : this() - { - this.t初期化( str項目名, eパネル種別 ); + 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初期インデックス値, 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() { @@ -50,33 +40,26 @@ namespace TJAPlayer3 // CItemBase 実装 - public override void tEnter押下() - { + public override void tEnter押下() { this.t項目値を次へ移動(); } - public override void t項目値を次へ移動() - { - if( ++this.n現在選択されている項目番号 >= this.list項目値.Count ) - { + public override void t項目値を次へ移動() { + if (++this.n現在選択されている項目番号 >= this.list項目値.Count) { this.n現在選択されている項目番号 = 0; } } - public override void t項目値を前へ移動() - { - if( --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パネル種別 ); + 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初期インデックス値, 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項目リスト); @@ -88,16 +71,13 @@ namespace TJAPlayer3 this.list項目値.Add(str); } } - public override object obj現在値() - { - return this.list項目値[ n現在選択されている項目番号 ]; + public override object obj現在値() { + return this.list項目値[n現在選択されている項目番号]; } - public override int GetIndex() - { + public override int GetIndex() { return n現在選択されている項目番号; } - public override void SetIndex( int index ) - { + public override void SetIndex(int index) { n現在選択されている項目番号 = index; } } @@ -109,43 +89,36 @@ namespace TJAPlayer3 /// 簡易コンフィグの「切り替え」に使用する、「リスト」(複数の固定値からの1つを選択可能)を表すアイテム。 /// e種別が違うのと、tEnter押下()で何もしない以外は、「リスト」そのまま。 /// - internal class CSwitchItemList : CItemList - { + internal class CSwitchItemList : CItemList { // コンストラクタ - public CSwitchItemList() - { + 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項目名) + : this() { + this.t初期化(str項目名); } - public CSwitchItemList( string str項目名, CItemBase.EPanelType eパネル種別 ) - : this() - { - this.t初期化( str項目名, eパネル種別 ); + 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初期インデックス値, 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 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押下() - { + public override void tEnter押下() { // this.t項目値を次へ移動(); // 何もしない } } diff --git a/OpenTaiko/src/Items/CItemThreeState.cs b/OpenTaiko/src/Items/CItemThreeState.cs index 48601f57..1dcfefbf 100644 --- a/OpenTaiko/src/Items/CItemThreeState.cs +++ b/OpenTaiko/src/Items/CItemThreeState.cs @@ -1,19 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace TJAPlayer3 -{ +namespace TJAPlayer3 { /// /// 「スリーステート」(ON, OFF, 不定 の3状態)を表すアイテム。 /// - internal class CItemThreeState : CItemBase - { + internal class CItemThreeState : CItemBase { // プロパティ public E状態 e現在の状態; - public enum E状態 - { + public enum E状態 { ON, OFF, 不定 @@ -22,15 +15,13 @@ namespace TJAPlayer3 // コンストラクタ - public CItemThreeState() - { + 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初期状態) + : this() { + this.t初期化(str項目名, e初期状態); } public CItemThreeState(string str項目名, E状態 e初期状態, string str説明文jp) : this() { @@ -41,10 +32,9 @@ namespace TJAPlayer3 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パネル種別) + : this() { + this.t初期化(str項目名, e初期状態, eパネル種別); } public CItemThreeState(string str項目名, E状態 e初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp) : this() { @@ -58,14 +48,11 @@ namespace TJAPlayer3 // CItemBase 実装 - public override void tEnter押下() - { + public override void tEnter押下() { this.t項目値を次へ移動(); } - public override void t項目値を次へ移動() - { - switch( this.e現在の状態 ) - { + public override void t項目値を次へ移動() { + switch (this.e現在の状態) { case E状態.ON: this.e現在の状態 = E状態.OFF; return; @@ -79,10 +66,8 @@ namespace TJAPlayer3 return; } } - public override void t項目値を前へ移動() - { - switch( this.e現在の状態 ) - { + public override void t項目値を前へ移動() { + switch (this.e現在の状態) { case E状態.ON: this.e現在の状態 = E状態.OFF; return; @@ -96,9 +81,8 @@ namespace TJAPlayer3 return; } } - public void t初期化( string str項目名, E状態 e初期状態 ) - { - this.t初期化( str項目名, e初期状態, CItemBase.EPanelType.Normal ); + 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); @@ -107,8 +91,7 @@ namespace TJAPlayer3 this.t初期化(str項目名, e初期状態, CItemBase.EPanelType.Normal, str説明文jp, str説明文en); } - public void t初期化( string str項目名, E状態 e初期状態, CItemBase.EPanelType eパネル種別 ) - { + 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) { @@ -118,37 +101,30 @@ namespace TJAPlayer3 base.t初期化(str項目名, eパネル種別, str説明文jp, str説明文en); this.e現在の状態 = e初期状態; } - public override object obj現在値() - { - if ( this.e現在の状態 == E状態.不定 ) - { + public override object obj現在値() { + if (this.e現在の状態 == E状態.不定) { return "- -"; - } - else - { + } else { return this.e現在の状態.ToString(); } } - public override int GetIndex() - { + 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 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 71aeb10a..7f5c3751 100644 --- a/OpenTaiko/src/Items/CItemToggle.cs +++ b/OpenTaiko/src/Items/CItemToggle.cs @@ -1,30 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace TJAPlayer3 -{ +namespace TJAPlayer3 { /// /// 「トグル」(ON, OFF の2状態)を表すアイテム。 /// - internal class CItemToggle : CItemBase - { + internal class CItemToggle : CItemBase { // プロパティ public bool bON; - + // コンストラクタ - public CItemToggle() - { + 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初期状態) + : this() { + this.t初期化(str項目名, b初期状態); } public CItemToggle(string str項目名, bool b初期状態, string str説明文jp) : this() { @@ -35,9 +27,8 @@ namespace TJAPlayer3 this.t初期化(str項目名, b初期状態, str説明文jp, str説明文en); } public CItemToggle(string str項目名, bool b初期状態, CItemBase.EPanelType eパネル種別) - : this() - { - this.t初期化( str項目名, b初期状態, eパネル種別 ); + : this() { + this.t初期化(str項目名, b初期状態, eパネル種別); } public CItemToggle(string str項目名, bool b初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp) : this() { @@ -51,21 +42,17 @@ namespace TJAPlayer3 // CItemBase 実装 - public override void tEnter押下() - { + public override void tEnter押下() { this.t項目値を次へ移動(); } - public override void t項目値を次へ移動() - { + public override void t項目値を次へ移動() { this.bON = !this.bON; } - public override void t項目値を前へ移動() - { + 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初期状態) { + 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); @@ -74,8 +61,7 @@ namespace TJAPlayer3 this.t初期化(str項目名, b初期状態, CItemBase.EPanelType.Normal, str説明文jp, str説明文en); } - public void t初期化(string str項目名, bool b初期状態, CItemBase.EPanelType eパネル種別) - { + 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) { @@ -85,18 +71,14 @@ namespace TJAPlayer3 base.t初期化(str項目名, eパネル種別, str説明文jp, str説明文en); this.bON = b初期状態; } - public override object obj現在値() - { - return ( this.bON ) ? "ON" : "OFF"; + public override object obj現在値() { + return (this.bON) ? "ON" : "OFF"; } - public override int GetIndex() - { - return ( this.bON ) ? 1 : 0; + public override int GetIndex() { + return (this.bON) ? 1 : 0; } - public override void SetIndex( int index ) - { - switch ( index ) - { + public override void SetIndex(int index) { + switch (index) { case 0: this.bON = false; break; diff --git a/OpenTaiko/src/Plugins/CPluginHost.cs b/OpenTaiko/src/Plugins/CPluginHost.cs index 7a5a1b7a..5ae375f5 100644 --- a/OpenTaiko/src/Plugins/CPluginHost.cs +++ b/OpenTaiko/src/Plugins/CPluginHost.cs @@ -1,71 +1,55 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.IO; -using System.Drawing; +using System.Drawing; using FDK; -namespace TJAPlayer3 -{ - internal class CPluginHost : IPluginHost - { +namespace TJAPlayer3 { + internal class CPluginHost : IPluginHost { // コンストラクタ - public CPluginHost() - { - this._DTXManiaVersion = new CDTXVersion( TJAPlayer3.VERSION ); + public CPluginHost() { + this._DTXManiaVersion = new CDTXVersion(TJAPlayer3.VERSION); } // IPluginHost 実装 - public CDTXVersion DTXManiaVersion - { + public CDTXVersion DTXManiaVersion { get { return this._DTXManiaVersion; } } - public CTimer Timer - { + public CTimer Timer { get { return TJAPlayer3.Timer; } } - public SoundManager Sound管理 - { + public SoundManager Sound管理 { get { return TJAPlayer3.SoundManager; } } - public Size ClientSize - { + public Size ClientSize { get { return new Size(TJAPlayer3.app.Window_.Size.X, TJAPlayer3.app.Window_.Size.Y); } } - public CStage.EStage e現在のステージ - { - get { return ( TJAPlayer3.r現在のステージ != null ) ? TJAPlayer3.r現在のステージ.eStageID : CStage.EStage.None; } + public CStage.EStage e現在のステージ { + get { return (TJAPlayer3.r現在のステージ != null) ? TJAPlayer3.r現在のステージ.eStageID : CStage.EStage.None; } } - public CStage.EPhase e現在のフェーズ - { - get { return ( TJAPlayer3.r現在のステージ != null ) ? TJAPlayer3.r現在のステージ.ePhaseID : CStage.EPhase.Common_NORMAL; } + public CStage.EPhase e現在のフェーズ { + get { return (TJAPlayer3.r現在のステージ != null) ? TJAPlayer3.r現在のステージ.ePhaseID : CStage.EPhase.Common_NORMAL; } } - public bool t入力を占有する(IPluginActivity act) - { + public bool t入力を占有する(IPluginActivity act) { if (TJAPlayer3.act現在入力を占有中のプラグイン != null) return false; TJAPlayer3.act現在入力を占有中のプラグイン = act; return true; } - public bool t入力の占有を解除する(IPluginActivity act) - { + public bool t入力の占有を解除する(IPluginActivity act) { if (TJAPlayer3.act現在入力を占有中のプラグイン == null || TJAPlayer3.act現在入力を占有中のプラグイン != act) return false; TJAPlayer3.act現在入力を占有中のプラグイン = null; return true; } - public void tシステムサウンドを再生する( Eシステムサウンド sound ) - { - if( TJAPlayer3.Skin != null ) - TJAPlayer3.Skin[ sound ].tPlay(); + public void tシステムサウンドを再生する(Eシステムサウンド sound) { + if (TJAPlayer3.Skin != null) + TJAPlayer3.Skin[sound].tPlay(); } - - + + // その他 #region [ private ] diff --git a/OpenTaiko/src/Plugins/IPluginActivity.cs b/OpenTaiko/src/Plugins/IPluginActivity.cs index 845b3208..11ca3676 100644 --- a/OpenTaiko/src/Plugins/IPluginActivity.cs +++ b/OpenTaiko/src/Plugins/IPluginActivity.cs @@ -1,5 +1,4 @@ -namespace TJAPlayer3 -{ +namespace TJAPlayer3 { /// /// Activity プラグインへのインターフェース。 /// DTXMania は、IPluginActivity に対して、以下のライフサイクルを実行します。 @@ -9,14 +8,13 @@ /// (4) Direct3D デバイスのリセット時には、デバイスのリセット前に OnUnmanagedリソースの解放() を1回呼び出し、デバイスをリセットしたのち、OnUnmanagedリソースの作成() を1回呼び出します。 /// (5) Direct3D デバイスのロスト時には、デバイスの再生成前に OnUnmanagedリソースの解放()_OnManagedリソースの解放() を1回ずつ呼び出し、デバイスを再生成したのち、OnManagedリソースの作成()_OnUnmanagedリソースの作成() を1回ずつ呼び出します。 /// - public interface IPluginActivity - { + public interface IPluginActivity { /// /// プラグインの初期化を行います。 /// DTXMania の起動処理の最後(セットアップ画面が表示される直前)に、DTXMania から一度だけ呼び出されます。 /// プラグインが、ホスト(DTXMania)の情報にアクセスするためのオブジェクト。 /// - void On初期化( global::TJAPlayer3.IPluginHost PluginHost ); + void On初期化(global::TJAPlayer3.IPluginHost PluginHost); /// /// プラグインの終了処理を行います。 @@ -28,7 +26,7 @@ /// Managed リソースを作成します。 /// void OnManagedリソースの作成(); - + /// /// Unmanaged リソースを作成します。 /// @@ -52,7 +50,7 @@ /// パッド入力。他のプラグインが入力占有中である場合は null が渡されます。 /// キーボード入力。他のプラグインが入力占有中である場合は null が渡されます。 /// - void On進行描画( global::TJAPlayer3.CPad pad, FDK.IInputDevice keyboard ); + void On進行描画(global::TJAPlayer3.CPad pad, FDK.IInputDevice keyboard); /// /// ステージが変わる度に呼び出されます。 @@ -67,10 +65,10 @@ /// /// 選択されている曲のファイルの名前。絶対パス。 /// 選択されている曲のブロック内の曲番号(0~4)。 - void On選択曲変更( string str選択曲ファイル名, int n曲番号inブロック ); + void On選択曲変更(string str選択曲ファイル名, int n曲番号inブロック); - void On演奏クリア( global::TJAPlayer3.CScoreIni scoreIni ); - void On演奏失敗( global::TJAPlayer3.CScoreIni scoreIni ); - void On演奏キャンセル( global::TJAPlayer3.CScoreIni scoreIni ); + void On演奏クリア(global::TJAPlayer3.CScoreIni scoreIni); + void On演奏失敗(global::TJAPlayer3.CScoreIni scoreIni); + void On演奏キャンセル(global::TJAPlayer3.CScoreIni scoreIni); } } diff --git a/OpenTaiko/src/Plugins/IPluginHost.cs b/OpenTaiko/src/Plugins/IPluginHost.cs index 5dfff46d..4494bea3 100644 --- a/OpenTaiko/src/Plugins/IPluginHost.cs +++ b/OpenTaiko/src/Plugins/IPluginHost.cs @@ -1,13 +1,11 @@  -namespace TJAPlayer3 -{ +namespace TJAPlayer3 { /// /// プラグインホスト情報提供インターフェース。 /// プラグインでは、On初期化() で渡されるこのインターフェースオブジェクトを通じて、 /// DTXMania の持つ様々なリソースにアクセスできます。 /// - public interface IPluginHost - { + public interface IPluginHost { /// /// DTXMania のバージョンを表します。 /// @@ -40,7 +38,7 @@ namespace TJAPlayer3 /// /// 宣言するプラグイン(すなわち this を指定する) /// 占有に成功すれば true を返し、既に誰かが占有中である場合には false を返します。 - bool t入力を占有する( IPluginActivity act ); + bool t入力を占有する(IPluginActivity act); /// /// 自分以外が入力データを扱って良いことを宣言します。 @@ -48,12 +46,12 @@ namespace TJAPlayer3 /// /// 宣言するプラグイン(すなわち this を指定する) /// 占有解除に成功すれば true、失敗すれば flase を返します。 - bool t入力の占有を解除する( IPluginActivity act ); + bool t入力の占有を解除する(IPluginActivity act); /// /// 指定されたシステムサウンド/BGMを再生します。 /// /// 再生するシステムサウンドの識別子。 - void tシステムサウンドを再生する( Eシステムサウンド sound ); + void tシステムサウンドを再生する(Eシステムサウンド sound); } } diff --git a/OpenTaiko/src/Songs/CBoxDef.cs b/OpenTaiko/src/Songs/CBoxDef.cs index e16c7e33..664befba 100644 --- a/OpenTaiko/src/Songs/CBoxDef.cs +++ b/OpenTaiko/src/Songs/CBoxDef.cs @@ -1,14 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using System.IO; +using System.Diagnostics; using System.Drawing; +using System.Text; -namespace TJAPlayer3 -{ - internal class CBoxDef - { +namespace TJAPlayer3 { + internal class CBoxDef { // プロパティ public Color Color; @@ -17,9 +12,9 @@ namespace TJAPlayer3 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 BackColor; + public bool IsChangedForeColor; + public bool IsChangedBackColor; public Color BoxColor; public bool IsChangedBoxColor; public Color BgColor; @@ -35,11 +30,10 @@ namespace TJAPlayer3 // コンストラクタ - public CBoxDef() - { + public CBoxDef() { this.Genre = ""; - ForeColor = Color.White; - BackColor = Color.Black; + ForeColor = Color.White; + BackColor = Color.Black; BoxColor = Color.White; BoxType = "0"; BgType = "0"; @@ -48,129 +42,86 @@ namespace TJAPlayer3 DefaultPreimage = null; ScenePreset = ""; } - public CBoxDef( string boxdefファイル名 ) - : this() - { - this.t読み込み( boxdefファイル名 ); + public CBoxDef(string boxdefファイル名) + : this() { + this.t読み込み(boxdefファイル名); } // メソッド - public void t読み込み( string boxdefファイル名 ) - { - StreamReader reader = new StreamReader( boxdefファイル名, Encoding.GetEncoding(TJAPlayer3.sEncType) ); + public void t読み込み(string boxdefファイル名) { + StreamReader reader = new StreamReader(boxdefファイル名, Encoding.GetEncoding(TJAPlayer3.sEncType)); string str = null; - while( ( str = reader.ReadLine() ) != null ) - { - if( str.Length != 0 ) - { - try - { + 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( ';' ) ); + str = str.TrimStart(ignoreCharsWoColon); + if ((str[0] == '#') && (str[0] != ';')) { + if (str.IndexOf(';') != -1) { + str = str.Substring(0, str.IndexOf(';')); } - + char[] ignoreChars = new char[] { ':', ' ', '\t' }; var split = str.Split(':'); - if (split.Length == 2) - { + if (split.Length == 2) { string key = split[0]; string value = split[1]; - if (key == "#TITLE") - { + 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") - { + } 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") - { + } else if (key == "#SELECTBG") { this.SelectBG = value.Trim(ignoreChars); - } - else if (key == "#FONTCOLOR") - { + } else if (key == "#FONTCOLOR") { this.Color = ColorTranslator.FromHtml(value.Trim(ignoreChars)); - } - else if (key == "#FORECOLOR") - { + } else if (key == "#FORECOLOR") { this.ForeColor = ColorTranslator.FromHtml(value.Trim(ignoreChars)); IsChangedForeColor = true; - } - else if (key == "#BACKCOLOR") - { + } else if (key == "#BACKCOLOR") { this.BackColor = ColorTranslator.FromHtml(value.Trim(ignoreChars)); IsChangedBackColor = true; - } - else if (key == "#BOXCOLOR") - { + } else if (key == "#BOXCOLOR") { this.BoxColor = ColorTranslator.FromHtml(value.Trim(ignoreChars)); IsChangedBoxColor = true; - } - else if (key == "#BGCOLOR") - { + } else if (key == "#BGCOLOR") { this.BgColor = ColorTranslator.FromHtml(value.Trim(ignoreChars)); IsChangedBgColor = true; - } - else if (key == "#BGTYPE") - { + } else if (key == "#BGTYPE") { this.BgType = value.Trim(ignoreChars); IsChangedBgType = true; - } - else if (key == "#BOXTYPE") - { + } else if (key == "#BOXTYPE") { this.BoxType = value.Trim(ignoreChars); IsChangedBoxType = true; - } - else if (key == "#BOXCHARA") - { - this.BoxChara = value.Trim(ignoreChars); + } else if (key == "#BOXCHARA") { + this.BoxChara = value.Trim(ignoreChars); IsChangedBoxChara = true; - } - else if (key == "#SCENEPRESET") - { + } else if (key == "#SCENEPRESET") { this.ScenePreset = value.Trim(ignoreChars); - } - else if (key == "#DEFAULTPREIMAGE") - { + } 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()) - { + } 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)); } - 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)" ); + } catch (Exception e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (178a9a36-a59e-4264-8e4c-b3c3459db43c)"); continue; } } diff --git a/OpenTaiko/src/Songs/CCourse.cs b/OpenTaiko/src/Songs/CCourse.cs index bb72afa1..acfb2f59 100644 --- a/OpenTaiko/src/Songs/CCourse.cs +++ b/OpenTaiko/src/Songs/CCourse.cs @@ -1,48 +1,39 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; +namespace TJAPlayer3 { + public class CCourse { + //2016.11.07 kairera0467 + //とりあえずメモ代わりに + // + // + //○コースデータ(.tjc) -namespace TJAPlayer3 -{ - public class CCourse - { - //2016.11.07 kairera0467 - //とりあえずメモ代わりに - // - // - //○コースデータ(.tjc) - - //複数の曲を共通のゲージで連続して演奏します。 - //通常ゲージは某段位認定っぽい増減の仕方をします(補正なし)。 - - //また曲は自動的に再生されるため、ばいそく等のオプションの使用は出来ません。 - - //.tjcのファイルは他の譜面(.tja等)と同様に扱われるので譜面データと同じフォルダに入れても構いません。 - // - // ●ヘッダ + //複数の曲を共通のゲージで連続して演奏します。 + //通常ゲージは某段位認定っぽい増減の仕方をします(補正なし)。 - // TITLE: コースの名前。 + //また曲は自動的に再生されるため、ばいそく等のオプションの使用は出来ません。 - // COURSE: 「Easy」「Normal」「Hard」「Oni」「Edit」もしくは0-4の値。 - // 譜面の難易度。(コースと呼ぶとややこしいですがご諒承ください) - // 指定した譜面は全てここで指定する難易度の譜面が流れます。 - // 曲ごとの指定は(今のところ)できません。 + //.tjcのファイルは他の譜面(.tja等)と同様に扱われるので譜面データと同じフォルダに入れても構いません。 + // + // ●ヘッダ - // LIFE: ライフ。省略可。 - // ここに値を入れると通常ゲージの代わりにライフ制になります。 + // TITLE: コースの名前。 - // SONG: 曲データ。 - // 演奏する曲のファイル名(.tja/.tjf)をtaikojiro.exeのあるディレクトリからの相対パスで指定。 - // 指定されたデータは上にあるものから順に演奏されます。 + // COURSE: 「Easy」「Normal」「Hard」「Oni」「Edit」もしくは0-4の値。 + // 譜面の難易度。(コースと呼ぶとややこしいですがご諒承ください) + // 指定した譜面は全てここで指定する難易度の譜面が流れます。 + // 曲ごとの指定は(今のところ)できません。 + + // 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 6124d61c..c8390a8d 100644 --- a/OpenTaiko/src/Songs/CDTX.cs +++ b/OpenTaiko/src/Songs/CDTX.cs @@ -1,502 +1,445 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; +using System.Diagnostics; using System.Drawing; -using System.Diagnostics; -using System.IO; using System.Globalization; -using System.Threading; +using System.Runtime.InteropServices; +using System.Text; using System.Text.RegularExpressions; using FDK; using FDK.ExtensionMethods; -using System.Linq; -using TJAPlayer3; using SkiaSharp; - -using Point = System.Drawing.Point; using Color = System.Drawing.Color; -namespace TJAPlayer3 -{ - internal class CDTX : CActivity - { - // 定数 +namespace TJAPlayer3 { + internal class CDTX : CActivity { + // 定数 - public enum E種別 { DTX, GDA, G2D, BMS, BME, SMF } + public enum E種別 { DTX, GDA, G2D, BMS, BME, SMF } - public List listErrors = new List(); - private int nNowReadLine; - // クラス + public List listErrors = new List(); + private int nNowReadLine; + // クラス - 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 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 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 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("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("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 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 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 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 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 int n表記上の番号; + public int n内部番号; - 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("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 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 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 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発声位置; // 発声時刻を格納していた変数のうちの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; + 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; + //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 fCamScrollStartX; + public float fCamScrollStartY; + public float fCamScrollEndX; + public float fCamScrollEndY; - public float fCamRotationStart; - public float fCamRotationEnd; + public float fCamRotationStart; + public float fCamRotationEnd; - public float fCamZoomStart; - public float fCamZoomEnd; + public float fCamZoomStart; + public float fCamZoomEnd; - public float fCamScaleStartX; - public float fCamScaleStartY; - public float fCamScaleEndX; - public float fCamScaleEndY; + public float fCamScaleStartX; + public float fCamScaleStartY; + public float fCamScaleEndX; + public float fCamScaleEndY; - public Color4 borderColor; + public Color4 borderColor; - public int fObjTimeMs; - public string strObjName; - public string strObjEaseType; - public Easing.CalcType objCalcType; + public int fObjTimeMs; + public string strObjName; + public string strObjEaseType; + public Easing.CalcType objCalcType; - public float fObjX; - public float fObjY; + public float fObjX; + public float fObjY; - public float fObjStart; - public float fObjEnd; + public float fObjStart; + public float fObjEnd; - public CSongObject obj; + public CSongObject obj; - public string strTargetTxName; - public string strNewPath; + public string strTargetTxName; + public string strNewPath; - public string strConfigValue; + public string strConfigValue; - public double dbAnimInterval; + public double dbAnimInterval; - public int intFrame; + public int intFrame; - public EGameType eGameType; - // + public EGameType eGameType; + // - public bool bBPMチップである - { - get - { - if (this.nチャンネル番号 == 3 || this.nチャンネル番号 == 8) - { - return true; - } - else - { - return false; - } - } - } - 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 bool bBPMチップである { + get { + if (this.nチャンネル番号 == 3 || this.nチャンネル番号 == 8) { + return true; + } else { + return false; + } + } + } + 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 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 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() - { + 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 = - { + //2016.10.07 kairera0467 近日中に再編成予定 + string[] chToStr = + { //システム "??", "バックコーラス", "小節長変更", "BPM変更", "??", "??", "??", "??", - "BPM変更(拡張)", "??", "??", "??", "??", "??", "??", "??", + "BPM変更(拡張)", "??", "??", "??", "??", "??", "??", "??", //太鼓1P(移動予定) "??", "ドン", "カツ", "ドン(大)", "カツ(大)", "連打", "連打(大)", "ふうせん連打", - "連打終点", "芋", "ドン(手)", "カッ(手)", "Mine", "??", "??", "AD-LIB", + "連打終点", "芋", "ドン(手)", "カッ(手)", "Mine", "??", "??", "AD-LIB", //太鼓予備 "??", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", //太鼓予備 "??", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", //太鼓予備 "??", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", //システム "小節線", "拍線", "??", "??", "AVI", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", //システム(移動予定) "SCROLL", "DELAY", "ゴーゴータイム開始", "ゴーゴータイム終了", "カメラ移動開始(縦)", "カメラ移動終了(縦)", "カメラ移動開始(横)", "カメラ移動終了(横)", - "カメラズーム開始", "カメラズーム終了", "カメラ回転開始", "カメラ回転終了", "カメラスケーリング開始(横)", "カメラスケーリング終了(横)", "カメラスケーリング開始(縦)", "カメラスケーリング終了(縦)", + "カメラズーム開始", "カメラズーム終了", "カメラ回転開始", "カメラ回転終了", "カメラスケーリング開始(横)", "カメラスケーリング終了(横)", "カメラスケーリング開始(縦)", "カメラスケーリング終了(縦)", - "ボーダーカラー変更", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", + "ボーダーカラー変更", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", //太鼓1P、システム(現行) "??", "??", "??", "太鼓_赤", "太鼓_青", "太鼓_赤(大)", "太鼓_青(大)", "太鼓_黄", - "太鼓_黄(大)", "太鼓_風船", "太鼓_連打末端", "太鼓_芋", "??", "SCROLL", "ゴーゴータイム開始", "ゴーゴータイム終了", + "太鼓_黄(大)", "太鼓_風船", "太鼓_連打末端", "太鼓_芋", "??", "SCROLL", "ゴーゴータイム開始", "ゴーゴータイム終了", - "??", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "太鼓 AD-LIB", + "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "太鼓 AD-LIB", - "??", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "??", "??", "0xC4", "0xC5", "0xC6", "??", - "??", "??", "0xCA", "??", "??", "??", "??", "0xCF", + "??", "??", "??", "??", "0xC4", "0xC5", "0xC6", "??", + "??", "??", "0xCA", "??", "??", "??", "??", "0xCF", //システム(現行) "0xD0", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "ミキサー追加", "ミキサー削除", "DELAY", "譜面分岐リセット", "譜面分岐アニメ", "譜面分岐内部処理", + "??", "??", "ミキサー追加", "ミキサー削除", "DELAY", "譜面分岐リセット", "譜面分岐アニメ", "譜面分岐内部処理", //システム(現行) "小節線ON/OFF", "分岐固定", "判定枠移動", "", "", "", "", "", - "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", - "0xF0", "歌詞", "??", "SUDDEN", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", "譜面終了", + "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; + "??", "??", "??", "??", "??", "??", "??", "??", + }; + 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; - TJAPlayer3.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 - { + if (this.nチャンネル番号 == 0x01) // WAV + { + CDTX.CWAV wc; + TJAPlayer3.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; TJAPlayer3.DTX.listVD.TryGetValue(this.n整数値_内部番号, out wc); - if (wc == null) - { + if (wc == null) { nDuration = 0; - } - else - { + } else { nDuration = (int)(wc.Duration * 1000); } - } + } - double _db再生速度 = (TJAPlayer3.DTXVmode.Enabled) ? TJAPlayer3.DTX.dbDTXVPlaySpeed : TJAPlayer3.DTX.db再生速度; - return (int)(nDuration / _db再生速度); - } + double _db再生速度 = (TJAPlayer3.DTXVmode.Enabled) ? TJAPlayer3.DTX.dbDTXVPlaySpeed : TJAPlayer3.DTX.db再生速度; + return (int)(nDuration / _db再生速度); + } - #region [ IComparable 実装 ] - //----------------- + #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 + 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 @@ -515,763 +458,717 @@ namespace TJAPlayer3 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[TJAPlayer3.ConfigIni.nPoliphonicSounds]; // 4 - public int SongVol = CSound.DefaultSongVol; - public LoudnessMetadata? SongLoudnessMetadata = null; - public int n現在再生中のサウンド番号; - public long[] n再生開始時刻 = new long[TJAPlayer3.ConfigIni.nPoliphonicSounds]; // 4 - public int n内部番号; - public int n表記上の番号; - public CSound[] rSound = new CSound[TJAPlayer3.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 < TJAPlayer3.ConfigIni.nPoliphonicSounds; i++) // 4 - { - if (this.rSound[i] != null) - TJAPlayer3.SoundManager.tDisposeSound(this.rSound[i]); - this.rSound[i] = null; - - if ((i == 0) && TJAPlayer3.ConfigIni.bLog作成解放ログ出力) - 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タイプ; - } - - // プロパティ - - - 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 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[TJAPlayer3.ConfigIni.nPoliphonicSounds]; // 4 + public int SongVol = CSound.DefaultSongVol; + public LoudnessMetadata? SongLoudnessMetadata = null; + public int n現在再生中のサウンド番号; + public long[] n再生開始時刻 = new long[TJAPlayer3.ConfigIni.nPoliphonicSounds]; // 4 + public int n内部番号; + public int n表記上の番号; + public CSound[] rSound = new CSound[TJAPlayer3.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 < TJAPlayer3.ConfigIni.nPoliphonicSounds; i++) // 4 + { + if (this.rSound[i] != null) + TJAPlayer3.SoundManager.tDisposeSound(this.rSound[i]); + this.rSound[i] = null; + + if ((i == 0) && TJAPlayer3.ConfigIni.bLog作成解放ログ出力) + 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タイプ; + } + + // プロパティ + + + 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; + 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 double[] dbNowSCROLL_Normal; + private double[] dbNowSCROLL_Expert; + private double[] dbNowSCROLL_Master; - private int nNextSongOffset; + 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オフセット; + 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 n現在の小節数 = 1; - private int nNowRoll = 0; - private int nNowRollCount = 0; - private int[] nNowRollCountBranch = new int[3]; + 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; + 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[] bHasBranch = new bool[(int)Difficulty.Total] { false, false, false, false, false, false, false }; - public bool[] bHasBranchDan = new bool[1] { false }; + public bool[] bHasBranchDan = new bool[1] { false }; - //分岐関連 - private ECourse n現在のコース = ECourse.eNormal; + //分岐関連 + 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]; + private bool b最初の分岐である; + public int[] nノーツ数 = new int[4]; //3:共通 - public int[] nノーツ数_Branch = new int[4]; // - public CChip[] pDan_LastChip; - public int[] n風船数 = new int[4]; //0~2:各コース 3:共通 + public int[] nDan_NotesCount = new int[1]; + public int[] nDan_BalloonCount = new int[1]; + // public int[] nDan_BallonCount = new int[1]; - private List listLine; - private int nLineCountTemp; //分岐開始時の小節数を記録。 - private ECourse nLineCountCourseTemp = ECourse.eNormal; //現在カウント中のコースを記録。 + public int[] nノーツ数_Branch = new int[4]; // + public CChip[] pDan_LastChip; + public int[] n風船数 = new int[4]; //0~2:各コース 3:共通 - 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 List listLine; + private int nLineCountTemp; //分岐開始時の小節数を記録。 + private ECourse nLineCountCourseTemp = ECourse.eNormal; //現在カウント中のコースを記録。 - 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 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=コース - public int[] bBARLINECUE = new int[2]; //命令を入れた次の小節の操作を実現するためのフラグ。0 = mainflag, 1 = cuetype - public bool b小節線を挿入している = false; + 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; - //Normal Regular Masterにしたいけどここは我慢。 - private List listBalloon_Normal; - private List listBalloon_Expert; - private List listBalloon_Master; - private List listBalloon; //旧構文用 + public int[] bBARLINECUE = new int[2]; //命令を入れた次の小節の操作を実現するためのフラグ。0 = mainflag, 1 = cuetype + public bool b小節線を挿入している = false; - public List listLyric; //歌詞を格納していくリスト。スペル忘れた(ぉい - public List listLyric2; + //Normal Regular Masterにしたいけどここは我慢。 + private List listBalloon_Normal; + private List listBalloon_Expert; + private List listBalloon_Master; + private List listBalloon; //旧構文用 - //public Dictionary kusudaMAP = new Dictionary(); + public List listLyric; //歌詞を格納していくリスト。スペル忘れた(ぉい + public List listLyric2; - public bool usingLyricsFile; //If lyric file is used (VTT/LRC), ignore #LYRIC tags & do not parse other lyric file tags + //public Dictionary kusudaMAP = new Dictionary(); - private int listBalloon_Normal_数値管理; - private int listBalloon_Expert_数値管理; - private int listBalloon_Master_数値管理; + public bool usingLyricsFile; //If lyric file is used (VTT/LRC), ignore #LYRIC tags & do not parse other lyric file tags - public string scenePreset; + private int listBalloon_Normal_数値管理; + private int listBalloon_Expert_数値管理; + private int listBalloon_Master_数値管理; - public bool[] b譜面が存在する = new bool[(int)Difficulty.Total]; + public string scenePreset; - private string[] dlmtSpace = { " " }; - private string[] dlmtEnter = { "\n" }; - private string[] dlmtCOURSE = { "COURSE:" }; + public bool[] b譜面が存在する = new bool[(int)Difficulty.Total]; - private int nスクロール方向 = 0; - //2015.09.18 kairera0467 - //バタフライスライドみたいなアレをやりたいがために実装。 - //次郎2みたいな複素数とかは意味不明なので、方向を指定してスクロールさせることにした。 - //0:通常 - //1:上 - //2:下 - //3:右上 - //4:右下 - //5:左 - //6:左上 - //7:左下 + private string[] dlmtSpace = { " " }; + private string[] dlmtEnter = { "\n" }; + private string[] dlmtCOURSE = { "COURSE:" }; - public string strBGIMAGE_PATH; - public string strBGVIDEO_PATH; + private int nスクロール方向 = 0; + //2015.09.18 kairera0467 + //バタフライスライドみたいなアレをやりたいがために実装。 + //次郎2みたいな複素数とかは意味不明なので、方向を指定してスクロールさせることにした。 + //0:通常 + //1:上 + //2:下 + //3:右上 + //4:右下 + //5:左 + //6:左上 + //7:左下 - public double db出現時刻; - public double db移動待機時刻; + public string strBGIMAGE_PATH; + public string strBGVIDEO_PATH; - public string strBGM_PATH; - public int SongVol; - public LoudnessMetadata? SongLoudnessMetadata; + public double db出現時刻; + public double db移動待機時刻; - public bool bHIDDENBRANCH; //2016.04.01 kairera0467 選曲画面上、譜面分岐開始前まで譜面分岐の表示を隠す - public bool bGOGOTIME; //2018.03.11 kairera0467 + public string strBGM_PATH; + public int SongVol; + public LoudnessMetadata? SongLoudnessMetadata; - public bool[] IsBranchBarDraw = new bool[4]; // 仕様変更により、黄色lineの表示法を変更.2020.04.21.akasoko26 - public bool IsEndedBranching = true; // BRANCHENDが呼び出されたかどうか - public Dan_C[] Dan_C; + public bool bHIDDENBRANCH; //2016.04.01 kairera0467 選曲画面上、譜面分岐開始前まで譜面分岐の表示を隠す + public bool bGOGOTIME; //2018.03.11 kairera0467 - public bool IsEnabledFixSENote; - public int FixSENote; - public GaugeIncreaseMode GaugeIncreaseMode; + public bool[] IsBranchBarDraw = new bool[4]; // 仕様変更により、黄色lineの表示法を変更.2020.04.21.akasoko26 + public bool IsEndedBranching = true; // BRANCHENDが呼び出されたかどうか + public Dan_C[] Dan_C; - #region [ EXTENDED VARiABLES ] - public Dictionary listObj; - public Dictionary listTextures; - public Dictionary listOriginalTextures; - #endregion + public bool IsEnabledFixSENote; + public int FixSENote; + public GaugeIncreaseMode GaugeIncreaseMode; + + #region [ EXTENDED VARiABLES ] + public Dictionary listObj; + public Dictionary listTextures; + public Dictionary listOriginalTextures; + #endregion @@ -1281,110 +1178,108 @@ namespace TJAPlayer3 // public bool bGUITAR演奏で直前のGUITARを消音する; // public bool bBASS演奏で直前のBASSを消音する; #endif - // コンストラクタ + // コンストラクタ - 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 = TJAPlayer3.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]; + 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 = TJAPlayer3.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 + #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 = TJAPlayer3.ConfigIni.nPoliphonicSounds; - this.dbDTXVPlaySpeed = 1.0f; + 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 = TJAPlayer3.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; - } + //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.dbBarLength = 1.0; - this.b最初の分岐である = true; + this.b最初の分岐である = true; - this.SongVol = CSound.DefaultSongVol; - this.SongLoudnessMetadata = null; + this.SongVol = CSound.DefaultSongVol; + this.SongLoudnessMetadata = null; - GaugeIncreaseMode = GaugeIncreaseMode.Normal; + GaugeIncreaseMode = GaugeIncreaseMode.Normal; #if TEST_NOTEOFFMODE this.bHH演奏で直前のHHを消音する = true; @@ -1392,13 +1287,13 @@ namespace TJAPlayer3 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; + 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全入力文字列, int difficulty) : this() { @@ -1418,13 +1313,12 @@ namespace TJAPlayer3 this.t入力_全入力文字列から(str全入力文字列, str全入力文字列, db再生速度, nBGMAdjust, difficulty); } */ - 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 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 nReadVersion, int difficulty) : this() { @@ -1432,175 +1326,139 @@ namespace TJAPlayer3 this.t入力(strファイル名, bヘッダのみ, db再生速度, nBGMAdjust, nReadVersion, 0, false, difficulty); } */ - public CDTX(string strファイル名, bool bヘッダのみ, double db再生速度, int nBGMAdjust, int nReadVersion, int nPlayerSide, bool bSession, int difficulty) - : this() - { - this.Activate(); - this.t入力(strファイル名, bヘッダのみ, db再生速度, nBGMAdjust, nReadVersion, nPlayerSide, bSession, difficulty); - } + public CDTX(string strファイル名, bool bヘッダのみ, double db再生速度, int nBGMAdjust, int nReadVersion, int nPlayerSide, bool bSession, int difficulty) + : this() { + this.Activate(); + this.t入力(strファイル名, bヘッダのみ, db再生速度, nBGMAdjust, nReadVersion, nPlayerSide, bSession, difficulty); + } - // メソッド + // メソッド - public void tAVIの読み込み() - { - if (!this.bヘッダのみ) - { - if (this.listVD != null) - { - foreach (CVideoDecoder cvd in this.listVD.Values) - { - cvd.InitRead(); - cvd.dbPlaySpeed = TJAPlayer3.ConfigIni.SongPlaybackSpeed; - } - } - } - } + public void tAVIの読み込み() { + if (!this.bヘッダのみ) { + if (this.listVD != null) { + foreach (CVideoDecoder cvd in this.listVD.Values) { + cvd.InitRead(); + cvd.dbPlaySpeed = TJAPlayer3.ConfigIni.SongPlaybackSpeed; + } + } + } + } - 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]; - //Trace.TraceInformation( "再生位置自動補正: {0}, seek先={1}ms, 全音長={2}ms", - // Path.GetFileName( wc.rSound[ 0 ].strファイル名 ), - // nAbsTimeFromStartPlaying, - // wc.rSound[ 0 ].n総演奏時間ms - //); - // wc.rSound[ i ].t再生位置を変更する( wc.rSound[ i ].t時刻から位置を返す( nAbsTimeFromStartPlaying ) ); - // WASAPI/ASIO用↓ - if (!TJAPlayer3.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(); - } - else - { - cwav.rSound[i].Stop(); - } - } - } - } - } - public void tWAVの読み込み(CWAV cwav) - { - string str = string.IsNullOrEmpty(this.PATH_WAV) ? this.strフォルダ名 : this.PATH_WAV; - str = str + cwav.strファイル名; + 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]; + //Trace.TraceInformation( "再生位置自動補正: {0}, seek先={1}ms, 全音長={2}ms", + // Path.GetFileName( wc.rSound[ 0 ].strファイル名 ), + // nAbsTimeFromStartPlaying, + // wc.rSound[ 0 ].n総演奏時間ms + //); + // wc.rSound[ i ].t再生位置を変更する( wc.rSound[ i ].t時刻から位置を返す( nAbsTimeFromStartPlaying ) ); + // WASAPI/ASIO用↓ + if (!TJAPlayer3.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(); + } else { + cwav.rSound[i].Stop(); + } + } + } + } + } + public void tWAVの読み込み(CWAV cwav) { + string str = string.IsNullOrEmpty(this.PATH_WAV) ? this.strフォルダ名 : this.PATH_WAV; + str = str + cwav.strファイル名; - try - { - #region [ 同時発音数を、チャンネルによって変える ] + try { + #region [ 同時発音数を、チャンネルによって変える ] - int nPoly = nPolyphonicSounds; - if (TJAPlayer3.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; - } + int nPoly = nPolyphonicSounds; + if (TJAPlayer3.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; + if (cwav.bIsBGMSound) nPoly = 1; - #endregion + #endregion - for (int i = 0; i < nPoly; i++) - { - try - { - cwav.rSound[i] = TJAPlayer3.SoundManager.tCreateSound(str, ESoundGroup.SongPlayback); + for (int i = 0; i < nPoly; i++) { + try { + cwav.rSound[i] = TJAPlayer3.SoundManager.tCreateSound(str, ESoundGroup.SongPlayback); - if (!TJAPlayer3.ConfigIni.bDynamicBassMixerManagement) - { - cwav.rSound[i].AddBassSoundFromMixer(); - } + if (!TJAPlayer3.ConfigIni.bDynamicBassMixerManagement) { + cwav.rSound[i].AddBassSoundFromMixer(); + } - if (TJAPlayer3.ConfigIni.bLog作成解放ログ出力) - { - 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()); + if (TJAPlayer3.ConfigIni.bLog作成解放ログ出力) { + 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; - } + for (int j = 0; j < nPolyphonicSounds; j++) { + cwav.rSound[j] = null; + } - //continue; - } - } + //continue; + } + } - public static string tZZ(int n) - { - if (n < 0 || n >= 36 * 36) - return "!!"; // オーバー/アンダーフロー。 + public static string tZZ(int n) { + if (n < 0 || n >= 36 * 36) + return "!!"; // オーバー/アンダーフロー。 - // n を36進数2桁の文字列にして返す。 + // n を36進数2桁の文字列にして返す。 - string str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - return new string(new char[] { str[n / 36], str[n % 36] }); - } + string str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + return new string(new char[] { str[n / 36], str[n % 36] }); + } - public static void tManageKusudama(CDTX[] dtxarr) - { - if (TJAPlayer3.ConfigIni.nPlayerCount == 1) return; + public static void tManageKusudama(CDTX[] dtxarr) { + if (TJAPlayer3.ConfigIni.nPlayerCount == 1) return; // Replace non-shared kusudamas by balloons #region [Sync check] - /* + /* for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { CDTX dtx = dtxarr[i]; @@ -1622,11 +1480,11 @@ namespace TJAPlayer3 } } */ - #endregion + #endregion - // Stack balloon values to all remining (= existing) kusudamas to player 1 - #region [Accumulation] - /* + // Stack balloon values to all remining (= existing) kusudamas to player 1 + #region [Accumulation] + /* CDTX dtx1 = dtxarr[0]; if (dtx1 == null) return; foreach (KeyValuePair kvp in dtx1.kusudaMAP) @@ -1657,4410 +1515,3796 @@ namespace TJAPlayer3 } */ - #endregion - } - - public void tApplyFunMods(int player = 0) - { - Random rnd = new System.Random(); - - var eFun = TJAPlayer3.ConfigIni.nFunMods[TJAPlayer3.GetActualPlayer(player)]; - var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.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); - - if (n < bombFactor) chip.nチャンネル番号 = 0x1C; - } - - 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(); - - var eRandom = TJAPlayer3.ConfigIni.eRandom[TJAPlayer3.GetActualPlayer(player)]; - - 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; - 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 (TJAPlayer3.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(TJAPlayer3.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 (TJAPlayer3.ConfigIni.b演奏速度が一倍速であるとき以外音声を再生しない && TJAPlayer3.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 = TJAPlayer3.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. - TJAPlayer3.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) - { - //long num1 = cwav.n一時停止時刻[ i ]; - //long num2 = cwav.n再生開始時刻[ i ]; - 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ヘッダのみ, int difficulty) - { - this.t入力(strファイル名, bヘッダのみ, 1.0, 0, 0, 0, false, difficulty); - } - public void t入力(string strファイル名, bool bヘッダのみ, double db再生速度, int nBGMAdjust, int nReadVersion, 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"); - - //if ( this.e種別 != E種別.SMF ) - { - try - { - this.nPlayerSide = nPlayerSide; - this.bSession譜面を読み込む = bSession; - if (nReadVersion != 0) - { - //DTX方式 - - //DateTime timeBeginLoad = DateTime.Now; - //TimeSpan span; - string[] files = Directory.GetFiles(this.strフォルダ名, "*.tja"); - - StreamReader reader = new StreamReader(strファイル名, Encoding.GetEncoding(TJAPlayer3.sEncType)); - string str2 = reader.ReadToEnd(); - reader.Close(); - - //StreamReader reader2 = new StreamReader( this.strフォルダ名 + "test.tja", Encoding.GetEncoding( "Shift_JIS" ) ); - StreamReader reader2 = new StreamReader(files[0], Encoding.GetEncoding(TJAPlayer3.sEncType)); - string str3 = reader2.ReadToEnd(); - reader2.Close(); - - //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); - //Trace.TraceInformation( "DTXfileload時間: {0}", span.ToString() ); - - this.t入力_全入力文字列から(str2, str3, db再生速度, nBGMAdjust, difficulty); - } - else - { - //次郎方式 - - //DateTime timeBeginLoad = DateTime.Now; - //TimeSpan span; - - StreamReader reader = new StreamReader(strファイル名, Encoding.GetEncoding(TJAPlayer3.sEncType)); - string str2 = reader.ReadToEnd(); - reader.Close(); - - //StreamReader reader2 = new StreamReader( this.strフォルダ名 + "test.tja", Encoding.GetEncoding( "Shift_JIS" ) ); - //StreamReader reader2 = new StreamReader( strファイル名, Encoding.GetEncoding( "Shift_JIS" ) ); - //string str3 = reader2.ReadToEnd(); - //reader2.Close(); - string str3 = str2; - - //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); - //Trace.TraceInformation( "DTXfileload時間: {0}", span.ToString() ); - - this.t入力_全入力文字列から(str2, str3, db再生速度, nBGMAdjust, difficulty); - } - } - catch (Exception ex) - { - //MessageBox.Show( "おや?エラーが出たようです。お兄様。" ); - Trace.TraceError("おや?エラーが出たようです。お兄様。"); - Trace.TraceError(ex.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (79ff8639-9b3c-477f-bc4a-f2eea9784860)"); - } - } - } - public void t入力_全入力文字列から(string str全入力文字列, int difficulty) - { - this.t入力_全入力文字列から(str全入力文字列, str全入力文字列, 1.0, 0, difficulty); - } - public void t入力_全入力文字列から(string str全入力文字列, string str1, double db再生速度, int nBGMAdjust, int Difficulty) - { - //DateTime timeBeginLoad = DateTime.Now; - //TimeSpan span; - - if (!string.IsNullOrEmpty(str全入力文字列)) - { - #region [ 改行カット ] - this.db再生速度 = db再生速度; - str全入力文字列 = str全入力文字列.Replace(Environment.NewLine, "\n"); - str全入力文字列 = str全入力文字列.Replace('\t', ' '); - str全入力文字列 = str全入力文字列 + "\n"; - #endregion - //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); - //Trace.TraceInformation( "改行カット時間: {0}", span.ToString() ); - //timeBeginLoad = DateTime.Now; - #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 - CharEnumerator ce = str全入力文字列.GetEnumerator(); - if (ce.MoveNext()) - { - this.n現在の行数 = 1; - do - { - if (!this.t入力_空白と改行をスキップする(ref ce)) - { - break; - } - if (this.listChip.Count == 0) - { - //this.t入力(str1); - //this.t入力_V3( str1, 3 ); - this.t入力_V4(str1, Difficulty); - } - if (ce.Current == '#') - { - if (ce.MoveNext()) - { - StringBuilder builder = new StringBuilder(0x20); - if (this.t入力_コマンド文字列を抜き出す(ref ce, ref builder)) - { - StringBuilder builder2 = new StringBuilder(0x400); - if (this.t入力_パラメータ文字列を抜き出す(ref ce, ref builder2)) - { - StringBuilder builder3 = new StringBuilder(0x400); - if (this.t入力_コメント文字列を抜き出す(ref ce, ref builder3)) - { - this.t入力_行解析(ref builder, ref builder2, ref builder3); - - this.n現在の行数++; - continue; - } - } - } - } - break; - } - //this.t入力(str1); - } - while (this.t入力_コメントをスキップする(ref ce)); - - #endregion - //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); - //Trace.TraceInformation( "抜き出し時間: {0}", span.ToString() ); - //timeBeginLoad = DateTime.Now; - this.n無限管理WAV = null; - this.n無限管理BPM = null; - this.n無限管理PAN = null; - this.n無限管理SIZE = null; - //this.t入力_行解析ヘッダ( str1 ); - 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 - //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); - //Trace.TraceInformation( "前準備完了時間: {0}", span.ToString() ); - //timeBeginLoad = DateTime.Now; - #region [ CWAV初期化 ] - foreach (CWAV cwav in this.listWAV.Values) - { - if (cwav.nチップサイズ < 0) - { - cwav.nチップサイズ = 100; - } - if (cwav.n位置 <= -10000) - { - cwav.n位置 = 0; - } - } - #endregion - //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); - //Trace.TraceInformation( "CWAV前準備時間: {0}", span.ToString() ); - //timeBeginLoad = DateTime.Now; - #region [ チップ倍率設定 ] // #28145 2012.4.22 yyagi 二重ループを1重ループに変更して高速化) - //foreach ( CWAV cwav in this.listWAV.Values ) - //{ - // foreach( CChip chip in this.listChip ) - // { - // if( chip.n整数値_内部番号 == cwav.n内部番号 ) - // { - // chip.dbチップサイズ倍率 = ( (double) cwav.nチップサイズ ) / 100.0; - // if (chip.nチャンネル番号 == 0x01 ) // BGMだったら - // { - // cwav.bIsOnBGMLane = true; - // } - // } - // } - //} - foreach (CChip chip in this.listChip) - { - if (this.listWAV.TryGetValue(chip.n整数値_内部番号, out CWAV cwav)) - //foreach ( CWAV cwav in this.listWAV.Values ) - { - // if ( chip.n整数値_内部番号 == cwav.n内部番号 ) - // { - chip.dbチップサイズ倍率 = ((double)cwav.nチップサイズ) / 100.0; - //if ( chip.nチャンネル番号 == 0x01 ) // BGMだったら - //{ - // cwav.bIsOnBGMLane = true; - //} - // } - } - } - #endregion - //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); - //Trace.TraceInformation( "CWAV全準備時間: {0}", span.ToString() ); - //timeBeginLoad = DateTime.Now; - #region [ 必要に応じて空打ち音を0小節に定義する ] - //for ( int m = 0xb1; m <= 0xbc; m++ ) // #28146 2012.4.21 yyagi; bb -> bc - //{ - // foreach ( CChip chip in this.listChip ) - // { - // if ( chip.nチャンネル番号 == m ) - // { - // CChip c = new CChip(); - // c.n発声位置 = 0; - // c.nチャンネル番号 = chip.nチャンネル番号; - // c.n整数値 = chip.n整数値; - // c.n整数値_内部番号 = chip.n整数値_内部番号; - // this.listChip.Insert( 0, c ); - // break; - // } - // } - //} - #endregion - //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); - //Trace.TraceInformation( "空打確認時間: {0}", span.ToString() ); - //timeBeginLoad = DateTime.Now; - #region [ 拍子_拍線の挿入 ] - if (this.listChip.Count > 0) - { - this.listChip.Sort(); // 高速化のためにはこれを削りたいが、listChipの最後がn発声位置の終端である必要があるので、 - // 保守性確保を優先してここでのソートは残しておく - // なお、093時点では、このソートを削除しても動作するようにはしてある。 - // (ここまでの一部チップ登録を、listChip.Add(c)から同Insert(0,c)に変更してある) - // これにより、数ms程度ながらここでのソートも高速化されている。 - - //double barlength = 1.0; - //int nEndOfSong = ( this.listChip[ this.listChip.Count - 1 ].n発声位置 + 384 ) - ( this.listChip[ this.listChip.Count - 1 ].n発声位置 % 384 ); - //for ( int tick384 = 0; tick384 <= nEndOfSong; tick384 += 384 ) // 小節線の挿入 (後に出てくる拍子線とループをまとめようとするなら、forループの終了条件の微妙な違いに注意が必要) - //{ - // CChip chip = new CChip(); - // chip.n発声位置 = tick384; - // chip.nチャンネル番号 = 0x50; // 小節線 - // chip.n整数値 = 36 * 36 - 1; - // chip.dbSCROLL = 1.0; - // this.listChip.Add( chip ); - //} - ////this.listChip.Sort(); // ここでのソートは不要。ただし最後にソートすること - //int nChipNo_BarLength = 0; - //int nChipNo_C1 = 0; - - //this.listChip.Sort(); - } - #endregion - //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); - //Trace.TraceInformation( "拍子_拍線挿入時間: {0}", span.ToString() ); - //timeBeginLoad = DateTime.Now; - #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 - //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); - //Trace.TraceInformation( "C2 [拍線_小節線表示指定]: {0}", span.ToString() ); - //timeBeginLoad = DateTime.Now; - this.n内部番号BRANCH1to = 0; - this.n内部番号JSCROLL1to = 0; - #region [ 発声時刻の計算 ] - double bpm = 120.0; - //double dbBarLength = 1.0; - int n発声位置 = 0; - int ms = 0; - int nBar = 0; - int nCount = 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チャンネル番号 == 0x02) { } - //else if( chip.nチャンネル番号 == 0x03 ){} - 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チャンネル番号; - - nCount++; - this.nNowRollCount++; - for (int i = 0; i < this.nNowRollCountBranch.Length; i++) - this.nNowRollCountBranch[i]++; - - switch (ch) - { - case 0x01: - { - n発声位置 = chip.n発声位置; - - 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); - } - } - - - 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; - //chip.n発声時刻ms += this.nDELAY; - //chip.dbBPM = this.dbNowBPM; - //chip.dbSCROLL = this.dbNowSCROLL; - - if (this.n内部番号BRANCH1to + 1 > this.listBRANCH.Count) - continue; - - if (this.listBRANCH[this.n内部番号BRANCH1to].n現在の小節 == nBar) - { - chip.bBranch = true; - this.n内部番号BRANCH1to++; - } - - //switch (this.n現在のコース) - //{ - // case 0: - // chip.dbSCROLL = this.dbNowSCROLL_Normal; - // break; - // case 1: - // chip.dbSCROLL = this.dbNowSCROLL_Expert; - // break; - // case 2: - // chip.dbSCROLL = this.dbNowSCROLL_Master; - // break; - //} - - //if( this.bBarLine == true ) - // chip.b可視 = true; - //else - // chip.b可視 = false; - - //if( this.b次の小節が分岐である ) - //{ - // chip.bBranch = true; - // this.b次の小節が分岐である = false; - //} - 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; - } - - //chip.dbBPM = this.dbNowBPM; - //chip.dbSCROLL = this.dbNowSCROLL; - this.nNowRoll = this.nNowRollCount - 1; - - //chip.nノーツ終了時刻ms = ms + ( (int) ( ( ( 0x271 * ( chip.nノーツ終了位置 - n発声位置 ) ) * dbBarLength ) / bpm ) ); - - #region[チップ番号を記録] - //switch(chip.nコース) - //{ - // case 0: - // this.n連打チップ_temp[0] = this.nNowRoll; - // this.dbSCROLL_temp[0] = this.dbNowSCROLL; - // break; - // case 1: - // this.n連打チップ_temp[1] = this.nNowRoll; - // this.dbSCROLL_temp[1] = this.dbNowSCROLL; - // break; - // case 2: - // this.n連打チップ_temp[2] = this.nNowRoll; - // this.dbSCROLL_temp[2] = this.dbNowSCROLL; - // break; - //} - - #endregion - - continue; - } - case 0x9A: - { - - if (this.bOFFSETの値がマイナスである) - { - chip.n発声時刻ms += this.nOFFSET; - } - //chip.n発声時刻ms += this.nDELAY; - //chip.dbBPM = this.dbNowBPM; - //chip.dbSCROLL = this.dbNowSCROLL; - - #region[チップ番号を記録] - //風船は現時点では未実装のため処理しない。 - - - //switch (chip.nコース) - //{ - // case 0: - // if (this.listChip[this.n連打チップ_temp[0]].nチャンネル番号 == 0x99) break; - // this.listChip[this.n連打チップ_temp[0]].nノーツ終了時刻ms = chip.n発声時刻ms; - // this.listChip[this.n連打チップ_temp[0]].dbSCROLL = this.dbSCROLL_temp[0]; - // break; - // case 1: - // if (this.listChip[this.n連打チップ_temp[1]].nチャンネル番号 == 0x99) break; - // this.listChip[this.n連打チップ_temp[1]].nノーツ終了時刻ms = chip.n発声時刻ms; - // this.listChip[this.n連打チップ_temp[1]].dbSCROLL = this.dbSCROLL_temp[1]; - // break; - // case 2: - // if (this.listChip[this.n連打チップ_temp[2]].nチャンネル番号 == 0x99) break; - // this.listChip[this.n連打チップ_temp[2]].nノーツ終了時刻ms = chip.n発声時刻ms; - // this.listChip[this.n連打チップ_temp[2]].dbSCROLL = this.dbSCROLL_temp[2]; - // break; - //} - - #endregion - - //this.listChip[this.nNowRoll].nノーツ終了時刻ms = chip.n発声時刻ms; - //this.listChip[this.nNowRoll].dbSCROLL = this.dbNowSCROLL; - //this.listChip[this.nNowRoll].dbBPM = this.dbNowBPM; - continue; - } - case 0x9D: - { - //if ( this.listSCROLL.ContainsKey( chip.n整数値_内部番号 ) ) - //{ - //this.dbNowSCROLL = ( ( this.listSCROLL[ chip.n整数値_内部番号 ].n表記上の番号 == 0 ) ? 0.0 : 1.0 ) + this.listSCROLL[ chip.n整数値_内部番号 ].dbSCROLL値; - //} - - //switch (chip.nコース) - //{ - // case 0: - // this.dbNowSCROLL_Normal = this.dbNowSCROLL; - // this.n現在のコース = 0; - // break; - // case 1: - // this.dbNowSCROLL_Expert = this.dbNowSCROLL; - // this.n現在のコース = 1; - // break; - // case 2: - // this.dbNowSCROLL_Master = this.dbNowSCROLL; - // this.n現在のコース = 2; - // break; - //} - - continue; - } - case 0xDC: - { - if (this.bOFFSETの値がマイナスである) - chip.n発声時刻ms += this.nOFFSET; - //if ( this.listDELAY.ContainsKey( chip.n整数値_内部番号 ) ) - //{ - // this.nDELAY = ( ( this.listDELAY[ chip.n整数値_内部番号 ].n表記上の番号 == 0 ) ? 0 : 0 ) + this.listDELAY[ chip.n整数値_内部番号 ].nDELAY値; - //} - 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; - //if ( this.listBRANCH.ContainsKey( chip.n整数値_内部番号 ) ) - //{ - //this.listBRANCH[chip.n整数値_内部番号].db分岐時間ms = chip.n発声時刻ms + ( this.bOFFSETの値がマイナスである ? this.nOFFSET : 0 ); - //} - - continue; - } - case 0xE0: - { - //if (this.bOFFSETの値がマイナスである) - // chip.n発声時刻ms += this.nOFFSET; - - //chip.dbBPM = this.dbNowBPM; - //chip.dbSCROLL = this.dbNowSCROLL; - //if( chip.n整数値_内部番号 == 1 ) - // this.bBarLine = false; - //else - // this.bBarLine = true; - continue; - } - default: - { - if (this.bOFFSETの値がマイナスである) - chip.n発声時刻ms += this.nOFFSET; - //chip.n発声時刻ms += this.nDELAY; - chip.dbBPM = this.dbNowBPM; - //chip.dbSCROLL = this.dbNowSCROLL; - continue; - } - } - } - if (this.db再生速度 > 0.0) - { - double _db再生速度 = (TJAPlayer3.DTXVmode.Enabled) ? this.dbDTXVPlaySpeed : 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 - //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); - //Trace.TraceInformation( "発声時刻計算: {0}", span.ToString() ); - //timeBeginLoad = DateTime.Now; - - #region[listlyricを時間順に並び替え。] - this.listLyric2 = tmplistlyric; - this.listLyric2.Sort((a, b) => a.Time.CompareTo(b.Time)); - #endregion - - this.nBGMAdjust = 0; - this.t各自動再生音チップの再生時刻を変更する(nBGMAdjust); - //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); - //Trace.TraceInformation( "再生時刻変更: {0}", span.ToString() ); - //timeBeginLoad = DateTime.Now; - - #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 - //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); - //Trace.TraceInformation( "可視チップ数カウント {0}", span.ToString() ); - //timeBeginLoad = DateTime.Now; - #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 - //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); - //Trace.TraceInformation( "ch番号集合確認: {0}", span.ToString() ); - //timeBeginLoad = DateTime.Now; - #region[ seNotes計算 ] - if (this.listBRANCH.Count != 0) - this.tSetSenotes_branch(); - else - this.tSetSenotes(); - - #endregion - #region [ bLogDTX詳細ログ出力 ] - if (TJAPlayer3.ConfigIni.bLogDTX詳細ログ出力) - { - 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 - - //ソートっぽい - //this.listChip.Sort(delegate(CChip pchipA, CChip pchipB) { return pchipA.n発声時刻ms - pchipB.n発声時刻ms; } ); - //Random ran1 = new Random(); - //for (int n = 0; n < this.listChip.Count; n++ ) - //{ - - // if (CDTXMania.ConfigIni.bHispeedRandom) - // { - - // int nRan = ran1.Next(5, 40); - // this.listChip[n].dbSCROLL = nRan / 10.0; - // } - //} - int n整数値管理 = 0; - 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])))//this.CharConvertNote(input[n].Substring(0, 1)) != -1)) - { - 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]))//this.CharConvertNote(input[n].Substring(0, 1)) != -1) - { - 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; - // str = strInput.Replace(Environment.NewLine, "\n"); - // str = str.Replace('\t', ' '); - - 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[ ]; - - } - } - 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 static readonly HashSet valableTokens = new HashSet(@"TIT|LEV|BPM|WAV|OFF|BAL|EXA|DAN|REN|BAL|SON|SEV|SCO|COU|STY|TOW|GAM|LIF|DEM|SID|SUB|GEN|MOV|BGI|BGM|HID|GAU|LYR|#HB|#BM".Split('|')); - - 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); - - // Regex called here - // strInputHeader = regexForStrippingHeadingLines.Replace(strInputHeader, ""); - - - strInput = strInputHeader + "\n" + strInput; - - //どうせ使わないので先にSplitしてコメントを削除。 - var strSplitした譜面 = (string[])this.str改行文字を削除する(strInput, 1); - - for (int i = 0; strSplitした譜面.Length > i; i++) - { - // strSplitした譜面[i] = this.tコメントを削除する(strSplitした譜面[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 - n読み込むコース = difficulty; - #endregion - - //指定したコースの譜面の命令を消去する。 - strSplitした譜面[n読み込むコース] = CDTXStyleExtractor.tセッション譜面がある( - strSplitした譜面[n読み込むコース], - TJAPlayer3.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; - } - - 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 - { - 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); - //string str命令消去譜面temp = this.StringArrayToString( this.str命令消去譜面 ); - //string[] strDelimiter = { "," }; - //this.str命令消去譜面 = str命令消去譜面temp.Split( strDelimiter, StringSplitOptions.RemoveEmptyEntries ); - - this.n現在の小節数 = 1; - try - { - #region[ 最初の処理 ] - //1小節の時間を挿入して開始時間を調節。 - this.dbNowTime += ((15000.0 / 120.0 * (4.0 / 4.0)) * 16.0); - //this.dbNowBMScollTime += (( this.dbBarLength ) * 16.0 ); - #endregion - //string strWrite = ""; - for (int i = 0; strSplitした後の譜面.Length > i; i++) - { - nNowReadLine++; - str = strSplitした後の譜面[i]; - //strWrite += str; - //if( !str.StartsWith( "#" ) && !string.IsNullOrEmpty( this.strTemp ) ) - //{ - // str = this.strTemp + str; - //} - - // Check line - - 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( stream != null ) - //{ - // stream.Flush(); - // stream.Close(); - //} - #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]; - } - } - - 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; - } - } - 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 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; - } - - char[] chDelimiter = new char[] { ' ' }; - string[] strArray = null; - - #endregion - - if (command == "#START") - { - //#STARTと同時に鳴らすのはどうかと思うけどしゃーなしだな。 - AddMusicPreTimeMs(); // 音源を鳴らす前に遅延。 - var chip = new CChip(); - - 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); - - var chip1 = new CChip(); - chip1.nチャンネル番号 = 0x54; - //chip1.n発声位置 = 384; - //chip1.n発声時刻ms = (int)this.dbNowTime; - 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(); - - chip.nチャンネル番号 = 0xFF; - chip.n発声位置 = ((this.n現在の小節数 + 2) * 384); - //chip.n発声時刻ms = (int)( this.dbNowTime + ((15000.0 / this.dbNowBPM * ( 4.0 / 4.0 )) * 16.0) * 2 ); - 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 (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; - } - } - } - } - - 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 (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); - 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); - - //lbMaster.Items.Add( ";拍子変更 " + strArray[0] + "/" + strArray[1] ); - } - 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; - default: - 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; - default: - 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; - default: - 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; - default: - 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)) - { - TJAPlayer3.Tx.trackedTextures.TryGetValue(chip.strTargetTxName, out CTexture oldTx); - this.listOriginalTextures.Add(chip.strTargetTxName, new CTexture(oldTx)); - } - if (!this.listTextures.ContainsKey(chip.strNewPath)) - { - CTexture tx = TJAPlayer3.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連打分岐) - { - /* + #endregion + } + + public void tApplyFunMods(int player = 0) { + Random rnd = new System.Random(); + + var eFun = TJAPlayer3.ConfigIni.nFunMods[TJAPlayer3.GetActualPlayer(player)]; + var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.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); + + if (n < bombFactor) chip.nチャンネル番号 = 0x1C; + } + + 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(); + + var eRandom = TJAPlayer3.ConfigIni.eRandom[TJAPlayer3.GetActualPlayer(player)]; + + 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; + 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 (TJAPlayer3.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(TJAPlayer3.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 (TJAPlayer3.ConfigIni.b演奏速度が一倍速であるとき以外音声を再生しない && TJAPlayer3.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 = TJAPlayer3.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. + TJAPlayer3.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) { + //long num1 = cwav.n一時停止時刻[ i ]; + //long num2 = cwav.n再生開始時刻[ i ]; + 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ヘッダのみ, int difficulty) { + this.t入力(strファイル名, bヘッダのみ, 1.0, 0, 0, 0, false, difficulty); + } + public void t入力(string strファイル名, bool bヘッダのみ, double db再生速度, int nBGMAdjust, int nReadVersion, 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"); + + //if ( this.e種別 != E種別.SMF ) + { + try { + this.nPlayerSide = nPlayerSide; + this.bSession譜面を読み込む = bSession; + if (nReadVersion != 0) { + //DTX方式 + + //DateTime timeBeginLoad = DateTime.Now; + //TimeSpan span; + string[] files = Directory.GetFiles(this.strフォルダ名, "*.tja"); + + StreamReader reader = new StreamReader(strファイル名, Encoding.GetEncoding(TJAPlayer3.sEncType)); + string str2 = reader.ReadToEnd(); + reader.Close(); + + //StreamReader reader2 = new StreamReader( this.strフォルダ名 + "test.tja", Encoding.GetEncoding( "Shift_JIS" ) ); + StreamReader reader2 = new StreamReader(files[0], Encoding.GetEncoding(TJAPlayer3.sEncType)); + string str3 = reader2.ReadToEnd(); + reader2.Close(); + + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "DTXfileload時間: {0}", span.ToString() ); + + this.t入力_全入力文字列から(str2, str3, db再生速度, nBGMAdjust, difficulty); + } else { + //次郎方式 + + //DateTime timeBeginLoad = DateTime.Now; + //TimeSpan span; + + StreamReader reader = new StreamReader(strファイル名, Encoding.GetEncoding(TJAPlayer3.sEncType)); + string str2 = reader.ReadToEnd(); + reader.Close(); + + //StreamReader reader2 = new StreamReader( this.strフォルダ名 + "test.tja", Encoding.GetEncoding( "Shift_JIS" ) ); + //StreamReader reader2 = new StreamReader( strファイル名, Encoding.GetEncoding( "Shift_JIS" ) ); + //string str3 = reader2.ReadToEnd(); + //reader2.Close(); + string str3 = str2; + + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "DTXfileload時間: {0}", span.ToString() ); + + this.t入力_全入力文字列から(str2, str3, db再生速度, nBGMAdjust, difficulty); + } + } catch (Exception ex) { + //MessageBox.Show( "おや?エラーが出たようです。お兄様。" ); + Trace.TraceError("おや?エラーが出たようです。お兄様。"); + Trace.TraceError(ex.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (79ff8639-9b3c-477f-bc4a-f2eea9784860)"); + } + } + } + public void t入力_全入力文字列から(string str全入力文字列, int difficulty) { + this.t入力_全入力文字列から(str全入力文字列, str全入力文字列, 1.0, 0, difficulty); + } + public void t入力_全入力文字列から(string str全入力文字列, string str1, double db再生速度, int nBGMAdjust, int Difficulty) { + //DateTime timeBeginLoad = DateTime.Now; + //TimeSpan span; + + if (!string.IsNullOrEmpty(str全入力文字列)) { + #region [ 改行カット ] + this.db再生速度 = db再生速度; + str全入力文字列 = str全入力文字列.Replace(Environment.NewLine, "\n"); + str全入力文字列 = str全入力文字列.Replace('\t', ' '); + str全入力文字列 = str全入力文字列 + "\n"; + #endregion + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "改行カット時間: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + #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 + CharEnumerator ce = str全入力文字列.GetEnumerator(); + if (ce.MoveNext()) { + this.n現在の行数 = 1; + do { + if (!this.t入力_空白と改行をスキップする(ref ce)) { + break; + } + if (this.listChip.Count == 0) { + //this.t入力(str1); + //this.t入力_V3( str1, 3 ); + this.t入力_V4(str1, Difficulty); + } + if (ce.Current == '#') { + if (ce.MoveNext()) { + StringBuilder builder = new StringBuilder(0x20); + if (this.t入力_コマンド文字列を抜き出す(ref ce, ref builder)) { + StringBuilder builder2 = new StringBuilder(0x400); + if (this.t入力_パラメータ文字列を抜き出す(ref ce, ref builder2)) { + StringBuilder builder3 = new StringBuilder(0x400); + if (this.t入力_コメント文字列を抜き出す(ref ce, ref builder3)) { + this.t入力_行解析(ref builder, ref builder2, ref builder3); + + this.n現在の行数++; + continue; + } + } + } + } + break; + } + //this.t入力(str1); + } + while (this.t入力_コメントをスキップする(ref ce)); + + #endregion + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "抜き出し時間: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + this.n無限管理WAV = null; + this.n無限管理BPM = null; + this.n無限管理PAN = null; + this.n無限管理SIZE = null; + //this.t入力_行解析ヘッダ( str1 ); + 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 + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "前準備完了時間: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + #region [ CWAV初期化 ] + foreach (CWAV cwav in this.listWAV.Values) { + if (cwav.nチップサイズ < 0) { + cwav.nチップサイズ = 100; + } + if (cwav.n位置 <= -10000) { + cwav.n位置 = 0; + } + } + #endregion + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "CWAV前準備時間: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + #region [ チップ倍率設定 ] // #28145 2012.4.22 yyagi 二重ループを1重ループに変更して高速化) + //foreach ( CWAV cwav in this.listWAV.Values ) + //{ + // foreach( CChip chip in this.listChip ) + // { + // if( chip.n整数値_内部番号 == cwav.n内部番号 ) + // { + // chip.dbチップサイズ倍率 = ( (double) cwav.nチップサイズ ) / 100.0; + // if (chip.nチャンネル番号 == 0x01 ) // BGMだったら + // { + // cwav.bIsOnBGMLane = true; + // } + // } + // } + //} + foreach (CChip chip in this.listChip) { + if (this.listWAV.TryGetValue(chip.n整数値_内部番号, out CWAV cwav)) + //foreach ( CWAV cwav in this.listWAV.Values ) + { + // if ( chip.n整数値_内部番号 == cwav.n内部番号 ) + // { + chip.dbチップサイズ倍率 = ((double)cwav.nチップサイズ) / 100.0; + //if ( chip.nチャンネル番号 == 0x01 ) // BGMだったら + //{ + // cwav.bIsOnBGMLane = true; + //} + // } + } + } + #endregion + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "CWAV全準備時間: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + #region [ 必要に応じて空打ち音を0小節に定義する ] + //for ( int m = 0xb1; m <= 0xbc; m++ ) // #28146 2012.4.21 yyagi; bb -> bc + //{ + // foreach ( CChip chip in this.listChip ) + // { + // if ( chip.nチャンネル番号 == m ) + // { + // CChip c = new CChip(); + // c.n発声位置 = 0; + // c.nチャンネル番号 = chip.nチャンネル番号; + // c.n整数値 = chip.n整数値; + // c.n整数値_内部番号 = chip.n整数値_内部番号; + // this.listChip.Insert( 0, c ); + // break; + // } + // } + //} + #endregion + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "空打確認時間: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + #region [ 拍子_拍線の挿入 ] + if (this.listChip.Count > 0) { + this.listChip.Sort(); // 高速化のためにはこれを削りたいが、listChipの最後がn発声位置の終端である必要があるので、 + // 保守性確保を優先してここでのソートは残しておく + // なお、093時点では、このソートを削除しても動作するようにはしてある。 + // (ここまでの一部チップ登録を、listChip.Add(c)から同Insert(0,c)に変更してある) + // これにより、数ms程度ながらここでのソートも高速化されている。 + + //double barlength = 1.0; + //int nEndOfSong = ( this.listChip[ this.listChip.Count - 1 ].n発声位置 + 384 ) - ( this.listChip[ this.listChip.Count - 1 ].n発声位置 % 384 ); + //for ( int tick384 = 0; tick384 <= nEndOfSong; tick384 += 384 ) // 小節線の挿入 (後に出てくる拍子線とループをまとめようとするなら、forループの終了条件の微妙な違いに注意が必要) + //{ + // CChip chip = new CChip(); + // chip.n発声位置 = tick384; + // chip.nチャンネル番号 = 0x50; // 小節線 + // chip.n整数値 = 36 * 36 - 1; + // chip.dbSCROLL = 1.0; + // this.listChip.Add( chip ); + //} + ////this.listChip.Sort(); // ここでのソートは不要。ただし最後にソートすること + //int nChipNo_BarLength = 0; + //int nChipNo_C1 = 0; + + //this.listChip.Sort(); + } + #endregion + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "拍子_拍線挿入時間: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + #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 + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "C2 [拍線_小節線表示指定]: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + this.n内部番号BRANCH1to = 0; + this.n内部番号JSCROLL1to = 0; + #region [ 発声時刻の計算 ] + double bpm = 120.0; + //double dbBarLength = 1.0; + int n発声位置 = 0; + int ms = 0; + int nBar = 0; + int nCount = 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チャンネル番号 == 0x02) { } + //else if( chip.nチャンネル番号 == 0x03 ){} + 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チャンネル番号; + + nCount++; + this.nNowRollCount++; + for (int i = 0; i < this.nNowRollCountBranch.Length; i++) + this.nNowRollCountBranch[i]++; + + switch (ch) { + case 0x01: { + n発声位置 = chip.n発声位置; + + 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); + } + } + + + 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; + //chip.n発声時刻ms += this.nDELAY; + //chip.dbBPM = this.dbNowBPM; + //chip.dbSCROLL = this.dbNowSCROLL; + + if (this.n内部番号BRANCH1to + 1 > this.listBRANCH.Count) + continue; + + if (this.listBRANCH[this.n内部番号BRANCH1to].n現在の小節 == nBar) { + chip.bBranch = true; + this.n内部番号BRANCH1to++; + } + + //switch (this.n現在のコース) + //{ + // case 0: + // chip.dbSCROLL = this.dbNowSCROLL_Normal; + // break; + // case 1: + // chip.dbSCROLL = this.dbNowSCROLL_Expert; + // break; + // case 2: + // chip.dbSCROLL = this.dbNowSCROLL_Master; + // break; + //} + + //if( this.bBarLine == true ) + // chip.b可視 = true; + //else + // chip.b可視 = false; + + //if( this.b次の小節が分岐である ) + //{ + // chip.bBranch = true; + // this.b次の小節が分岐である = false; + //} + 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; + } + + //chip.dbBPM = this.dbNowBPM; + //chip.dbSCROLL = this.dbNowSCROLL; + this.nNowRoll = this.nNowRollCount - 1; + + //chip.nノーツ終了時刻ms = ms + ( (int) ( ( ( 0x271 * ( chip.nノーツ終了位置 - n発声位置 ) ) * dbBarLength ) / bpm ) ); + + #region[チップ番号を記録] + //switch(chip.nコース) + //{ + // case 0: + // this.n連打チップ_temp[0] = this.nNowRoll; + // this.dbSCROLL_temp[0] = this.dbNowSCROLL; + // break; + // case 1: + // this.n連打チップ_temp[1] = this.nNowRoll; + // this.dbSCROLL_temp[1] = this.dbNowSCROLL; + // break; + // case 2: + // this.n連打チップ_temp[2] = this.nNowRoll; + // this.dbSCROLL_temp[2] = this.dbNowSCROLL; + // break; + //} + + #endregion + + continue; + } + case 0x9A: { + + if (this.bOFFSETの値がマイナスである) { + chip.n発声時刻ms += this.nOFFSET; + } + //chip.n発声時刻ms += this.nDELAY; + //chip.dbBPM = this.dbNowBPM; + //chip.dbSCROLL = this.dbNowSCROLL; + + #region[チップ番号を記録] + //風船は現時点では未実装のため処理しない。 + + + //switch (chip.nコース) + //{ + // case 0: + // if (this.listChip[this.n連打チップ_temp[0]].nチャンネル番号 == 0x99) break; + // this.listChip[this.n連打チップ_temp[0]].nノーツ終了時刻ms = chip.n発声時刻ms; + // this.listChip[this.n連打チップ_temp[0]].dbSCROLL = this.dbSCROLL_temp[0]; + // break; + // case 1: + // if (this.listChip[this.n連打チップ_temp[1]].nチャンネル番号 == 0x99) break; + // this.listChip[this.n連打チップ_temp[1]].nノーツ終了時刻ms = chip.n発声時刻ms; + // this.listChip[this.n連打チップ_temp[1]].dbSCROLL = this.dbSCROLL_temp[1]; + // break; + // case 2: + // if (this.listChip[this.n連打チップ_temp[2]].nチャンネル番号 == 0x99) break; + // this.listChip[this.n連打チップ_temp[2]].nノーツ終了時刻ms = chip.n発声時刻ms; + // this.listChip[this.n連打チップ_temp[2]].dbSCROLL = this.dbSCROLL_temp[2]; + // break; + //} + + #endregion + + //this.listChip[this.nNowRoll].nノーツ終了時刻ms = chip.n発声時刻ms; + //this.listChip[this.nNowRoll].dbSCROLL = this.dbNowSCROLL; + //this.listChip[this.nNowRoll].dbBPM = this.dbNowBPM; + continue; + } + case 0x9D: { + //if ( this.listSCROLL.ContainsKey( chip.n整数値_内部番号 ) ) + //{ + //this.dbNowSCROLL = ( ( this.listSCROLL[ chip.n整数値_内部番号 ].n表記上の番号 == 0 ) ? 0.0 : 1.0 ) + this.listSCROLL[ chip.n整数値_内部番号 ].dbSCROLL値; + //} + + //switch (chip.nコース) + //{ + // case 0: + // this.dbNowSCROLL_Normal = this.dbNowSCROLL; + // this.n現在のコース = 0; + // break; + // case 1: + // this.dbNowSCROLL_Expert = this.dbNowSCROLL; + // this.n現在のコース = 1; + // break; + // case 2: + // this.dbNowSCROLL_Master = this.dbNowSCROLL; + // this.n現在のコース = 2; + // break; + //} + + continue; + } + case 0xDC: { + if (this.bOFFSETの値がマイナスである) + chip.n発声時刻ms += this.nOFFSET; + //if ( this.listDELAY.ContainsKey( chip.n整数値_内部番号 ) ) + //{ + // this.nDELAY = ( ( this.listDELAY[ chip.n整数値_内部番号 ].n表記上の番号 == 0 ) ? 0 : 0 ) + this.listDELAY[ chip.n整数値_内部番号 ].nDELAY値; + //} + 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; + //if ( this.listBRANCH.ContainsKey( chip.n整数値_内部番号 ) ) + //{ + //this.listBRANCH[chip.n整数値_内部番号].db分岐時間ms = chip.n発声時刻ms + ( this.bOFFSETの値がマイナスである ? this.nOFFSET : 0 ); + //} + + continue; + } + case 0xE0: { + //if (this.bOFFSETの値がマイナスである) + // chip.n発声時刻ms += this.nOFFSET; + + //chip.dbBPM = this.dbNowBPM; + //chip.dbSCROLL = this.dbNowSCROLL; + //if( chip.n整数値_内部番号 == 1 ) + // this.bBarLine = false; + //else + // this.bBarLine = true; + continue; + } + default: { + if (this.bOFFSETの値がマイナスである) + chip.n発声時刻ms += this.nOFFSET; + //chip.n発声時刻ms += this.nDELAY; + chip.dbBPM = this.dbNowBPM; + //chip.dbSCROLL = this.dbNowSCROLL; + continue; + } + } + } + if (this.db再生速度 > 0.0) { + double _db再生速度 = (TJAPlayer3.DTXVmode.Enabled) ? this.dbDTXVPlaySpeed : 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 + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "発声時刻計算: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + + #region[listlyricを時間順に並び替え。] + this.listLyric2 = tmplistlyric; + this.listLyric2.Sort((a, b) => a.Time.CompareTo(b.Time)); + #endregion + + this.nBGMAdjust = 0; + this.t各自動再生音チップの再生時刻を変更する(nBGMAdjust); + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "再生時刻変更: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + + #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 + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "可視チップ数カウント {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + #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 + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "ch番号集合確認: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + #region[ seNotes計算 ] + if (this.listBRANCH.Count != 0) + this.tSetSenotes_branch(); + else + this.tSetSenotes(); + + #endregion + #region [ bLogDTX詳細ログ出力 ] + if (TJAPlayer3.ConfigIni.bLogDTX詳細ログ出力) { + 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 + + //ソートっぽい + //this.listChip.Sort(delegate(CChip pchipA, CChip pchipB) { return pchipA.n発声時刻ms - pchipB.n発声時刻ms; } ); + //Random ran1 = new Random(); + //for (int n = 0; n < this.listChip.Count; n++ ) + //{ + + // if (CDTXMania.ConfigIni.bHispeedRandom) + // { + + // int nRan = ran1.Next(5, 40); + // this.listChip[n].dbSCROLL = nRan / 10.0; + // } + //} + int n整数値管理 = 0; + 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])))//this.CharConvertNote(input[n].Substring(0, 1)) != -1)) + { + 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]))//this.CharConvertNote(input[n].Substring(0, 1)) != -1) + { + 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; + // str = strInput.Replace(Environment.NewLine, "\n"); + // str = str.Replace('\t', ' '); + + 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[ ]; + + } + } 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 static readonly HashSet valableTokens = new HashSet(@"TIT|LEV|BPM|WAV|OFF|BAL|EXA|DAN|REN|BAL|SON|SEV|SCO|COU|STY|TOW|GAM|LIF|DEM|SID|SUB|GEN|MOV|BGI|BGM|HID|GAU|LYR|#HB|#BM".Split('|')); + + 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); + + // Regex called here + // strInputHeader = regexForStrippingHeadingLines.Replace(strInputHeader, ""); + + + strInput = strInputHeader + "\n" + strInput; + + //どうせ使わないので先にSplitしてコメントを削除。 + var strSplitした譜面 = (string[])this.str改行文字を削除する(strInput, 1); + + for (int i = 0; strSplitした譜面.Length > i; i++) { + // strSplitした譜面[i] = this.tコメントを削除する(strSplitした譜面[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 + n読み込むコース = difficulty; + #endregion + + //指定したコースの譜面の命令を消去する。 + strSplitした譜面[n読み込むコース] = CDTXStyleExtractor.tセッション譜面がある( + strSplitした譜面[n読み込むコース], + TJAPlayer3.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; + } + + 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 { + 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); + //string str命令消去譜面temp = this.StringArrayToString( this.str命令消去譜面 ); + //string[] strDelimiter = { "," }; + //this.str命令消去譜面 = str命令消去譜面temp.Split( strDelimiter, StringSplitOptions.RemoveEmptyEntries ); + + this.n現在の小節数 = 1; + try { + #region[ 最初の処理 ] + //1小節の時間を挿入して開始時間を調節。 + this.dbNowTime += ((15000.0 / 120.0 * (4.0 / 4.0)) * 16.0); + //this.dbNowBMScollTime += (( this.dbBarLength ) * 16.0 ); + #endregion + //string strWrite = ""; + for (int i = 0; strSplitした後の譜面.Length > i; i++) { + nNowReadLine++; + str = strSplitした後の譜面[i]; + //strWrite += str; + //if( !str.StartsWith( "#" ) && !string.IsNullOrEmpty( this.strTemp ) ) + //{ + // str = this.strTemp + str; + //} + + // Check line + + 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( stream != null ) + //{ + // stream.Flush(); + // stream.Close(); + //} + #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]; + } + } + + 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; + } + } + 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 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; + } + + char[] chDelimiter = new char[] { ' ' }; + string[] strArray = null; + + #endregion + + if (command == "#START") { + //#STARTと同時に鳴らすのはどうかと思うけどしゃーなしだな。 + AddMusicPreTimeMs(); // 音源を鳴らす前に遅延。 + var chip = new CChip(); + + 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); + + var chip1 = new CChip(); + chip1.nチャンネル番号 = 0x54; + //chip1.n発声位置 = 384; + //chip1.n発声時刻ms = (int)this.dbNowTime; + 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(); + + chip.nチャンネル番号 = 0xFF; + chip.n発声位置 = ((this.n現在の小節数 + 2) * 384); + //chip.n発声時刻ms = (int)( this.dbNowTime + ((15000.0 / this.dbNowBPM * ( 4.0 / 4.0 )) * 16.0) * 2 ); + 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 (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; + } + } + } + } + + 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 (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); + 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); + + //lbMaster.Items.Add( ";拍子変更 " + strArray[0] + "/" + strArray[1] ); + } 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; + default: + 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; + default: + 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; + default: + 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; + default: + 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)) { + TJAPlayer3.Tx.trackedTextures.TryGetValue(chip.strTargetTxName, out CTexture oldTx); + this.listOriginalTextures.Add(chip.strTargetTxName, new CTexture(oldTx)); + } + if (!this.listTextures.ContainsKey(chip.strNewPath)) { + CTexture tx = TJAPlayer3.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); //連打分岐の位置を再現 //この計算式はあてにならないと思うが、まあどうしようもないんでこれで @@ -6068,1565 +5312,1304 @@ namespace TJAPlayer3 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 && TJAPlayer3.ConfigIni.nPlayerCount < 4) // Do not parse LYRIC tags if a lyric file is already loaded - { - if (TJAPlayer3.r現在のステージ.eStageID == CStage.EStage.SongLoading)//起動時に重たくなってしまう問題の修正用 - this.listLyric.Add(this.pf歌詞フォント.DrawText(argument, TJAPlayer3.Skin.Game_Lyric_ForeColor, TJAPlayer3.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 - (bOFFSETの値がマイナスである ? -nOFFSET : nOFFSET); - 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であったら適応 - } - } - } - - //もし、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.n発声時刻ms = (int)this.dbNowTime; - 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); - //--全ての拍線の時間を出力する-- - //Trace.WriteLine( string.Format( "|| {0,3:##0} Time:{1} Beat:{2}", this.n現在の小節数, hakusen.n発声時刻ms, measure ) ); - //-------------------------------- - } - - #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; - } - 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++) - { - 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現在のコース; - - 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; - - 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; - } - 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; - } - - //listChip[ nNowRollCount ].dbBPM = this.dbNowBPM; - //listChip[ nNowRollCount ].dbSCROLL = this.dbNowSCROLL; - if (!IsEndedBranching || i == 2) - nNowRoll = 0; - //continue; - } - - 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) - { - 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]++; - } - } - - 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); - // Array.Resize(ref nDan_BallonCount, nDan_BallonCount.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文字数)); - } - } - } - } - - /// - /// 難易度ごとによって変わるヘッダ値を読み込む。 - /// (BALLOONなど。) - /// - /// - private void t難易度別ヘッダ(string InputText) - { - if (TJAPlayer3.actEnumSongs != null && TJAPlayer3.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; - }); - } - - //if( this.nScoreModeTmp == 99 ) //2017.01.28 DD SCOREMODEを入力していない場合のみConfigで設定したモードにする - //{ - // this.nScoreModeTmp = CDTXMania.ConfigIni.nScoreMode; - //} - //if( CDTXMania.ConfigIni.nScoreMode == 3 && !this.b配点が指定されている[ 2, this.n参照中の難易度 ] ){ //2017.06.04 kairera0467 - // this.nScoreModeTmp = 3; - //} - - - - 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 = TJAPlayer3.ConfigIni.nScoreMode; - } - if (TJAPlayer3.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) ? -TJAPlayer3.ConfigIni.nGlobalOffsetMs : TJAPlayer3.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); - } + 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 && TJAPlayer3.ConfigIni.nPlayerCount < 4) // Do not parse LYRIC tags if a lyric file is already loaded + { + if (TJAPlayer3.r現在のステージ.eStageID == CStage.EStage.SongLoading)//起動時に重たくなってしまう問題の修正用 + this.listLyric.Add(this.pf歌詞フォント.DrawText(argument, TJAPlayer3.Skin.Game_Lyric_ForeColor, TJAPlayer3.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 - (bOFFSETの値がマイナスである ? -nOFFSET : nOFFSET); + 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であったら適応 + } + } + } + + //もし、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.n発声時刻ms = (int)this.dbNowTime; + 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); + //--全ての拍線の時間を出力する-- + //Trace.WriteLine( string.Format( "|| {0,3:##0} Time:{1} Beat:{2}", this.n現在の小節数, hakusen.n発声時刻ms, measure ) ); + //-------------------------------- + } + + #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; + } 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++) { + 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現在のコース; + + 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; + + 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; + } + 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; + } + + //listChip[ nNowRollCount ].dbBPM = this.dbNowBPM; + //listChip[ nNowRollCount ].dbSCROLL = this.dbNowSCROLL; + if (!IsEndedBranching || i == 2) + nNowRoll = 0; + //continue; + } + + 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) { + 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]++; + } + } + + 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); + // Array.Resize(ref nDan_BallonCount, nDan_BallonCount.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文字数)); + } + } + } + } + + /// + /// 難易度ごとによって変わるヘッダ値を読み込む。 + /// (BALLOONなど。) + /// + /// + private void t難易度別ヘッダ(string InputText) { + if (TJAPlayer3.actEnumSongs != null && TJAPlayer3.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; + }); + } + + //if( this.nScoreModeTmp == 99 ) //2017.01.28 DD SCOREMODEを入力していない場合のみConfigで設定したモードにする + //{ + // this.nScoreModeTmp = CDTXMania.ConfigIni.nScoreMode; + //} + //if( CDTXMania.ConfigIni.nScoreMode == 3 && !this.b配点が指定されている[ 2, this.n参照中の難易度 ] ){ //2017.06.04 kairera0467 + // this.nScoreModeTmp = 3; + //} + + + + 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 = TJAPlayer3.ConfigIni.nScoreMode; + } + if (TJAPlayer3.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) ? -TJAPlayer3.ConfigIni.nGlobalOffsetMs : TJAPlayer3.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)) @@ -7634,34 +6617,28 @@ namespace TJAPlayer3 else strVideoFilename = this.strフォルダ名 + this.strBGVIDEO_PATH; - try - { + 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"+ + } 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からも入力できるようにする。 + } 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 videoPath = ""; + if (!string.IsNullOrEmpty(strCommandParam)) { + videoPath = + CDTXCompanionFileFinder.FindFileName(this.strフォルダ名, strファイル名, strCommandParam); + } string strVideoFilename; if (!string.IsNullOrEmpty(this.PATH_WAV)) @@ -7669,233 +6646,186 @@ namespace TJAPlayer3 else strVideoFilename = this.strフォルダ名 + videoPath; - try - { + try { CVideoDecoder vd = new CVideoDecoder(strVideoFilename); - var indexText = strCommandName.Remove(0, 3); + 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"+ + } 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 && TJAPlayer3.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]; + } 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 && TJAPlayer3.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 (TJAPlayer3.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 && TJAPlayer3.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 (TJAPlayer3.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 = TJAPlayer3.ConfigIni.nScoreMode; - } - } - /// - /// 指定した文字が数値かを返すメソッド - /// - /// - /// - public bool bIsNumber(char Char) - { - if ((Char >= '0') && (Char <= '9')) - return true; - else - return false; - } + if (File.Exists(filePaths[i])) { + try { + if (TJAPlayer3.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 && TJAPlayer3.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 (TJAPlayer3.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 = TJAPlayer3.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)); - } + /// + /// string型からint型に変換する。 + /// TJAP2から持ってきた。 + /// + private int CharConvertNote(string str) { + return (NotesManager.GetNoteValueFromChar(str)); + } - private int strConvertCourse(string str) - { - //2016.08.24 kairera0467 - //正規表現を使っているため、easyでもEASYでもOK。 + 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; - } - } + // 小文字大文字区別しない正規表現で仮対応。 (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; - } - } + 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ファイルのパス + /// + /// 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", ""); + { + 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], TJAPlayer3.Skin.Game_Lyric_ForeColor, TJAPlayer3.Skin.Game_Lyric_BackColor, null, 30); - stlrc.Time = list[listindex]; - stlrc.index = ordnumber; - this.listLyric2.Add(stlrc); - } - } - } - } - } + for (int listindex = 0; listindex < list.Count; listindex++) { + STLYRIC stlrc; + stlrc.Text = strSplit後[i]; + stlrc.TextTex = this.pf歌詞フォント.DrawText(strSplit後[i], TJAPlayer3.Skin.Game_Lyric_ForeColor, TJAPlayer3.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) - { - /* + /// + /// 複素数のパースもどき + /// + private void tParsedComplexNumber(string strScroll, ref double[] dbScroll) { + /* bool bFirst = true; //最初の数値か bool bUse = false; //数値扱い中 string[] arScroll = new string[2]; @@ -7919,1690 +6849,1488 @@ namespace TJAPlayer3 dbScroll[1] = Convert.ToDouble(arScroll[1]); */ - var cpx = strScroll.ParseComplex(); - dbScroll[0] = cpx[0]; - dbScroll[1] = cpx[1]; - return; - } + var cpx = strScroll.ParseComplex(); + dbScroll[0] = cpx[0]; + dbScroll[1] = cpx[1]; + return; + } - private void tSetSenotes() - { - #region[ list作成 ] - //ひとまずチップだけのリストを作成しておく。 - List list音符のみのリスト; - list音符のみのリスト = new List(); - int nCount = 0; - int dkdkCount = 0; + 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 + foreach (CChip chip in this.listChip) { + if (NotesManager.IsCommonNote(chip)) { + list音符のみのリスト.Add(chip); + } + } + #endregion - //時間判定は、「次のチップの発声時刻」から「現在(過去)のチップの発声時刻」で引く必要がある。 - //逆にしてしまうと計算がとてつもないことになるので注意。 + //時間判定は、「次のチップの発声時刻」から「現在(過去)のチップの発声時刻」で引く必要がある。 + //逆にしてしまうと計算がとてつもないことになるので注意。 - try - { - //this.tSenotes_Core( list音符のみのリスト ); - this.tSenotes_Core_V2(list音符のみのリスト, true); - } - catch (Exception ex) - { - Trace.TraceError(ex.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (b67473e4-1930-44f1-b320-4ead5786e74c)"); - } + try { + //this.tSenotes_Core( list音符のみのリスト ); + 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; + /// + /// 譜面分岐がある場合はこちらを使う + /// + 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); + 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 + 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; - } + //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( list音符のみのリスト ); - this.tSenotes_Core_V2(list音符のみのリスト, true); - } + //this.tSenotes_Core( list音符のみのリスト ); + 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; + /// + /// コア部分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; - } + 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; + if (ignoreSENote && list音符のみのリスト[i].IsFixedSENote) continue; - switch (list音符のみのリスト[i].nチャンネル番号) - { - case 0x11: + 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; - } + //(左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; - } - } + //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分間隔の「ドドド」→「ドンドンドン」 + //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 - 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; + //ドコドコドン + 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; - } - } + //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; - } - } - } + //右の音符が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 (TJAPlayer3.SoundManager.GetCurrentSoundDeviceType() == "DirectSound") // DShowでの再生の場合はミキシング負荷が高くないため、 - { // チップのライフタイム管理を行わない - return; - } + /// + /// サウンドミキサーにサウンドを登録_削除する時刻を事前に算出する + /// + public void PlanToAddMixerChannel() { + if (TJAPlayer3.SoundManager.GetCurrentSoundDeviceType() == "DirectSound") // DShowでの再生の場合はミキシング負荷が高くないため、 + { // チップのライフタイム管理を行わない + return; + } - List listAddMixerChannel = new List(128); ; - List listRemoveMixerChannel = new List(128); - List listRemoveTiming = new List(128); + 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: + 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 [ BGMチップならば即ミキサーに追加 ] - //if ( pChip.nチャンネル番号 == 0x01 ) // BGMチップは即ミキサーに追加 - //{ - // if ( listWAV.ContainsKey( pChip.n整数値_内部番号 ) ) - // { - // CDTX.CWAV wc = CDTXMania.DTX.listWAV[ pChip.n整数値_内部番号 ]; - // if ( wc.rSound[ 0 ] != null ) - // { - // CDTXMania.Sound管理.AddMixer( wc.rSound[ 0 ] ); // BGMは多重再生しない仕様としているので、1個目だけミキサーに登録すればよい - // } - // } - //} - #endregion - #region [ 発音1秒前のタイミングを算出 ] - int nAddMixer時刻ms, nAddMixer位置 = 0; - //Debug.WriteLine("=================================================================="); - //Debug.WriteLine( "Start: ch=" + pChip.nチャンネル番号.ToString("x2") + ", nWAV番号=" + pChip.n整数値 + ", time=" + pChip.n発声時刻ms + ", lasttime=" + listChip[ listChip.Count - 1 ].n発声時刻ms ); - t発声時刻msと発声位置を取得する(pChip.n発声時刻ms - n発音前余裕ms, out nAddMixer時刻ms, out nAddMixer位置); - //Debug.WriteLine( "nAddMixer時刻ms=" + nAddMixer時刻ms + ",nAddMixer位置=" + nAddMixer位置 ); + #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 [ BGMチップならば即ミキサーに追加 ] + //if ( pChip.nチャンネル番号 == 0x01 ) // BGMチップは即ミキサーに追加 + //{ + // if ( listWAV.ContainsKey( pChip.n整数値_内部番号 ) ) + // { + // CDTX.CWAV wc = CDTXMania.DTX.listWAV[ pChip.n整数値_内部番号 ]; + // if ( wc.rSound[ 0 ] != null ) + // { + // CDTXMania.Sound管理.AddMixer( wc.rSound[ 0 ] ); // BGMは多重再生しない仕様としているので、1個目だけミキサーに登録すればよい + // } + // } + //} + #endregion + #region [ 発音1秒前のタイミングを算出 ] + int nAddMixer時刻ms, nAddMixer位置 = 0; + //Debug.WriteLine("=================================================================="); + //Debug.WriteLine( "Start: ch=" + pChip.nチャンネル番号.ToString("x2") + ", nWAV番号=" + pChip.n整数値 + ", time=" + pChip.n発声時刻ms + ", lasttime=" + listChip[ listChip.Count - 1 ].n発声時刻ms ); + t発声時刻msと発声位置を取得する(pChip.n発声時刻ms - n発音前余裕ms, out nAddMixer時刻ms, out nAddMixer位置); + //Debug.WriteLine( "nAddMixer時刻ms=" + nAddMixer時刻ms + ",nAddMixer位置=" + 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); - //Debug.WriteLine("listAddMixerChannel:" ); - //DebugOut_CChipList( listAddMixerChannel ); - #endregion + 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); + //Debug.WriteLine("listAddMixerChannel:" ); + //DebugOut_CChipList( listAddMixerChannel ); + #endregion - int duration = 0; - if (listWAV.TryGetValue(pChip.n整数値_内部番号, out CDTX.CWAV wc)) - { - double _db再生速度 = (TJAPlayer3.DTXVmode.Enabled) ? this.dbDTXVPlaySpeed : this.db再生速度; - duration = (wc.rSound[0] == null) ? 0 : (int)(wc.rSound[0].TotalPlayTime / _db再生速度); // #23664 durationに再生速度が加味されておらず、低速再生でBGMが途切れる問題を修正 (発声時刻msは、DTX読み込み時に再生速度加味済) - } - //Debug.WriteLine("duration=" + duration ); - int n新RemoveMixer時刻ms, n新RemoveMixer位置; - t発声時刻msと発声位置を取得する(pChip.n発声時刻ms + duration + n発音後余裕ms, out n新RemoveMixer時刻ms, out n新RemoveMixer位置); - //Debug.WriteLine( "n新RemoveMixer時刻ms=" + n新RemoveMixer時刻ms + ",n新RemoveMixer位置=" + 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; - //continue; // 発声位置の計算ができないので、Mixer削除をあきらめる___のではなく - // #32248 2013.10.15 yyagi 演奏終了後も再生を続けるチップであるというフラグをpChip内に立てる - break; - } - #region [ 未使用コード ] - //if ( n新RemoveMixer時刻ms < pChip.n発声時刻ms + duration ) // 曲の最後でサウンドが切れるような場合 - //{ - // n新RemoveMixer時刻ms = pChip.n発声時刻ms + duration; - // // 「位置」は比例計算で求めてお茶を濁す...このやり方だと誤動作したため対応中止 - // n新RemoveMixer位置 = listChip[ listChip.Count - 1 ].n発声位置 * n新RemoveMixer時刻ms / listChip[ listChip.Count - 1 ].n発声時刻ms; - //} - #endregion + int duration = 0; + if (listWAV.TryGetValue(pChip.n整数値_内部番号, out CDTX.CWAV wc)) { + double _db再生速度 = (TJAPlayer3.DTXVmode.Enabled) ? this.dbDTXVPlaySpeed : this.db再生速度; + duration = (wc.rSound[0] == null) ? 0 : (int)(wc.rSound[0].TotalPlayTime / _db再生速度); // #23664 durationに再生速度が加味されておらず、低速再生でBGMが途切れる問題を修正 (発声時刻msは、DTX読み込み時に再生速度加味済) + } + //Debug.WriteLine("duration=" + duration ); + int n新RemoveMixer時刻ms, n新RemoveMixer位置; + t発声時刻msと発声位置を取得する(pChip.n発声時刻ms + duration + n発音後余裕ms, out n新RemoveMixer時刻ms, out n新RemoveMixer位置); + //Debug.WriteLine( "n新RemoveMixer時刻ms=" + n新RemoveMixer時刻ms + ",n新RemoveMixer位置=" + 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; + //continue; // 発声位置の計算ができないので、Mixer削除をあきらめる___のではなく + // #32248 2013.10.15 yyagi 演奏終了後も再生を続けるチップであるというフラグをpChip内に立てる + break; + } + #region [ 未使用コード ] + //if ( n新RemoveMixer時刻ms < pChip.n発声時刻ms + duration ) // 曲の最後でサウンドが切れるような場合 + //{ + // n新RemoveMixer時刻ms = pChip.n発声時刻ms + duration; + // // 「位置」は比例計算で求めてお茶を濁す...このやり方だと誤動作したため対応中止 + // n新RemoveMixer位置 = listChip[ listChip.Count - 1 ].n発声位置 * n新RemoveMixer時刻ms / listChip[ listChip.Count - 1 ].n発声時刻ms; + //} + #endregion - #region [ 発音終了2秒後にmixerから削除するが、その前に再発音することになるのかを確認(再発音ならmixer削除タイミングを延期) ] - int n整数値 = pChip.n整数値; - int index = listRemoveTiming.FindIndex( - delegate (CChip cchip) { return cchip.n整数値 == n整数値; } - ); - //Debug.WriteLine( "index=" + index ); - if (index >= 0) // 過去に同じチップで発音中のものが見つかった場合 - { // 過去の発音のmixer削除を確定させるか、延期するかの2択。 - int n旧RemoveMixer時刻ms = listRemoveTiming[index].n発声時刻ms; - int n旧RemoveMixer位置 = listRemoveTiming[index].n発声位置; + #region [ 発音終了2秒後にmixerから削除するが、その前に再発音することになるのかを確認(再発音ならmixer削除タイミングを延期) ] + int n整数値 = pChip.n整数値; + int index = listRemoveTiming.FindIndex( + delegate (CChip cchip) { return cchip.n整数値 == n整数値; } + ); + //Debug.WriteLine( "index=" + index ); + if (index >= 0) // 過去に同じチップで発音中のものが見つかった場合 + { // 過去の発音のmixer削除を確定させるか、延期するかの2択。 + int n旧RemoveMixer時刻ms = listRemoveTiming[index].n発声時刻ms; + int n旧RemoveMixer位置 = listRemoveTiming[index].n発声位置; - //Debug.WriteLine( "n旧RemoveMixer時刻ms=" + n旧RemoveMixer時刻ms + ",n旧RemoveMixer位置=" + n旧RemoveMixer位置 ); - 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削除後に再発音するような流れの場合は - { - //Debug.WriteLine( "Publish the value(listRemoveTiming[index] to listRemoveMixerChannel." ); - 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; - //listRemoveTiming[ index ].n発声時刻ms = n新RemoveMixer時刻ms; // mixer削除時刻を更新(遅延)する - //listRemoveTiming[ index ].n発声位置 = n新RemoveMixer位置; - //Debug.WriteLine( "listRemoveTiming: modified" ); - //DebugOut_CChipList( listRemoveTiming ); - } - else // 過去に同じチップを発音していないor - { // 発音していたが既にmixer削除確定していたなら - CChip c = new CChip() // 新しくmixer削除候補として追加する - { - nチャンネル番号 = 0xDB, - n整数値 = pChip.n整数値, - n整数値_内部番号 = pChip.n整数値_内部番号, - n発声時刻ms = n新RemoveMixer時刻ms, - n発声位置 = n新RemoveMixer位置 - }; - //Debug.WriteLine( "Add new chip to listRemoveMixerTiming: " ); - //Debug.WriteLine( "ch=" + c.nチャンネル番号.ToString( "x2" ) + ", nWAV番号=" + c.n整数値 + ", time=" + c.n発声時刻ms + ", lasttime=" + listChip[ listChip.Count - 1 ].n発声時刻ms ); - listRemoveTiming.Add(c); - //Debug.WriteLine( "listRemoveTiming:" ); - //DebugOut_CChipList( listRemoveTiming ); - } - #endregion - break; - } - } - //Debug.WriteLine("=================================================================="); - //Debug.WriteLine( "Result:" ); - //Debug.WriteLine( "listAddMixerChannel:" ); - //DebugOut_CChipList( listAddMixerChannel ); - //Debug.WriteLine( "listRemoveMixerChannel:" ); - //DebugOut_CChipList( listRemoveMixerChannel ); - //Debug.WriteLine( "listRemoveTiming:" ); - //DebugOut_CChipList( listRemoveTiming ); - //Debug.WriteLine( "==================================================================" ); + //Debug.WriteLine( "n旧RemoveMixer時刻ms=" + n旧RemoveMixer時刻ms + ",n旧RemoveMixer位置=" + n旧RemoveMixer位置 ); + 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削除後に再発音するような流れの場合は + { + //Debug.WriteLine( "Publish the value(listRemoveTiming[index] to listRemoveMixerChannel." ); + 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; + //listRemoveTiming[ index ].n発声時刻ms = n新RemoveMixer時刻ms; // mixer削除時刻を更新(遅延)する + //listRemoveTiming[ index ].n発声位置 = n新RemoveMixer位置; + //Debug.WriteLine( "listRemoveTiming: modified" ); + //DebugOut_CChipList( listRemoveTiming ); + } else // 過去に同じチップを発音していないor + { // 発音していたが既にmixer削除確定していたなら + CChip c = new CChip() // 新しくmixer削除候補として追加する + { + nチャンネル番号 = 0xDB, + n整数値 = pChip.n整数値, + n整数値_内部番号 = pChip.n整数値_内部番号, + n発声時刻ms = n新RemoveMixer時刻ms, + n発声位置 = n新RemoveMixer位置 + }; + //Debug.WriteLine( "Add new chip to listRemoveMixerTiming: " ); + //Debug.WriteLine( "ch=" + c.nチャンネル番号.ToString( "x2" ) + ", nWAV番号=" + c.n整数値 + ", time=" + c.n発声時刻ms + ", lasttime=" + listChip[ listChip.Count - 1 ].n発声時刻ms ); + listRemoveTiming.Add(c); + //Debug.WriteLine( "listRemoveTiming:" ); + //DebugOut_CChipList( listRemoveTiming ); + } + #endregion + break; + } + } + //Debug.WriteLine("=================================================================="); + //Debug.WriteLine( "Result:" ); + //Debug.WriteLine( "listAddMixerChannel:" ); + //DebugOut_CChipList( listAddMixerChannel ); + //Debug.WriteLine( "listRemoveMixerChannel:" ); + //DebugOut_CChipList( listRemoveMixerChannel ); + //Debug.WriteLine( "listRemoveTiming:" ); + //DebugOut_CChipList( listRemoveTiming ); + //Debug.WriteLine( "==================================================================" ); - listChip.AddRange(listAddMixerChannel); - listChip.AddRange(listRemoveMixerChannel); - listChip.AddRange(listRemoveTiming); - listChip.Sort(); - } - private void DebugOut_CChipList(List c) - { - //Debug.WriteLine( "Count=" + c.Count ); - 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つのチップの発声位置の中間を取る。 + listChip.AddRange(listAddMixerChannel); + listChip.AddRange(listRemoveMixerChannel); + listChip.AddRange(listRemoveTiming); + listChip.Sort(); + } + private void DebugOut_CChipList(List c) { + //Debug.WriteLine( "Count=" + c.Count ); + 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; - } - //else if ( n希望発声時刻ms > listChip[ listChip.Count - 1 ].n発声時刻ms ) // BGMの最後の余韻を殺してしまうので、この条件は外す - //{ - // n希望発声時刻ms = listChip[ listChip.Count - 1 ].n発声時刻ms; - //} + if (n希望発声時刻ms < 0) { + n希望発声時刻ms = 0; + } + //else if ( n希望発声時刻ms > listChip[ listChip.Count - 1 ].n発声時刻ms ) // BGMの最後の余韻を殺してしまうので、この条件は外す + //{ + // n希望発声時刻ms = listChip[ listChip.Count - 1 ].n発声時刻ms; + //} - 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 = n希望発声時刻ms; - //n新発声位置 = listChip[ listChip.Count - 1 ].n発声位置 * n希望発声時刻ms / listChip[ listChip.Count - 1 ].n発声時刻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 (TJAPlayer3.r現在のステージ.eStageID == CStage.EStage.SongLoading) - { - //まさかこれが原因で曲の読み込みが停止するとは思わなかった... - //どういうことかというとスキンを読み込むときに...いや厳密には - //RefleshSkinを呼び出した後一回Disposeしてnullにして解放(その後にまたインスタンスを作成する)するんだけど - //その時にここでTJAPlayer3.Skinを参照して例外が出ていたんだ.... - //いやいや! なんでTJAPlayer3.Skinをnullにした瞬間に参照されるんだ!と思った方もいるかもしれないですが - //実は曲の読み込みはマルチスレッドで実行されているのでnullにした瞬間に参照される可能性も十分にある - //それならアプリが終了するんじゃないかと思ったのだけどtryを使ってい曲の読み込みを続行していた... - //いやーマルチスレッドって難しいね! - if (!string.IsNullOrEmpty(TJAPlayer3.Skin.Game_Lyric_FontName)) - { - this.pf歌詞フォント = new CCachedFontRenderer(TJAPlayer3.Skin.Game_Lyric_FontName, TJAPlayer3.Skin.Game_Lyric_FontSize); - } - else - { - this.pf歌詞フォント = new CCachedFontRenderer(CFontRenderer.DefaultFontName, TJAPlayer3.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) + int index_min = -1, index_max = -1; + for (int i = 0; i < listChip.Count; i++) // 希望発声位置前後の「前」の方のチップを検索 { - foreach (CVideoDecoder cvd in this.listVD.Values) - { + if (listChip[i].n発声時刻ms >= n希望発声時刻ms) { + index_min = i; + break; + } + } + if (index_min < 0) // 希望発声時刻に至らずに曲が終了してしまう場合 + { + // listの最終項目の時刻をそのまま使用する + //___のではダメ。BGMが尻切れになる。 + // そこで、listの最終項目の発声時刻msと発生位置から、希望発声時刻に相当する希望発声位置を比例計算して求める。 + //n新発声時刻ms = n希望発声時刻ms; + //n新発声位置 = listChip[ listChip.Count - 1 ].n発声位置 * n希望発声時刻ms / listChip[ listChip.Count - 1 ].n発声時刻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 (TJAPlayer3.r現在のステージ.eStageID == CStage.EStage.SongLoading) { + //まさかこれが原因で曲の読み込みが停止するとは思わなかった... + //どういうことかというとスキンを読み込むときに...いや厳密には + //RefleshSkinを呼び出した後一回Disposeしてnullにして解放(その後にまたインスタンスを作成する)するんだけど + //その時にここでTJAPlayer3.Skinを参照して例外が出ていたんだ.... + //いやいや! なんでTJAPlayer3.Skinをnullにした瞬間に参照されるんだ!と思った方もいるかもしれないですが + //実は曲の読み込みはマルチスレッドで実行されているのでnullにした瞬間に参照される可能性も十分にある + //それならアプリが終了するんじゃないかと思ったのだけどtryを使ってい曲の読み込みを続行していた... + //いやーマルチスレッドって難しいね! + if (!string.IsNullOrEmpty(TJAPlayer3.Skin.Game_Lyric_FontName)) { + this.pf歌詞フォント = new CCachedFontRenderer(TJAPlayer3.Skin.Game_Lyric_FontName, TJAPlayer3.Skin.Game_Lyric_FontSize); + } else { + this.pf歌詞フォント = new CCachedFontRenderer(CFontRenderer.DefaultFontName, TJAPlayer3.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; - TJAPlayer3.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; - } - TJAPlayer3.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 bool t入力_コマンド文字列を抜き出す(ref CharEnumerator ce, ref StringBuilder sb文字列) - { - if (!this.t入力_空白をスキップする(ref ce)) - return false; // 文字が尽きた - - #region [ コマンド終端文字(':')、半角空白、コメント開始文字(';')、改行のいずれかが出現するまでをコマンド文字列と見なし、sb文字列 にコピーする。] - //----------------- - while (ce.Current != ':' && ce.Current != ' ' && ce.Current != ';' && ce.Current != '\n') - { - sb文字列.Append(ce.Current); - - if (!ce.MoveNext()) - return false; // 文字が尽きた - } - //----------------- - #endregion - - #region [ コマンド終端文字(':')で終端したなら、その次から空白をスキップしておく。] - //----------------- - if (ce.Current == ':') - { - if (!ce.MoveNext()) - return false; // 文字が尽きた - - if (!this.t入力_空白をスキップする(ref ce)) - return false; // 文字が尽きた - } - //----------------- - #endregion - - return true; - } - private bool t入力_コメントをスキップする(ref CharEnumerator ce) - { - // 改行が現れるまでをコメントと見なしてスキップする。 - - while (ce.Current != '\n') - { - if (!ce.MoveNext()) - return false; // 文字が尽きた - } - - // 改行の次の文字へ移動した結果を返す。 - - return ce.MoveNext(); - } - private bool t入力_コメント文字列を抜き出す(ref CharEnumerator ce, ref StringBuilder sb文字列) - { - if (ce.Current != ';') // コメント開始文字(';')じゃなければ正常帰還。 - return true; - - if (!ce.MoveNext()) // ';' の次で文字列が終わってたら終了帰還。 - return false; - - #region [ ';' の次の文字から '\n' の1つ前までをコメント文字列と見なし、sb文字列にコピーする。] - //----------------- - while (ce.Current != '\n') - { - sb文字列.Append(ce.Current); - - if (!ce.MoveNext()) - return false; - } - //----------------- - #endregion - - return true; - } - private void t入力_パラメータ食い込みチェック(string strコマンド名, ref string strコマンド, ref string strパラメータ) - { - if ((strコマンド.Length > strコマンド名.Length) && strコマンド.StartsWith(strコマンド名, StringComparison.OrdinalIgnoreCase)) - { - strパラメータ = strコマンド.Substring(strコマンド名.Length).Trim(); - strコマンド = strコマンド.Substring(0, strコマンド名.Length); - } - } - private bool t入力_パラメータ文字列を抜き出す(ref CharEnumerator ce, ref StringBuilder sb文字列) - { - if (!this.t入力_空白をスキップする(ref ce)) - return false; // 文字が尽きた - - #region [ 改行またはコメント開始文字(';')が出現するまでをパラメータ文字列と見なし、sb文字列 にコピーする。] - //----------------- - while (ce.Current != '\n' && ce.Current != ';') - { - sb文字列.Append(ce.Current); - - if (!ce.MoveNext()) - return false; - } - //----------------- - #endregion - - return true; - } - private bool t入力_空白と改行をスキップする(ref CharEnumerator ce) - { - // 空白と改行が続く間はこれらをスキップする。 - - while (ce.Current == ' ' || ce.Current == '\n') - { - if (ce.Current == '\n') - this.n現在の行数++; // 改行文字では行番号が増える。 - - if (!ce.MoveNext()) - return false; // 文字が尽きた - } - - return true; - } - private bool t入力_空白をスキップする(ref CharEnumerator ce) - { - // 空白が続く間はこれをスキップする。 - - while (ce.Current == ' ') - { - if (!ce.MoveNext()) - return false; // 文字が尽きた - } - - return true; - } - private void t入力_行解析(ref StringBuilder sbコマンド, ref StringBuilder sbパラメータ, ref StringBuilder sbコメント) - { - string strコマンド = sbコマンド.ToString(); - string strパラメータ = sbパラメータ.ToString().Trim(); - string strコメント = sbコメント.ToString(); - - // 行頭コマンドの処理 - - #region [ IF ] - //----------------- - if (strコマンド.StartsWith("IF", StringComparison.OrdinalIgnoreCase)) - { - this.t入力_パラメータ食い込みチェック("IF", ref strコマンド, ref strパラメータ); - - if (this.bstackIFからENDIFをスキップする.Count == 255) - { - Trace.TraceWarning("#IF の入れ子の数が 255 を超えました。この #IF を無視します。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数); - } - else if (this.bstackIFからENDIFをスキップする.Peek()) - { - this.bstackIFからENDIFをスキップする.Push(true); // 親が true ならその入れ子も問答無用で true 。 - } - else // 親が false なら入れ子はパラメータと乱数を比較して結果を判断する。 - { - int n数値 = 0; - - if (!int.TryParse(strパラメータ, out n数値)) - n数値 = 1; - - this.bstackIFからENDIFをスキップする.Push(n数値 != this.n現在の乱数); // 乱数と数値が一致したら true 。 - } - } - //----------------- - #endregion - #region [ ENDIF ] - //----------------- - else if (strコマンド.StartsWith("ENDIF", StringComparison.OrdinalIgnoreCase)) - { - this.t入力_パラメータ食い込みチェック("ENDIF", ref strコマンド, ref strパラメータ); - - if (this.bstackIFからENDIFをスキップする.Count > 1) - { - this.bstackIFからENDIFをスキップする.Pop(); // 入れ子を1つ脱出。 - } - else - { - Trace.TraceWarning("#ENDIF に対応する #IF がありません。この #ENDIF を無視します。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数); - } - } - //----------------- - #endregion - - else if (!this.bstackIFからENDIFをスキップする.Peek()) // IF~ENDIF をスキップするなら以下はすべて無視。 - { - #region [ PATH_WAV ] - //----------------- - if (strコマンド.StartsWith("PATH_WAV", StringComparison.OrdinalIgnoreCase)) - { - this.t入力_パラメータ食い込みチェック("PATH_WAV", ref strコマンド, ref strパラメータ); - this.PATH_WAV = strパラメータ; - } - //----------------- - #endregion - #region [ TITLE ] - //----------------- - else if (strコマンド.StartsWith("TITLE", StringComparison.OrdinalIgnoreCase)) - { - //this.t入力_パラメータ食い込みチェック( "TITLE", ref strコマンド, ref strパラメータ ); - //this.TITLE = strパラメータ; - } - //----------------- - #endregion - #region [ ARTIST ] - //----------------- - else if (strコマンド.StartsWith("ARTIST", StringComparison.OrdinalIgnoreCase)) - { - this.t入力_パラメータ食い込みチェック("ARTIST", ref strコマンド, ref strパラメータ); - this.ARTIST = strパラメータ; - } - //----------------- - #endregion - #region [ COMMENT ] - //----------------- - else if (strコマンド.StartsWith("COMMENT", StringComparison.OrdinalIgnoreCase)) - { - this.t入力_パラメータ食い込みチェック("COMMENT", ref strコマンド, ref strパラメータ); - this.COMMENT = strパラメータ; - } - //----------------- - #endregion - #region [ GENRE ] - //----------------- - else if (strコマンド.StartsWith("GENRE", StringComparison.OrdinalIgnoreCase)) - { - this.t入力_パラメータ食い込みチェック("GENRE", ref strコマンド, ref strパラメータ); - this.GENRE = strパラメータ; - } - //----------------- - #endregion - #region [ MAKER ] - //----------------- - else if (strコマンド.StartsWith("MAKER", StringComparison.OrdinalIgnoreCase)) - { - this.t入力_パラメータ食い込みチェック("MAKER", ref strコマンド, ref strパラメータ); - this.MAKER = strパラメータ; - } - //----------------- - #endregion - #region [ SELECTBG ] - //----------------- - else if (strコマンド.StartsWith("SELECTBG", StringComparison.OrdinalIgnoreCase)) - { - this.t入力_パラメータ食い込みチェック("SELECTBG", ref strコマンド, ref strパラメータ); - this.SELECTBG = strパラメータ; - } - //----------------- - #endregion - #region [ HIDDENLEVEL ] - //----------------- - else if (strコマンド.StartsWith("HIDDENLEVEL", StringComparison.OrdinalIgnoreCase)) - { - this.t入力_パラメータ食い込みチェック("HIDDENLEVEL", ref strコマンド, ref strパラメータ); - this.HIDDENLEVEL = strパラメータ.ToLower().Equals("on"); - } - //----------------- - #endregion - #region [ PREVIEW ] - //----------------- - else if (strコマンド.StartsWith("PREVIEW", StringComparison.OrdinalIgnoreCase)) - { - this.t入力_パラメータ食い込みチェック("PREVIEW", ref strコマンド, ref strパラメータ); - this.PREVIEW = strパラメータ; - } - //----------------- - #endregion - #region [ PREIMAGE ] - //----------------- - else if (strコマンド.StartsWith("PREIMAGE", StringComparison.OrdinalIgnoreCase)) - { - this.t入力_パラメータ食い込みチェック("PREIMAGE", ref strコマンド, ref strパラメータ); - this.PREIMAGE = strパラメータ; - } - //----------------- - #endregion - #region [ RANDOM ] - //----------------- - else if (strコマンド.StartsWith("RANDOM", StringComparison.OrdinalIgnoreCase)) - { - this.t入力_パラメータ食い込みチェック("RANDOM", ref strコマンド, ref strパラメータ); - - int n数値 = 1; - if (!int.TryParse(strパラメータ, out n数値)) - n数値 = 1; - - this.n現在の乱数 = TJAPlayer3.Random.Next(n数値) + 1; // 1~数値 までの乱数を生成。 - } - //----------------- - #endregion - #region [ BPM ] - //----------------- - else if (strコマンド.StartsWith("BPM", StringComparison.OrdinalIgnoreCase)) - { - //this.t入力_行解析_BPM_BPMzz( strコマンド, strパラメータ, strコメント ); - } - //----------------- - #endregion - #region [ DTXVPLAYSPEED ] - //----------------- - else if (strコマンド.StartsWith("DTXVPLAYSPEED", StringComparison.OrdinalIgnoreCase)) - { - this.t入力_パラメータ食い込みチェック("DTXVPLAYSPEED", ref strコマンド, ref strパラメータ); - - double dtxvplayspeed = 0.0; - if (TryParse(strパラメータ, out dtxvplayspeed) && dtxvplayspeed > 0.0) - { - this.dbDTXVPlaySpeed = dtxvplayspeed; - } - } - //----------------- - #endregion - else if (!this.bヘッダのみ) // ヘッダのみの解析の場合、以下は無視。 - { - #region [ PANEL ] - //----------------- - if (strコマンド.StartsWith("PANEL", StringComparison.OrdinalIgnoreCase)) - { - this.t入力_パラメータ食い込みチェック("PANEL", ref strコマンド, ref strパラメータ); - - int dummyResult; // #23885 2010.12.12 yyagi: not to confuse "#PANEL strings (panel)" and "#PANEL int (panpot of EL)" - if (!int.TryParse(strパラメータ, out dummyResult)) - { // 数値じゃないならPANELとみなす - this.PANEL = strパラメータ; // - goto EOL; // - } // 数値ならPAN ELとみなす - - } - //----------------- - #endregion - #region [ BASEBPM ] - //----------------- - else if (strコマンド.StartsWith("BASEBPM", StringComparison.OrdinalIgnoreCase)) - { - this.t入力_パラメータ食い込みチェック("BASEBPM", ref strコマンド, ref strパラメータ); - - double basebpm = 0.0; - //if( double.TryParse( str2, out num6 ) && ( num6 > 0.0 ) ) - if (TryParse(strパラメータ, out basebpm) && basebpm > 0.0) // #23880 2010.12.30 yyagi: alternative TryParse to permit both '.' and ',' for decimal point - { // #24204 2011.01.21 yyagi: Fix the condition correctly - this.BASEBPM = basebpm; - } - } - //----------------- - #endregion - - // オブジェクト記述コマンドの処理。 - - else if ( - !this.t入力_行解析_WAVPAN_PAN(strコマンド, strパラメータ, strコメント) && - // !this.t入力_行解析_BPM_BPMzz( strコマンド, strパラメータ, strコメント ) && // bヘッダのみ==trueの場合でもチェックするよう変更 - !this.t入力_行解析_SIZE(strコマンド, strパラメータ, strコメント)) - { - this.t入力_行解析_チップ配置(strコマンド, strパラメータ, strコメント); - } - EOL: - Debug.Assert(true); // #23885 2010.12.12 yyagi: dummy line to exit parsing the line - // 2011.8.17 from: "int xx=0;" から変更。毎回警告が出るので。 - } - //else - //{ // Duration測定のため、bヘッダのみ==trueでも、チップ配置は行う - // this.t入力_行解析_チップ配置( strコマンド, strパラメータ, strコメント ); - //} - } - } - private bool t入力_行解析_BPM_BPMzz(string strコマンド, string strパラメータ, string strコメント) - { - // (1) コマンドを処理。 - - #region [ "BPM" で始まらないコマンドは無効。] - //----------------- - if (!strコマンド.StartsWith("BPM", StringComparison.OrdinalIgnoreCase)) - return false; - - strコマンド = strコマンド.Substring(3); // strコマンド から先頭の"BPM"文字を除去。 - //----------------- - #endregion - - // (2) パラメータを処理。 - - int zz = 0; - - #region [ BPM番号 zz を取得する。] - //----------------- - if (strコマンド.Length < 2) - { - #region [ (A) "#BPM:" の場合 → zz = 00 ] - //----------------- - zz = 0; - //----------------- - #endregion - } - else - { - #region [ (B) "#BPMzz:" の場合 → zz = 00 ~ ZZ ] - //----------------- - zz = CConversion.n36進数2桁の文字列を数値に変換して返す(strコマンド.Substring(0, 2)); - if (zz < 0 || zz >= 36 * 36) - { - Trace.TraceError("BPM番号に 00~ZZ 以外の値または不正な文字列が指定されました。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数); - return false; - } - //----------------- - #endregion - } - //----------------- - #endregion - - double dbBPM = 0.0; - - #region [ BPM値を取得する。] - //----------------- - //if( !double.TryParse( strパラメータ, out result ) ) - if (!TryParse(strパラメータ, out dbBPM)) // #23880 2010.12.30 yyagi: alternative TryParse to permit both '.' and ',' for decimal point - return false; - - if (dbBPM <= 0.0) - return false; - //----------------- - #endregion - - if (zz == 0) // "#BPM00:" と "#BPM:" は等価。 - this.BPM = dbBPM; // この曲の代表 BPM に格納する。 - - #region [ BPMリストに {内部番号, zz, dbBPM} の組を登録。] - //----------------- - this.listBPM.Add( - this.n内部番号BPM1to, - new CBPM() - { - n内部番号 = this.n内部番号BPM1to, - n表記上の番号 = zz, - dbBPM値 = dbBPM, - }); - //----------------- - #endregion - - #region [ BPM番号が zz であるBPM未設定のBPMチップがあれば、そのサイズを変更する。無限管理に対応。] - //----------------- - if (this.n無限管理BPM[zz] == -zz) // 初期状態では n無限管理BPM[zz] = -zz である。この場合、#BPMzz がまだ出現していないことを意味する。 - { - for (int i = 0; i < this.listChip.Count; i++) // これまでに出てきたチップのうち、該当する(BPM値が未設定の)BPMチップの値を変更する(仕組み上、必ず後方参照となる)。 - { - var chip = this.listChip[i]; - - if (chip.bBPMチップである && chip.n整数値_内部番号 == -zz) // #BPMzz 行より前の行に出現した #BPMzz では、整数値_内部番号は -zz に初期化されている。 - chip.n整数値_内部番号 = this.n内部番号BPM1to; - } - } - this.n無限管理BPM[zz] = this.n内部番号BPM1to; // 次にこの BPM番号 zz を使うBPMチップが現れたら、このBPM値が格納されることになる。 - this.n内部番号BPM1to++; // 内部番号は単純増加連番。 - //----------------- - #endregion - - return true; - } - - private bool t入力_行解析_SIZE(string strコマンド, string strパラメータ, string strコメント) - { - // (1) コマンドを処理。 - - #region [ "SIZE" で始まらないコマンドや、その後ろに2文字(番号)が付随してないコマンドは無効。] - //----------------- - if (!strコマンド.StartsWith("SIZE", StringComparison.OrdinalIgnoreCase)) - return false; - - strコマンド = strコマンド.Substring(4); // strコマンド から先頭の"SIZE"文字を除去。 - - if (strコマンド.Length < 2) // サイズ番号の指定がない場合は無効。 - return false; - //----------------- - #endregion - - #region [ nWAV番号(36進数2桁)を取得。] - //----------------- - int nWAV番号 = CConversion.n36進数2桁の文字列を数値に変換して返す(strコマンド.Substring(0, 2)); - - if (nWAV番号 < 0 || nWAV番号 >= 36 * 36) - { - Trace.TraceError("SIZEのWAV番号に 00~ZZ 以外の値または不正な文字列が指定されました。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数); - return false; - } - //----------------- - #endregion - - - // (2) パラメータを処理。 - - #region [ nサイズ値 を取得する。値は 0~100 に収める。] - //----------------- - int nサイズ値; - - if (!int.TryParse(strパラメータ, out nサイズ値)) - return true; // int変換に失敗しても、この行自体の処理は終えたのでtrueを返す。 - - nサイズ値 = Math.Min(Math.Max(nサイズ値, 0), 100); // 0未満は0、100超えは100に強制変換。 - //----------------- - #endregion - - #region [ nWAV番号で示されるサイズ未設定のWAVチップがあれば、そのサイズを変更する。無限管理に対応。] - //----------------- - if (this.n無限管理SIZE[nWAV番号] == -nWAV番号) // 初期状態では n無限管理SIZE[xx] = -xx である。この場合、#SIZExx がまだ出現していないことを意味する。 - { - foreach (CWAV wav in this.listWAV.Values) // これまでに出てきたWAVチップのうち、該当する(サイズが未設定の)チップのサイズを変更する(仕組み上、必ず後方参照となる)。 - { - if (wav.nチップサイズ == -nWAV番号) // #SIZExx 行より前の行に出現した #WAVxx では、チップサイズは -xx に初期化されている。 - wav.nチップサイズ = nサイズ値; - } - } - this.n無限管理SIZE[nWAV番号] = nサイズ値; // 次にこの nWAV番号を使うWAVチップが現れたら、負数の代わりに、このサイズ値が格納されることになる。 - //----------------- - #endregion - - return true; - } - private bool t入力_行解析_WAVPAN_PAN(string strコマンド, string strパラメータ, string strコメント) - { - // (1) コマンドを処理。 - - #region [ "WAVPAN" or "PAN" で始まらないコマンドは無効。] - //----------------- - if (strコマンド.StartsWith("WAVPAN", StringComparison.OrdinalIgnoreCase)) - strコマンド = strコマンド.Substring(6); // strコマンド から先頭の"WAVPAN"文字を除去。 - - else if (strコマンド.StartsWith("PAN", StringComparison.OrdinalIgnoreCase)) - strコマンド = strコマンド.Substring(3); // strコマンド から先頭の"PAN"文字を除去。 - - else - return false; - //----------------- - #endregion - - // (2) パラメータを処理。 - - if (strコマンド.Length < 2) - return false; // WAV番号 zz がないなら無効。 - - #region [ WAV番号 zz を取得する。] - //----------------- - int zz = CConversion.n36進数2桁の文字列を数値に変換して返す(strコマンド.Substring(0, 2)); - if (zz < 0 || zz >= 36 * 36) - { - Trace.TraceError("WAVPAN(PAN)のWAV番号に 00~ZZ 以外の値または不正な文字列が指定されました。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数); - return false; - } - //----------------- - #endregion - - #region [ WAV番号 zz を持つWAVチップの位置を変更する。無限定義対応。] - //----------------- - int n位置; - if (int.TryParse(strパラメータ, out n位置)) - { - n位置 = Math.Min(Math.Max(n位置, -100), 100); // -100~+100 に丸める - - if (this.n無限管理PAN[zz] == (-10000 - zz)) // 初期状態では n無限管理PAN[zz] = -10000 - zz である。この場合、#WAVPANzz, #PANzz がまだ出現していないことを意味する。 - { - foreach (CWAV wav in this.listWAV.Values) // これまでに出てきたチップのうち、該当する(位置が未設定の)WAVチップの値を変更する(仕組み上、必ず後方参照となる)。 - { - if (wav.n位置 == (-10000 - zz)) // #WAVPANzz, #PANzz 行より前の行に出現した #WAVzz では、位置は -10000-zz に初期化されている。 - wav.n位置 = n位置; - } - } - this.n無限管理PAN[zz] = n位置; // 次にこの WAV番号 zz を使うWAVチップが現れたら、この位置が格納されることになる。 - } - //----------------- - #endregion - - return true; - } - private bool t入力_行解析_チップ配置(string strコマンド, string strパラメータ, string strコメント) - { - // (1) コマンドを処理。 - - if (strコマンド.Length != 5) // コマンドは必ず5文字であること。 - return false; - - #region [ n小節番号 を取得する。] - //----------------- - int n小節番号 = CConversion.n小節番号の文字列3桁を数値に変換して返す(strコマンド.Substring(0, 3)); - if (n小節番号 < 0) - return false; - - n小節番号++; // 先頭に空の1小節を設ける。 - //----------------- - #endregion - - #region [ nチャンネル番号 を取得する。] - //----------------- - int nチャンネル番号 = -1; - - // ファイルフォーマットによって処理が異なる。 - #region [ (B) その他の場合:チャンネル番号は16進数2桁。] - //----------------- - nチャンネル番号 = CConversion.n16進数2桁の文字列を数値に変換して返す(strコマンド.Substring(3, 2)); - - if (nチャンネル番号 < 0) - return false; - //----------------- - #endregion - //----------------- - #endregion - #region [ 取得したチャンネル番号で、this.bチップがある に該当があれば設定する。] - //----------------- - if ((nチャンネル番号 >= 0x11) && (nチャンネル番号 <= 0x1a)) - { - this.bチップがある.Drums = true; - } - else if ((nチャンネル番号 >= 0x20) && (nチャンネル番号 <= 0x27)) - { - this.bチップがある.Guitar = true; - } - else if ((nチャンネル番号 >= 0xA0) && (nチャンネル番号 <= 0xa7)) - { - this.bチップがある.Bass = true; - } - switch (nチャンネル番号) - { - case 0x18: - this.bチップがある.HHOpen = true; - break; - - case 0x19: - this.bチップがある.Ride = true; - break; - - case 0x1a: - this.bチップがある.LeftCymbal = true; - break; - - case 0x20: - this.bチップがある.OpenGuitar = true; - break; - - case 0xA0: - this.bチップがある.OpenBass = true; - break; - } - //----------------- - #endregion - - - // (2) Ch.02を処理。 - - #region [ 小節長変更(Ch.02)は他のチャンネルとはパラメータが特殊なので、先にとっとと終わらせる。 ] - //----------------- - if (nチャンネル番号 == 0x02) - { - // 小節長倍率を取得する。 - - double db小節長倍率 = 1.0; - //if( !double.TryParse( strパラメータ, out result ) ) - if (!this.TryParse(strパラメータ, out db小節長倍率)) // #23880 2010.12.30 yyagi: alternative TryParse to permit both '.' and ',' for decimal point - { - Trace.TraceError("小節長倍率に不正な値を指定しました。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数); - return false; - } - - // 小節長倍率チップを配置する。 - - this.listChip.Insert( - 0, - new CChip() - { - nチャンネル番号 = nチャンネル番号, - db実数値 = db小節長倍率, - n発声位置 = n小節番号 * 384, - }); - - return true; // 配置終了。 - } - //----------------- - #endregion - - - // (3) パラメータを処理。 - - if (string.IsNullOrEmpty(strパラメータ)) // パラメータはnullまたは空文字列ではないこと。 - return false; - - #region [ strパラメータ にオブジェクト記述を格納し、その n文字数 をカウントする。] - //----------------- - int n文字数 = 0; - - var sb = new StringBuilder(strパラメータ.Length); - - // strパラメータを先頭から1文字ずつ見ながら正規化(無効文字('_')を飛ばしたり不正な文字でエラーを出したり)し、sb へ格納する。 - - CharEnumerator ce = strパラメータ.GetEnumerator(); - while (ce.MoveNext()) - { - if (ce.Current == '_') // '_' は無視。 - continue; - - if (CConversion.str36進数文字.IndexOf(ce.Current) < 0) // オブジェクト記述は36進数文字であること。 - { - Trace.TraceError("不正なオブジェクト指定があります。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数); - return false; - } - - sb.Append(ce.Current); - n文字数++; - } - - strパラメータ = sb.ToString(); // 正規化された文字列になりました。 - - if ((n文字数 % 2) != 0) // パラメータの文字数が奇数の場合、最後の1文字を無視する。 - n文字数--; - //----------------- - #endregion - - - // (4) パラメータをオブジェクト数値に分解して配置する。 - - for (int i = 0; i < (n文字数 / 2); i++) // 2文字で1オブジェクト数値 - { - #region [ nオブジェクト数値 を1つ取得する。'00' なら無視。] - //----------------- - int nオブジェクト数値 = 0; - - if (nチャンネル番号 == 0x03) - { - // Ch.03 のみ 16進数2桁。 - nオブジェクト数値 = CConversion.n16進数2桁の文字列を数値に変換して返す(strパラメータ.Substring(i * 2, 2)); - } - else - { - // その他のチャンネルは36進数2桁。 - nオブジェクト数値 = CConversion.n36進数2桁の文字列を数値に変換して返す(strパラメータ.Substring(i * 2, 2)); - } - - if (nオブジェクト数値 == 0x00) - continue; - //----------------- - #endregion - - // オブジェクト数値に対応するチップを生成。 - - var chip = new CChip(); - - chip.nチャンネル番号 = nチャンネル番号; - chip.n発声位置 = (n小節番号 * 384) + ((384 * i) / (n文字数 / 2)); - chip.n整数値 = nオブジェクト数値; - chip.n整数値_内部番号 = nオブジェクト数値; - - #region [ chip.e楽器パート = ... ] - //----------------- - if ((nチャンネル番号 >= 0x11) && (nチャンネル番号 <= 0x1C)) - { - chip.e楽器パート = EInstrumentPad.DRUMS; - } - if ((nチャンネル番号 >= 0x20) && (nチャンネル番号 <= 0x27)) - { - chip.e楽器パート = EInstrumentPad.GUITAR; - } - if ((nチャンネル番号 >= 160) && (nチャンネル番号 <= 0xA7)) - { - chip.e楽器パート = EInstrumentPad.BASS; - } - //----------------- - #endregion - - #region [ 無限定義への対応 → 内部番号の取得。] - //----------------- - if (chip.nチャンネル番号 == 0x01) - { - chip.n整数値_内部番号 = this.n無限管理WAV[nオブジェクト数値]; // これが本当に一意なWAV番号となる。(無限定義の場合、chip.n整数値 は一意である保証がない。) - } - else if (chip.bBPMチップである) - { - chip.n整数値_内部番号 = this.n無限管理BPM[nオブジェクト数値]; // これが本当に一意なBPM番号となる。(同上。) - } - //----------------- - #endregion - - #region [ フィルインON/OFFチャンネル(Ch.53)の場合、発声位置を少し前後にずらす。] - //----------------- - if (nチャンネル番号 == 0x53) - { - // ずらすのは、フィルインONチップと同じ位置にいるチップでも確実にフィルインが発動し、 - // 同様に、フィルインOFFチップと同じ位置にいるチップでも確実にフィルインが終了するようにするため。 - - if ((nオブジェクト数値 > 0) && (nオブジェクト数値 != 2)) - { - chip.n発声位置 -= 32; // 384÷32=12 ということで、フィルインONチップは12分音符ほど前へ移動。 - } - else if (nオブジェクト数値 == 2) - { - chip.n発声位置 += 32; // 同じく、フィルインOFFチップは12分音符ほど後ろへ移動。 - } - } - //----------------- - #endregion - - // チップを配置。 - - this.listChip.Add(chip); - } - return true; - } - #region [#23880 2010.12.30 yyagi: コンマとスペースの両方を小数点として扱うTryParse] - /// - /// 小数点としてコンマとピリオドの両方を受け付けるTryParse() - /// - /// strings convert to double - /// parsed double value - /// s が正常に変換された場合は true。それ以外の場合は false。 - /// style が NumberStyles 値でないか、style に NumberStyles.AllowHexSpecifier 値が含まれている - private bool TryParse(string s, out double result) - { // #23880 2010.12.30 yyagi: alternative TryParse to permit both '.' and ',' for decimal point - // EU諸国での #BPM 123,45 のような記述に対応するため、 - // 小数点の最終位置を検出して、それをlocaleにあった - // 文字に置き換えてからTryParse()する - // 桁区切りの文字はスキップする - - const string DecimalSeparators = ".,"; // 小数点文字 - const string GroupSeparators = ".,' "; // 桁区切り文字 - const string NumberSymbols = "0123456789"; // 数値文字 - - int len = s.Length; // 文字列長 - int decimalPosition = len; // 真の小数点の位置 最初は文字列終端位置に仮置きする - - for (int i = 0; i < len; i++) - { // まず、真の小数点(一番最後に現れる小数点)の位置を求める - char c = s[i]; - if (NumberSymbols.IndexOf(c) >= 0) - { // 数値だったらスキップ - continue; - } - else if (DecimalSeparators.IndexOf(c) >= 0) - { // 小数点文字だったら、その都度位置を上書き記憶 - decimalPosition = i; - } - else if (GroupSeparators.IndexOf(c) >= 0) - { // 桁区切り文字の場合もスキップ - continue; - } - else - { // 数値_小数点_区切り文字以外がきたらループ終了 - break; - } - } - - StringBuilder decimalStr = new StringBuilder(16); - for (int i = 0; i < len; i++) - { // 次に、localeにあった数値文字列を生成する - char c = s[i]; - if (NumberSymbols.IndexOf(c) >= 0) - { // 数値だったら - decimalStr.Append(c); // そのままコピー - } - else if (DecimalSeparators.IndexOf(c) >= 0) - { // 小数点文字だったら - if (i == decimalPosition) - { // 最後に出現した小数点文字なら、localeに合った小数点を出力する - decimalStr.Append(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator); - } - } - else if (GroupSeparators.IndexOf(c) >= 0) - { // 桁区切り文字だったら - continue; // 何もしない(スキップ) - } - else - { - break; - } - } - return double.TryParse(decimalStr.ToString(), out result); // 最後に、自分のlocale向けの文字列に対してTryParse実行 - } - #endregion - /// - /// 音源再生前の空白を追加するメソッド。 - /// - private void AddMusicPreTimeMs() - { - this.dbNowTime += TJAPlayer3.ConfigIni.MusicPreTimeMs; - this.dbNowBMScollTime += TJAPlayer3.ConfigIni.MusicPreTimeMs * this.dbNowBPM / 15000; - } - //----------------- - #endregion - } + 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; + TJAPlayer3.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; + } + TJAPlayer3.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 bool t入力_コマンド文字列を抜き出す(ref CharEnumerator ce, ref StringBuilder sb文字列) { + if (!this.t入力_空白をスキップする(ref ce)) + return false; // 文字が尽きた + + #region [ コマンド終端文字(':')、半角空白、コメント開始文字(';')、改行のいずれかが出現するまでをコマンド文字列と見なし、sb文字列 にコピーする。] + //----------------- + while (ce.Current != ':' && ce.Current != ' ' && ce.Current != ';' && ce.Current != '\n') { + sb文字列.Append(ce.Current); + + if (!ce.MoveNext()) + return false; // 文字が尽きた + } + //----------------- + #endregion + + #region [ コマンド終端文字(':')で終端したなら、その次から空白をスキップしておく。] + //----------------- + if (ce.Current == ':') { + if (!ce.MoveNext()) + return false; // 文字が尽きた + + if (!this.t入力_空白をスキップする(ref ce)) + return false; // 文字が尽きた + } + //----------------- + #endregion + + return true; + } + private bool t入力_コメントをスキップする(ref CharEnumerator ce) { + // 改行が現れるまでをコメントと見なしてスキップする。 + + while (ce.Current != '\n') { + if (!ce.MoveNext()) + return false; // 文字が尽きた + } + + // 改行の次の文字へ移動した結果を返す。 + + return ce.MoveNext(); + } + private bool t入力_コメント文字列を抜き出す(ref CharEnumerator ce, ref StringBuilder sb文字列) { + if (ce.Current != ';') // コメント開始文字(';')じゃなければ正常帰還。 + return true; + + if (!ce.MoveNext()) // ';' の次で文字列が終わってたら終了帰還。 + return false; + + #region [ ';' の次の文字から '\n' の1つ前までをコメント文字列と見なし、sb文字列にコピーする。] + //----------------- + while (ce.Current != '\n') { + sb文字列.Append(ce.Current); + + if (!ce.MoveNext()) + return false; + } + //----------------- + #endregion + + return true; + } + private void t入力_パラメータ食い込みチェック(string strコマンド名, ref string strコマンド, ref string strパラメータ) { + if ((strコマンド.Length > strコマンド名.Length) && strコマンド.StartsWith(strコマンド名, StringComparison.OrdinalIgnoreCase)) { + strパラメータ = strコマンド.Substring(strコマンド名.Length).Trim(); + strコマンド = strコマンド.Substring(0, strコマンド名.Length); + } + } + private bool t入力_パラメータ文字列を抜き出す(ref CharEnumerator ce, ref StringBuilder sb文字列) { + if (!this.t入力_空白をスキップする(ref ce)) + return false; // 文字が尽きた + + #region [ 改行またはコメント開始文字(';')が出現するまでをパラメータ文字列と見なし、sb文字列 にコピーする。] + //----------------- + while (ce.Current != '\n' && ce.Current != ';') { + sb文字列.Append(ce.Current); + + if (!ce.MoveNext()) + return false; + } + //----------------- + #endregion + + return true; + } + private bool t入力_空白と改行をスキップする(ref CharEnumerator ce) { + // 空白と改行が続く間はこれらをスキップする。 + + while (ce.Current == ' ' || ce.Current == '\n') { + if (ce.Current == '\n') + this.n現在の行数++; // 改行文字では行番号が増える。 + + if (!ce.MoveNext()) + return false; // 文字が尽きた + } + + return true; + } + private bool t入力_空白をスキップする(ref CharEnumerator ce) { + // 空白が続く間はこれをスキップする。 + + while (ce.Current == ' ') { + if (!ce.MoveNext()) + return false; // 文字が尽きた + } + + return true; + } + private void t入力_行解析(ref StringBuilder sbコマンド, ref StringBuilder sbパラメータ, ref StringBuilder sbコメント) { + string strコマンド = sbコマンド.ToString(); + string strパラメータ = sbパラメータ.ToString().Trim(); + string strコメント = sbコメント.ToString(); + + // 行頭コマンドの処理 + + #region [ IF ] + //----------------- + if (strコマンド.StartsWith("IF", StringComparison.OrdinalIgnoreCase)) { + this.t入力_パラメータ食い込みチェック("IF", ref strコマンド, ref strパラメータ); + + if (this.bstackIFからENDIFをスキップする.Count == 255) { + Trace.TraceWarning("#IF の入れ子の数が 255 を超えました。この #IF を無視します。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数); + } else if (this.bstackIFからENDIFをスキップする.Peek()) { + this.bstackIFからENDIFをスキップする.Push(true); // 親が true ならその入れ子も問答無用で true 。 + } else // 親が false なら入れ子はパラメータと乱数を比較して結果を判断する。 + { + int n数値 = 0; + + if (!int.TryParse(strパラメータ, out n数値)) + n数値 = 1; + + this.bstackIFからENDIFをスキップする.Push(n数値 != this.n現在の乱数); // 乱数と数値が一致したら true 。 + } + } + //----------------- + #endregion + #region [ ENDIF ] + //----------------- + else if (strコマンド.StartsWith("ENDIF", StringComparison.OrdinalIgnoreCase)) { + this.t入力_パラメータ食い込みチェック("ENDIF", ref strコマンド, ref strパラメータ); + + if (this.bstackIFからENDIFをスキップする.Count > 1) { + this.bstackIFからENDIFをスキップする.Pop(); // 入れ子を1つ脱出。 + } else { + Trace.TraceWarning("#ENDIF に対応する #IF がありません。この #ENDIF を無視します。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数); + } + } + //----------------- + #endregion + + else if (!this.bstackIFからENDIFをスキップする.Peek()) // IF~ENDIF をスキップするなら以下はすべて無視。 + { + #region [ PATH_WAV ] + //----------------- + if (strコマンド.StartsWith("PATH_WAV", StringComparison.OrdinalIgnoreCase)) { + this.t入力_パラメータ食い込みチェック("PATH_WAV", ref strコマンド, ref strパラメータ); + this.PATH_WAV = strパラメータ; + } + //----------------- + #endregion + #region [ TITLE ] + //----------------- + else if (strコマンド.StartsWith("TITLE", StringComparison.OrdinalIgnoreCase)) { + //this.t入力_パラメータ食い込みチェック( "TITLE", ref strコマンド, ref strパラメータ ); + //this.TITLE = strパラメータ; + } + //----------------- + #endregion + #region [ ARTIST ] + //----------------- + else if (strコマンド.StartsWith("ARTIST", StringComparison.OrdinalIgnoreCase)) { + this.t入力_パラメータ食い込みチェック("ARTIST", ref strコマンド, ref strパラメータ); + this.ARTIST = strパラメータ; + } + //----------------- + #endregion + #region [ COMMENT ] + //----------------- + else if (strコマンド.StartsWith("COMMENT", StringComparison.OrdinalIgnoreCase)) { + this.t入力_パラメータ食い込みチェック("COMMENT", ref strコマンド, ref strパラメータ); + this.COMMENT = strパラメータ; + } + //----------------- + #endregion + #region [ GENRE ] + //----------------- + else if (strコマンド.StartsWith("GENRE", StringComparison.OrdinalIgnoreCase)) { + this.t入力_パラメータ食い込みチェック("GENRE", ref strコマンド, ref strパラメータ); + this.GENRE = strパラメータ; + } + //----------------- + #endregion + #region [ MAKER ] + //----------------- + else if (strコマンド.StartsWith("MAKER", StringComparison.OrdinalIgnoreCase)) { + this.t入力_パラメータ食い込みチェック("MAKER", ref strコマンド, ref strパラメータ); + this.MAKER = strパラメータ; + } + //----------------- + #endregion + #region [ SELECTBG ] + //----------------- + else if (strコマンド.StartsWith("SELECTBG", StringComparison.OrdinalIgnoreCase)) { + this.t入力_パラメータ食い込みチェック("SELECTBG", ref strコマンド, ref strパラメータ); + this.SELECTBG = strパラメータ; + } + //----------------- + #endregion + #region [ HIDDENLEVEL ] + //----------------- + else if (strコマンド.StartsWith("HIDDENLEVEL", StringComparison.OrdinalIgnoreCase)) { + this.t入力_パラメータ食い込みチェック("HIDDENLEVEL", ref strコマンド, ref strパラメータ); + this.HIDDENLEVEL = strパラメータ.ToLower().Equals("on"); + } + //----------------- + #endregion + #region [ PREVIEW ] + //----------------- + else if (strコマンド.StartsWith("PREVIEW", StringComparison.OrdinalIgnoreCase)) { + this.t入力_パラメータ食い込みチェック("PREVIEW", ref strコマンド, ref strパラメータ); + this.PREVIEW = strパラメータ; + } + //----------------- + #endregion + #region [ PREIMAGE ] + //----------------- + else if (strコマンド.StartsWith("PREIMAGE", StringComparison.OrdinalIgnoreCase)) { + this.t入力_パラメータ食い込みチェック("PREIMAGE", ref strコマンド, ref strパラメータ); + this.PREIMAGE = strパラメータ; + } + //----------------- + #endregion + #region [ RANDOM ] + //----------------- + else if (strコマンド.StartsWith("RANDOM", StringComparison.OrdinalIgnoreCase)) { + this.t入力_パラメータ食い込みチェック("RANDOM", ref strコマンド, ref strパラメータ); + + int n数値 = 1; + if (!int.TryParse(strパラメータ, out n数値)) + n数値 = 1; + + this.n現在の乱数 = TJAPlayer3.Random.Next(n数値) + 1; // 1~数値 までの乱数を生成。 + } + //----------------- + #endregion + #region [ BPM ] + //----------------- + else if (strコマンド.StartsWith("BPM", StringComparison.OrdinalIgnoreCase)) { + //this.t入力_行解析_BPM_BPMzz( strコマンド, strパラメータ, strコメント ); + } + //----------------- + #endregion + #region [ DTXVPLAYSPEED ] + //----------------- + else if (strコマンド.StartsWith("DTXVPLAYSPEED", StringComparison.OrdinalIgnoreCase)) { + this.t入力_パラメータ食い込みチェック("DTXVPLAYSPEED", ref strコマンド, ref strパラメータ); + + double dtxvplayspeed = 0.0; + if (TryParse(strパラメータ, out dtxvplayspeed) && dtxvplayspeed > 0.0) { + this.dbDTXVPlaySpeed = dtxvplayspeed; + } + } + //----------------- + #endregion + else if (!this.bヘッダのみ) // ヘッダのみの解析の場合、以下は無視。 + { + #region [ PANEL ] + //----------------- + if (strコマンド.StartsWith("PANEL", StringComparison.OrdinalIgnoreCase)) { + this.t入力_パラメータ食い込みチェック("PANEL", ref strコマンド, ref strパラメータ); + + int dummyResult; // #23885 2010.12.12 yyagi: not to confuse "#PANEL strings (panel)" and "#PANEL int (panpot of EL)" + if (!int.TryParse(strパラメータ, out dummyResult)) { // 数値じゃないならPANELとみなす + this.PANEL = strパラメータ; // + goto EOL; // + } // 数値ならPAN ELとみなす + + } + //----------------- + #endregion + #region [ BASEBPM ] + //----------------- + else if (strコマンド.StartsWith("BASEBPM", StringComparison.OrdinalIgnoreCase)) { + this.t入力_パラメータ食い込みチェック("BASEBPM", ref strコマンド, ref strパラメータ); + + double basebpm = 0.0; + //if( double.TryParse( str2, out num6 ) && ( num6 > 0.0 ) ) + if (TryParse(strパラメータ, out basebpm) && basebpm > 0.0) // #23880 2010.12.30 yyagi: alternative TryParse to permit both '.' and ',' for decimal point + { // #24204 2011.01.21 yyagi: Fix the condition correctly + this.BASEBPM = basebpm; + } + } + //----------------- + #endregion + + // オブジェクト記述コマンドの処理。 + + else if ( + !this.t入力_行解析_WAVPAN_PAN(strコマンド, strパラメータ, strコメント) && + // !this.t入力_行解析_BPM_BPMzz( strコマンド, strパラメータ, strコメント ) && // bヘッダのみ==trueの場合でもチェックするよう変更 + !this.t入力_行解析_SIZE(strコマンド, strパラメータ, strコメント)) { + this.t入力_行解析_チップ配置(strコマンド, strパラメータ, strコメント); + } + EOL: + Debug.Assert(true); // #23885 2010.12.12 yyagi: dummy line to exit parsing the line + // 2011.8.17 from: "int xx=0;" から変更。毎回警告が出るので。 + } + //else + //{ // Duration測定のため、bヘッダのみ==trueでも、チップ配置は行う + // this.t入力_行解析_チップ配置( strコマンド, strパラメータ, strコメント ); + //} + } + } + private bool t入力_行解析_BPM_BPMzz(string strコマンド, string strパラメータ, string strコメント) { + // (1) コマンドを処理。 + + #region [ "BPM" で始まらないコマンドは無効。] + //----------------- + if (!strコマンド.StartsWith("BPM", StringComparison.OrdinalIgnoreCase)) + return false; + + strコマンド = strコマンド.Substring(3); // strコマンド から先頭の"BPM"文字を除去。 + //----------------- + #endregion + + // (2) パラメータを処理。 + + int zz = 0; + + #region [ BPM番号 zz を取得する。] + //----------------- + if (strコマンド.Length < 2) { + #region [ (A) "#BPM:" の場合 → zz = 00 ] + //----------------- + zz = 0; + //----------------- + #endregion + } else { + #region [ (B) "#BPMzz:" の場合 → zz = 00 ~ ZZ ] + //----------------- + zz = CConversion.n36進数2桁の文字列を数値に変換して返す(strコマンド.Substring(0, 2)); + if (zz < 0 || zz >= 36 * 36) { + Trace.TraceError("BPM番号に 00~ZZ 以外の値または不正な文字列が指定されました。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数); + return false; + } + //----------------- + #endregion + } + //----------------- + #endregion + + double dbBPM = 0.0; + + #region [ BPM値を取得する。] + //----------------- + //if( !double.TryParse( strパラメータ, out result ) ) + if (!TryParse(strパラメータ, out dbBPM)) // #23880 2010.12.30 yyagi: alternative TryParse to permit both '.' and ',' for decimal point + return false; + + if (dbBPM <= 0.0) + return false; + //----------------- + #endregion + + if (zz == 0) // "#BPM00:" と "#BPM:" は等価。 + this.BPM = dbBPM; // この曲の代表 BPM に格納する。 + + #region [ BPMリストに {内部番号, zz, dbBPM} の組を登録。] + //----------------- + this.listBPM.Add( + this.n内部番号BPM1to, + new CBPM() { + n内部番号 = this.n内部番号BPM1to, + n表記上の番号 = zz, + dbBPM値 = dbBPM, + }); + //----------------- + #endregion + + #region [ BPM番号が zz であるBPM未設定のBPMチップがあれば、そのサイズを変更する。無限管理に対応。] + //----------------- + if (this.n無限管理BPM[zz] == -zz) // 初期状態では n無限管理BPM[zz] = -zz である。この場合、#BPMzz がまだ出現していないことを意味する。 + { + for (int i = 0; i < this.listChip.Count; i++) // これまでに出てきたチップのうち、該当する(BPM値が未設定の)BPMチップの値を変更する(仕組み上、必ず後方参照となる)。 + { + var chip = this.listChip[i]; + + if (chip.bBPMチップである && chip.n整数値_内部番号 == -zz) // #BPMzz 行より前の行に出現した #BPMzz では、整数値_内部番号は -zz に初期化されている。 + chip.n整数値_内部番号 = this.n内部番号BPM1to; + } + } + this.n無限管理BPM[zz] = this.n内部番号BPM1to; // 次にこの BPM番号 zz を使うBPMチップが現れたら、このBPM値が格納されることになる。 + this.n内部番号BPM1to++; // 内部番号は単純増加連番。 + //----------------- + #endregion + + return true; + } + + private bool t入力_行解析_SIZE(string strコマンド, string strパラメータ, string strコメント) { + // (1) コマンドを処理。 + + #region [ "SIZE" で始まらないコマンドや、その後ろに2文字(番号)が付随してないコマンドは無効。] + //----------------- + if (!strコマンド.StartsWith("SIZE", StringComparison.OrdinalIgnoreCase)) + return false; + + strコマンド = strコマンド.Substring(4); // strコマンド から先頭の"SIZE"文字を除去。 + + if (strコマンド.Length < 2) // サイズ番号の指定がない場合は無効。 + return false; + //----------------- + #endregion + + #region [ nWAV番号(36進数2桁)を取得。] + //----------------- + int nWAV番号 = CConversion.n36進数2桁の文字列を数値に変換して返す(strコマンド.Substring(0, 2)); + + if (nWAV番号 < 0 || nWAV番号 >= 36 * 36) { + Trace.TraceError("SIZEのWAV番号に 00~ZZ 以外の値または不正な文字列が指定されました。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数); + return false; + } + //----------------- + #endregion + + + // (2) パラメータを処理。 + + #region [ nサイズ値 を取得する。値は 0~100 に収める。] + //----------------- + int nサイズ値; + + if (!int.TryParse(strパラメータ, out nサイズ値)) + return true; // int変換に失敗しても、この行自体の処理は終えたのでtrueを返す。 + + nサイズ値 = Math.Min(Math.Max(nサイズ値, 0), 100); // 0未満は0、100超えは100に強制変換。 + //----------------- + #endregion + + #region [ nWAV番号で示されるサイズ未設定のWAVチップがあれば、そのサイズを変更する。無限管理に対応。] + //----------------- + if (this.n無限管理SIZE[nWAV番号] == -nWAV番号) // 初期状態では n無限管理SIZE[xx] = -xx である。この場合、#SIZExx がまだ出現していないことを意味する。 + { + foreach (CWAV wav in this.listWAV.Values) // これまでに出てきたWAVチップのうち、該当する(サイズが未設定の)チップのサイズを変更する(仕組み上、必ず後方参照となる)。 + { + if (wav.nチップサイズ == -nWAV番号) // #SIZExx 行より前の行に出現した #WAVxx では、チップサイズは -xx に初期化されている。 + wav.nチップサイズ = nサイズ値; + } + } + this.n無限管理SIZE[nWAV番号] = nサイズ値; // 次にこの nWAV番号を使うWAVチップが現れたら、負数の代わりに、このサイズ値が格納されることになる。 + //----------------- + #endregion + + return true; + } + private bool t入力_行解析_WAVPAN_PAN(string strコマンド, string strパラメータ, string strコメント) { + // (1) コマンドを処理。 + + #region [ "WAVPAN" or "PAN" で始まらないコマンドは無効。] + //----------------- + if (strコマンド.StartsWith("WAVPAN", StringComparison.OrdinalIgnoreCase)) + strコマンド = strコマンド.Substring(6); // strコマンド から先頭の"WAVPAN"文字を除去。 + + else if (strコマンド.StartsWith("PAN", StringComparison.OrdinalIgnoreCase)) + strコマンド = strコマンド.Substring(3); // strコマンド から先頭の"PAN"文字を除去。 + + else + return false; + //----------------- + #endregion + + // (2) パラメータを処理。 + + if (strコマンド.Length < 2) + return false; // WAV番号 zz がないなら無効。 + + #region [ WAV番号 zz を取得する。] + //----------------- + int zz = CConversion.n36進数2桁の文字列を数値に変換して返す(strコマンド.Substring(0, 2)); + if (zz < 0 || zz >= 36 * 36) { + Trace.TraceError("WAVPAN(PAN)のWAV番号に 00~ZZ 以外の値または不正な文字列が指定されました。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数); + return false; + } + //----------------- + #endregion + + #region [ WAV番号 zz を持つWAVチップの位置を変更する。無限定義対応。] + //----------------- + int n位置; + if (int.TryParse(strパラメータ, out n位置)) { + n位置 = Math.Min(Math.Max(n位置, -100), 100); // -100~+100 に丸める + + if (this.n無限管理PAN[zz] == (-10000 - zz)) // 初期状態では n無限管理PAN[zz] = -10000 - zz である。この場合、#WAVPANzz, #PANzz がまだ出現していないことを意味する。 + { + foreach (CWAV wav in this.listWAV.Values) // これまでに出てきたチップのうち、該当する(位置が未設定の)WAVチップの値を変更する(仕組み上、必ず後方参照となる)。 + { + if (wav.n位置 == (-10000 - zz)) // #WAVPANzz, #PANzz 行より前の行に出現した #WAVzz では、位置は -10000-zz に初期化されている。 + wav.n位置 = n位置; + } + } + this.n無限管理PAN[zz] = n位置; // 次にこの WAV番号 zz を使うWAVチップが現れたら、この位置が格納されることになる。 + } + //----------------- + #endregion + + return true; + } + private bool t入力_行解析_チップ配置(string strコマンド, string strパラメータ, string strコメント) { + // (1) コマンドを処理。 + + if (strコマンド.Length != 5) // コマンドは必ず5文字であること。 + return false; + + #region [ n小節番号 を取得する。] + //----------------- + int n小節番号 = CConversion.n小節番号の文字列3桁を数値に変換して返す(strコマンド.Substring(0, 3)); + if (n小節番号 < 0) + return false; + + n小節番号++; // 先頭に空の1小節を設ける。 + //----------------- + #endregion + + #region [ nチャンネル番号 を取得する。] + //----------------- + int nチャンネル番号 = -1; + + // ファイルフォーマットによって処理が異なる。 + #region [ (B) その他の場合:チャンネル番号は16進数2桁。] + //----------------- + nチャンネル番号 = CConversion.n16進数2桁の文字列を数値に変換して返す(strコマンド.Substring(3, 2)); + + if (nチャンネル番号 < 0) + return false; + //----------------- + #endregion + //----------------- + #endregion + #region [ 取得したチャンネル番号で、this.bチップがある に該当があれば設定する。] + //----------------- + if ((nチャンネル番号 >= 0x11) && (nチャンネル番号 <= 0x1a)) { + this.bチップがある.Drums = true; + } else if ((nチャンネル番号 >= 0x20) && (nチャンネル番号 <= 0x27)) { + this.bチップがある.Guitar = true; + } else if ((nチャンネル番号 >= 0xA0) && (nチャンネル番号 <= 0xa7)) { + this.bチップがある.Bass = true; + } + switch (nチャンネル番号) { + case 0x18: + this.bチップがある.HHOpen = true; + break; + + case 0x19: + this.bチップがある.Ride = true; + break; + + case 0x1a: + this.bチップがある.LeftCymbal = true; + break; + + case 0x20: + this.bチップがある.OpenGuitar = true; + break; + + case 0xA0: + this.bチップがある.OpenBass = true; + break; + } + //----------------- + #endregion + + + // (2) Ch.02を処理。 + + #region [ 小節長変更(Ch.02)は他のチャンネルとはパラメータが特殊なので、先にとっとと終わらせる。 ] + //----------------- + if (nチャンネル番号 == 0x02) { + // 小節長倍率を取得する。 + + double db小節長倍率 = 1.0; + //if( !double.TryParse( strパラメータ, out result ) ) + if (!this.TryParse(strパラメータ, out db小節長倍率)) // #23880 2010.12.30 yyagi: alternative TryParse to permit both '.' and ',' for decimal point + { + Trace.TraceError("小節長倍率に不正な値を指定しました。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数); + return false; + } + + // 小節長倍率チップを配置する。 + + this.listChip.Insert( + 0, + new CChip() { + nチャンネル番号 = nチャンネル番号, + db実数値 = db小節長倍率, + n発声位置 = n小節番号 * 384, + }); + + return true; // 配置終了。 + } + //----------------- + #endregion + + + // (3) パラメータを処理。 + + if (string.IsNullOrEmpty(strパラメータ)) // パラメータはnullまたは空文字列ではないこと。 + return false; + + #region [ strパラメータ にオブジェクト記述を格納し、その n文字数 をカウントする。] + //----------------- + int n文字数 = 0; + + var sb = new StringBuilder(strパラメータ.Length); + + // strパラメータを先頭から1文字ずつ見ながら正規化(無効文字('_')を飛ばしたり不正な文字でエラーを出したり)し、sb へ格納する。 + + CharEnumerator ce = strパラメータ.GetEnumerator(); + while (ce.MoveNext()) { + if (ce.Current == '_') // '_' は無視。 + continue; + + if (CConversion.str36進数文字.IndexOf(ce.Current) < 0) // オブジェクト記述は36進数文字であること。 + { + Trace.TraceError("不正なオブジェクト指定があります。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数); + return false; + } + + sb.Append(ce.Current); + n文字数++; + } + + strパラメータ = sb.ToString(); // 正規化された文字列になりました。 + + if ((n文字数 % 2) != 0) // パラメータの文字数が奇数の場合、最後の1文字を無視する。 + n文字数--; + //----------------- + #endregion + + + // (4) パラメータをオブジェクト数値に分解して配置する。 + + for (int i = 0; i < (n文字数 / 2); i++) // 2文字で1オブジェクト数値 + { + #region [ nオブジェクト数値 を1つ取得する。'00' なら無視。] + //----------------- + int nオブジェクト数値 = 0; + + if (nチャンネル番号 == 0x03) { + // Ch.03 のみ 16進数2桁。 + nオブジェクト数値 = CConversion.n16進数2桁の文字列を数値に変換して返す(strパラメータ.Substring(i * 2, 2)); + } else { + // その他のチャンネルは36進数2桁。 + nオブジェクト数値 = CConversion.n36進数2桁の文字列を数値に変換して返す(strパラメータ.Substring(i * 2, 2)); + } + + if (nオブジェクト数値 == 0x00) + continue; + //----------------- + #endregion + + // オブジェクト数値に対応するチップを生成。 + + var chip = new CChip(); + + chip.nチャンネル番号 = nチャンネル番号; + chip.n発声位置 = (n小節番号 * 384) + ((384 * i) / (n文字数 / 2)); + chip.n整数値 = nオブジェクト数値; + chip.n整数値_内部番号 = nオブジェクト数値; + + #region [ chip.e楽器パート = ... ] + //----------------- + if ((nチャンネル番号 >= 0x11) && (nチャンネル番号 <= 0x1C)) { + chip.e楽器パート = EInstrumentPad.DRUMS; + } + if ((nチャンネル番号 >= 0x20) && (nチャンネル番号 <= 0x27)) { + chip.e楽器パート = EInstrumentPad.GUITAR; + } + if ((nチャンネル番号 >= 160) && (nチャンネル番号 <= 0xA7)) { + chip.e楽器パート = EInstrumentPad.BASS; + } + //----------------- + #endregion + + #region [ 無限定義への対応 → 内部番号の取得。] + //----------------- + if (chip.nチャンネル番号 == 0x01) { + chip.n整数値_内部番号 = this.n無限管理WAV[nオブジェクト数値]; // これが本当に一意なWAV番号となる。(無限定義の場合、chip.n整数値 は一意である保証がない。) + } else if (chip.bBPMチップである) { + chip.n整数値_内部番号 = this.n無限管理BPM[nオブジェクト数値]; // これが本当に一意なBPM番号となる。(同上。) + } + //----------------- + #endregion + + #region [ フィルインON/OFFチャンネル(Ch.53)の場合、発声位置を少し前後にずらす。] + //----------------- + if (nチャンネル番号 == 0x53) { + // ずらすのは、フィルインONチップと同じ位置にいるチップでも確実にフィルインが発動し、 + // 同様に、フィルインOFFチップと同じ位置にいるチップでも確実にフィルインが終了するようにするため。 + + if ((nオブジェクト数値 > 0) && (nオブジェクト数値 != 2)) { + chip.n発声位置 -= 32; // 384÷32=12 ということで、フィルインONチップは12分音符ほど前へ移動。 + } else if (nオブジェクト数値 == 2) { + chip.n発声位置 += 32; // 同じく、フィルインOFFチップは12分音符ほど後ろへ移動。 + } + } + //----------------- + #endregion + + // チップを配置。 + + this.listChip.Add(chip); + } + return true; + } + #region [#23880 2010.12.30 yyagi: コンマとスペースの両方を小数点として扱うTryParse] + /// + /// 小数点としてコンマとピリオドの両方を受け付けるTryParse() + /// + /// strings convert to double + /// parsed double value + /// s が正常に変換された場合は true。それ以外の場合は false。 + /// style が NumberStyles 値でないか、style に NumberStyles.AllowHexSpecifier 値が含まれている + private bool TryParse(string s, out double result) { // #23880 2010.12.30 yyagi: alternative TryParse to permit both '.' and ',' for decimal point + // EU諸国での #BPM 123,45 のような記述に対応するため、 + // 小数点の最終位置を検出して、それをlocaleにあった + // 文字に置き換えてからTryParse()する + // 桁区切りの文字はスキップする + + const string DecimalSeparators = ".,"; // 小数点文字 + const string GroupSeparators = ".,' "; // 桁区切り文字 + const string NumberSymbols = "0123456789"; // 数値文字 + + int len = s.Length; // 文字列長 + int decimalPosition = len; // 真の小数点の位置 最初は文字列終端位置に仮置きする + + for (int i = 0; i < len; i++) { // まず、真の小数点(一番最後に現れる小数点)の位置を求める + char c = s[i]; + if (NumberSymbols.IndexOf(c) >= 0) { // 数値だったらスキップ + continue; + } else if (DecimalSeparators.IndexOf(c) >= 0) { // 小数点文字だったら、その都度位置を上書き記憶 + decimalPosition = i; + } else if (GroupSeparators.IndexOf(c) >= 0) { // 桁区切り文字の場合もスキップ + continue; + } else { // 数値_小数点_区切り文字以外がきたらループ終了 + break; + } + } + + StringBuilder decimalStr = new StringBuilder(16); + for (int i = 0; i < len; i++) { // 次に、localeにあった数値文字列を生成する + char c = s[i]; + if (NumberSymbols.IndexOf(c) >= 0) { // 数値だったら + decimalStr.Append(c); // そのままコピー + } else if (DecimalSeparators.IndexOf(c) >= 0) { // 小数点文字だったら + if (i == decimalPosition) { // 最後に出現した小数点文字なら、localeに合った小数点を出力する + decimalStr.Append(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator); + } + } else if (GroupSeparators.IndexOf(c) >= 0) { // 桁区切り文字だったら + continue; // 何もしない(スキップ) + } else { + break; + } + } + return double.TryParse(decimalStr.ToString(), out result); // 最後に、自分のlocale向けの文字列に対してTryParse実行 + } + #endregion + /// + /// 音源再生前の空白を追加するメソッド。 + /// + private void AddMusicPreTimeMs() { + this.dbNowTime += TJAPlayer3.ConfigIni.MusicPreTimeMs; + this.dbNowBMScollTime += TJAPlayer3.ConfigIni.MusicPreTimeMs * this.dbNowBPM / 15000; + } + //----------------- + #endregion + } } diff --git a/OpenTaiko/src/Songs/CDTXCompanionFileFinder.cs b/OpenTaiko/src/Songs/CDTXCompanionFileFinder.cs index 393c667f..04c26baa 100644 --- a/OpenTaiko/src/Songs/CDTXCompanionFileFinder.cs +++ b/OpenTaiko/src/Songs/CDTXCompanionFileFinder.cs @@ -1,228 +1,206 @@ using System.Diagnostics; -using System.IO; using System.Text; -namespace TJAPlayer3 -{ - internal static class CDTXCompanionFileFinder - { - internal static string FindFileName( - string directory, - string mainFileName, - string expectedCompanionFileName) - { - var expectedCompanionPath = Path.Combine(directory, expectedCompanionFileName); +namespace TJAPlayer3 { + internal static class CDTXCompanionFileFinder { + internal static string FindFileName( + string directory, + string mainFileName, + string expectedCompanionFileName) { + var expectedCompanionPath = Path.Combine(directory, expectedCompanionFileName); - if (File.Exists(expectedCompanionPath)) - { - return expectedCompanionFileName; - } + if (File.Exists(expectedCompanionPath)) { + return 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 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. - // 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(TJAPlayer3.sEncType).GetBytes(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(TJAPlayer3.sEncType).GetBytes(expectedCompanionFileName); - // 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); + // 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}'."); + 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}'."); - foundCompanionFileName = null; - return false; - } + foundCompanionFileName = null; + return false; + } - 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}."); + 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 = 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; - } + // 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; + } - // 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; - } + // 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; + } - // 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; - } + // 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; + } - // 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; - } + // 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; + } - // 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."); + Trace.TraceWarning( + $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' by any available means."); - return expectedCompanionFileName; - } + 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('*', '_'); + 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); - } + // 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); + 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 companionFileExtension = Path.GetExtension(expectedCompanionPath); - var mainFilePathWithCompanionFileExtension = - Path.ChangeExtension(mainFilePath, companionFileExtension); + 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."); + // 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 = mainFileNameWithCompanionFileExtension; + return true; + } - foundCompanionFileName = null; - return false; - } + foundCompanionFileName = null; + return false; + } - private static bool TryFindViaCompanionFileExtension( - string directory, - string expectedCompanionPath, - out string foundCompanionFileName) - { - var companionFileExtension = Path.GetExtension(expectedCompanionPath); + 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); + 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."); + 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; - } - } + return true; + } + } - foundCompanionFileName = null; - return false; - } - } -} \ No newline at end of file + foundCompanionFileName = null; + return false; + } + } +} diff --git a/OpenTaiko/src/Songs/CDTXStyleExtractor.cs b/OpenTaiko/src/Songs/CDTXStyleExtractor.cs index d94dcccb..fe9dcada 100644 --- a/OpenTaiko/src/Songs/CDTXStyleExtractor.cs +++ b/OpenTaiko/src/Songs/CDTXStyleExtractor.cs @@ -1,546 +1,491 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; +using System.Diagnostics; using System.Text; using System.Text.RegularExpressions; -namespace TJAPlayer3 -{ - /// - /// 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 TJAPlayer3 { + /// + /// 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 const string StylePrefixRegexPattern = @"^STYLE\s*:\s*"; - private const string SheetStartPrefixRegexPattern = @"^#START"; + private const string StylePrefixRegexPattern = @"^STYLE\s*:\s*"; + private const string SheetStartPrefixRegexPattern = @"^#START"; - private static readonly string StyleSingleSectionRegexMatchPattern = - $"{StylePrefixRegexPattern}(?:Single|1)"; + private static readonly string StyleSingleSectionRegexMatchPattern = + $"{StylePrefixRegexPattern}(?:Single|1)"; - private static readonly string StyleDoubleSectionRegexMatchPattern = - $"{StylePrefixRegexPattern}(?:Double|Couple|2)"; + private static readonly string StyleDoubleSectionRegexMatchPattern = + $"{StylePrefixRegexPattern}(?:Double|Couple|2)"; - private static readonly string StyleUnrecognizedSectionRegexMatchPattern = - $"{StylePrefixRegexPattern}"; + private static readonly string StyleUnrecognizedSectionRegexMatchPattern = + $"{StylePrefixRegexPattern}"; - private static readonly string SheetStartBareRegexMatchPattern = - $"{SheetStartPrefixRegexPattern}$"; - - 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 SheetStartUnrecognizedRegexMatchPattern = - $"{SheetStartPrefixRegexPattern}.*$"; + private static readonly string SheetStartP1RegexMatchPattern = + $"{SheetStartPrefixRegexPattern}\\s*P1"; - private static readonly Regex SectionSplitRegex = new Regex($"(?={StylePrefixRegexPattern})", StyleExtractorRegexOptions); - private static readonly Regex SubSectionSplitRegex = new Regex($"(?={SheetStartPrefixRegexPattern})|(?<=#END\\n)", StyleExtractorRegexOptions); + private static readonly string SheetStartP2RegexMatchPattern = + $"{SheetStartPrefixRegexPattern}\\s*P2"; - 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 string SheetStartUnrecognizedRegexMatchPattern = + $"{SheetStartPrefixRegexPattern}.*$"; - 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 SectionSplitRegex = new Regex($"(?={StylePrefixRegexPattern})", StyleExtractorRegexOptions); + private static readonly Regex SubSectionSplitRegex = new Regex($"(?={SheetStartPrefixRegexPattern})|(?<=#END\\n)", StyleExtractorRegexOptions); - private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartBare = - new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartBare); + 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 StyleSingleAndSheetStartP1 = - new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartP1); + 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 StyleSingleAndSheetStartP2 = - new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartP2); + private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartBare = + new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartBare); - private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartUnrecognized = - new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartUnrecognized); + private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartP1 = + new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartP1); - private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartBare = - new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartBare); + private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartP2 = + new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartP2); - private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartP1 = - new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartP1); + private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartUnrecognized = + new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartUnrecognized); - private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartP2 = - new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartP2); + private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartBare = + new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartBare); - private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartUnrecognized = - new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartUnrecognized); + private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartP1 = + new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartP1); - private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartBare = - new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartBare); + private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartP2 = + new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartP2); - private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartP1 = - new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartP1); + private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartUnrecognized = + new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartUnrecognized); - private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartP2 = - new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartP2); + private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartBare = + new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartBare); - private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartUnrecognized = - new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartUnrecognized); + private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartP1 = + new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartP1); - private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartBare = - new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartBare); + private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartP2 = + new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartP2); - private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartP1 = - new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartP1); + private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartUnrecognized = + new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartUnrecognized); - private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartP2 = - new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartP2); + private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartBare = + new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartBare); - private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartUnrecognized = - new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartUnrecognized); + private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartP1 = + new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartP1); - private static readonly IDictionary[] - SeqNoSheetRanksBySectionKindAndSubSectionKind = - { + private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartP2 = + new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartP2); + + private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartUnrecognized = + new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartUnrecognized); + + private static readonly IDictionary[] + SeqNoSheetRanksBySectionKindAndSubSectionKind = + { // 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, - }, + [StyleSingleAndSheetStartP2] = 13, + [NonStyleAndSheetStartP2] = 14, + [StyleUnrecognizedAndSheetStartP2] = 15, + [StyleDoubleAndSheetStartP2] = 16, + }, // seqNo 1 new Dictionary - { - [StyleDoubleAndSheetStartP1] = 1, - [StyleUnrecognizedAndSheetStartP1] = 2, - [NonStyleAndSheetStartP1] = 3, - [StyleSingleAndSheetStartP1] = 4, + { + [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, - }, + [StyleDoubleAndSheetStartP2] = 13, + [StyleUnrecognizedAndSheetStartP2] = 14, + [NonStyleAndSheetStartP2] = 15, + [StyleSingleAndSheetStartP2] = 16, + }, // seqNo 2 new Dictionary - { - [StyleDoubleAndSheetStartP2] = 1, - [StyleUnrecognizedAndSheetStartP2] = 2, - [NonStyleAndSheetStartP2] = 3, - [StyleSingleAndSheetStartP2] = 4, + { + [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; - } + //入力された譜面が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); + // 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); + // 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); + // 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; - } + // 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); + // 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); + // 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); + // 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); - } + // 8. Reassemble the string + return Reassemble(sections); + } - // 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(); - } + // 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(); + } - private static SectionKind GetSectionKind(string section) - { - if (StyleSingleSectionMatchRegex.IsMatch(section)) - { - return SectionKind.StyleSingle; - } + private static SectionKind GetSectionKind(string section) { + if (StyleSingleSectionMatchRegex.IsMatch(section)) { + return SectionKind.StyleSingle; + } - if (StyleDoubleSectionMatchRegex.IsMatch(section)) - { - return SectionKind.StyleDouble; - } + if (StyleDoubleSectionMatchRegex.IsMatch(section)) { + return SectionKind.StyleDouble; + } - if (StyleUnrecognizedSectionMatchRegex.IsMatch(section)) - { - return SectionKind.StyleUnrecognized; - } + if (StyleUnrecognizedSectionMatchRegex.IsMatch(section)) { + return SectionKind.StyleUnrecognized; + } - return SectionKind.NonStyle; - } + return SectionKind.NonStyle; + } - private enum SectionKind - { - StyleSingle, - StyleDouble, - StyleUnrecognized, - NonStyle - } + private enum SectionKind { + StyleSingle, + StyleDouble, + StyleUnrecognized, + NonStyle + } - private sealed class Section - { - public readonly SectionKind SectionKind; - public readonly string OriginalRawValue; + private sealed class Section { + public readonly SectionKind SectionKind; + public readonly string OriginalRawValue; - public List SubSections; + public List SubSections; - public Section(SectionKind sectionKind, string originalRawValue) - { - SectionKind = sectionKind; - OriginalRawValue = originalRawValue; - } - } + 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(); - } - } + // 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; - } + 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 (SheetStartP1MatchRegex.IsMatch(subsection)) { + return SubSectionKind.SheetStartP1; + } - if (SheetStartP2MatchRegex.IsMatch(subsection)) - { - return SubSectionKind.SheetStartP2; - } - - if (SheetStartUnrecognizedMatchRegex.IsMatch(subsection)) - { - return SubSectionKind.SheetStartUnrecognized; - } - } + if (SheetStartP2MatchRegex.IsMatch(subsection)) { + return SubSectionKind.SheetStartP2; + } - return SubSectionKind.NonSheet; - } + if (SheetStartUnrecognizedMatchRegex.IsMatch(subsection)) { + return SubSectionKind.SheetStartUnrecognized; + } + } - private enum SubSectionKind - { - SheetStartP1, - SheetStartP2, - SheetStartBare, - SheetStartUnrecognized, - NonSheet - } + return SubSectionKind.NonSheet; + } - private sealed class SubSection - { - public readonly SubSectionKind SubSectionKind; - public readonly string OriginalRawValue; + private enum SubSectionKind { + SheetStartP1, + SheetStartP2, + SheetStartBare, + SheetStartUnrecognized, + NonSheet + } - public int Rank; + private sealed class SubSection { + public readonly SubSectionKind SubSectionKind; + public readonly string OriginalRawValue; - public SubSection(SubSectionKind subSectionKind, string originalRawValue) - { - SubSectionKind = subSectionKind; - OriginalRawValue = originalRawValue; - } - } + public int Rank; - // 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]; + public SubSection(SubSectionKind subSectionKind, string originalRawValue) { + SubSectionKind = subSectionKind; + OriginalRawValue = originalRawValue; + } + } - foreach (var section in sections) - { - var sectionKind = section.SectionKind; + // 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 subSection in section.SubSections) - { - var subSectionKind = subSection.SubSectionKind; + foreach (var section in sections) { + var sectionKind = section.SectionKind; - if (subSectionKind == SubSectionKind.NonSheet) - { - continue; - } + foreach (var subSection in section.SubSections) { + var subSectionKind = subSection.SubSectionKind; - var sectionKindAndSubSectionKind = new SectionKindAndSubSectionKind( - sectionKind, subSectionKind); + if (subSectionKind == SubSectionKind.NonSheet) { + continue; + } - subSection.Rank = sheetRanksBySectionKindAndSubSectionKind[sectionKindAndSubSectionKind]; - } - } - } + var sectionKindAndSubSectionKind = new SectionKindAndSubSectionKind( + sectionKind, subSectionKind); - private sealed class SectionKindAndSubSectionKind : IEquatable - { - public readonly SectionKind SectionKind; - public readonly SubSectionKind SubSectionKind; + subSection.Rank = sheetRanksBySectionKindAndSubSectionKind[sectionKindAndSubSectionKind]; + } + } + } - public SectionKindAndSubSectionKind(SectionKind sectionKind, SubSectionKind subSectionKind) - { - SectionKind = sectionKind; - SubSectionKind = subSectionKind; - } + private sealed class SectionKindAndSubSectionKind : IEquatable { + public readonly SectionKind SectionKind; + public readonly 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 SectionKindAndSubSectionKind(SectionKind sectionKind, SubSectionKind subSectionKind) { + SectionKind = sectionKind; + SubSectionKind = 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 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 int GetHashCode() - { - unchecked - { - return ((int) SectionKind * 397) ^ (int) 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 static bool operator ==(SectionKindAndSubSectionKind left, SectionKindAndSubSectionKind right) - { - return Equals(left, right); - } + 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(); - } + public static bool operator !=(SectionKindAndSubSectionKind left, SectionKindAndSubSectionKind right) { + return !Equals(left, right); + } + } - // 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. + // 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(); + } - foreach (var section in sections) - { - section.SubSections.RemoveAll(o => o.Rank > bestRank); - } + // 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. - // 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(o => o.Rank > bestRank); + } - foreach (var section in sections) - { - section.SubSections.RemoveAll(extraBestRankedSheets.Contains); - } - } + // 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)); - // 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. + foreach (var section in sections) { + section.SubSections.RemoveAll(extraBestRankedSheets.Contains); + } + } - sections.RemoveAll(o => - (o.SectionKind == SectionKind.StyleSingle || o.SectionKind == SectionKind.StyleDouble) && - o.SubSections.Count(subSection => subSection.SubSectionKind == SubSectionKind.NonSheet) == o.SubSections.Count); - } + // 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. - // 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; + sections.RemoveAll(o => + (o.SectionKind == SectionKind.StyleSingle || o.SectionKind == SectionKind.StyleDouble) && + o.SubSections.Count(subSection => subSection.SubSectionKind == SubSectionKind.NonSheet) == o.SubSections.Count); + } - var lastIndex = subSections.FindIndex(o => o.SubSectionKind != SubSectionKind.NonSheet); - var removalIndex = lastIndex + 1; + // 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; - if (lastIndex != -1 && removalIndex < subSections.Count) - { - subSections.RemoveRange(removalIndex, subSections.Count - removalIndex); - } - } - } - } + var lastIndex = subSections.FindIndex(o => o.SubSectionKind != SubSectionKind.NonSheet); + var removalIndex = lastIndex + 1; - // 8. Reassemble the string - private static string Reassemble(List
sections) - { - var sb = new StringBuilder(); + if (lastIndex != -1 && removalIndex < subSections.Count) { + subSections.RemoveRange(removalIndex, subSections.Count - removalIndex); + } + } + } + } - foreach (var section in sections) - { - foreach (var subSection in section.SubSections) - { - sb.Append(subSection.OriginalRawValue); - } - } + // 8. Reassemble the string + private static string Reassemble(List
sections) { + var sb = new StringBuilder(); - return sb.ToString(); - } - } -} \ No newline at end of file + 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 4478fea5..9e243874 100644 --- a/OpenTaiko/src/Songs/CScoreIni.cs +++ b/OpenTaiko/src/Songs/CScoreIni.cs @@ -1,33 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; -using System.Drawing; -using System.Drawing.Imaging; -using System.Diagnostics; -using System.IO; -using System.Security.Cryptography; -using FDK; -using TJAPlayer3; - -namespace TJAPlayer3 -{ +namespace TJAPlayer3 { [Serializable] - public class CScoreIni - { + public class CScoreIni { // プロパティ [Serializable] - public class C演奏記録 - { + public class C演奏記録 { public int nOkCount; public int nBadCount; public int nGoodCount; - public Dan_C[] Dan_C; + public Dan_C[] Dan_C; - public C演奏記録() - { - Dan_C = new Dan_C[CExamInfo.cMaxExam]; + 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 29d3b702..7ff2f6b7 100644 --- a/OpenTaiko/src/Songs/CScoreIni_Importer.cs +++ b/OpenTaiko/src/Songs/CScoreIni_Importer.cs @@ -1,214 +1,193 @@ -using Microsoft.Data.Sqlite; -using System; -using System.Collections.Generic; -using System.ComponentModel.Design; -using System.Diagnostics; -using System.Linq; -using System.Reflection.Emit; -using System.Text; -using System.Threading.Tasks; +using System.Diagnostics; +using Microsoft.Data.Sqlite; -namespace TJAPlayer3 -{ - 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 TJAPlayer3 { + 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!"); - Status = "Establishing connection to database..."; - SqliteConnection? connection = DBSaves.GetSavesDBConnection(); - if (connection == null) - { - Trace.TraceError("Could not establish a connection to Saves.db3 database. Aborting score import."); - return; - } + Status = "Establishing connection to database..."; + SqliteConnection? connection = DBSaves.GetSavesDBConnection(); + if (connection == null) { + Trace.TraceError("Could not establish a connection to Saves.db3 database. Aborting score import."); + return; + } - Status = "Searching for scores..."; - string[] _scoreFiles = Directory.GetFiles(TJAPlayer3.ConfigIni.strSongsPath, "*.score.ini", SearchOption.AllDirectories); - Trace.TraceInformation($"{_scoreFiles.Length} score.ini files have been found. Beginning import."); + Status = "Searching for scores..."; + string[] _scoreFiles = Directory.GetFiles(TJAPlayer3.ConfigIni.strSongsPath, "*.score.ini", SearchOption.AllDirectories); + Trace.TraceInformation($"{_scoreFiles.Length} score.ini files have been found. Beginning import."); - int importcount = 0; - Status = "Importing scores..."; - foreach (string _score in _scoreFiles) - { - try - { - string directory = Path.GetDirectoryName(_score); - DirectoryInfo dir_parent = Directory.GetParent(directory); + int importcount = 0; + Status = "Importing scores..."; + foreach (string _score in _scoreFiles) { + try { + string directory = Path.GetDirectoryName(_score); + DirectoryInfo dir_parent = Directory.GetParent(directory); - 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(); + 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(); - string[] ScoreData = File.ReadAllLines(_score); + string[] ScoreData = File.ReadAllLines(_score); - 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 = ""; + 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 = ""; - 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 }; + 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; - } - } + 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; + } + } - 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 = $@" + 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.Replace(@"'", @"''")}', @@ -222,7 +201,7 @@ namespace TJAPlayer3 {(i != 5 ? Rank[i] : -1)}, {HighScore[score_index]}, {GetPlayerId(_score)}, - {(i == 5 ? Rank[i]+1 : 0)}, + {(i == 5 ? Rank[i] + 1 : 0)}, '[-1]', '[-1]', '[-1]', @@ -241,41 +220,37 @@ namespace TJAPlayer3 ) ON CONFLICT(ChartUniqueId,ChartDifficulty,PlayMods) DO NOTHING "; - if (cmd.ExecuteNonQuery() > 0) - importcount++; - } - } - } - catch (Exception ex) - { - Trace.TraceWarning($"Failed to import {_score} into new database. More details:\n{ex}"); - } - } - Trace.TraceInformation($"Imported {importcount} of {_scoreFiles.Length} scores from score.ini files."); - Status = ""; - } + if (cmd.ExecuteNonQuery() > 0) + importcount++; + } + } + } catch (Exception ex) { + Trace.TraceWarning($"Failed to import {_score} into new database. More details:\n{ex}"); + } + } + Trace.TraceInformation($"Imported {importcount} of {_scoreFiles.Length} scores from score.ini files."); + Status = ""; + } - private static string GetTJAFile(string path) - { - FileInfo info = new FileInfo(path); - - if (info.FullName.EndsWith("1P.score.ini")) return info.FullName.Replace("1P.score.ini", ""); - if (info.FullName.EndsWith("2P.score.ini")) return info.FullName.Replace("2P.score.ini", ""); - if (info.FullName.EndsWith("3P.score.ini")) return info.FullName.Replace("3P.score.ini", ""); - if (info.FullName.EndsWith("4P.score.ini")) return info.FullName.Replace("4P.score.ini", ""); - if (info.FullName.EndsWith("5P.score.ini")) return info.FullName.Replace("5P.score.ini", ""); - return info.FullName.Replace(".score.ini", ""); - } - private static int GetPlayerId(string path) - { - FileInfo info = new FileInfo(path); + private static string GetTJAFile(string path) { + FileInfo info = new FileInfo(path); - if (info.Name.EndsWith("1P.score.ini")) return 0; - if (info.Name.EndsWith("2P.score.ini")) return 1; - if (info.Name.EndsWith("3P.score.ini")) return 2; - if (info.Name.EndsWith("4P.score.ini")) return 3; - if (info.Name.EndsWith("5P.score.ini")) return 4; - return 0; - } - } + if (info.FullName.EndsWith("1P.score.ini")) return info.FullName.Replace("1P.score.ini", ""); + if (info.FullName.EndsWith("2P.score.ini")) return info.FullName.Replace("2P.score.ini", ""); + if (info.FullName.EndsWith("3P.score.ini")) return info.FullName.Replace("3P.score.ini", ""); + if (info.FullName.EndsWith("4P.score.ini")) return info.FullName.Replace("4P.score.ini", ""); + if (info.FullName.EndsWith("5P.score.ini")) return info.FullName.Replace("5P.score.ini", ""); + return info.FullName.Replace(".score.ini", ""); + } + private static int GetPlayerId(string path) { + FileInfo info = new FileInfo(path); + + if (info.Name.EndsWith("1P.score.ini")) return 0; + if (info.Name.EndsWith("2P.score.ini")) return 1; + if (info.Name.EndsWith("3P.score.ini")) return 2; + if (info.Name.EndsWith("4P.score.ini")) return 3; + if (info.Name.EndsWith("5P.score.ini")) return 4; + return 0; + } + } } diff --git a/OpenTaiko/src/Songs/CSongListNode.cs b/OpenTaiko/src/Songs/CSongListNode.cs index 4e969522..50f0ef77 100644 --- a/OpenTaiko/src/Songs/CSongListNode.cs +++ b/OpenTaiko/src/Songs/CSongListNode.cs @@ -1,17 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Drawing; +using System.Drawing; -namespace TJAPlayer3 -{ +namespace TJAPlayer3 { [Serializable] - internal class CSongListNode - { + internal class CSongListNode { // プロパティ public ENodeType eノード種別 = ENodeType.UNKNOWN; - public enum ENodeType - { + public enum ENodeType { SCORE, SCORE_MIDI, BOX, @@ -24,20 +19,17 @@ namespace TJAPlayer3 public string[] ar難易度ラベル = new string[(int)Difficulty.Total]; public bool bDTXFilesで始まるフォルダ名のBOXである; - public bool bBoxDefで作成されたBOXである - { - get - { + public bool bBoxDefで作成されたBOXである { + get { return !this.bDTXFilesで始まるフォルダ名のBOXである; } - set - { + set { this.bDTXFilesで始まるフォルダ名のBOXである = !value; } } public Color col文字色 = Color.White; - public Color ForeColor = Color.White; - public Color BackColor = Color.Black; + public Color ForeColor = Color.White; + public Color BackColor = Color.Black; public Color BoxColor = Color.White; public Color BgColor = Color.White; @@ -49,8 +41,8 @@ namespace TJAPlayer3 public string BoxChara; public bool isChangedBoxChara; - public bool IsChangedForeColor; - public bool IsChangedBackColor; + public bool IsChangedForeColor; + public bool IsChangedBackColor; public bool isChangedBoxColor; public List listランダム用ノードリスト; public List list子リスト; @@ -61,7 +53,7 @@ namespace TJAPlayer3 public int nスコア数; public CSongListNode rParentNode; - + public int Openindex; public bool bIsOpenFolder; public string strジャンル = ""; @@ -72,15 +64,15 @@ namespace TJAPlayer3 public CLocalizationData ldSubtitle = new CLocalizationData(); public string strMaker = ""; public string[] strNotesDesigner = new string[(int)Difficulty.Total] { "", "", "", "", "", "", "" }; - public CDTX.ESide nSide = CDTX.ESide.eEx; + 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 }; - + 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; @@ -91,53 +83,47 @@ namespace TJAPlayer3 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() - { + public string tGetUniqueId() { return uniqueId?.data.id ?? ""; } // コンストラクタ - public CSongListNode() - { + public CSongListNode() { this.nID = id++; } - public CSongListNode Clone() - { + public CSongListNode Clone() { return (CSongListNode)MemberwiseClone(); } - public override bool Equals(object other) - { - if (other.GetType() == typeof(CSongListNode)) - { + 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(); - } + public override int GetHashCode() { + return base.GetHashCode(); + } - // その他 + // その他 - #region [ private ] - //----------------- - private static int id; + #region [ private ] + //----------------- + private static int id; //----------------- #endregion } diff --git a/OpenTaiko/src/Songs/CSongUniqueID.cs b/OpenTaiko/src/Songs/CSongUniqueID.cs index 08d3d0dd..239f8993 100644 --- a/OpenTaiko/src/Songs/CSongUniqueID.cs +++ b/OpenTaiko/src/Songs/CSongUniqueID.cs @@ -1,70 +1,53 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.IO; -using Newtonsoft.Json; +namespace TJAPlayer3 { + [Serializable()] + internal class CSongUniqueID { + public CSongUniqueID(string path) { + filePath = path; -namespace TJAPlayer3 -{ - [Serializable()] - internal class CSongUniqueID - { - public CSongUniqueID(string path) - { - filePath = path; + tGenerateUniqueID(); + tSongUniqueID(); + } - tGenerateUniqueID(); - tSongUniqueID(); - } + public void tSongUniqueID() { + if (!File.Exists(filePath)) + tSaveFile(); - public void tSongUniqueID() - { - if (!File.Exists(filePath)) - tSaveFile(); + tLoadFile(); + } - tLoadFile(); - } + #region [Auxiliary methods] - #region [Auxiliary methods] + public void tAttachOnlineAddress(string url) { + data.url = url; + tSaveFile(); + } - public void tAttachOnlineAddress(string url) - { - data.url = url; - tSaveFile(); - } + public void tGenerateUniqueID() { + data.id = CCrypto.GetUniqueKey(64); + } - public void tGenerateUniqueID() - { - data.id = CCrypto.GetUniqueKey(64); - } + #endregion - #endregion + [Serializable] + public class Data { + public string id = ""; + public string url = ""; + } - [Serializable] - public class Data - { - public string id = ""; - public string url = ""; - } + public Data data = new Data(); - public Data data = new Data(); + public string filePath; - public string filePath; + #region [private] - #region [private] + private void tSaveFile() { + ConfigManager.SaveConfig(data, filePath); + } - private void tSaveFile() - { - ConfigManager.SaveConfig(data, filePath); - } + private void tLoadFile() { + data = ConfigManager.GetConfig(filePath); + } - private void tLoadFile() - { - data = ConfigManager.GetConfig(filePath); - } - - #endregion - } + #endregion + } } diff --git a/OpenTaiko/src/Songs/CSong管理.cs b/OpenTaiko/src/Songs/CSong管理.cs index 28b1bba5..3f8debfd 100644 --- a/OpenTaiko/src/Songs/CSong管理.cs +++ b/OpenTaiko/src/Songs/CSong管理.cs @@ -1,21 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Text; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Threading; -using TJAPlayer3.C曲リストノードComparers; -using FDK; -using System.Drawing; +using System.Diagnostics; using System.Security.Cryptography; +using System.Text; +using TJAPlayer3.C曲リストノードComparers; -namespace TJAPlayer3 -{ +namespace TJAPlayer3 { [Serializable] - internal class CSongs管理 - { + internal class CSongs管理 { // プロパティ /*public int nSongsDBから取得できたスコア数 @@ -28,37 +18,33 @@ namespace TJAPlayer3 get; set; }*/ - public int nスコアキャッシュから反映できたスコア数 - { - get; - set; - } - public int nファイルから反映できたスコア数 - { + public int nスコアキャッシュから反映できたスコア数 { get; set; } - public int n検索されたスコア数 - { + public int nファイルから反映できたスコア数 { get; set; } - public int n検索された曲ノード数 - { - get; + public int n検索されたスコア数 { + get; set; } - public Dictionary listSongsDB; // songs.dbから構築されるlist + 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()を実行する + public bool bIsSuspending // 外部スレッドから、内部スレッドのsuspendを指示する時にtrueにする + { // 再開時は、これをfalseにしてから、次のautoReset.Set()を実行する get; set; } - public bool bIsSlowdown // #PREMOVIE再生時に曲検索を遅くする + public bool bIsSlowdown // #PREMOVIE再生時に曲検索を遅くする { get; set; @@ -77,18 +63,17 @@ namespace TJAPlayer3 } }*/ - private int searchCount; // #PREMOVIE中は検索n回実行したら少しスリープする + private int searchCount; // #PREMOVIE中は検索n回実行したら少しスリープする // コンストラクタ - public CSongs管理() - { - this.listSongsDB = new (); + 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.bIsSuspending = false; // #27060 + this.AutoReset = new AutoResetEvent(true); // #27060 this.searchCount = 0; } @@ -98,38 +83,32 @@ namespace TJAPlayer3 #region [ Fetch song list ] //----------------- - public void UpdateDownloadBox() - { + public void UpdateDownloadBox() { CSongListNode downloadBox = null; - for (int i = 0; i < TJAPlayer3.Songs管理.list曲ルート.Count; i++) - { - if (TJAPlayer3.Songs管理.list曲ルート[i].strジャンル == "Download") - { + for (int i = 0; i < TJAPlayer3.Songs管理.list曲ルート.Count; i++) { + if (TJAPlayer3.Songs管理.list曲ルート[i].strジャンル == "Download") { downloadBox = TJAPlayer3.Songs管理.list曲ルート[i]; if (downloadBox.rParentNode != null) downloadBox = downloadBox.rParentNode; } } - if (downloadBox != null && downloadBox.list子リスト != null) - { + if (downloadBox != null && downloadBox.list子リスト != null) { var flatten = TJAPlayer3.stageSongSelect.actSongList.flattenList(downloadBox.list子リスト); - + // Works because flattenList creates a new List - for (int i = 0; i < downloadBox.list子リスト.Count; i++) - { + 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) - { + if (flatten.Count > 0) { int index = list曲ルート.IndexOf(flatten[0]); /* @@ -143,8 +122,7 @@ namespace TJAPlayer3 } */ - if (!list曲ルート.Contains(downloadBox)) - { + if (!list曲ルート.Contains(downloadBox)) { this.list曲ルート = this.list曲ルート.Except(flatten).ToList(); list曲ルート.Insert(index, downloadBox); } @@ -154,91 +132,79 @@ namespace TJAPlayer3 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 ); + 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 ) ) + 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基点フォルダ ); + DirectoryInfo info = new DirectoryInfo(str基点フォルダ); - if( TJAPlayer3.ConfigIni.bLog曲検索ログ出力 ) - Trace.TraceInformation( "基点フォルダ: " + str基点フォルダ ); + if (TJAPlayer3.ConfigIni.bLog曲検索ログ出力) + Trace.TraceInformation("基点フォルダ: " + str基点フォルダ); #region [ a.フォルダ内に set.def が存在する場合 → 1フォルダ内のtjaファイル無制限] //----------------------------- string path = str基点フォルダ + "set.def"; - if( File.Exists( path ) ) - { - new FileInfo( path ); - if( TJAPlayer3.ConfigIni.bLog曲検索ログ出力 ) - { - Trace.TraceInformation( "set.def検出 : {0}", path ); + if (File.Exists(path)) { + new FileInfo(path); + if (TJAPlayer3.ConfigIni.bLog曲検索ログ出力) { + 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; - } - } + 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[ 新処理 ] + #region[ 新処理 ] - CSongListNode c曲リストノード = new CSongListNode(); - c曲リストノード.eノード種別 = CSongListNode.ENodeType.SCORE; + CSongListNode c曲リストノード = new CSongListNode(); + c曲リストノード.eノード種別 = CSongListNode.ENodeType.SCORE; - 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; + 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; - c曲リストノード.ldTitle = dtx.TITLE; - c曲リストノード.ldSubtitle = dtx.SUBTITLE; - c曲リストノード.strジャンル = dtx.GENRE; + 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曲リストノード.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 (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; + // LIFE here + c曲リストノード.nLife = dtx.LIFE; c曲リストノード.nTowerType = dtx.TOWERTYPE; @@ -248,8 +214,7 @@ namespace TJAPlayer3 // Total count of floors for a tower chart c曲リストノード.nTotalFloor = 0; - for (int i = 0; i < dtx.listChip.Count; i++) - { + 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整数値_内部番号; @@ -275,31 +240,27 @@ namespace TJAPlayer3 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; + 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( TJAPlayer3.ConfigIni.bLog曲検索ログ出力 ) - { + if (b == false) { + this.n検索されたスコア数++; + listノードリスト.Add(c曲リストノード); + this.n検索された曲ノード数++; + b = true; + } + } + } + } + #endregion + } + } finally { + if (TJAPlayer3.ConfigIni.bLog曲検索ログ出力) { Trace.Unindent(); } } @@ -309,33 +270,30 @@ namespace TJAPlayer3 #region [ b.フォルダ内に set.def が存在しない場合 → 個別ファイルからノード作成 ] //----------------------------- - else - { - foreach( FileInfo fileinfo in info.GetFiles() ) - { - SlowOrSuspendSearchTask(); // #27060 中断要求があったら、解除要求が来るまで待機, #PREMOVIE再生中は検索負荷を落とす + 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 廃止。 - //if( strExt.Equals( ".tja" ) ) - //{ - // //tja、dtxが両方存在していた場合、tjaを読み込まずにdtxだけ使う。 - // string[] dtxscoreini = Directory.GetFiles( str基点フォルダ, "*.dtx"); - // if(dtxscoreini.Length != 0 ) - // { - // continue; - // } - //} + if ((strExt.Equals(".tja") || strExt.Equals(".dtx"))) { + // 2017.06.02 kairera0467 廃止。 + //if( strExt.Equals( ".tja" ) ) + //{ + // //tja、dtxが両方存在していた場合、tjaを読み込まずにdtxだけ使う。 + // string[] dtxscoreini = Directory.GetFiles( str基点フォルダ, "*.dtx"); + // if(dtxscoreini.Length != 0 ) + // { + // continue; + // } + //} - #region[ 新処理 ] + #region[ 新処理 ] string filePath = str基点フォルダ + fileinfo.Name; using SHA1 hashProvider = SHA1.Create(); var fs = File.OpenRead(filePath); - byte[] rawhash = hashProvider.ComputeHash(fs); + byte[] rawhash = hashProvider.ComputeHash(fs); string hash = ""; for (int i = 0; i < rawhash.Length; i++) { hash += string.Format("{0:X2}", rawhash[i]); @@ -343,84 +301,69 @@ namespace TJAPlayer3 fs.Dispose(); - if (listSongsDB.TryGetValue(filePath + hash, out CSongListNode value)) - { + if (listSongsDB.TryGetValue(filePath + hash, out CSongListNode value)) { this.n検索されたスコア数++; - listノードリスト.Add( value ); + listノードリスト.Add(value); CSongDict.tAddSongNode(value.uniqueId, value); - value.rParentNode = node親; + value.rParentNode = node親; - if (value.rParentNode != null) - { + if (value.rParentNode != null) { value.strScenePreset = value.rParentNode.strScenePreset; - if (value.rParentNode.IsChangedForeColor) - { + if (value.rParentNode.IsChangedForeColor) { value.ForeColor = value.rParentNode.ForeColor; value.IsChangedForeColor = true; } - if (value.rParentNode.IsChangedBackColor) - { + if (value.rParentNode.IsChangedBackColor) { value.BackColor = value.rParentNode.BackColor; value.IsChangedBackColor = true; } - if (value.rParentNode.isChangedBoxColor) - { + if (value.rParentNode.isChangedBoxColor) { value.BoxColor = value.rParentNode.BoxColor; value.isChangedBoxColor = true; } - if (value.rParentNode.isChangedBgColor) - { + if (value.rParentNode.isChangedBgColor) { value.BgColor = value.rParentNode.BgColor; value.isChangedBgColor = true; } - if (value.rParentNode.isChangedBgType) - { + if (value.rParentNode.isChangedBgType) { value.BgType = value.rParentNode.BgType; value.isChangedBgType = true; } - if (value.rParentNode.isChangedBoxType) - { + if (value.rParentNode.isChangedBoxType) { value.BoxType = value.rParentNode.BoxType; value.isChangedBoxType = true; } - if (value.rParentNode.isChangedBoxChara) - { + 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 ); + } 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 ] ) - { + for (int n = 0; n < (int)Difficulty.Total; n++) { + if (dtx.b譜面が存在する[n]) { c曲リストノード.nスコア数++; c曲リストノード.rParentNode = node親; - c曲リストノード.strBreadcrumbs = ( c曲リストノード.rParentNode == null ) ? + 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曲リストノード.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 = new(); + if (dtx.List_DanSongs != null) { + for (int i = 0; i < dtx.List_DanSongs.Count; i++) { c曲リストノード.DanSongs.Add(dtx.List_DanSongs[i]); } } @@ -428,80 +371,62 @@ namespace TJAPlayer3 if (dtx.Dan_C != null) c曲リストノード.Dan_C = dtx.Dan_C; - if (!string.IsNullOrEmpty(dtx.GENRE)) - { - if(c曲リストノード.rParentNode != null) - { + if (!string.IsNullOrEmpty(dtx.GENRE)) { + if (c曲リストノード.rParentNode != null) { c曲リストノード.strジャンル = c曲リストノード.rParentNode.strジャンル; c曲リストノード.str本当のジャンル = dtx.GENRE; - } - else - { + } else { c曲リストノード.strジャンル = dtx.GENRE; c曲リストノード.str本当のジャンル = dtx.GENRE; } - } - else - { + } else { c曲リストノード.strジャンル = c曲リストノード.rParentNode.strジャンル; c曲リストノード.str本当のジャンル = c曲リストノード.rParentNode.strジャンル; } - if (c曲リストノード.strSelectBGPath == null || !File.Exists(str基点フォルダ + dtx.SELECTBG)) - { + if (c曲リストノード.strSelectBGPath == null || !File.Exists(str基点フォルダ + dtx.SELECTBG)) { c曲リストノード.strSelectBGPath = c曲リストノード.rParentNode.strSelectBGPath; - } - else - { + } else { c曲リストノード.strSelectBGPath = str基点フォルダ + dtx.SELECTBG; } if (!File.Exists(c曲リストノード.strSelectBGPath)) c曲リストノード.strSelectBGPath = null; - if (c曲リストノード.rParentNode != null) - { + if (c曲リストノード.rParentNode != null) { c曲リストノード.strScenePreset = c曲リストノード.rParentNode.strScenePreset; - if (c曲リストノード.rParentNode.IsChangedForeColor) - { + if (c曲リストノード.rParentNode.IsChangedForeColor) { c曲リストノード.ForeColor = c曲リストノード.rParentNode.ForeColor; c曲リストノード.IsChangedForeColor = true; } - if (c曲リストノード.rParentNode.IsChangedBackColor) - { + if (c曲リストノード.rParentNode.IsChangedBackColor) { c曲リストノード.BackColor = c曲リストノード.rParentNode.BackColor; c曲リストノード.IsChangedBackColor = true; } - if (c曲リストノード.rParentNode.isChangedBoxColor) - { + if (c曲リストノード.rParentNode.isChangedBoxColor) { c曲リストノード.BoxColor = c曲リストノード.rParentNode.BoxColor; c曲リストノード.isChangedBoxColor = true; } - if (c曲リストノード.rParentNode.isChangedBgColor) - { + if (c曲リストノード.rParentNode.isChangedBgColor) { c曲リストノード.BgColor = c曲リストノード.rParentNode.BgColor; c曲リストノード.isChangedBgColor = true; } - if (c曲リストノード.rParentNode.isChangedBgType) - { + if (c曲リストノード.rParentNode.isChangedBgType) { c曲リストノード.BgType = c曲リストノード.rParentNode.BgType; c曲リストノード.isChangedBgType = true; } - if (c曲リストノード.rParentNode.isChangedBoxType) - { + if (c曲リストノード.rParentNode.isChangedBoxType) { c曲リストノード.BoxType = c曲リストノード.rParentNode.BoxType; c曲リストノード.isChangedBoxType = true; } - if (c曲リストノード.rParentNode.isChangedBoxChara) - { + if (c曲リストノード.rParentNode.isChangedBoxChara) { c曲リストノード.BoxChara = c曲リストノード.rParentNode.BoxChara; c曲リストノード.isChangedBoxChara = true; } - - + + } - switch (CStrジャンルtoNum.ForAC15(c曲リストノード.strジャンル)) - { + switch (CStrジャンルtoNum.ForAC15(c曲リストノード.strジャンル)) { case 0: c曲リストノード.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_JPOP; c曲リストノード.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_JPOP; @@ -545,242 +470,211 @@ namespace TJAPlayer3 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曲リストノード.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 (c曲リストノード.rParentNode != null && String.IsNullOrEmpty(c曲リストノード.arスコア[n].譜面情報.Preimage)) - { + 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 ) - { + if (b == false) { this.n検索されたスコア数++; - listノードリスト.Add( c曲リストノード ); - if (!listSongsDB.ContainsKey(filePath + hash)) listSongsDB.Add(filePath + hash, c曲リストノード ); + listノードリスト.Add(c曲リストノード); + if (!listSongsDB.ContainsKey(filePath + hash)) listSongsDB.Add(filePath + hash, c曲リストノード); this.n検索された曲ノード数++; b = true; } - if( TJAPlayer3.ConfigIni.bLog曲検索ログ出力 ) - { - // Trace.Indent(); - // try - // { - // StringBuilder sb = new StringBuilder( 0x100 ); - // sb.Append( string.Format( "nID#{0:D3}", c曲リストノード.nID ) ); - // if( c曲リストノード.r親ノード != null ) - // { - // sb.Append( string.Format( "(in#{0:D3}):", c曲リストノード.r親ノード.nID ) ); - // } - // else - // { - // sb.Append( "(onRoot):" ); - // } - // sb.Append( " SONG, File=" + c曲リストノード.arスコア[ 0 ].ファイル情報.ファイルの絶対パス ); - // sb.Append( ", Size=" + c曲リストノード.arスコア[ 0 ].ファイル情報.ファイルサイズ ); - // sb.Append( ", LastUpdate=" + c曲リストノード.arスコア[ 0 ].ファイル情報.最終更新日時 ); - // Trace.TraceInformation( sb.ToString() ); - // } - // finally - // { - // Trace.Unindent(); - // } + if (TJAPlayer3.ConfigIni.bLog曲検索ログ出力) { + // Trace.Indent(); + // try + // { + // StringBuilder sb = new StringBuilder( 0x100 ); + // sb.Append( string.Format( "nID#{0:D3}", c曲リストノード.nID ) ); + // if( c曲リストノード.r親ノード != null ) + // { + // sb.Append( string.Format( "(in#{0:D3}):", c曲リストノード.r親ノード.nID ) ); + // } + // else + // { + // sb.Append( "(onRoot):" ); + // } + // sb.Append( " SONG, File=" + c曲リストノード.arスコア[ 0 ].ファイル情報.ファイルの絶対パス ); + // sb.Append( ", Size=" + c曲リストノード.arスコア[ 0 ].ファイル情報.ファイルサイズ ); + // sb.Append( ", LastUpdate=" + c曲リストノード.arスコア[ 0 ].ファイル情報.最終更新日時 ); + // Trace.TraceInformation( sb.ToString() ); + // } + // finally + // { + // Trace.Unindent(); + // } } } } } - #endregion - } + #endregion + } } } //----------------------------- #endregion - foreach( DirectoryInfo infoDir in info.GetDirectories() ) - { - SlowOrSuspendSearchTask(); // #27060 中断要求があったら、解除要求が来るまで待機, #PREMOVIE再生中は検索負荷を落とす + 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" ); + 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; + 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) - { + 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) - { + } + if (boxdef.IsChangedBgColor) { c曲リストノード.BgColor = boxdef.BgColor; c曲リストノード.isChangedBgColor = true; } - if (boxdef.IsChangedBgType) - { + if (boxdef.IsChangedBgType) { c曲リストノード.BgType = boxdef.BgType; c曲リストノード.isChangedBgType = true; } - if (boxdef.IsChangedBoxType) - { + if (boxdef.IsChangedBoxType) { c曲リストノード.BoxType = boxdef.BoxType; c曲リストノード.isChangedBoxType = true; } - if (boxdef.IsChangedBoxChara) - { + if (boxdef.IsChangedBoxChara) { c曲リストノード.BoxChara = boxdef.BoxChara; c曲リストノード.isChangedBoxChara = true; } - - for (int i = 0; i < 3; i++) - { - if ((boxdef.strBoxText[i] != null)) - { + + 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 = TJAPlayer3.Skin.SongSelect_ForeColor_JPOP; - c曲リストノード.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_JPOP; - break; - case 1: - c曲リストノード.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Anime; - c曲リストノード.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Anime; - break; - case 2: - c曲リストノード.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_VOCALOID; - c曲リストノード.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_VOCALOID; - break; - case 3: - c曲リストノード.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Children; - c曲リストノード.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Children; - break; - case 4: - c曲リストノード.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Variety; - c曲リストノード.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Variety; - break; - case 5: - c曲リストノード.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Classic; - c曲リストノード.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Classic; - break; - case 6: - c曲リストノード.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_GameMusic; - c曲リストノード.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_GameMusic; - break; - case 7: - c曲リストノード.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Namco; - c曲リストノード.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Namco; - break; - default: - break; - } + switch (CStrジャンルtoNum.ForAC15(c曲リストノード.strジャンル)) { + case 0: + c曲リストノード.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_JPOP; + c曲リストノード.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_JPOP; + break; + case 1: + c曲リストノード.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Anime; + c曲リストノード.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Anime; + break; + case 2: + c曲リストノード.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_VOCALOID; + c曲リストノード.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_VOCALOID; + break; + case 3: + c曲リストノード.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Children; + c曲リストノード.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Children; + break; + case 4: + c曲リストノード.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Variety; + c曲リストノード.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Variety; + break; + case 5: + c曲リストノード.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Classic; + c曲リストノード.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Classic; + break; + case 6: + c曲リストノード.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_GameMusic; + c曲リストノード.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_GameMusic; + break; + case 7: + c曲リストノード.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Namco; + c曲リストノード.BackColor = TJAPlayer3.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曲リストノード.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曲リストノード.strBreadcrumbs = (c曲リストノード.rParentNode == null) ? c曲リストノード.ldTitle.GetString("") : c曲リストノード.rParentNode.strBreadcrumbs + " > " + c曲リストノード.ldTitle.GetString(""); - - + + c曲リストノード.list子リスト = new List(); - listノードリスト.Add( c曲リストノード ); - if( TJAPlayer3.ConfigIni.bLog曲検索ログ出力 ) - { - Trace.TraceInformation( "box.def検出 : {0}", infoDir.FullName + @$"{Path.DirectorySeparatorChar}box.def" ); + listノードリスト.Add(c曲リストノード); + if (TJAPlayer3.ConfigIni.bLog曲検索ログ出力) { + 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 ) ); + 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):"); } - else - { - sb.Append( "(onRoot):" ); + sb.Append("BOX, Title=" + c曲リストノード.ldTitle.GetString("")); + if ((c曲リストノード.strジャンル != null) && (c曲リストノード.strジャンル.Length > 0)) { + sb.Append(", Genre=" + c曲リストノード.strジャンル); } - 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曲リストノード.IsChangedForeColor) - { - sb.Append(", ForeColor=" + c曲リストノード.ForeColor.ToString()); - } - if (c曲リストノード.IsChangedBackColor) - { - sb.Append(", BackColor=" + c曲リストノード.BackColor.ToString()); - } - if (c曲リストノード.isChangedBoxColor) - { + if (c曲リストノード.IsChangedBackColor) { + sb.Append(", BackColor=" + c曲リストノード.BackColor.ToString()); + } + if (c曲リストノード.isChangedBoxColor) { sb.Append(", BoxColor=" + c曲リストノード.BoxColor.ToString()); - } - if (c曲リストノード.isChangedBgColor) - { + } + if (c曲リストノード.isChangedBgColor) { sb.Append(", BgColor=" + c曲リストノード.BgColor.ToString()); } - if (c曲リストノード.isChangedBoxType) - { + if (c曲リストノード.isChangedBoxType) { sb.Append(", BoxType=" + c曲リストノード.BoxType.ToString()); } - if (c曲リストノード.isChangedBgType) - { + if (c曲リストノード.isChangedBgType) { sb.Append(", BgType=" + c曲リストノード.BgType.ToString()); } - if (c曲リストノード.isChangedBoxChara) - { + if (c曲リストノード.isChangedBoxChara) { sb.Append(", BoxChara=" + c曲リストノード.BoxChara.ToString()); } - Trace.TraceInformation( sb.ToString() ); - } - finally - { + Trace.TraceInformation(sb.ToString()); + } finally { Trace.Unindent(); } } - if( b子BOXへ再帰する ) - { - this.t曲を検索してリストを作成する( infoDir.FullName + Path.DirectorySeparatorChar, b子BOXへ再帰する, c曲リストノード.list子リスト, c曲リストノード ); + if (b子BOXへ再帰する) { + this.t曲を検索してリストを作成する(infoDir.FullName + Path.DirectorySeparatorChar, b子BOXへ再帰する, c曲リストノード.list子リスト, c曲リストノード); } } //----------------------------- @@ -788,9 +682,8 @@ namespace TJAPlayer3 #region [ c.通常フォルダの場合 ] //----------------------------- - else - { - this.t曲を検索してリストを作成する( infoDir.FullName + Path.DirectorySeparatorChar, b子BOXへ再帰する, listノードリスト, node親 ); + else { + this.t曲を検索してリストを作成する(infoDir.FullName + Path.DirectorySeparatorChar, b子BOXへ再帰する, listノードリスト, node親); } //----------------------------- #endregion @@ -799,124 +692,112 @@ namespace TJAPlayer3 //----------------- #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++; + 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(""); - - this.nファイルから反映できたスコア数++; - cdtx.DeActivate(); -//Debug.WriteLine( "★" + this.nファイルから反映できたスコア数 + " " + c曲リストノード.arスコア[ i ].譜面情報.タイトル ); - #region [ 曲検索ログ出力 ] - //----------------- - if( TJAPlayer3.ConfigIni.bLog曲検索ログ出力 ) - { - 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 + 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(); + //Debug.WriteLine( "★" + this.nファイルから反映できたスコア数 + " " + c曲リストノード.arスコア[ i ].譜面情報.タイトル ); + #region [ 曲検索ログ出力 ] + //----------------- + if (TJAPlayer3.ConfigIni.bLog曲検索ログ出力) { + 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曲リストへ後処理を適用する() - { + public void t曲リストへ後処理を適用する() { listStrBoxDefSkinSubfolderFullName = new List(); - if ( TJAPlayer3.Skin.strBoxDefSkinSubfolders != null ) - { - foreach ( string b in TJAPlayer3.Skin.strBoxDefSkinSubfolders ) - { - listStrBoxDefSkinSubfolderFullName.Add( b ); + if (TJAPlayer3.Skin.strBoxDefSkinSubfolders != null) { + foreach (string b in TJAPlayer3.Skin.strBoxDefSkinSubfolders) { + listStrBoxDefSkinSubfolderFullName.Add(b); } } @@ -960,15 +841,11 @@ namespace TJAPlayer3 this.t曲リストへ後処理を適用する(this.list曲ルート); - for (int p = 0; p < list曲ルート.Count; p++) - { + for (int p = 0; p < list曲ルート.Count; p++) { var c曲リストノード = list曲ルート[p]; - if (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX) - { - if (c曲リストノード.strジャンル == "段位道場") - { - if (TJAPlayer3.ConfigIni.bDanTowerHide) - { + if (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX) { + if (c曲リストノード.strジャンル == "段位道場") { + if (TJAPlayer3.ConfigIni.bDanTowerHide) { list曲ルート.Remove(c曲リストノード); p--; } @@ -985,32 +862,24 @@ namespace TJAPlayer3 } } */ - } - else if (c曲リストノード.strジャンル == "太鼓タワー") - { - if (TJAPlayer3.ConfigIni.bDanTowerHide) - { + } else if (c曲リストノード.strジャンル == "太鼓タワー") { + if (TJAPlayer3.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) - { + } else { + for (int i = 0; i < c曲リストノード.list子リスト.Count; i++) { + if (c曲リストノード.list子リスト[i].arスコア[6] != null) { list曲ルート_Dan.Add(c曲リストノード.list子リスト[i]); if (TJAPlayer3.ConfigIni.bDanTowerHide) c曲リストノード.list子リスト.Remove(c曲リストノード.list子リスト[i]); - + continue; } - if (c曲リストノード.list子リスト[i].arスコア[5] != null) - { + if (c曲リストノード.list子リスト[i].arスコア[5] != null) { list曲ルート_Tower.Add(c曲リストノード.list子リスト[i]); if (TJAPlayer3.ConfigIni.bDanTowerHide) @@ -1020,9 +889,7 @@ namespace TJAPlayer3 } } } - } - else - { + } else { // ??????? /* @@ -1037,29 +904,25 @@ namespace TJAPlayer3 } #region [ skin名で比較して、systemスキンとboxdefスキンに重複があれば、boxdefスキン側を削除する ] - string[] systemSkinNames = CSkin.GetSkinName( TJAPlayer3.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 ); + string[] systemSkinNames = CSkin.GetSkinName(TJAPlayer3.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 ); + Array.Sort(ba); TJAPlayer3.Skin.strBoxDefSkinSubfolders = ba; } - private void t曲リストへ後処理を適用する( List ノードリスト, string parentName = "/", bool isGlobal = true ) - { - - if (isGlobal && ノードリスト.Count > 0) - { + private void t曲リストへ後処理を適用する(List ノードリスト, string parentName = "/", bool isGlobal = true) { + + if (isGlobal && ノードリスト.Count > 0) { var randomNode = CSongDict.tGenerateRandomButton(ノードリスト[0].rParentNode, parentName); ノードリスト.Add(randomNode); @@ -1068,20 +931,14 @@ namespace TJAPlayer3 // Don't sort songs if the folder isn't global // Call back reinsert back folders if sort called ? - if (isGlobal) - { + if (isGlobal) { #region [ Sort nodes ] //----------------------------- - if (TJAPlayer3.ConfigIni.nDefaultSongSort == 0) - { + if (TJAPlayer3.ConfigIni.nDefaultSongSort == 0) { t曲リストのソート1_絶対パス順(ノードリスト); - } - else if (TJAPlayer3.ConfigIni.nDefaultSongSort == 1) - { + } else if (TJAPlayer3.ConfigIni.nDefaultSongSort == 1) { t曲リストのソート9_ジャンル順(ノードリスト, EInstrumentPad.TAIKO, 1, 0); - } - else if (TJAPlayer3.ConfigIni.nDefaultSongSort == 2) - { + } else if (TJAPlayer3.ConfigIni.nDefaultSongSort == 2) { t曲リストのソート9_ジャンル順(ノードリスト, EInstrumentPad.TAIKO, 2, 0); } //----------------------------- @@ -1089,27 +946,20 @@ namespace TJAPlayer3 } // すべてのノードについて… - foreach ( CSongListNode c曲リストノード in ノードリスト ) - { + foreach (CSongListNode c曲リストノード in ノードリスト) { SlowOrSuspendSearchTask(); // #27060 中断要求があったら、解除要求が来るまで待機, #PREMOVIE再生中は検索負荷を落とす #region [ Append "Back" buttons to the included folders ] //----------------------------- - if ( c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX ) - { + if (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX) { #region [ Sort child nodes ] //----------------------------- - if (TJAPlayer3.ConfigIni.nDefaultSongSort == 0) - { + if (TJAPlayer3.ConfigIni.nDefaultSongSort == 0) { t曲リストのソート1_絶対パス順(c曲リストノード.list子リスト); - } - else if (TJAPlayer3.ConfigIni.nDefaultSongSort == 1) - { + } else if (TJAPlayer3.ConfigIni.nDefaultSongSort == 1) { t曲リストのソート9_ジャンル順(c曲リストノード.list子リスト, EInstrumentPad.TAIKO, 1, 0); - } - else if (TJAPlayer3.ConfigIni.nDefaultSongSort == 2) - { + } else if (TJAPlayer3.ConfigIni.nDefaultSongSort == 2) { t曲リストのソート9_ジャンル順(c曲リストノード.list子リスト, EInstrumentPad.TAIKO, 2, 0); } //----------------------------- @@ -1131,16 +981,13 @@ namespace TJAPlayer3 #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 ].譜面情報.タイトル ) ) - { + 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( TJAPlayer3.ConfigIni.bLog曲検索ログ出力 ) - Trace.TraceInformation( "タイトルを設定しました。(nID#{0:D3}, title={1})", c曲リストノード.nID, c曲リストノード.ldTitle.GetString("")); + if (TJAPlayer3.ConfigIni.bLog曲検索ログ出力) + Trace.TraceInformation("タイトルを設定しました。(nID#{0:D3}, title={1})", c曲リストノード.nID, c曲リストノード.ldTitle.GetString("")); break; } @@ -1292,91 +1139,80 @@ namespace TJAPlayer3 } //----------------- #endregion*/ - + #region [ 曲リストソート ] //----------------- - public static void t曲リストのソート1_絶対パス順( List ノードリスト ) - { - t曲リストのソート1_絶対パス順(ノードリスト, EInstrumentPad.TAIKO, 1, 0); + 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)); + 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 ); - } + ノードリスト.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)); + 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 ); - } + ノードリスト.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)); + 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); - } + ノードリスト.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)); + 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); - } + ノードリスト.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曲リストのソート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)); + 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)"); - } - } + ノードリスト.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 ) @@ -1387,7 +1223,7 @@ namespace TJAPlayer3 { ノードリスト.Sort( delegate( C曲リストノード n1, C曲リストノード n2 ) { - #region [ 共通処理 ] + #region [ 共通処理 ] if ( n1 == n2 ) { return 0; @@ -1401,7 +1237,7 @@ namespace TJAPlayer3 { return order * n1.arスコア[ 0 ].ファイル情報.フォルダの絶対パス.CompareTo( n2.arスコア[ 0 ].ファイル情報.フォルダの絶対パス ); } - #endregion + #endregion double dBPMn1 = 0.0, dBPMn2 = 0.0; if ( n1.arスコア[ nL12345 ] != null ) { @@ -1430,8 +1266,8 @@ Debug.WriteLine( dBPM + ":" + c曲リストノード.strタイトル ); } } #endif - //----------------- - #endregion + //----------------- + #endregion // その他 @@ -1439,24 +1275,22 @@ Debug.WriteLine( dBPM + ":" + c曲リストノード.strタイトル ); #region [ private ] //----------------- //private const string SONGSDB_VERSION = "SongsDB5"; - public List listStrBoxDefSkinSubfolderFullName - { + public List listStrBoxDefSkinSubfolderFullName { get; private set; - } + } /// /// 検索を中断_スローダウンする /// - private void SlowOrSuspendSearchTask() - { - if ( this.bIsSuspending ) // #27060 中断要求があったら、解除要求が来るまで待機 + private void SlowOrSuspendSearchTask() { + if (this.bIsSuspending) // #27060 中断要求があったら、解除要求が来るまで待機 { AutoReset.WaitOne(); } - if ( this.bIsSlowdown && ++this.searchCount > 10 ) // #27060 #PREMOVIE再生中は検索負荷を下げる + if (this.bIsSlowdown && ++this.searchCount > 10) // #27060 #PREMOVIE再生中は検索負荷を下げる { - Thread.Sleep( 100 ); + Thread.Sleep(100); this.searchCount = 0; } } @@ -1465,4 +1299,4 @@ Debug.WriteLine( dBPM + ":" + c曲リストノード.strタイトル ); #endregion } } -  + diff --git a/OpenTaiko/src/Songs/CStrジャンルtoNum.cs b/OpenTaiko/src/Songs/CStrジャンルtoNum.cs index 9dcf7d69..c93822a9 100644 --- a/OpenTaiko/src/Songs/CStrジャンルtoNum.cs +++ b/OpenTaiko/src/Songs/CStrジャンルtoNum.cs @@ -1,62 +1,56 @@ -namespace TJAPlayer3 -{ - 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 TJAPlayer3 { + 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; - } - } - } + 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 6ec6a590..4a41c894 100644 --- a/OpenTaiko/src/Songs/Cスコア.cs +++ b/OpenTaiko/src/Songs/Cスコア.cs @@ -1,28 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Drawing; using System.Runtime.InteropServices; -using System.Runtime.Serialization.Formatters.Binary; using FDK; -using System.Drawing; -namespace TJAPlayer3 -{ +namespace TJAPlayer3 { [Serializable] - internal class Cスコア - { + internal class Cスコア { // プロパティ public STScoreIni情報 ScoreIni情報; [Serializable] - [StructLayout( LayoutKind.Sequential )] - public struct STScoreIni情報 - { + [StructLayout(LayoutKind.Sequential)] + public struct STScoreIni情報 { public DateTime 最終更新日時; public long ファイルサイズ; - public STScoreIni情報( DateTime 最終更新日時, long ファイルサイズ ) - { + public STScoreIni情報(DateTime 最終更新日時, long ファイルサイズ) { this.最終更新日時 = 最終更新日時; this.ファイルサイズ = ファイルサイズ; } @@ -30,16 +22,14 @@ namespace TJAPlayer3 public STファイル情報 ファイル情報; [Serializable] - [StructLayout( LayoutKind.Sequential )] - public struct STファイル情報 - { + [StructLayout(LayoutKind.Sequential)] + public struct STファイル情報 { public string ファイルの絶対パス; public string フォルダの絶対パス; public DateTime 最終更新日時; public long ファイルサイズ; - public STファイル情報( string ファイルの絶対パス, string フォルダの絶対パス, DateTime 最終更新日時, long ファイルサイズ ) - { + public STファイル情報(string ファイルの絶対パス, string フォルダの絶対パス, DateTime 最終更新日時, long ファイルサイズ) { this.ファイルの絶対パス = ファイルの絶対パス; this.フォルダの絶対パス = フォルダの絶対パス; this.最終更新日時 = 最終更新日時; @@ -50,9 +40,8 @@ namespace TJAPlayer3 public ST譜面情報 譜面情報; [Serializable] - [StructLayout( LayoutKind.Sequential )] - public struct ST譜面情報 - { + [StructLayout(LayoutKind.Sequential)] + public struct ST譜面情報 { public string タイトル; public string アーティスト名; public string コメント; @@ -73,16 +62,16 @@ namespace TJAPlayer3 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 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; @@ -97,22 +86,18 @@ namespace TJAPlayer3 public List nExamResult; [Serializable] - [StructLayout( LayoutKind.Sequential )] - public struct STHISTORY - { + [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 ) - { + public string 行6; + public string 行7; + public string this[int index] { + get { + switch (index) { case 0: return this.行1; @@ -127,17 +112,15 @@ namespace TJAPlayer3 case 4: return this.行5; - case 5: - return this.行6; - case 6: - return this.行7; + case 5: + return this.行6; + case 6: + return this.行7; } throw new IndexOutOfRangeException(); } - set - { - switch( index ) - { + set { + switch (index) { case 0: this.行1 = value; return; @@ -157,12 +140,12 @@ namespace TJAPlayer3 case 4: this.行5 = value; return; - case 5: - this.行6 = value; - return; - case 6: - this.行7 = value; - return; + case 5: + this.行6 = value; + return; + case 6: + this.行7 = value; + return; } throw new IndexOutOfRangeException(); } @@ -170,27 +153,22 @@ namespace TJAPlayer3 } [Serializable] - [StructLayout( LayoutKind.Sequential )] - public struct STRANK - { + [StructLayout(LayoutKind.Sequential)] + public struct STRANK { public int Drums; public int Guitar; public int Bass; } [Serializable] - [StructLayout( LayoutKind.Sequential )] - public struct STSKILL - { + [StructLayout(LayoutKind.Sequential)] + public struct STSKILL { public double Drums; public double Guitar; public double Bass; - public double this[ int index ] - { - get - { - switch( index ) - { + public double this[int index] { + get { + switch (index) { case 0: return this.Drums; @@ -202,14 +180,11 @@ namespace TJAPlayer3 } throw new IndexOutOfRangeException(); } - set - { - if( ( value < 0.0 ) || ( value > 100.0 ) ) - { + set { + if ((value < 0.0) || (value > 100.0)) { throw new ArgumentOutOfRangeException(); } - switch( index ) - { + switch (index) { case 0: this.Drums = value; return; @@ -229,22 +204,19 @@ namespace TJAPlayer3 } public bool bSongDBにキャッシュがあった; - public bool bスコアが有効である - { - get - { - return ( ( ( this.譜面情報.レベル[ 0 ] + this.譜面情報.レベル[ 1 ] ) + this.譜面情報.レベル[ 2 ] ) != 0 ); + public bool bスコアが有効である { + get { + return (((this.譜面情報.レベル[0] + this.譜面情報.レベル[1]) + this.譜面情報.レベル[2]) != 0); } } // コンストラクタ - public Cスコア() - { - this.ScoreIni情報 = new STScoreIni情報( DateTime.MinValue, 0L ); + public Cスコア() { + this.ScoreIni情報 = new STScoreIni情報(DateTime.MinValue, 0L); this.bSongDBにキャッシュがあった = false; - this.ファイル情報 = new STファイル情報( "", "", DateTime.MinValue, 0L ); + this.ファイル情報 = new STファイル情報("", "", DateTime.MinValue, 0L); this.譜面情報 = new ST譜面情報(); this.譜面情報.タイトル = ""; this.譜面情報.アーティスト名 = ""; @@ -263,28 +235,28 @@ namespace TJAPlayer3 this.譜面情報.演奏履歴.行3 = ""; this.譜面情報.演奏履歴.行4 = ""; this.譜面情報.演奏履歴.行5 = ""; - this.譜面情報.演奏履歴.行6 = ""; - this.譜面情報.演奏履歴.行7 = ""; - this.譜面情報.レベルを非表示にする = false; + 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.譜面情報.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 { }; //for (int i = 0; i < TJAPlayer3.stage選曲.r確定された曲.DanSongs.Count; i++) //{ diff --git a/OpenTaiko/src/Songs/C曲リストノードComparers/ComparerChain.cs b/OpenTaiko/src/Songs/C曲リストノードComparers/ComparerChain.cs index 358edcc9..c0c9d3b4 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/ComparerChain.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/ComparerChain.cs @@ -1,34 +1,25 @@ -using System.Collections.Generic; +namespace TJAPlayer3.C曲リストノードComparers { + internal sealed class ComparerChain : IComparer where T : class { + private readonly IComparer[] _comparers; -namespace TJAPlayer3.C曲リストノードComparers -{ - internal sealed class ComparerChain : IComparer where T : class - { - private readonly IComparer[] _comparers; + public ComparerChain(params IComparer[] comparers) { + _comparers = comparers; + } - public ComparerChain(params IComparer[] comparers) - { - _comparers = comparers; - } + public int Compare(T x, T y) { + if (ReferenceEquals(x, y)) { + return 0; + } - 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); - for (int i = 0; i < _comparers.Length; i++) - { - var result = _comparers[i].Compare(x, y); + if (result != 0) { + return result; + } + } - if (result != 0) - { - return result; - } - } - - return 0; - } - } -} \ No newline at end of file + return 0; + } + } +} diff --git a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerAC15.cs b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerAC15.cs index 3cf0e4ec..f2804f78 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerAC15.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerAC15.cs @@ -1,12 +1,7 @@ -using System.Collections.Generic; - -namespace TJAPlayer3.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ジャンル)); - } - } -} \ No newline at end of file +namespace TJAPlayer3.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 27c7cd53..87b4125f 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerAC8_14.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerAC8_14.cs @@ -1,12 +1,7 @@ -using System.Collections.Generic; - -namespace TJAPlayer3.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ジャンル)); - } - } -} \ No newline at end of file +namespace TJAPlayer3.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 9d2e890c..6bf065a2 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerLevel.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerLevel.cs @@ -1,32 +1,24 @@ -using System.Collections.Generic; +namespace TJAPlayer3.C曲リストノードComparers { + internal sealed class C曲リストノードComparerLevel : IComparer { + private readonly int _order; -namespace TJAPlayer3.C曲リストノードComparers -{ - internal sealed class C曲リストノードComparerLevel : IComparer - { - private readonly int _order; + public C曲リストノードComparerLevel(int order) { + this._order = 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; + 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)); - } + if (_n1s == 0 || _n2s == 0) { + return 0; + } + return _order * _diffOf(n1).CompareTo(_diffOf(n2)); + } - private int _diffOf(CSongListNode n1) - { - return n1.nLevel[TJAPlayer3.stageSongSelect.actSongList.tFetchDifficulty(n1)]; - } - } -} \ No newline at end of file + private int _diffOf(CSongListNode n1) { + return n1.nLevel[TJAPlayer3.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 753c57bb..57d303d3 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerLevelIcon.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerLevelIcon.cs @@ -1,32 +1,24 @@ -using System.Collections.Generic; +namespace TJAPlayer3.C曲リストノードComparers { + internal sealed class C曲リストノードComparerLevelIcon : IComparer { + private readonly int _order; -namespace TJAPlayer3.C曲リストノードComparers -{ - internal sealed class C曲リストノードComparerLevelIcon : IComparer - { - private readonly int _order; + public C曲リストノードComparerLevelIcon(int order) { + this._order = 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; + 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)); - } + if (_n1s == 0 || _n2s == 0) { + return 0; + } + return _order * _diffOf(n1).CompareTo(_diffOf(n2)); + } - private int _diffOf(CSongListNode n1) - { - return (int)n1.nLevelIcon[TJAPlayer3.stageSongSelect.actSongList.tFetchDifficulty(n1)]; - } - } -} \ No newline at end of file + private int _diffOf(CSongListNode n1) { + return (int)n1.nLevelIcon[TJAPlayer3.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 ecf7dc20..1051400f 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerSubtitle.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerSubtitle.cs @@ -1,19 +1,13 @@ -using System.Collections.Generic; +namespace TJAPlayer3.C曲リストノードComparers { + internal sealed class C曲リストノードComparerSubtitle : IComparer { + private readonly int _order; -namespace TJAPlayer3.C曲リストノードComparers -{ - internal sealed class C曲リストノードComparerSubtitle : IComparer - { - private readonly int _order; + public C曲リストノードComparerSubtitle(int order) { + this._order = order; + } - public C曲リストノードComparerSubtitle(int order) - { - this._order = order; - } - - public int Compare(CSongListNode n1, CSongListNode n2) - { - return _order * n1.ldSubtitle.GetString("").CompareTo(n2.ldSubtitle.GetString("")); - } - } -} \ No newline at end of file + 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 85423101..5e185014 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerタイトル.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerタイトル.cs @@ -1,19 +1,13 @@ -using System.Collections.Generic; +namespace TJAPlayer3.C曲リストノードComparers { + internal sealed class C曲リストノードComparerタイトル : IComparer { + private readonly int _order; -namespace TJAPlayer3.C曲リストノードComparers -{ - internal sealed class C曲リストノードComparerタイトル : IComparer - { - private readonly int _order; + public C曲リストノードComparerタイトル(int order) { + this._order = order; + } - public C曲リストノードComparerタイトル(int order) - { - this._order = order; - } - - public int Compare(CSongListNode n1, CSongListNode n2) - { - return _order * n1.ldTitle.GetString("").CompareTo( n2.ldTitle.GetString("")); - } - } -} \ No newline at end of file + 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 8ac7cc36..fc6fba00 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerノード種別.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerノード種別.cs @@ -1,33 +1,25 @@ -using System; -using System.Collections.Generic; +namespace TJAPlayer3.C曲リストノードComparers { + internal sealed class C曲リストノードComparerノード種別 : IComparer { + public int Compare(CSongListNode x, CSongListNode y) { + return ToComparable(x.eノード種別).CompareTo(ToComparable(y.eノード種別)); + } -namespace TJAPlayer3.C曲リストノードComparers -{ - 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(); - } - } - } + 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 9e8b5215..821b1010 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparer絶対パス.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparer絶対パス.cs @@ -1,40 +1,30 @@ -using System.Collections.Generic; +namespace TJAPlayer3.C曲リストノードComparers { + internal sealed class C曲リストノードComparer絶対パス : IComparer { + private readonly int _order; -namespace TJAPlayer3.C曲リストノードComparers -{ - internal sealed class C曲リストノードComparer絶対パス : IComparer - { - private readonly int _order; + public C曲リストノードComparer絶対パス(int order) { + this._order = 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); - var str = strファイルの絶対パス(n1); - var strB = strファイルの絶対パス(n2); + return _order * str.CompareTo(strB); + } - 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].ファイル情報.ファイルの絶対パス ?? ""; + } + } - 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 ""; - } - } -} \ No newline at end of file + return ""; + } + } +} diff --git a/OpenTaiko/src/Songs/Dan-C.cs b/OpenTaiko/src/Songs/Dan-C.cs index f5a9d689..00caeca0 100644 --- a/OpenTaiko/src/Songs/Dan-C.cs +++ b/OpenTaiko/src/Songs/Dan-C.cs @@ -1,395 +1,346 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace TJAPlayer3 -{ - /// - /// 段位認定を管理するクラス。 - /// +namespace TJAPlayer3 { + /// + /// 段位認定を管理するクラス。 + /// [Serializable] - public class Dan_C - { - public Dan_C() - { + 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()) - { - - } + 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 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; + /// + /// 段位認定の条件を初期化し、生成します。 + /// + /// 条件の種別。 + /// 条件の合格量。 + /// 条件の合格の範囲。 + public Dan_C(Exam.Type examType, int[] value, Exam.Range examRange) { + IsEnable = true; + NotReached = false; + SetExamType(examType); + SetValue(value[0], value[1]); + SetExamRange(examRange); + } - 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 bool Update(int nowValue) { + var isChangedAmount = false; - /// - /// 段位認定の条件が有効であるかどうかを返します。 - /// - /// 段位認定の条件が有効であるかどうか。 - public bool GetEnable() - { - return this.IsEnable; - } + if (nowValue < 0) + return isChangedAmount; - /// - /// 各合格条件のボーダーを設定します。 - /// - /// 赤合格条件 - /// 金合格条件 - public void SetValue(int redValue, int goldValue) - { - if (redValue != -1) this.Value[0] = redValue; - if (goldValue != -1) this.Value[1] = goldValue; - } + 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; + } - /// - /// 各合格条件のボーダーを返します。 - /// - /// trueを指定すると、金合格条件を返します。 - /// 合格条件の値。 - public int GetValue(bool isGoldValue) - { - return isGoldValue == true ? this.Value[1] : this.Value[0]; - } + /// + /// 段位認定の条件が有効であるかどうかを返します。 + /// + /// 段位認定の条件が有効であるかどうか。 + public bool GetEnable() { + return this.IsEnable; + } - /// - /// 現在の値を設定します。 - /// - /// 現在の値。 - public void SetAmount(int amount) - { - this.Amount = amount; - } + /// + /// 各合格条件のボーダーを設定します。 + /// + /// 赤合格条件 + /// 金合格条件 + public void SetValue(int redValue, int goldValue) { + if (redValue != -1) this.Value[0] = redValue; + if (goldValue != -1) this.Value[1] = goldValue; + } - /// - /// 現在の値を返します。 - /// - /// 現在の値。 - public int GetAmount() - { - return this.Amount; - } + /// + /// 各合格条件のボーダーを返します。 + /// + /// trueを指定すると、金合格条件を返します。 + /// 合格条件の値。 + public int GetValue(bool isGoldValue) { + return isGoldValue == true ? this.Value[1] : this.Value[0]; + } - /// - /// 条件の種別を返します。 - /// - /// 条件の種別 - public Exam.Type GetExamType() - { - return this.Type; - } + /// + /// 現在の値を設定します。 + /// + /// 現在の値。 + public void SetAmount(int amount) { + this.Amount = amount; + } - /// - /// 条件の種別を設定します。 - /// - /// 条件の種別。 - private void SetExamType(Exam.Type type) - { - this.Type = type; - } + /// + /// 現在の値を返します。 + /// + /// 現在の値。 + public int GetAmount() { + return this.Amount; + } - /// - /// 条件の範囲を返します。 - /// - /// 条件の範囲 - public Exam.Range GetExamRange() - { - return this.Range; - } + /// + /// 条件の種別を返します。 + /// + /// 条件の種別 + public Exam.Type GetExamType() { + return this.Type; + } - /// - /// 条件の範囲を設定します。 - /// - /// - private void SetExamRange(Exam.Range range) - { - this.Range = range; - } + /// + /// 条件の種別を設定します。 + /// + /// 条件の種別。 + private void SetExamType(Exam.Type type) { + this.Type = type; + } - /// - /// 条件にクリアしているかどうか返します。 - /// - /// 条件にクリアしているかどうか。 - public bool[] GetCleared() - { - return IsCleared; - } + /// + /// 条件の範囲を返します。 + /// + /// 条件の範囲 + 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; - } - } - } - - /// - /// ゲージの描画のための百分率を返す。 - /// - /// 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; - } + /// + /// 条件と現在の値をチェックして、合格もしくは金合格をしてるか否かを更新する。 + /// + 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 void SetReached(bool notReached) - { - NotReached = notReached; - } + /// + /// ゲージの描画のための百分率を返す。 + /// + /// 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 bool GetReached() - { - return NotReached; - } + /// + /// 条件に達成できる見込みがあるかどうか値を代入します。 + /// + /// 未達成かどうか。 + public void SetReached(bool notReached) { + NotReached = 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()); - } + /// + /// 条件に達成できる見込みがあるかどうかを返します。 + /// + /// 条件に達成できる見込みがあるかどうか。 + 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 }; + // フィールド + /// + /// その条件が有効であるかどうか。 + /// + 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]; + /// + /// 曲ごとの条件を格納する + /// + // public Dan_C[] SongExam = new Dan_C[3]; - /// - /// 条件の達成見込みがなくなったら、真になる。 - /// この変数が一度trueになれば、基本的にfalseに戻ることはない。 - /// (スコア加算については、この限りではない。) - /// - private bool NotReached = false; - } + /// + /// 条件の達成見込みがなくなったら、真になる。 + /// この変数が一度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 static class Exam { + /// + /// 段位認定の条件の種別。 + /// + public enum Type { + Gauge, + JudgePerfect, + JudgeGood, + JudgeBad, + Score, + Roll, + Hit, + Combo, + Accuracy, + JudgeADLIB, + JudgeMine, + Total, + } - /// - /// 段位認定の合格範囲。 - /// - public enum Range - { - /// - /// 以上 - /// - More, - /// - /// 未満 - /// - Less - } + /// + /// 段位認定の合格範囲。 + /// + public enum Range { + /// + /// 以上 + /// + More, + /// + /// 未満 + /// + Less + } - /// - /// ステータス。 - /// - public enum Status - { - /// - /// 不合格 - /// - Failure, - /// - /// 合格 - /// - Success, - /// - /// より良い合格 - /// - Better_Success - } - } + /// + /// ステータス。 + /// + public enum Status { + /// + /// 不合格 + /// + Failure, + /// + /// 合格 + /// + Success, + /// + /// より良い合格 + /// + Better_Success + } + } } diff --git a/OpenTaiko/src/Songs/Extended/CSongObject.cs b/OpenTaiko/src/Songs/Extended/CSongObject.cs index c6fe47bd..59a063b1 100644 --- a/OpenTaiko/src/Songs/Extended/CSongObject.cs +++ b/OpenTaiko/src/Songs/Extended/CSongObject.cs @@ -1,111 +1,91 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Diagnostics; -using System.IO; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - class CSongObject - { - public CSongObject(string name, float x, float y, string path) - { - this.name = path; - this.isVisible = false; +namespace TJAPlayer3 { + class CSongObject { + public CSongObject(string name, float x, float y, string path) { + this.name = path; + this.isVisible = false; - 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; + 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; - FileAttributes attr = File.GetAttributes(path); + FileAttributes attr = File.GetAttributes(path); - if ((attr & FileAttributes.Directory) == FileAttributes.Directory) - { - textures = TJAPlayer3.Tx.TxCSongFolder(path); - } - else - { - textures = new CTexture[1]; - textures[0] = TJAPlayer3.Tx.TxCSong(path); - } - } + if ((attr & FileAttributes.Directory) == FileAttributes.Directory) { + textures = TJAPlayer3.Tx.TxCSongFolder(path); + } else { + textures = new CTexture[1]; + textures[0] = TJAPlayer3.Tx.TxCSong(path); + } + } - public void tStartAnimation(double animInterval, bool loop) - { - counter.Start(0, textures.Length - 1, animInterval, TJAPlayer3.Timer); - counter.CurrentValue = this.frame; + public void tStartAnimation(double animInterval, bool loop) { + counter.Start(0, textures.Length - 1, animInterval, TJAPlayer3.Timer); + counter.CurrentValue = this.frame; - this.isLooping = loop; - this.isAnimating = true; - } + this.isLooping = loop; + this.isAnimating = true; + } - public void tStopAnimation() - { - counter.Stop(); - this.isAnimating = false; - } + 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(); - } + public void tDraw() { + if (isAnimating) { + if (isLooping) counter.TickLoop(); + else { + counter.Tick(); + if (counter.IsEnded) this.tStopAnimation(); + } - frame = counter.CurrentValue; - } + frame = counter.CurrentValue; + } - CTexture tx = this.textures[frame]; - if (frame + 1 > textures.Length) return; - if (tx == null) return; + 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; + tx.fZ軸中心回転 = CConversion.DegreeToRadian(this.rotation); + tx.color4 = this.color; + tx.Opacity = this.opacity; - float screen_ratiox = TJAPlayer3.Skin.Resolution[0] / 1280.0f; - float screen_ratioy = TJAPlayer3.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); - } + float screen_ratiox = TJAPlayer3.Skin.Resolution[0] / 1280.0f; + float screen_ratioy = TJAPlayer3.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(); - } - } + 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; + private CCounter counter = new CCounter(); + private bool isAnimating; + private bool isLooping; - public CTexture[] textures; + public CTexture[] textures; - public string name; - public bool isVisible; + 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 float x; + public float y; + public float rotation; + public int opacity; + public float xScale; + public float yScale; + public Color4 color; - public int frame; - } -} \ No newline at end of file + public int frame; + } +} diff --git a/OpenTaiko/src/Songs/GaugeIncreaseMode.cs b/OpenTaiko/src/Songs/GaugeIncreaseMode.cs index 427579f6..2748192b 100644 --- a/OpenTaiko/src/Songs/GaugeIncreaseMode.cs +++ b/OpenTaiko/src/Songs/GaugeIncreaseMode.cs @@ -1,29 +1,27 @@ -namespace TJAPlayer3 -{ - /// - /// ゲージ増加量の種類。 - /// - public enum GaugeIncreaseMode - { - /// - /// 切り捨てる。Floorと同義。 - /// - Normal, - /// - /// 切り捨てる。 - /// - Floor, - /// - /// 四捨五入する。 - /// - Round, - /// - /// 切り上げる。 - /// - Ceiling, - /// - /// 丸め処理を行わない。 - /// - NotFix - } +namespace TJAPlayer3 { + /// + /// ゲージ増加量の種類。 + /// + public enum GaugeIncreaseMode { + /// + /// 切り捨てる。Floorと同義。 + /// + Normal, + /// + /// 切り捨てる。 + /// + Floor, + /// + /// 四捨五入する。 + /// + Round, + /// + /// 切り上げる。 + /// + Ceiling, + /// + /// 丸め処理を行わない。 + /// + NotFix + } } diff --git a/OpenTaiko/src/Songs/VTTParser.cs b/OpenTaiko/src/Songs/VTTParser.cs index 190531b4..825ea7c9 100644 --- a/OpenTaiko/src/Songs/VTTParser.cs +++ b/OpenTaiko/src/Songs/VTTParser.cs @@ -1,560 +1,476 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; +using System.Diagnostics; using System.Drawing; -using System.IO; -using System.Linq; using System.Net; -using System.Text; using System.Text.RegularExpressions; -using System.Threading.Tasks; using FDK; using SkiaSharp; using static TJAPlayer3.CDTX; -namespace TJAPlayer3 -{ - public class VTTParser : IDisposable - { - /* +namespace TJAPlayer3 { + public class VTTParser : IDisposable { + /* TO-DO : - timestamp tag support */ - [Flags] - private enum ParseMode - { - None = 0, - Tag = 1, - TagEnd = 2, - Rt = 4 - } + [Flags] + private enum ParseMode { + None = 0, + Tag = 1, + TagEnd = 2, + Rt = 4 + } - internal struct LyricData - { - public long timestamp; // WIP, only first timestamp is accounted for - public string Text; + internal struct LyricData { + public long timestamp; // WIP, only first timestamp is accounted for + public string Text; - public CCachedFontRenderer.FontStyle Style; - public Color ForeColor; - public Color BackColor; + public CCachedFontRenderer.FontStyle Style; + public Color ForeColor; + public Color BackColor; - public bool IsRuby; - public string RubyText; + public bool IsRuby; + public string RubyText; - public int line; - public string Language; - } + public int line; + public string Language; + } - private static string[] _vttdelimiter; + private static string[] _vttdelimiter; - private static Regex regexTimestamp; + private static Regex regexTimestamp; - private static Regex regexOffset; - private static Regex regexLang; + private static Regex regexOffset; + private static Regex regexLang; - private static bool isUsingLang; + private static bool isUsingLang; - private bool _isDisposed; + private bool _isDisposed; - public VTTParser() - { - _vttdelimiter = new[] { "-->", "- >", "->" }; + public VTTParser() { + _vttdelimiter = new[] { "-->", "- >", "->" }; - regexTimestamp = new Regex(@"(-)?(([0-9]+):)?([0-9]+):([0-9]+)[,\\.]([0-9]+)"); + 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;" + 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; - } + isUsingLang = false; + } - #region Dispose stuff - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } + #region Dispose stuff + public void Dispose() { + Dispose(true); + GC.SuppressFinalize(this); + } - protected virtual void Dispose(bool disposing) - { - if (!_isDisposed && disposing) - { - _vttdelimiter = null; - regexTimestamp = null; + protected virtual void Dispose(bool disposing) { + if (!_isDisposed && disposing) { + _vttdelimiter = null; + regexTimestamp = null; - regexOffset = null; - regexLang = null; + regexOffset = null; + regexLang = null; - isUsingLang = false; + isUsingLang = false; - _isDisposed = true; - } + _isDisposed = true; + } - } - #endregion + } + #endregion - internal List ParseVTTFile(string filepath, int order, long offset) - { - List lrclist = new List(); - List lines = File.ReadAllLines(filepath).ToList(); + 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 + #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 - long startTime = -1; - long endTime = -1; + long startTime = -1; + long endTime = -1; - bool ignoreLyrics = false; - bool langIsMatch = false; + bool ignoreLyrics = false; + bool langIsMatch = false; - List lyricData = new List(); + List lyricData = new List(); - LyricData data = new LyricData() - { - ForeColor = TJAPlayer3.Skin.Game_Lyric_ForeColor, - BackColor = TJAPlayer3.Skin.Game_Lyric_BackColor - }; + LyricData data = new LyricData() { + ForeColor = TJAPlayer3.Skin.Game_Lyric_ForeColor, + BackColor = TJAPlayer3.Skin.Game_Lyric_BackColor + }; - bool readingHeader = true; - for (int i = 0; i < lines.Count; i++) - { - long start; - long end; + 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 (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)); - } + 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 = TJAPlayer3.Skin.Game_Lyric_ForeColor, - BackColor = TJAPlayer3.Skin.Game_Lyric_BackColor - }; - ignoreLyrics = false; - isUsingLang = false; - langIsMatch = false; + lyricData = new List(); + data = new LyricData() { + timestamp = startTime, + ForeColor = TJAPlayer3.Skin.Game_Lyric_ForeColor, + BackColor = TJAPlayer3.Skin.Game_Lyric_BackColor + }; + ignoreLyrics = false; + isUsingLang = false; + langIsMatch = false; - continue; - } + continue; + } - if (lines[i].StartsWith("NOTE ")) { ignoreLyrics = true; } + 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 - 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. + } - 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; - 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; - data.timestamp = start + offset; - } + string tagdata = String.Empty; + data.Text = String.Empty; - else if (!ignoreLyrics) // If all else fails, let's assume it's a lyric. ¯\_(ツ)_/¯ - { - int j = 0; - var parseMode = ParseMode.None; + 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 = TJAPlayer3.Skin.Game_Lyric_ForeColor; + data.BackColor = TJAPlayer3.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 = TJAPlayer3.Skin.Game_Lyric_VTTForeColor[0]; + break; + case "lime": + data.ForeColor = TJAPlayer3.Skin.Game_Lyric_VTTForeColor[1]; + break; + case "cyan": + data.ForeColor = TJAPlayer3.Skin.Game_Lyric_VTTForeColor[2]; + break; + case "red": + data.ForeColor = TJAPlayer3.Skin.Game_Lyric_VTTForeColor[3]; + break; + case "yellow": + data.ForeColor = TJAPlayer3.Skin.Game_Lyric_VTTForeColor[4]; + break; + case "magenta": + data.ForeColor = TJAPlayer3.Skin.Game_Lyric_VTTForeColor[5]; + break; + case "blue": + data.ForeColor = TJAPlayer3.Skin.Game_Lyric_VTTForeColor[6]; + break; + case "black": + data.ForeColor = TJAPlayer3.Skin.Game_Lyric_VTTForeColor[7]; + break; + case "bg_white": + data.BackColor = TJAPlayer3.Skin.Game_Lyric_VTTBackColor[0]; + break; + case "bg_lime": + data.BackColor = TJAPlayer3.Skin.Game_Lyric_VTTBackColor[1]; + break; + case "bg_cyan": + data.BackColor = TJAPlayer3.Skin.Game_Lyric_VTTBackColor[2]; + break; + case "bg_red": + data.BackColor = TJAPlayer3.Skin.Game_Lyric_VTTBackColor[3]; + break; + case "bg_yellow": + data.BackColor = TJAPlayer3.Skin.Game_Lyric_VTTBackColor[4]; + break; + case "bg_magenta": + data.BackColor = TJAPlayer3.Skin.Game_Lyric_VTTBackColor[5]; + break; + case "bg_blue": + data.BackColor = TJAPlayer3.Skin.Game_Lyric_VTTBackColor[6]; + break; + case "bg_black": + data.BackColor = TJAPlayer3.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; - 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 = TJAPlayer3.Skin.Game_Lyric_ForeColor; - data.BackColor = TJAPlayer3.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 = TJAPlayer3.Skin.Game_Lyric_VTTForeColor[0]; - break; - case "lime": - data.ForeColor = TJAPlayer3.Skin.Game_Lyric_VTTForeColor[1]; - break; - case "cyan": - data.ForeColor = TJAPlayer3.Skin.Game_Lyric_VTTForeColor[2]; - break; - case "red": - data.ForeColor = TJAPlayer3.Skin.Game_Lyric_VTTForeColor[3]; - break; - case "yellow": - data.ForeColor = TJAPlayer3.Skin.Game_Lyric_VTTForeColor[4]; - break; - case "magenta": - data.ForeColor = TJAPlayer3.Skin.Game_Lyric_VTTForeColor[5]; - break; - case "blue": - data.ForeColor = TJAPlayer3.Skin.Game_Lyric_VTTForeColor[6]; - break; - case "black": - data.ForeColor = TJAPlayer3.Skin.Game_Lyric_VTTForeColor[7]; - break; - case "bg_white": - data.BackColor = TJAPlayer3.Skin.Game_Lyric_VTTBackColor[0]; - break; - case "bg_lime": - data.BackColor = TJAPlayer3.Skin.Game_Lyric_VTTBackColor[1]; - break; - case "bg_cyan": - data.BackColor = TJAPlayer3.Skin.Game_Lyric_VTTBackColor[2]; - break; - case "bg_red": - data.BackColor = TJAPlayer3.Skin.Game_Lyric_VTTBackColor[3]; - break; - case "bg_yellow": - data.BackColor = TJAPlayer3.Skin.Game_Lyric_VTTBackColor[4]; - break; - case "bg_magenta": - data.BackColor = TJAPlayer3.Skin.Game_Lyric_VTTBackColor[5]; - break; - case "bg_blue": - data.BackColor = TJAPlayer3.Skin.Game_Lyric_VTTBackColor[6]; - break; - case "bg_black": - data.BackColor = TJAPlayer3.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); - 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); - lyricData.Add(data); + 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; - 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; + } + 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; - } - 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); - 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); + } - 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 + 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; + 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); - } + for (int i = 0; i < linecount; i++) { + textures.Add(new List()); + rubywidthoffset.Add(new List()); + rubyheightoffset.Add(0); + } - string text = String.Empty; + string text = String.Empty; - foreach (LyricData data in datalist) - { - using (CCachedFontRenderer fastdraw = HPrivateFastFont.tInstantiateFont(TJAPlayer3.Skin.Game_Lyric_FontName, TJAPlayer3.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(TJAPlayer3.Skin.Game_Lyric_FontName, TJAPlayer3.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 + (TJAPlayer3.Skin.Game_Lyric_VTTRubyOffset + (ruby.Height / 2))); - SKBitmap fullruby = new SKBitmap(size.Width, size.Height); + foreach (LyricData data in datalist) { + using (CCachedFontRenderer fastdraw = HPrivateFastFont.tInstantiateFont(TJAPlayer3.Skin.Game_Lyric_FontName, TJAPlayer3.Skin.Game_Lyric_FontSize, data.Style)) { + SKBitmap textdrawing = fastdraw.DrawText(data.Text, data.ForeColor, data.BackColor, null, 30); // Draw main text - - 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) - TJAPlayer3.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; - } + if (data.IsRuby) // ruby time + { + using (CCachedFontRenderer rubydraw = HPrivateFastFont.tInstantiateFont(TJAPlayer3.Skin.Game_Lyric_FontName, TJAPlayer3.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 + (TJAPlayer3.Skin.Game_Lyric_VTTRubyOffset + (ruby.Height / 2))); + SKBitmap fullruby = new SKBitmap(size.Width, size.Height); - 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]; - } + 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) - TJAPlayer3.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; + } - 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 + 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; - if (textures.Count > 0) - { - using (SKCanvas canvas = new SKCanvas(lyrictex)) - { - canvas.Clear(); + 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; - 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]; - } - } - } + 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]; + } - STLYRIC st = new STLYRIC() - { - index = order, - Text = text, - TextTex = lyrictex, - Time = timestamp - }; - return st; - } - } + 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 c43df48a..ad5ba115 100644 --- a/OpenTaiko/src/Stages/01.StartUp/CCharacter.cs +++ b/OpenTaiko/src/Stages/01.StartUp/CCharacter.cs @@ -1,84 +1,68 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using FDK; -using System.IO; -using static TJAPlayer3.DBNameplateUnlockables; +namespace TJAPlayer3 { + class CCharacter { + public DBCharacter.CharacterData metadata; + public DBCharacter.CharacterEffect effect; + public DBUnlockables.CUnlockConditions unlock; + public string _path; -namespace TJAPlayer3 -{ - class CCharacter - { - public DBCharacter.CharacterData metadata; - public DBCharacter.CharacterEffect effect; - public DBUnlockables.CUnlockConditions unlock; - public string _path; + public float GetEffectCoinMultiplier() { + float mult = 1f; - public float GetEffectCoinMultiplier() - { - float mult = 1f; + mult *= HRarity.tRarityToRarityToCoinMultiplier(metadata.Rarity); + mult *= effect.GetCoinMultiplier(); - mult *= HRarity.tRarityToRarityToCoinMultiplier(metadata.Rarity); - mult *= effect.GetCoinMultiplier(); + return mult; + } - return mult; - } + public void tGetUnlockedItems(int _player, ModalQueue mq) { + int player = TJAPlayer3.GetActualPlayer(_player); + var _sf = TJAPlayer3.SaveFileInstances[player].data.UnlockedCharacters; + bool _edited = false; - public void tGetUnlockedItems(int _player, ModalQueue mq) - { - int player = TJAPlayer3.GetActualPlayer(_player); - var _sf = TJAPlayer3.SaveFileInstances[player].data.UnlockedCharacters; - bool _edited = false; + var _npvKey = Path.GetFileName(_path); - var _npvKey = Path.GetFileName(_path); + if (!_sf.Contains(_npvKey)) { + var _fulfilled = unlock?.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1 ?? false; - if (!_sf.Contains(_npvKey)) - { - var _fulfilled = unlock?.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1 ?? false; + if (_fulfilled) { + _sf.Add(_npvKey); + _edited = true; + mq.tAddModal( + new Modal( + Modal.EModalType.Character, + HRarity.tRarityToModalInt(metadata.Rarity), + metadata.tGetName() + ), + _player); - if (_fulfilled) - { - _sf.Add(_npvKey); - _edited = true; - mq.tAddModal( - new Modal( - Modal.EModalType.Character, - HRarity.tRarityToModalInt(metadata.Rarity), - metadata.tGetName() - ), - _player); + DBSaves.RegisterStringUnlockedAsset(TJAPlayer3.SaveFileInstances[player].data.SaveId, "unlocked_characters", _npvKey); + } + } - DBSaves.RegisterStringUnlockedAsset(TJAPlayer3.SaveFileInstances[player].data.SaveId, "unlocked_characters", _npvKey); - } - } + if (_edited) + TJAPlayer3.SaveFileInstances[player].tApplyHeyaChanges(); + } - if (_edited) - TJAPlayer3.SaveFileInstances[player].tApplyHeyaChanges(); - } + public CCharacter(string path) { + _path = path; - public CCharacter(string path) - { - _path = path; + // Character metadata + if (File.Exists($@"{path}{Path.DirectorySeparatorChar}Metadata.json")) + metadata = ConfigManager.GetConfig($@"{path}{Path.DirectorySeparatorChar}Metadata.json"); + else + metadata = new DBCharacter.CharacterData(); - // Character metadata - if (File.Exists($@"{path}{Path.DirectorySeparatorChar}Metadata.json")) - metadata = ConfigManager.GetConfig($@"{path}{Path.DirectorySeparatorChar}Metadata.json"); - else - metadata = new DBCharacter.CharacterData(); + // 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}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; - } - } + // 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 e0b17ed2..109020e3 100644 --- a/OpenTaiko/src/Stages/01.StartUp/CPuchichara.cs +++ b/OpenTaiko/src/Stages/01.StartUp/CPuchichara.cs @@ -1,101 +1,87 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.IO; +using FDK; using Silk.NET.Maths; -using FDK; -namespace TJAPlayer3 -{ - 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 TJAPlayer3 { + 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; - public float GetEffectCoinMultiplier() - { - float mult = 1f; + public float GetEffectCoinMultiplier() { + float mult = 1f; - mult *= HRarity.tRarityToRarityToCoinMultiplier(metadata.Rarity); - mult *= effect.GetCoinMultiplier(); + mult *= HRarity.tRarityToRarityToCoinMultiplier(metadata.Rarity); + mult *= effect.GetCoinMultiplier(); - return mult; - } + return mult; + } - public void tGetUnlockedItems(int _player, ModalQueue mq) - { - int player = TJAPlayer3.GetActualPlayer(_player); - var _sf = TJAPlayer3.SaveFileInstances[player].data.UnlockedPuchicharas; - bool _edited = false; + public void tGetUnlockedItems(int _player, ModalQueue mq) { + int player = TJAPlayer3.GetActualPlayer(_player); + var _sf = TJAPlayer3.SaveFileInstances[player].data.UnlockedPuchicharas; + bool _edited = false; - var _npvKey = Path.GetFileName(_path); + var _npvKey = Path.GetFileName(_path); - if (!_sf.Contains(_npvKey)) - { - var _fulfilled = unlock?.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1 ?? false; + if (!_sf.Contains(_npvKey)) { + var _fulfilled = unlock?.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1 ?? false; - if (_fulfilled) - { - _sf.Add(_npvKey); - _edited = true; - mq.tAddModal( - new Modal( - Modal.EModalType.Puchichara, - HRarity.tRarityToModalInt(metadata.Rarity), - metadata.tGetName() - ), - _player); + if (_fulfilled) { + _sf.Add(_npvKey); + _edited = true; + mq.tAddModal( + new Modal( + Modal.EModalType.Puchichara, + HRarity.tRarityToModalInt(metadata.Rarity), + metadata.tGetName() + ), + _player); - DBSaves.RegisterStringUnlockedAsset(TJAPlayer3.SaveFileInstances[player].data.SaveId, "unlocked_puchicharas", _npvKey); - } - } + DBSaves.RegisterStringUnlockedAsset(TJAPlayer3.SaveFileInstances[player].data.SaveId, "unlocked_puchicharas", _npvKey); + } + } - if (_edited) - TJAPlayer3.SaveFileInstances[player].tApplyHeyaChanges(); - } + if (_edited) + TJAPlayer3.SaveFileInstances[player].tApplyHeyaChanges(); + } - public CPuchichara(string path) - { - _path = path; + public CPuchichara(string path) { + _path = path; - // Puchichara textures - tx = TJAPlayer3.Tx.TxCAbsolute($@"{path}{Path.DirectorySeparatorChar}Chara.png"); - if (tx != null) - { - tx.vcScaleRatio = new Vector3D(TJAPlayer3.Skin.Game_PuchiChara_Scale[0]); - } + // Puchichara textures + tx = TJAPlayer3.Tx.TxCAbsolute($@"{path}{Path.DirectorySeparatorChar}Chara.png"); + if (tx != null) { + tx.vcScaleRatio = new Vector3D(TJAPlayer3.Skin.Game_PuchiChara_Scale[0]); + } - // Heya render - render = TJAPlayer3.Tx.TxCAbsolute($@"{path}{Path.DirectorySeparatorChar}Render.png"); + // Heya render + render = TJAPlayer3.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 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}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 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 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 2d0e4e36..742f6ef5 100644 --- a/OpenTaiko/src/Stages/01.StartUp/CStage起動.cs +++ b/OpenTaiko/src/Stages/01.StartUp/CStage起動.cs @@ -1,22 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; -using System.Threading; -using System.IO; +using System.Diagnostics; using FDK; -using System.Runtime.Serialization.Formatters.Binary; -using System.Windows.Input; -using SkiaSharp; -namespace TJAPlayer3 -{ - internal class CStage起動 : CStage - { +namespace TJAPlayer3 { + internal class CStage起動 : CStage { // コンストラクタ - public CStage起動() - { + public CStage起動() { base.eStageID = CStage.EStage.StartUp; base.IsDeActivated = true; } @@ -25,103 +14,84 @@ namespace TJAPlayer3 // CStage 実装 - public override void Activate() - { - Trace.TraceInformation( "起動ステージを活性化します。" ); + public override void Activate() { + Trace.TraceInformation("起動ステージを活性化します。"); Trace.Indent(); - try - { + try { Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.STARTUP}Script.lua")); Background.Init(); - if (TJAPlayer3.ConfigIsNew) - { + if (TJAPlayer3.ConfigIsNew) { langSelectFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.StartUp_LangSelect_FontSize); langSelectTitle = TJAPlayer3.tテクスチャの生成(langSelectFont.DrawText("Select Language:", System.Drawing.Color.White)); - langList = new CTexture[CLangManager.Languages.Length]; + langList = new CTexture[CLangManager.Languages.Length]; langListHighlighted = new CTexture[CLangManager.Languages.Length]; - for (int i = 0; i < langList.Length; i++) - { + for (int i = 0; i < langList.Length; i++) { langList[i] = TJAPlayer3.tテクスチャの生成(langSelectFont.DrawText(CLangManager.Languages[i], System.Drawing.Color.White)); - langListHighlighted[i] = TJAPlayer3.tテクスチャの生成(langSelectFont.DrawText(CLangManager.Languages[i], System.Drawing.Color.Red)); - } + langListHighlighted[i] = TJAPlayer3.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 }; } - this.list進行文字列 = new List(); + this.list進行文字列 = new List(); base.ePhaseID = CStage.EPhase.Common_NORMAL; base.Activate(); - Trace.TraceInformation( "起動ステージの活性化を完了しました。" ); - } - finally - { + Trace.TraceInformation("起動ステージの活性化を完了しました。"); + } finally { Trace.Unindent(); } } - public override void DeActivate() - { - Trace.TraceInformation( "起動ステージを非活性化します。" ); + public override void DeActivate() { + Trace.TraceInformation("起動ステージを非活性化します。"); Trace.Indent(); - try - { + try { TJAPlayer3.tDisposeSafely(ref Background); TJAPlayer3.tDisposeSafely(ref langSelectFont); TJAPlayer3.tDisposeSafely(ref langSelectTitle); - if (langList != null) - { - for (int i = 0; i < langList.Length; i++) - { + if (langList != null) { + for (int i = 0; i < langList.Length; i++) { TJAPlayer3.tDisposeSafely(ref langList[i]); TJAPlayer3.tDisposeSafely(ref langListHighlighted[i]); } } this.list進行文字列 = null; - if ( es != null ) - { - if ( ( es.thDTXFileEnumerate != null ) && es.thDTXFileEnumerate.IsAlive ) - { - Trace.TraceWarning( "リスト構築スレッドを強制停止します。" ); + if (es != null) { + if ((es.thDTXFileEnumerate != null) && es.thDTXFileEnumerate.IsAlive) { + Trace.TraceWarning("リスト構築スレッドを強制停止します。"); es.thDTXFileEnumerate.Abort(); es.thDTXFileEnumerate.Join(); } } base.DeActivate(); - Trace.TraceInformation( "起動ステージの非活性化を完了しました。" ); - } - finally - { + Trace.TraceInformation("起動ステージの非活性化を完了しました。"); + } finally { Trace.Unindent(); } } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + 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: " + TJAPlayer3.VERSION + " [" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + "]" ); + 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: " + TJAPlayer3.VERSION + " [" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + "]"); - this.list進行文字列.Add(""); - this.list進行文字列.Add("TJAPlayer3-Develop-ReWrite forked TJAPlayer3(@aioilight)"); + 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(""); + this.list進行文字列.Add(""); - es = new CEnumSongs(); - es.StartEnumFromCache(); // 曲リスト取得(別スレッドで実行される) + es = new CEnumSongs(); + es.StartEnumFromCache(); // 曲リスト取得(別スレッドで実行される) base.IsFirstDraw = false; return 0; } @@ -133,8 +103,7 @@ namespace TJAPlayer3 #region [ this.str現在進行中 の決定 ] //----------------- - switch( base.ePhaseID ) - { + switch (base.ePhaseID) { case CStage.EPhase.Startup_0_CreateSystemSound: this.str現在進行中 = "SYSTEM SOUND..."; break; @@ -144,45 +113,39 @@ namespace TJAPlayer3 break; case CStage.EPhase.Startup_2_EnumerateSongs: - this.str現在進行中 = string.Format( "{0} ... {1}", "Enumerating songs", es.Songs管理.n検索されたスコア数 ); + this.str現在進行中 = string.Format("{0} ... {1}", "Enumerating songs", es.Songs管理.n検索されたスコア数); 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検索されたスコア数 ); + this.str現在進行中 = string.Format("{0} ... {1}/{2}", "Loading score properties from songs.db", es.Songs管理.nスコアキャッシュから反映できたスコア数, es.Songs管理.n検索されたスコア数); 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スコアキャッシュから反映できたスコア数 ); + 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_5_PostProcessSonglist: - this.str現在進行中 = string.Format( "{0} ... ", "Building songlists" ); + this.str現在進行中 = string.Format("{0} ... ", "Building songlists"); break; case CStage.EPhase.Startup_6_LoadTextures: - if (!bIsLoadingTextures) - { - void loadTexture() - { + if (!bIsLoadingTextures) { + void loadTexture() { this.list進行文字列.Add("LOADING TEXTURES..."); - try - { + try { TJAPlayer3.Tx.LoadTexture(); - + this.list進行文字列.Add("LOADING TEXTURES...OK"); this.str現在進行中 = "Setup done."; this.ePhaseID = EPhase.Startup_Complete; TJAPlayer3.Skin.bgm起動画面.tStop(); - } - catch(Exception exception) - { + } catch (Exception exception) { TJAPlayer3.Skin.bgm起動画面.tStop(); - Trace.TraceError( exception.ToString() ); + Trace.TraceError(exception.ToString()); this.list進行文字列.Add("LOADING TEXTURES...NG"); - foreach(var text in exception.ToString().Split('\n')) - { + foreach (var text in exception.ToString().Split('\n')) { this.list進行文字列.Add(text); } } @@ -192,49 +155,40 @@ namespace TJAPlayer3 this.ePhaseID = EPhase.Startup_Complete; TJAPlayer3.Skin.bgm起動画面.tStop(); } - if (TJAPlayer3.ConfigIni.ASyncTextureLoad) - { + if (TJAPlayer3.ConfigIni.ASyncTextureLoad) { Task.Run(loadTexture); - } - else - { + } else { loadTexture(); } } bIsLoadingTextures = true; - break; + break; } //----------------- #endregion - if(ePhaseID != EPhase.Startup_Complete) - { + if (ePhaseID != EPhase.Startup_Complete) { #region [ this.list進行文字列+this.現在進行中 の表示 ] //----------------- int x = 320; int y = 20; - for(int i = 0; i < this.list進行文字列.Count; i++) - { + for (int i = 0; i < this.list進行文字列.Count; i++) { TJAPlayer3.actTextConsole.tPrint((int)(x * TJAPlayer3.Skin.Resolution[0] / 1280.0), (int)(y * TJAPlayer3.Skin.Resolution[1] / 720.0), CTextConsole.EFontType.White, this.list進行文字列[i]); y += 24; } TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.White, this.str現在進行中); //----------------- #endregion - } - else if (TJAPlayer3.ConfigIsNew && !bLanguageSelected) // Prompt language selection if Config.ini is newly generated - { - if (TJAPlayer3.Tx.Tile_Black != null) - { + } else if (TJAPlayer3.ConfigIsNew && !bLanguageSelected) // Prompt language selection if Config.ini is newly generated + { + if (TJAPlayer3.Tx.Tile_Black != null) { TJAPlayer3.Tx.Tile_Black.Opacity = 255; - for (int i = 0; i <= SampleFramework.GameWindowSize.Width; i += TJAPlayer3.Tx.Tile_Black.szTextureSize.Width) - { - for (int j = 0; j <= SampleFramework.GameWindowSize.Height; j += TJAPlayer3.Tx.Tile_Black.szTextureSize.Height) - { - TJAPlayer3.Tx.Tile_Black.t2D描画(i, j); - } - } - } + for (int i = 0; i <= SampleFramework.GameWindowSize.Width; i += TJAPlayer3.Tx.Tile_Black.szTextureSize.Width) { + for (int j = 0; j <= SampleFramework.GameWindowSize.Height; j += TJAPlayer3.Tx.Tile_Black.szTextureSize.Height) { + TJAPlayer3.Tx.Tile_Black.t2D描画(i, j); + } + } + } int x = langSelectOffset[0]; int y = langSelectOffset[1]; @@ -242,40 +196,31 @@ namespace TJAPlayer3 langSelectTitle.t2D中心基準描画(x, y); y += langSelectTitle.szTextureSize.Height; - for (int i = 0; i < langList.Length; i++) - { + 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 (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.DownArrow) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) - { + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.DownArrow) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) { langSelectIndex = Math.Min(langSelectIndex + 1, CLangManager.Languages.Length - 1); - } - else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.UpArrow) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) - { + } else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.UpArrow) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) { langSelectIndex = Math.Max(langSelectIndex - 1, 0); + } else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)) { + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + TJAPlayer3.ConfigIni.sLang = CLangManager.intToLang(langSelectIndex); + CLangManager.langAttach(TJAPlayer3.ConfigIni.sLang); + bLanguageSelected = true; } - else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)) - { - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - TJAPlayer3.ConfigIni.sLang = CLangManager.intToLang(langSelectIndex); - CLangManager.langAttach(TJAPlayer3.ConfigIni.sLang); - bLanguageSelected = true; - } - } - else - { - if ( es != null && es.IsSongListEnumCompletelyDone ) // 曲リスト作成が終わったら + } else { + if (es != null && es.IsSongListEnumCompletelyDone) // 曲リスト作成が終わったら { - TJAPlayer3.Songs管理 = ( es != null ) ? es.Songs管理 : null; // 最後に、曲リストを拾い上げる + TJAPlayer3.Songs管理 = (es != null) ? es.Songs管理 : null; // 最後に、曲リストを拾い上げる - if(TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)) - { + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)) { TJAPlayer3.Skin.soundDecideSFX.tPlay(); return 1; } diff --git a/OpenTaiko/src/Stages/01.StartUp/TextureLoader.cs b/OpenTaiko/src/Stages/01.StartUp/TextureLoader.cs index f4a690ae..022a0e3a 100644 --- a/OpenTaiko/src/Stages/01.StartUp/TextureLoader.cs +++ b/OpenTaiko/src/Stages/01.StartUp/TextureLoader.cs @@ -1,1289 +1,1227 @@ -using FDK; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.IO; - -namespace TJAPlayer3 -{ - 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}"; - public static string OPENENCYCLOPEDIA = @$"15_OpenEncyclopedia{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() - { - // コンストラクタ - } - - internal CTexture TxC(string FileName, bool localize = true) - { - var texpath = (localize) ? HLocalizedPath.GetAvailableLocalizedPath(CSkin.Path(BASE + FileName)) : CSkin.Path(BASE + FileName); - var tex = TJAPlayer3.tテクスチャの生成(texpath, false); - - listTexture.Add(tex); - return tex; - } - - internal CTexture TxCGlobal(string FileName) - { - var tex = TJAPlayer3.tテクスチャの生成(TJAPlayer3.strEXEのあるフォルダ + GLOBAL + FileName, false); - listTexture.Add(tex); - return tex; - } - - internal CTexture TxCAbsolute(string FileName) - { - var tex = TJAPlayer3.tテクスチャの生成(FileName, false); - listTexture.Add(tex); - return tex; - } - - internal CTextureAf TxCAf(string FileName) - { - var tex = TJAPlayer3.tテクスチャの生成Af(CSkin.Path(BASE + FileName)); - listTexture.Add(tex); - return tex; - } - internal CTexture TxCGen(string FileName) - { - return TJAPlayer3.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 = TJAPlayer3.t連番画像の枚数を数える(folder); - var texture = count == 0 ? null : TxCSong(count, folder + "{0}.png"); - return texture; - } - - internal CTexture TxCUntrackedSong(string path) - { - return TJAPlayer3.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"); - NamePlate = new CTexture[2]; - NamePlateBase = TxC(@$"NamePlate.png"); - NamePlate_Extension = TxC(@$"NamePlate_Extension.png"); - NamePlate[0] = TxC(@$"1P_NamePlate.png"); - NamePlate[1] = TxC(@$"2P_NamePlate.png"); - NamePlate_Effect[0] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}GoldMStar.png"); - NamePlate_Effect[1] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}PurpleMStar.png"); - NamePlate_Effect[2] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}GoldBStar.png"); - NamePlate_Effect[3] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}PurpleBStar.png"); - NamePlate_Effect[4] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}Slash.png"); - - TJAPlayer3.Skin.Config_NamePlate_Ptn_Title = System.IO.Directory.GetDirectories(CSkin.Path(BASE + @$"9_NamePlateEffect{Path.DirectorySeparatorChar}Title{Path.DirectorySeparatorChar}")).Length; - TJAPlayer3.Skin.Config_NamePlate_Ptn_Title_Boxes = new int[TJAPlayer3.Skin.Config_NamePlate_Ptn_Title]; - - NamePlate_Title = new CTexture[TJAPlayer3.Skin.Config_NamePlate_Ptn_Title][]; - NamePlate_Title_Big = new CTexture[TJAPlayer3.Skin.Config_NamePlate_Ptn_Title]; - NamePlate_Title_Small = new CTexture[TJAPlayer3.Skin.Config_NamePlate_Ptn_Title]; - - for (int i = 0; i < TJAPlayer3.Skin.Config_NamePlate_Ptn_Title; i++) - { - TJAPlayer3.Skin.Config_NamePlate_Ptn_Title_Boxes[i] = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + @$"9_NamePlateEffect{Path.DirectorySeparatorChar}Title{Path.DirectorySeparatorChar}" + i.ToString() + @$"{Path.DirectorySeparatorChar}")); - NamePlate_Title[i] = new CTexture[TJAPlayer3.Skin.Config_NamePlate_Ptn_Title_Boxes[i]]; - - for (int j = 0; j < TJAPlayer3.Skin.Config_NamePlate_Ptn_Title_Boxes[i]; j++) - { - NamePlate_Title[i][j] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}Title{Path.DirectorySeparatorChar}" + i.ToString() + @$"{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - } - - NamePlate_Title_Big[i] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}Title{Path.DirectorySeparatorChar}" + i.ToString() + @$"{Path.DirectorySeparatorChar}Big.png"); - NamePlate_Title_Small[i] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}Title{Path.DirectorySeparatorChar}" + i.ToString() + @$"{Path.DirectorySeparatorChar}Small.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)) - TJAPlayer3.Skin.Game_SkinScenes = ConfigManager.GetConfig(_presetsDefs); - else - TJAPlayer3.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"); - - TJAPlayer3.Skin.Game_Gauge_Rainbow_Ptn = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + GAUGE + @$"Rainbow{Path.DirectorySeparatorChar}")); - if (TJAPlayer3.Skin.Game_Gauge_Rainbow_Ptn != 0) - { - Gauge_Rainbow = new CTexture[TJAPlayer3.Skin.Game_Gauge_Rainbow_Ptn]; - for (int i = 0; i < TJAPlayer3.Skin.Game_Gauge_Rainbow_Ptn; i++) - { - Gauge_Rainbow[i] = TxC(GAME + GAUGE + @$"Rainbow{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); - } - } - - TJAPlayer3.Skin.Game_Gauge_Rainbow_Flat_Ptn = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + GAUGE + @$"Rainbow_Flat{Path.DirectorySeparatorChar}")); - if (TJAPlayer3.Skin.Game_Gauge_Rainbow_Flat_Ptn != 0) - { - Gauge_Rainbow_Flat = new CTexture[TJAPlayer3.Skin.Game_Gauge_Rainbow_Flat_Ptn]; - for (int i = 0; i < TJAPlayer3.Skin.Game_Gauge_Rainbow_Flat_Ptn; i++) - { - Gauge_Rainbow_Flat[i] = TxC(GAME + GAUGE + @$"Rainbow_Flat{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); - } - } - - TJAPlayer3.Skin.Game_Gauge_Rainbow_2PGauge_Ptn = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + GAUGE + @$"Rainbow_2PGauge{Path.DirectorySeparatorChar}")); - if (TJAPlayer3.Skin.Game_Gauge_Rainbow_2PGauge_Ptn != 0) - { - Gauge_Rainbow_2PGauge = new CTexture[TJAPlayer3.Skin.Game_Gauge_Rainbow_2PGauge_Ptn]; - for (int i = 0; i < TJAPlayer3.Skin.Game_Gauge_Rainbow_2PGauge_Ptn; i++) - { - Gauge_Rainbow_2PGauge[i] = TxC(GAME + GAUGE + @$"Rainbow_2PGauge{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); - } - } - - // Dan - - TJAPlayer3.Skin.Game_Gauge_Dan_Rainbow_Ptn = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + DANC + @$"Rainbow{Path.DirectorySeparatorChar}")); - if (TJAPlayer3.Skin.Game_Gauge_Dan_Rainbow_Ptn != 0) - { - Gauge_Dan_Rainbow = new CTexture[TJAPlayer3.Skin.Game_Gauge_Dan_Rainbow_Ptn]; - for (int i = 0; i < TJAPlayer3.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_Flash = TxC(GAME + GAUGE + @$"Flash.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加算合成 = TJAPlayer3.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加算合成 = TJAPlayer3.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加算合成 = TJAPlayer3.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加算合成 = TJAPlayer3.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加算合成 = TJAPlayer3.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"); - } - TJAPlayer3.Skin.Game_Effect_Roll_Ptn = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + EFFECTS + @$"Roll{Path.DirectorySeparatorChar}")); - Effects_Roll = new CTexture[TJAPlayer3.Skin.Game_Effect_Roll_Ptn]; - for (int i = 0; i < TJAPlayer3.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(TJAPlayer3.strEXEのあるフォルダ + GLOBAL + PUCHICHARA); - TJAPlayer3.Skin.Puchichara_Ptn = puchicharaDirs.Length; - - Puchichara = new CPuchichara[TJAPlayer3.Skin.Puchichara_Ptn]; - TJAPlayer3.Skin.Puchicharas_Name = new string[TJAPlayer3.Skin.Puchichara_Ptn]; - - for (int i = 0; i < TJAPlayer3.Skin.Puchichara_Ptn; i++) - { - Puchichara[i] = new CPuchichara(puchicharaDirs[i]); - - TJAPlayer3.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_Sky_Gradient = TxC(GAME + TOWER + @$"Sky_Gradient.png"); - - Tower_Miss = TxC(GAME + TOWER + @$"Miss.png"); - - // Tower elements - string[] towerDirectories = System.IO.Directory.GetDirectories(CSkin.Path(BASE + GAME + TOWER + TOWERFLOOR)); - TJAPlayer3.Skin.Game_Tower_Ptn = towerDirectories.Length; - TJAPlayer3.Skin.Game_Tower_Names = new string[TJAPlayer3.Skin.Game_Tower_Ptn]; - for (int i = 0; i < TJAPlayer3.Skin.Game_Tower_Ptn; i++) - TJAPlayer3.Skin.Game_Tower_Names[i] = new DirectoryInfo(towerDirectories[i]).Name; - Tower_Top = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn]; - Tower_Base = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn][]; - Tower_Deco = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn][]; - - TJAPlayer3.Skin.Game_Tower_Ptn_Base = new int[TJAPlayer3.Skin.Game_Tower_Ptn]; - TJAPlayer3.Skin.Game_Tower_Ptn_Deco = new int[TJAPlayer3.Skin.Game_Tower_Ptn]; - - for (int i = 0; i < TJAPlayer3.Skin.Game_Tower_Ptn; i++) - { - TJAPlayer3.Skin.Game_Tower_Ptn_Base[i] = TJAPlayer3.t連番画像の枚数を数える((towerDirectories[i] + @$"{Path.DirectorySeparatorChar}Base{Path.DirectorySeparatorChar}"), "Base"); - TJAPlayer3.Skin.Game_Tower_Ptn_Deco[i] = TJAPlayer3.t連番画像の枚数を数える((towerDirectories[i] + @$"{Path.DirectorySeparatorChar}Deco{Path.DirectorySeparatorChar}"), "Deco"); - - Tower_Top[i] = TxC(GAME + TOWER + TOWERFLOOR + TJAPlayer3.Skin.Game_Tower_Names[i] + @$"{Path.DirectorySeparatorChar}Top.png"); - - Tower_Base[i] = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Base[i]]; - Tower_Deco[i] = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Deco[i]]; - - for (int j = 0; j < TJAPlayer3.Skin.Game_Tower_Ptn_Base[i]; j++) - { - Tower_Base[i][j] = TxC(GAME + TOWER + TOWERFLOOR + TJAPlayer3.Skin.Game_Tower_Names[i] + @$"{Path.DirectorySeparatorChar}Base{Path.DirectorySeparatorChar}Base" + j.ToString() + ".png"); - } - - for (int j = 0; j < TJAPlayer3.Skin.Game_Tower_Ptn_Deco[i]; j++) - { - Tower_Deco[i][j] = TxC(GAME + TOWER + TOWERFLOOR + TJAPlayer3.Skin.Game_Tower_Names[i] + @$"{Path.DirectorySeparatorChar}Deco{Path.DirectorySeparatorChar}Deco" + j.ToString() + ".png"); - } - } - - // Tower climbing Don - TJAPlayer3.Skin.Game_Tower_Ptn_Don = System.IO.Directory.GetDirectories(CSkin.Path(BASE + GAME + TOWER + TOWERDON)).Length; - Tower_Don_Climbing = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Don][]; - Tower_Don_Jump = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Don][]; - Tower_Don_Running = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Don][]; - Tower_Don_Standing = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Don][]; - - TJAPlayer3.Skin.Game_Tower_Ptn_Don_Climbing = new int[TJAPlayer3.Skin.Game_Tower_Ptn_Don]; - TJAPlayer3.Skin.Game_Tower_Ptn_Don_Jump = new int[TJAPlayer3.Skin.Game_Tower_Ptn_Don]; - TJAPlayer3.Skin.Game_Tower_Ptn_Don_Running = new int[TJAPlayer3.Skin.Game_Tower_Ptn_Don]; - TJAPlayer3.Skin.Game_Tower_Ptn_Don_Standing = new int[TJAPlayer3.Skin.Game_Tower_Ptn_Don]; - - for (int i = 0; i < TJAPlayer3.Skin.Game_Tower_Ptn_Don; i++) - { - TJAPlayer3.Skin.Game_Tower_Ptn_Don_Climbing[i] = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + TOWER + TOWERDON + i.ToString() + @$"{Path.DirectorySeparatorChar}Climbing{Path.DirectorySeparatorChar}"), "Climbing"); - TJAPlayer3.Skin.Game_Tower_Ptn_Don_Running[i] = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + TOWER + TOWERDON + i.ToString() + @$"{Path.DirectorySeparatorChar}Running{Path.DirectorySeparatorChar}"), "Running"); - TJAPlayer3.Skin.Game_Tower_Ptn_Don_Standing[i] = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + TOWER + TOWERDON + i.ToString() + @$"{Path.DirectorySeparatorChar}Standing{Path.DirectorySeparatorChar}"), "Standing"); - TJAPlayer3.Skin.Game_Tower_Ptn_Don_Jump[i] = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + TOWER + TOWERDON + i.ToString() + @$"{Path.DirectorySeparatorChar}Jump{Path.DirectorySeparatorChar}"), "Jump"); - - Tower_Don_Climbing[i] = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Don_Climbing[i]]; - Tower_Don_Running[i] = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Don_Running[i]]; - Tower_Don_Standing[i] = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Don_Standing[i]]; - Tower_Don_Jump[i] = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Don_Jump[i]]; - - for (int j = 0; j < TJAPlayer3.Skin.Game_Tower_Ptn_Don_Climbing[i]; j++) - { - Tower_Don_Climbing[i][j] = TxC(GAME + TOWER + TOWERDON + i.ToString() + @$"{Path.DirectorySeparatorChar}Climbing{Path.DirectorySeparatorChar}Climbing" + j.ToString() + ".png"); - } - - for (int j = 0; j < TJAPlayer3.Skin.Game_Tower_Ptn_Don_Running[i]; j++) - { - Tower_Don_Running[i][j] = TxC(GAME + TOWER + TOWERDON + i.ToString() + @$"{Path.DirectorySeparatorChar}Running{Path.DirectorySeparatorChar}Running" + j.ToString() + ".png"); - } - - for (int j = 0; j < TJAPlayer3.Skin.Game_Tower_Ptn_Don_Standing[i]; j++) - { - Tower_Don_Standing[i][j] = TxC(GAME + TOWER + TOWERDON + i.ToString() + @$"{Path.DirectorySeparatorChar}Standing{Path.DirectorySeparatorChar}Standing" + j.ToString() + ".png"); - } - - for (int j = 0; j < TJAPlayer3.Skin.Game_Tower_Ptn_Don_Jump[i]; j++) - { - Tower_Don_Jump[i][j] = TxC(GAME + TOWER + TOWERDON + i.ToString() + @$"{Path.DirectorySeparatorChar}Jump{Path.DirectorySeparatorChar}Jump" + 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_FadeIn = TxC(RESULT + @$"FadeIn.png"); - - 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"); +using System.Diagnostics; +using FDK; + +namespace TJAPlayer3 { + 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}"; + public static string OPENENCYCLOPEDIA = @$"15_OpenEncyclopedia{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() { + // コンストラクタ + } + + internal CTexture TxC(string FileName, bool localize = true) { + var texpath = (localize) ? HLocalizedPath.GetAvailableLocalizedPath(CSkin.Path(BASE + FileName)) : CSkin.Path(BASE + FileName); + var tex = TJAPlayer3.tテクスチャの生成(texpath, false); + + listTexture.Add(tex); + return tex; + } + + internal CTexture TxCGlobal(string FileName) { + var tex = TJAPlayer3.tテクスチャの生成(TJAPlayer3.strEXEのあるフォルダ + GLOBAL + FileName, false); + listTexture.Add(tex); + return tex; + } + + internal CTexture TxCAbsolute(string FileName) { + var tex = TJAPlayer3.tテクスチャの生成(FileName, false); + listTexture.Add(tex); + return tex; + } + + internal CTextureAf TxCAf(string FileName) { + var tex = TJAPlayer3.tテクスチャの生成Af(CSkin.Path(BASE + FileName)); + listTexture.Add(tex); + return tex; + } + internal CTexture TxCGen(string FileName) { + return TJAPlayer3.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 = TJAPlayer3.t連番画像の枚数を数える(folder); + var texture = count == 0 ? null : TxCSong(count, folder + "{0}.png"); + return texture; + } + + internal CTexture TxCUntrackedSong(string path) { + return TJAPlayer3.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"); + NamePlate = new CTexture[2]; + NamePlateBase = TxC(@$"NamePlate.png"); + NamePlate_Extension = TxC(@$"NamePlate_Extension.png"); + NamePlate[0] = TxC(@$"1P_NamePlate.png"); + NamePlate[1] = TxC(@$"2P_NamePlate.png"); + NamePlate_Effect[0] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}GoldMStar.png"); + NamePlate_Effect[1] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}PurpleMStar.png"); + NamePlate_Effect[2] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}GoldBStar.png"); + NamePlate_Effect[3] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}PurpleBStar.png"); + NamePlate_Effect[4] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}Slash.png"); + + TJAPlayer3.Skin.Config_NamePlate_Ptn_Title = System.IO.Directory.GetDirectories(CSkin.Path(BASE + @$"9_NamePlateEffect{Path.DirectorySeparatorChar}Title{Path.DirectorySeparatorChar}")).Length; + TJAPlayer3.Skin.Config_NamePlate_Ptn_Title_Boxes = new int[TJAPlayer3.Skin.Config_NamePlate_Ptn_Title]; + + NamePlate_Title = new CTexture[TJAPlayer3.Skin.Config_NamePlate_Ptn_Title][]; + NamePlate_Title_Big = new CTexture[TJAPlayer3.Skin.Config_NamePlate_Ptn_Title]; + NamePlate_Title_Small = new CTexture[TJAPlayer3.Skin.Config_NamePlate_Ptn_Title]; + + for (int i = 0; i < TJAPlayer3.Skin.Config_NamePlate_Ptn_Title; i++) { + TJAPlayer3.Skin.Config_NamePlate_Ptn_Title_Boxes[i] = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + @$"9_NamePlateEffect{Path.DirectorySeparatorChar}Title{Path.DirectorySeparatorChar}" + i.ToString() + @$"{Path.DirectorySeparatorChar}")); + NamePlate_Title[i] = new CTexture[TJAPlayer3.Skin.Config_NamePlate_Ptn_Title_Boxes[i]]; + + for (int j = 0; j < TJAPlayer3.Skin.Config_NamePlate_Ptn_Title_Boxes[i]; j++) { + NamePlate_Title[i][j] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}Title{Path.DirectorySeparatorChar}" + i.ToString() + @$"{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + } + + NamePlate_Title_Big[i] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}Title{Path.DirectorySeparatorChar}" + i.ToString() + @$"{Path.DirectorySeparatorChar}Big.png"); + NamePlate_Title_Small[i] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}Title{Path.DirectorySeparatorChar}" + i.ToString() + @$"{Path.DirectorySeparatorChar}Small.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)) + TJAPlayer3.Skin.Game_SkinScenes = ConfigManager.GetConfig(_presetsDefs); + else + TJAPlayer3.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"); + + TJAPlayer3.Skin.Game_Gauge_Rainbow_Ptn = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + GAUGE + @$"Rainbow{Path.DirectorySeparatorChar}")); + if (TJAPlayer3.Skin.Game_Gauge_Rainbow_Ptn != 0) { + Gauge_Rainbow = new CTexture[TJAPlayer3.Skin.Game_Gauge_Rainbow_Ptn]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Gauge_Rainbow_Ptn; i++) { + Gauge_Rainbow[i] = TxC(GAME + GAUGE + @$"Rainbow{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); + } + } + + TJAPlayer3.Skin.Game_Gauge_Rainbow_Flat_Ptn = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + GAUGE + @$"Rainbow_Flat{Path.DirectorySeparatorChar}")); + if (TJAPlayer3.Skin.Game_Gauge_Rainbow_Flat_Ptn != 0) { + Gauge_Rainbow_Flat = new CTexture[TJAPlayer3.Skin.Game_Gauge_Rainbow_Flat_Ptn]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Gauge_Rainbow_Flat_Ptn; i++) { + Gauge_Rainbow_Flat[i] = TxC(GAME + GAUGE + @$"Rainbow_Flat{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); + } + } + + TJAPlayer3.Skin.Game_Gauge_Rainbow_2PGauge_Ptn = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + GAUGE + @$"Rainbow_2PGauge{Path.DirectorySeparatorChar}")); + if (TJAPlayer3.Skin.Game_Gauge_Rainbow_2PGauge_Ptn != 0) { + Gauge_Rainbow_2PGauge = new CTexture[TJAPlayer3.Skin.Game_Gauge_Rainbow_2PGauge_Ptn]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Gauge_Rainbow_2PGauge_Ptn; i++) { + Gauge_Rainbow_2PGauge[i] = TxC(GAME + GAUGE + @$"Rainbow_2PGauge{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); + } + } + + // Dan + + TJAPlayer3.Skin.Game_Gauge_Dan_Rainbow_Ptn = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + DANC + @$"Rainbow{Path.DirectorySeparatorChar}")); + if (TJAPlayer3.Skin.Game_Gauge_Dan_Rainbow_Ptn != 0) { + Gauge_Dan_Rainbow = new CTexture[TJAPlayer3.Skin.Game_Gauge_Dan_Rainbow_Ptn]; + for (int i = 0; i < TJAPlayer3.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_Flash = TxC(GAME + GAUGE + @$"Flash.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加算合成 = TJAPlayer3.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加算合成 = TJAPlayer3.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加算合成 = TJAPlayer3.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加算合成 = TJAPlayer3.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加算合成 = TJAPlayer3.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"); + } + TJAPlayer3.Skin.Game_Effect_Roll_Ptn = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + EFFECTS + @$"Roll{Path.DirectorySeparatorChar}")); + Effects_Roll = new CTexture[TJAPlayer3.Skin.Game_Effect_Roll_Ptn]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Effect_Roll_Ptn; i++) { + Effects_Roll[i] = TxC(GAME + EFFECTS + @$"Roll{Path.DirectorySeparatorChar}" + i.ToString() + ".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"); + #endregion - Result_Speech_Bubble[0] = TxC(RESULT + @$"Speech_Bubble.png"); - Result_Speech_Bubble[1] = TxC(RESULT + @$"Speech_Bubble_2.png"); + #region Lane - 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"); + 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"); + } - Result_Flower = TxC(RESULT + @$"Flower{Path.DirectorySeparatorChar}Flower.png"); + Lane_Red = new CTexture[2]; + Lane_Blue = new CTexture[2]; + Lane_Clap = new CTexture[2]; - for (int i = 0; i < 4; i++) - Result_Panel_4P[i] = TxC(RESULT + @$"Panel_4P_" + (i + 1).ToString() + ".png"); + var _suffixes = new string[] { "", "_Konga" }; - for (int i = 0; i < 5; i++) - Result_Panel_5P[i] = TxC(RESULT + @$"Panel_5P_" + (i + 1).ToString() + ".png"); + 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"); + } - 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"); + 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"); - TJAPlayer3.Skin.Result_Gauge_Rainbow_Ptn = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + RESULT + @$"Rainbow{Path.DirectorySeparatorChar}")); - if (TJAPlayer3.Skin.Result_Gauge_Rainbow_Ptn != 0) - { - Result_Rainbow = new CTexture[TJAPlayer3.Skin.Result_Gauge_Rainbow_Ptn]; - for (int i = 0; i < TJAPlayer3.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] - - TJAPlayer3.Skin.Game_Tower_Ptn_Result = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + TOWERRESULT + @$"Tower{Path.DirectorySeparatorChar}")); - TowerResult_Tower = new CTexture[TJAPlayer3.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 < TJAPlayer3.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(TJAPlayer3.strEXEのあるフォルダ + GLOBAL + CHARACTERS); - TJAPlayer3.Skin.Characters_Ptn = charaDirs.Length; - - Characters_Heya_Preview = new CTexture[TJAPlayer3.Skin.Characters_Ptn]; - Characters_Heya_Render = new CTexture[TJAPlayer3.Skin.Characters_Ptn]; - Characters_Result_Clear_1P = new CTexture[TJAPlayer3.Skin.Characters_Ptn]; - Characters_Result_Failed_1P = new CTexture[TJAPlayer3.Skin.Characters_Ptn]; - Characters_Result_Clear_2P = new CTexture[TJAPlayer3.Skin.Characters_Ptn]; - Characters_Result_Failed_2P = new CTexture[TJAPlayer3.Skin.Characters_Ptn]; - Characters = new CCharacter[TJAPlayer3.Skin.Characters_Ptn]; - - Characters_Normal = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Normal_Missed = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Normal_MissedDown = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Normal_Cleared = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Normal_Maxed = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_MissIn = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_MissDownIn = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_GoGoTime = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_GoGoTime_Maxed = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_10Combo = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_10Combo_Clear = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_10Combo_Maxed = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_GoGoStart = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_GoGoStart_Clear = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_GoGoStart_Maxed = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Become_Cleared = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Become_Maxed = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_SoulOut = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_ClearOut = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Return = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Balloon_Breaking = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Balloon_Broke = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Balloon_Miss = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Kusudama_Idle = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Kusudama_Breaking = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Kusudama_Broke = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Kusudama_Miss = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Title_Entry = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Title_Normal = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Result_Clear = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Result_Failed = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Result_Failed_In = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Result_Normal = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Menu_Loop = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Menu_Start = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Menu_Select = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Menu_Wait = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Tower_Standing = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Tower_Climbing = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Tower_Running = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Tower_Clear = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Tower_Fail = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Tower_Standing_Tired = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Tower_Climbing_Tired = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Tower_Running_Tired = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - Characters_Tower_Clear_Tired = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; - - TJAPlayer3.Skin.Characters_DirName = new string[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Normal_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Normal_Missed_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Normal_MissedDown_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Normal_Cleared_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Normal_Maxed_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_MissIn_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_MissDownIn_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_GoGoTime_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_GoGoTime_Maxed_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_10Combo_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_10Combo_Clear_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_10Combo_Maxed_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_GoGoStart_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_GoGoStart_Clear_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_GoGoStart_Maxed_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Become_Cleared_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Become_Maxed_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_SoulOut_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_ClearOut_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Return_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Balloon_Breaking_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Kusudama_Idle_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Kusudama_Breaking_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Kusudama_Broke_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Kusudama_Miss_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Title_Entry_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Title_Normal_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Result_Clear_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Result_Failed_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Result_Failed_In_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Result_Normal_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Menu_Loop_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Menu_Start_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Menu_Select_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Menu_Wait_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Tower_Standing_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Tower_Running_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Tower_Clear_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Tower_Fail_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Tower_Climbing_Tired_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Tower_Running_Tired_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Tower_Clear_IsLooping = new bool[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Tower_Clear_Tired_IsLooping = new bool[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Tower_Fail_IsLooping = new bool[TJAPlayer3.Skin.Characters_Ptn]; - - TJAPlayer3.Skin.Characters_Resolution = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Heya_Render_Offset = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_UseResult1P = new bool[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_X = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Y = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_4P = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_5P = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_X_AI = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Y_AI = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Balloon_X = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Balloon_Y = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Balloon_4P = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Balloon_5P = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Kusudama_X = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Kusudama_Y = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_Normal = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_10Combo = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_10Combo_Clear = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_10ComboMax = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_Miss = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_MissDown = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_ClearIn = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_Clear = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_ClearMax = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_MissIn = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_MissDownIn = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_GoGoStart = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_GoGoStart_Clear = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_GoGoStartMax = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_GoGo = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_GoGoMax = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_SoulIn = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_SoulOut = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_ClearOut = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_Return = new int[TJAPlayer3.Skin.Characters_Ptn][]; - /* + #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(TJAPlayer3.strEXEのあるフォルダ + GLOBAL + PUCHICHARA); + TJAPlayer3.Skin.Puchichara_Ptn = puchicharaDirs.Length; + + Puchichara = new CPuchichara[TJAPlayer3.Skin.Puchichara_Ptn]; + TJAPlayer3.Skin.Puchicharas_Name = new string[TJAPlayer3.Skin.Puchichara_Ptn]; + + for (int i = 0; i < TJAPlayer3.Skin.Puchichara_Ptn; i++) { + Puchichara[i] = new CPuchichara(puchicharaDirs[i]); + + TJAPlayer3.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_Sky_Gradient = TxC(GAME + TOWER + @$"Sky_Gradient.png"); + + Tower_Miss = TxC(GAME + TOWER + @$"Miss.png"); + + // Tower elements + string[] towerDirectories = System.IO.Directory.GetDirectories(CSkin.Path(BASE + GAME + TOWER + TOWERFLOOR)); + TJAPlayer3.Skin.Game_Tower_Ptn = towerDirectories.Length; + TJAPlayer3.Skin.Game_Tower_Names = new string[TJAPlayer3.Skin.Game_Tower_Ptn]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Tower_Ptn; i++) + TJAPlayer3.Skin.Game_Tower_Names[i] = new DirectoryInfo(towerDirectories[i]).Name; + Tower_Top = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn]; + Tower_Base = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn][]; + Tower_Deco = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn][]; + + TJAPlayer3.Skin.Game_Tower_Ptn_Base = new int[TJAPlayer3.Skin.Game_Tower_Ptn]; + TJAPlayer3.Skin.Game_Tower_Ptn_Deco = new int[TJAPlayer3.Skin.Game_Tower_Ptn]; + + for (int i = 0; i < TJAPlayer3.Skin.Game_Tower_Ptn; i++) { + TJAPlayer3.Skin.Game_Tower_Ptn_Base[i] = TJAPlayer3.t連番画像の枚数を数える((towerDirectories[i] + @$"{Path.DirectorySeparatorChar}Base{Path.DirectorySeparatorChar}"), "Base"); + TJAPlayer3.Skin.Game_Tower_Ptn_Deco[i] = TJAPlayer3.t連番画像の枚数を数える((towerDirectories[i] + @$"{Path.DirectorySeparatorChar}Deco{Path.DirectorySeparatorChar}"), "Deco"); + + Tower_Top[i] = TxC(GAME + TOWER + TOWERFLOOR + TJAPlayer3.Skin.Game_Tower_Names[i] + @$"{Path.DirectorySeparatorChar}Top.png"); + + Tower_Base[i] = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Base[i]]; + Tower_Deco[i] = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Deco[i]]; + + for (int j = 0; j < TJAPlayer3.Skin.Game_Tower_Ptn_Base[i]; j++) { + Tower_Base[i][j] = TxC(GAME + TOWER + TOWERFLOOR + TJAPlayer3.Skin.Game_Tower_Names[i] + @$"{Path.DirectorySeparatorChar}Base{Path.DirectorySeparatorChar}Base" + j.ToString() + ".png"); + } + + for (int j = 0; j < TJAPlayer3.Skin.Game_Tower_Ptn_Deco[i]; j++) { + Tower_Deco[i][j] = TxC(GAME + TOWER + TOWERFLOOR + TJAPlayer3.Skin.Game_Tower_Names[i] + @$"{Path.DirectorySeparatorChar}Deco{Path.DirectorySeparatorChar}Deco" + j.ToString() + ".png"); + } + } + + // Tower climbing Don + TJAPlayer3.Skin.Game_Tower_Ptn_Don = System.IO.Directory.GetDirectories(CSkin.Path(BASE + GAME + TOWER + TOWERDON)).Length; + Tower_Don_Climbing = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Don][]; + Tower_Don_Jump = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Don][]; + Tower_Don_Running = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Don][]; + Tower_Don_Standing = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Don][]; + + TJAPlayer3.Skin.Game_Tower_Ptn_Don_Climbing = new int[TJAPlayer3.Skin.Game_Tower_Ptn_Don]; + TJAPlayer3.Skin.Game_Tower_Ptn_Don_Jump = new int[TJAPlayer3.Skin.Game_Tower_Ptn_Don]; + TJAPlayer3.Skin.Game_Tower_Ptn_Don_Running = new int[TJAPlayer3.Skin.Game_Tower_Ptn_Don]; + TJAPlayer3.Skin.Game_Tower_Ptn_Don_Standing = new int[TJAPlayer3.Skin.Game_Tower_Ptn_Don]; + + for (int i = 0; i < TJAPlayer3.Skin.Game_Tower_Ptn_Don; i++) { + TJAPlayer3.Skin.Game_Tower_Ptn_Don_Climbing[i] = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + TOWER + TOWERDON + i.ToString() + @$"{Path.DirectorySeparatorChar}Climbing{Path.DirectorySeparatorChar}"), "Climbing"); + TJAPlayer3.Skin.Game_Tower_Ptn_Don_Running[i] = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + TOWER + TOWERDON + i.ToString() + @$"{Path.DirectorySeparatorChar}Running{Path.DirectorySeparatorChar}"), "Running"); + TJAPlayer3.Skin.Game_Tower_Ptn_Don_Standing[i] = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + TOWER + TOWERDON + i.ToString() + @$"{Path.DirectorySeparatorChar}Standing{Path.DirectorySeparatorChar}"), "Standing"); + TJAPlayer3.Skin.Game_Tower_Ptn_Don_Jump[i] = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + TOWER + TOWERDON + i.ToString() + @$"{Path.DirectorySeparatorChar}Jump{Path.DirectorySeparatorChar}"), "Jump"); + + Tower_Don_Climbing[i] = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Don_Climbing[i]]; + Tower_Don_Running[i] = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Don_Running[i]]; + Tower_Don_Standing[i] = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Don_Standing[i]]; + Tower_Don_Jump[i] = new CTexture[TJAPlayer3.Skin.Game_Tower_Ptn_Don_Jump[i]]; + + for (int j = 0; j < TJAPlayer3.Skin.Game_Tower_Ptn_Don_Climbing[i]; j++) { + Tower_Don_Climbing[i][j] = TxC(GAME + TOWER + TOWERDON + i.ToString() + @$"{Path.DirectorySeparatorChar}Climbing{Path.DirectorySeparatorChar}Climbing" + j.ToString() + ".png"); + } + + for (int j = 0; j < TJAPlayer3.Skin.Game_Tower_Ptn_Don_Running[i]; j++) { + Tower_Don_Running[i][j] = TxC(GAME + TOWER + TOWERDON + i.ToString() + @$"{Path.DirectorySeparatorChar}Running{Path.DirectorySeparatorChar}Running" + j.ToString() + ".png"); + } + + for (int j = 0; j < TJAPlayer3.Skin.Game_Tower_Ptn_Don_Standing[i]; j++) { + Tower_Don_Standing[i][j] = TxC(GAME + TOWER + TOWERDON + i.ToString() + @$"{Path.DirectorySeparatorChar}Standing{Path.DirectorySeparatorChar}Standing" + j.ToString() + ".png"); + } + + for (int j = 0; j < TJAPlayer3.Skin.Game_Tower_Ptn_Don_Jump[i]; j++) { + Tower_Don_Jump[i][j] = TxC(GAME + TOWER + TOWERDON + i.ToString() + @$"{Path.DirectorySeparatorChar}Jump{Path.DirectorySeparatorChar}Jump" + 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_FadeIn = TxC(RESULT + @$"FadeIn.png"); + + 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"); + + TJAPlayer3.Skin.Result_Gauge_Rainbow_Ptn = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + RESULT + @$"Rainbow{Path.DirectorySeparatorChar}")); + if (TJAPlayer3.Skin.Result_Gauge_Rainbow_Ptn != 0) { + Result_Rainbow = new CTexture[TJAPlayer3.Skin.Result_Gauge_Rainbow_Ptn]; + for (int i = 0; i < TJAPlayer3.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] + + TJAPlayer3.Skin.Game_Tower_Ptn_Result = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + TOWERRESULT + @$"Tower{Path.DirectorySeparatorChar}")); + TowerResult_Tower = new CTexture[TJAPlayer3.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 < TJAPlayer3.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(TJAPlayer3.strEXEのあるフォルダ + GLOBAL + CHARACTERS); + TJAPlayer3.Skin.Characters_Ptn = charaDirs.Length; + + Characters_Heya_Preview = new CTexture[TJAPlayer3.Skin.Characters_Ptn]; + Characters_Heya_Render = new CTexture[TJAPlayer3.Skin.Characters_Ptn]; + Characters_Result_Clear_1P = new CTexture[TJAPlayer3.Skin.Characters_Ptn]; + Characters_Result_Failed_1P = new CTexture[TJAPlayer3.Skin.Characters_Ptn]; + Characters_Result_Clear_2P = new CTexture[TJAPlayer3.Skin.Characters_Ptn]; + Characters_Result_Failed_2P = new CTexture[TJAPlayer3.Skin.Characters_Ptn]; + Characters = new CCharacter[TJAPlayer3.Skin.Characters_Ptn]; + + Characters_Normal = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Normal_Missed = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Normal_MissedDown = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Normal_Cleared = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Normal_Maxed = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_MissIn = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_MissDownIn = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_GoGoTime = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_GoGoTime_Maxed = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_10Combo = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_10Combo_Clear = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_10Combo_Maxed = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_GoGoStart = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_GoGoStart_Clear = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_GoGoStart_Maxed = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Become_Cleared = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Become_Maxed = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_SoulOut = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_ClearOut = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Return = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Balloon_Breaking = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Balloon_Broke = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Balloon_Miss = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Kusudama_Idle = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Kusudama_Breaking = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Kusudama_Broke = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Kusudama_Miss = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Title_Entry = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Title_Normal = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Result_Clear = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Result_Failed = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Result_Failed_In = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Result_Normal = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Menu_Loop = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Menu_Start = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Menu_Select = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Menu_Wait = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Tower_Standing = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Tower_Climbing = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Tower_Running = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Tower_Clear = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Tower_Fail = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Tower_Standing_Tired = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Tower_Climbing_Tired = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Tower_Running_Tired = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + Characters_Tower_Clear_Tired = new CTexture[TJAPlayer3.Skin.Characters_Ptn][]; + + TJAPlayer3.Skin.Characters_DirName = new string[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Normal_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Normal_Missed_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Normal_MissedDown_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Normal_Cleared_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Normal_Maxed_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_MissIn_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_MissDownIn_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_GoGoTime_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_GoGoTime_Maxed_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_10Combo_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_10Combo_Clear_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_10Combo_Maxed_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_GoGoStart_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_GoGoStart_Clear_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_GoGoStart_Maxed_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Become_Cleared_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Become_Maxed_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_SoulOut_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_ClearOut_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Return_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Balloon_Breaking_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Kusudama_Idle_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Kusudama_Breaking_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Kusudama_Broke_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Kusudama_Miss_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Title_Entry_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Title_Normal_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Result_Clear_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Result_Failed_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Result_Failed_In_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Result_Normal_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Menu_Loop_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Menu_Start_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Menu_Select_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Menu_Wait_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Tower_Standing_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Tower_Running_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Tower_Clear_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Tower_Fail_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Tower_Climbing_Tired_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Tower_Running_Tired_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Tower_Clear_IsLooping = new bool[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Tower_Clear_Tired_IsLooping = new bool[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Tower_Fail_IsLooping = new bool[TJAPlayer3.Skin.Characters_Ptn]; + + TJAPlayer3.Skin.Characters_Resolution = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Heya_Render_Offset = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_UseResult1P = new bool[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_X = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Y = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_4P = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_5P = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_X_AI = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Y_AI = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Balloon_X = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Balloon_Y = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Balloon_4P = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Balloon_5P = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Kusudama_X = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Kusudama_Y = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_Normal = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_10Combo = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_10Combo_Clear = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_10ComboMax = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_Miss = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_MissDown = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_ClearIn = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_Clear = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_ClearMax = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_MissIn = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_MissDownIn = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_GoGoStart = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_GoGoStart_Clear = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_GoGoStartMax = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_GoGo = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_GoGoMax = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_SoulIn = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_SoulOut = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_ClearOut = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_Return = new int[TJAPlayer3.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][]; @@ -1294,627 +1232,610 @@ namespace TJAPlayer3 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][]; */ - TJAPlayer3.Skin.Characters_Beat_Normal = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_Miss = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_MissDown = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_Clear = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_GoGo = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_10Combo = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_10Combo_Clear = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_10ComboMax = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_ClearIn = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_ClearMax = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_MissIn = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_MissDownIn = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_GoGoStart = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_GoGoStart_Clear = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_GoGoStartMax = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_GoGoMax = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_SoulIn = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_SoulOut = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_ClearOut = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_Return = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_Tower_Standing = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_Tower_Clear = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_Tower_Fail = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_Tower_Standing_Tired = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Beat_Tower_Clear_Tired = new float[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Balloon_Timer = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Balloon_Delay = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Balloon_FadeOut = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Title_Entry_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Title_Normal_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Menu_Loop_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Menu_Select_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Menu_Start_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Menu_Wait_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Result_Normal_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Result_Clear_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Result_Failed_In_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; - TJAPlayer3.Skin.Characters_Result_Failed_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_Normal = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_Miss = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_MissDown = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_Clear = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_GoGo = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_10Combo = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_10Combo_Clear = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_10ComboMax = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_ClearIn = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_ClearMax = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_MissIn = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_MissDownIn = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_GoGoStart = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_GoGoStart_Clear = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_GoGoStartMax = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_GoGoMax = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_SoulIn = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_SoulOut = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_ClearOut = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_Return = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_Tower_Standing = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_Tower_Clear = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_Tower_Fail = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_Tower_Standing_Tired = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Beat_Tower_Clear_Tired = new float[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Balloon_Timer = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Balloon_Delay = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Balloon_FadeOut = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Title_Entry_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Title_Normal_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Menu_Loop_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Menu_Select_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Menu_Start_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Menu_Wait_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Result_Normal_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Result_Clear_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Result_Failed_In_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; + TJAPlayer3.Skin.Characters_Result_Failed_AnimationDuration = new int[TJAPlayer3.Skin.Characters_Ptn]; - for (int i = 0; i < charaDirs.Length; i++) - { - TJAPlayer3.Skin.Characters_DirName[i] = System.IO.Path.GetFileName(charaDirs[i]); - } + for (int i = 0; i < charaDirs.Length; i++) { + TJAPlayer3.Skin.Characters_DirName[i] = System.IO.Path.GetFileName(charaDirs[i]); + } - #endregion + #endregion - for (int i = 0; i < 5; i++) - { - TJAPlayer3.SaveFileInstances[i].tReindexCharacter(TJAPlayer3.Skin.Characters_DirName); - this.ReloadCharacter(-1, TJAPlayer3.SaveFileInstances[i].data.Character, i, true); - } - - - for (int i = 0; i < TJAPlayer3.Skin.Characters_Ptn; i++) - { - Characters_Heya_Preview[i] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Normal{Path.DirectorySeparatorChar}0.png"); - Characters_Heya_Render[i] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Render.png"); - Characters_Result_Clear_1P[i] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Clear_1P.png"); - Characters_Result_Failed_1P[i] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Failed_1P.png"); - Characters_Result_Clear_2P[i] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Clear_2P.png"); - Characters_Result_Failed_2P[i] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Failed_2P.png"); - - TJAPlayer3.Skin.Characters_Resolution[i] = new int[] { 1280, 720 }; - TJAPlayer3.Skin.Characters_Heya_Render_Offset[i] = new int[] { 0, 0 }; - TJAPlayer3.Skin.Characters_UseResult1P[i] = false; + for (int i = 0; i < 5; i++) { + TJAPlayer3.SaveFileInstances[i].tReindexCharacter(TJAPlayer3.Skin.Characters_DirName); + this.ReloadCharacter(-1, TJAPlayer3.SaveFileInstances[i].data.Character, i, true); + } - var _str = ""; - TJAPlayer3.Skin.LoadSkinConfigFromFile(charaDirs[i] + @$"{Path.DirectorySeparatorChar}CharaConfig.txt", ref _str); + for (int i = 0; i < TJAPlayer3.Skin.Characters_Ptn; i++) { + Characters_Heya_Preview[i] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Normal{Path.DirectorySeparatorChar}0.png"); + Characters_Heya_Render[i] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Render.png"); + Characters_Result_Clear_1P[i] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Clear_1P.png"); + Characters_Result_Failed_1P[i] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Failed_1P.png"); + Characters_Result_Clear_2P[i] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Clear_2P.png"); + Characters_Result_Failed_2P[i] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Failed_2P.png"); - string[] delimiter = { "\n", "\r" }; - string[] strSingleLine = _str.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); + TJAPlayer3.Skin.Characters_Resolution[i] = new int[] { 1280, 720 }; + TJAPlayer3.Skin.Characters_Heya_Render_Offset[i] = new int[] { 0, 0 }; + TJAPlayer3.Skin.Characters_UseResult1P[i] = false; - foreach (string line in strSingleLine) - { - if (line.StartsWith("Chara_Resolution=")) // required for Heya resolution compatibility - { - string[] values = line.Substring(17).Trim().Split(','); - TJAPlayer3.Skin.Characters_Resolution[i][0] = int.Parse(values[0]); - TJAPlayer3.Skin.Characters_Resolution[i][1] = int.Parse(values[1]); - } - else if (line.StartsWith("Heya_Chara_Render_Offset=")) - { - string[] values = line.Substring(25).Trim().Split(','); - TJAPlayer3.Skin.Characters_Heya_Render_Offset[i][0] = int.Parse(values[0]); - TJAPlayer3.Skin.Characters_Heya_Render_Offset[i][1] = int.Parse(values[1]); - } - else if (line.StartsWith("Result_UseResult1P=")) - { - TJAPlayer3.Skin.Characters_UseResult1P[i] = FDK.CConversion.bONorOFF(line.Substring(19).Trim()[0]); - } - } - Characters[i] = new CCharacter(charaDirs[i]); - } - + var _str = ""; + TJAPlayer3.Skin.LoadSkinConfigFromFile(charaDirs[i] + @$"{Path.DirectorySeparatorChar}CharaConfig.txt", ref _str); - #endregion + string[] delimiter = { "\n", "\r" }; + string[] strSingleLine = _str.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); - #region [11_Modals] + foreach (string line in strSingleLine) { + if (line.StartsWith("Chara_Resolution=")) // required for Heya resolution compatibility + { + string[] values = line.Substring(17).Trim().Split(','); + TJAPlayer3.Skin.Characters_Resolution[i][0] = int.Parse(values[0]); + TJAPlayer3.Skin.Characters_Resolution[i][1] = int.Parse(values[1]); + } else if (line.StartsWith("Heya_Chara_Render_Offset=")) { + string[] values = line.Substring(25).Trim().Split(','); + TJAPlayer3.Skin.Characters_Heya_Render_Offset[i][0] = int.Parse(values[0]); + TJAPlayer3.Skin.Characters_Heya_Render_Offset[i][1] = int.Parse(values[1]); + } else if (line.StartsWith("Result_UseResult1P=")) { + TJAPlayer3.Skin.Characters_UseResult1P[i] = FDK.CConversion.bONorOFF(line.Substring(19).Trim()[0]); + } + } - Modal_Full = new CTexture[6]; - Modal_Half = new CTexture[6]; - Modal_Half_4P = new CTexture[6]; - Modal_Half_5P = new CTexture[6]; - for (int i = 0; i < 5; i++) - { - Modal_Full[i] = TxC(MODALS + i.ToString() + @$"_full.png"); - Modal_Half[i] = TxC(MODALS + i.ToString() + @$"_half.png"); - Modal_Half_4P[i] = TxC(MODALS + i.ToString() + @$"_half_4P.png"); - Modal_Half_5P[i] = TxC(MODALS + i.ToString() + @$"_half_5P.png"); - } - Modal_Full[Modal_Full.Length - 1] = TxC(MODALS + @$"Coin_full.png"); - Modal_Half[Modal_Full.Length - 1] = TxC(MODALS + @$"Coin_half.png"); - Modal_Half_4P[Modal_Full.Length - 1] = TxC(MODALS + @$"Coin_half_4P.png"); - Modal_Half_5P[Modal_Full.Length - 1] = TxC(MODALS + @$"Coin_half_5P.png"); + Characters[i] = new CCharacter(charaDirs[i]); + } - #endregion - #region [12_OnlineLounge] + #endregion - //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"); + #region [11_Modals] - #endregion + Modal_Full = new CTexture[6]; + Modal_Half = new CTexture[6]; + Modal_Half_4P = new CTexture[6]; + Modal_Half_5P = new CTexture[6]; + for (int i = 0; i < 5; i++) { + Modal_Full[i] = TxC(MODALS + i.ToString() + @$"_full.png"); + Modal_Half[i] = TxC(MODALS + i.ToString() + @$"_half.png"); + Modal_Half_4P[i] = TxC(MODALS + i.ToString() + @$"_half_4P.png"); + Modal_Half_5P[i] = TxC(MODALS + i.ToString() + @$"_half_5P.png"); + } + Modal_Full[Modal_Full.Length - 1] = TxC(MODALS + @$"Coin_full.png"); + Modal_Half[Modal_Full.Length - 1] = TxC(MODALS + @$"Coin_half.png"); + Modal_Half_4P[Modal_Full.Length - 1] = TxC(MODALS + @$"Coin_half_4P.png"); + Modal_Half_5P[Modal_Full.Length - 1] = TxC(MODALS + @$"Coin_half_5P.png"); - #region [13_TowerSelect] + #endregion - TowerSelect_Tower = TxC(TOWERSELECT + @"Tower.png"); + #region [12_OnlineLounge] - #endregion + //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"); - #region [15_OpenEncyclopedia] + #endregion - //OpenEncyclopedia_Background = TxC(OPENENCYCLOPEDIA + @"Background.png"); - OpenEncyclopedia_Context = TxC(OPENENCYCLOPEDIA + @"Context.png"); - OpenEncyclopedia_Side_Menu = TxC(OPENENCYCLOPEDIA + @"Side_Menu.png"); - OpenEncyclopedia_Return_Box = TxC(OPENENCYCLOPEDIA + @"Return_Box.png"); + #region [13_TowerSelect] - #endregion + TowerSelect_Tower = TxC(TOWERSELECT + @"Tower.png"); - if (TJAPlayer3.ConfigIni.PreAssetsLoading) - { - foreach(var act in TJAPlayer3.app.listトップレベルActivities) - { + #endregion + + #region [15_OpenEncyclopedia] + + //OpenEncyclopedia_Background = TxC(OPENENCYCLOPEDIA + @"Background.png"); + OpenEncyclopedia_Context = TxC(OPENENCYCLOPEDIA + @"Context.png"); + OpenEncyclopedia_Side_Menu = TxC(OPENENCYCLOPEDIA + @"Side_Menu.png"); + OpenEncyclopedia_Return_Box = TxC(OPENENCYCLOPEDIA + @"Return_Box.png"); + + #endregion + + if (TJAPlayer3.ConfigIni.PreAssetsLoading) { + foreach (var act in TJAPlayer3.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 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 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; + public void ReloadCharacter(int old, int newC, int player, bool primary = false) { + if (old == newC) + return; - if (old >= 0 && - (TJAPlayer3.SaveFileInstances[0].data.Character != old || player == 0) && - (TJAPlayer3.SaveFileInstances[1].data.Character != old || player == 1) && - (TJAPlayer3.SaveFileInstances[2].data.Character != old || player == 2) && - (TJAPlayer3.SaveFileInstances[3].data.Character != old || player == 3) && - (TJAPlayer3.SaveFileInstances[4].data.Character != old || player == 4)) - { - int i = old; + if (old >= 0 && + (TJAPlayer3.SaveFileInstances[0].data.Character != old || player == 0) && + (TJAPlayer3.SaveFileInstances[1].data.Character != old || player == 1) && + (TJAPlayer3.SaveFileInstances[2].data.Character != old || player == 2) && + (TJAPlayer3.SaveFileInstances[3].data.Character != old || player == 3) && + (TJAPlayer3.SaveFileInstances[4].data.Character != old || player == 4)) { + int i = old; - #region [Dispose the previous character] + #region [Dispose the previous character] - for (int j = 0; j < TJAPlayer3.Skin.Characters_Menu_Loop_Ptn[i]; j++) - Characters_Menu_Loop[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Menu_Loop_Ptn[i]; j++) + Characters_Menu_Loop[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Menu_Start_Ptn[i]; j++) - Characters_Menu_Start[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Menu_Start_Ptn[i]; j++) + Characters_Menu_Start[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Menu_Select_Ptn[i]; j++) - Characters_Menu_Select[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Menu_Select_Ptn[i]; j++) + Characters_Menu_Select[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Menu_Wait_Ptn[i]; j++) - Characters_Menu_Wait[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Menu_Wait_Ptn[i]; j++) + Characters_Menu_Wait[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Result_Normal_Ptn[i]; j++) - Characters_Result_Normal[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Result_Normal_Ptn[i]; j++) + Characters_Result_Normal[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Result_Failed_In_Ptn[i]; j++) - Characters_Result_Failed_In[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Result_Failed_In_Ptn[i]; j++) + Characters_Result_Failed_In[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Result_Failed_Ptn[i]; j++) - Characters_Result_Failed[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Result_Failed_Ptn[i]; j++) + Characters_Result_Failed[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Result_Clear_Ptn[i]; j++) - Characters_Result_Clear[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Result_Clear_Ptn[i]; j++) + Characters_Result_Clear[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Title_Normal_Ptn[i]; j++) - Characters_Title_Normal[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Title_Normal_Ptn[i]; j++) + Characters_Title_Normal[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Title_Entry_Ptn[i]; j++) - Characters_Title_Entry[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Title_Entry_Ptn[i]; j++) + Characters_Title_Entry[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_Ptn[i]; j++) - Characters_Normal[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_Ptn[i]; j++) + Characters_Normal[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_Missed_Ptn[i]; j++) - Characters_Normal_Missed[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_Missed_Ptn[i]; j++) + Characters_Normal_Missed[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_MissedDown_Ptn[i]; j++) - Characters_Normal_MissedDown[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_MissedDown_Ptn[i]; j++) + Characters_Normal_MissedDown[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_Cleared_Ptn[i]; j++) - Characters_Normal_Cleared[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_Cleared_Ptn[i]; j++) + Characters_Normal_Cleared[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_Maxed_Ptn[i]; j++) - Characters_Normal_Maxed[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_Maxed_Ptn[i]; j++) + Characters_Normal_Maxed[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_MissIn_Ptn[i]; j++) - Characters_MissIn[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_MissIn_Ptn[i]; j++) + Characters_MissIn[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_MissDownIn_Ptn[i]; j++) - Characters_MissDownIn[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_MissDownIn_Ptn[i]; j++) + Characters_MissDownIn[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoTime_Ptn[i]; j++) - Characters_GoGoTime[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoTime_Ptn[i]; j++) + Characters_GoGoTime[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoTime_Maxed_Ptn[i]; j++) - Characters_GoGoTime_Maxed[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoTime_Maxed_Ptn[i]; j++) + Characters_GoGoTime_Maxed[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoStart_Ptn[i]; j++) - Characters_GoGoStart[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoStart_Ptn[i]; j++) + Characters_GoGoStart[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoStart_Clear_Ptn[i]; j++) - Characters_GoGoStart_Clear[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoStart_Clear_Ptn[i]; j++) + Characters_GoGoStart_Clear[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoStart_Maxed_Ptn[i]; j++) - Characters_GoGoStart_Maxed[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoStart_Maxed_Ptn[i]; j++) + Characters_GoGoStart_Maxed[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_10Combo_Ptn[i]; j++) - Characters_10Combo[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_10Combo_Ptn[i]; j++) + Characters_10Combo[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_10Combo_Clear_Ptn[i]; j++) - Characters_10Combo_Clear[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_10Combo_Clear_Ptn[i]; j++) + Characters_10Combo_Clear[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_10Combo_Maxed_Ptn[i]; j++) - Characters_10Combo_Maxed[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_10Combo_Maxed_Ptn[i]; j++) + Characters_10Combo_Maxed[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Become_Cleared_Ptn[i]; j++) - Characters_Become_Cleared[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Become_Cleared_Ptn[i]; j++) + Characters_Become_Cleared[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Become_Maxed_Ptn[i]; j++) - Characters_Become_Maxed[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Become_Maxed_Ptn[i]; j++) + Characters_Become_Maxed[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_SoulOut_Ptn[i]; j++) - Characters_SoulOut[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_SoulOut_Ptn[i]; j++) + Characters_SoulOut[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_ClearOut_Ptn[i]; j++) - Characters_ClearOut[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_ClearOut_Ptn[i]; j++) + Characters_ClearOut[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Return_Ptn[i]; j++) - Characters_Return[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Return_Ptn[i]; j++) + Characters_Return[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Balloon_Breaking_Ptn[i]; j++) - Characters_Balloon_Breaking[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Balloon_Breaking_Ptn[i]; j++) + Characters_Balloon_Breaking[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn[i]; j++) - Characters_Balloon_Broke[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn[i]; j++) + Characters_Balloon_Broke[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn[i]; j++) - Characters_Balloon_Miss[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn[i]; j++) + Characters_Balloon_Miss[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Kusudama_Idle_Ptn[i]; j++) - Characters_Kusudama_Idle[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Kusudama_Idle_Ptn[i]; j++) + Characters_Kusudama_Idle[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Kusudama_Breaking_Ptn[i]; j++) - Characters_Kusudama_Breaking[i][j]?.Dispose(); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Kusudama_Breaking_Ptn[i]; j++) + Characters_Kusudama_Breaking[i][j]?.Dispose(); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Kusudama_Broke_Ptn[i]; j++) - Characters_Kusudama_Broke[i][j]?.Dispose(); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Kusudama_Miss_Ptn[i]; j++) - Characters_Kusudama_Miss[i][j]?.Dispose(); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[i]; j++) - Characters_Tower_Standing[i][j]?.Dispose(); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[i]; j++) - Characters_Tower_Climbing[i][j]?.Dispose(); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Running_Ptn[i]; j++) - Characters_Tower_Running[i][j]?.Dispose(); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[i]; j++) - Characters_Tower_Clear[i][j]?.Dispose(); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[i]; j++) - Characters_Tower_Fail[i][j]?.Dispose(); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn[i]; j++) - Characters_Tower_Standing_Tired[i][j]?.Dispose(); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Climbing_Tired_Ptn[i]; j++) - Characters_Tower_Climbing_Tired[i][j]?.Dispose(); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Running_Tired_Ptn[i]; j++) - Characters_Tower_Running_Tired[i][j]?.Dispose(); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[i]; j++) - Characters_Tower_Clear_Tired[i][j]?.Dispose(); - #endregion - } - - string charaPath = TJAPlayer3.strEXEのあるフォルダ + GLOBAL + CHARACTERS + TJAPlayer3.Skin.Characters_DirName[newC]; - - if ((newC >= 0 && - TJAPlayer3.SaveFileInstances[0].data.Character != newC && - TJAPlayer3.SaveFileInstances[1].data.Character != newC && - TJAPlayer3.SaveFileInstances[2].data.Character != newC && - TJAPlayer3.SaveFileInstances[3].data.Character != newC && - TJAPlayer3.SaveFileInstances[4].data.Character != newC) || primary) - { - int i = newC; - - #region [Allocate the new character] - - #region [Character individual values count initialisation] - - TJAPlayer3.Skin.Characters_Normal_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Normal{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Normal_Missed_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Miss{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Normal_MissedDown_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}MissDown{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_MissIn_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}MissIn{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_MissDownIn_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}MissDownIn{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Normal_Cleared_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Normal_Maxed_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Clear_Max{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_GoGoTime_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGo{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_GoGoTime_Maxed_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGo_Max{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_10Combo_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}10combo{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_10Combo_Clear_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}10combo_Clear{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_10Combo_Maxed_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}10combo_Max{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_GoGoStart_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGoStart{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_GoGoStart_Clear_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGoStart_Clear{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_GoGoStart_Maxed_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGoStart_Max{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Become_Cleared_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Clearin{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Become_Maxed_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Soulin{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_SoulOut_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}SoulOut{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_ClearOut_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}ClearOut{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Return_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Return{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Balloon_Breaking_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Balloon_Breaking{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Balloon_Broke{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Balloon_Miss{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Kusudama_Idle_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Kusudama_Idle{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Kusudama_Breaking_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Kusudama_Breaking{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Kusudama_Broke_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Kusudama_Broke{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Kusudama_Miss_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Kusudama_Miss{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Title_Entry_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Title_Entry{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Title_Normal_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Title_Normal{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Menu_Loop_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Menu_Loop{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Menu_Select_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Menu_Select{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Menu_Start_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Menu_Start{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Menu_Wait_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Menu_Wait{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Result_Clear_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Result_Clear{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Result_Failed_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Result_Failed{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Result_Failed_In_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Result_Failed_In{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Result_Normal_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Result_Normal{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Standing{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Climbing{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Tower_Running_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Running{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Fail{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Standing_Tired{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Tower_Climbing_Tired_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Climbing_Tired{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Tower_Running_Tired_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Running_Tired{Path.DirectorySeparatorChar}"); - TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Clear_Tired{Path.DirectorySeparatorChar}"); - - Characters_Normal[i] = new CTexture[TJAPlayer3.Skin.Characters_Normal_Ptn[i]]; - Characters_Normal_Missed[i] = new CTexture[TJAPlayer3.Skin.Characters_Normal_Missed_Ptn[i]]; - Characters_Normal_MissedDown[i] = new CTexture[TJAPlayer3.Skin.Characters_Normal_MissedDown_Ptn[i]]; - Characters_Normal_Cleared[i] = new CTexture[TJAPlayer3.Skin.Characters_Normal_Cleared_Ptn[i]]; - Characters_Normal_Maxed[i] = new CTexture[TJAPlayer3.Skin.Characters_Normal_Maxed_Ptn[i]]; - Characters_MissIn[i] = new CTexture[TJAPlayer3.Skin.Characters_MissIn_Ptn[i]]; - Characters_MissDownIn[i] = new CTexture[TJAPlayer3.Skin.Characters_MissDownIn_Ptn[i]]; - Characters_GoGoTime[i] = new CTexture[TJAPlayer3.Skin.Characters_GoGoTime_Ptn[i]]; - Characters_GoGoTime_Maxed[i] = new CTexture[TJAPlayer3.Skin.Characters_GoGoTime_Maxed_Ptn[i]]; - Characters_10Combo[i] = new CTexture[TJAPlayer3.Skin.Characters_10Combo_Ptn[i]]; - Characters_10Combo_Clear[i] = new CTexture[TJAPlayer3.Skin.Characters_10Combo_Clear_Ptn[i]]; - Characters_10Combo_Maxed[i] = new CTexture[TJAPlayer3.Skin.Characters_10Combo_Maxed_Ptn[i]]; - Characters_GoGoStart[i] = new CTexture[TJAPlayer3.Skin.Characters_GoGoStart_Ptn[i]]; - Characters_GoGoStart_Clear[i] = new CTexture[TJAPlayer3.Skin.Characters_GoGoStart_Clear_Ptn[i]]; - Characters_GoGoStart_Maxed[i] = new CTexture[TJAPlayer3.Skin.Characters_GoGoStart_Maxed_Ptn[i]]; - Characters_Become_Cleared[i] = new CTexture[TJAPlayer3.Skin.Characters_Become_Cleared_Ptn[i]]; - Characters_Become_Maxed[i] = new CTexture[TJAPlayer3.Skin.Characters_Become_Maxed_Ptn[i]]; - Characters_SoulOut[i] = new CTexture[TJAPlayer3.Skin.Characters_SoulOut_Ptn[i]]; - Characters_ClearOut[i] = new CTexture[TJAPlayer3.Skin.Characters_ClearOut_Ptn[i]]; - Characters_Return[i] = new CTexture[TJAPlayer3.Skin.Characters_Return_Ptn[i]]; - Characters_Balloon_Breaking[i] = new CTexture[TJAPlayer3.Skin.Characters_Balloon_Breaking_Ptn[i]]; - Characters_Balloon_Broke[i] = new CTexture[TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn[i]]; - Characters_Balloon_Miss[i] = new CTexture[TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn[i]]; - Characters_Kusudama_Idle[i] = new CTexture[TJAPlayer3.Skin.Characters_Kusudama_Idle_Ptn[i]]; - Characters_Kusudama_Breaking[i] = new CTexture[TJAPlayer3.Skin.Characters_Kusudama_Breaking_Ptn[i]]; - Characters_Kusudama_Broke[i] = new CTexture[TJAPlayer3.Skin.Characters_Kusudama_Broke_Ptn[i]]; - Characters_Kusudama_Miss[i] = new CTexture[TJAPlayer3.Skin.Characters_Kusudama_Miss_Ptn[i]]; - Characters_Title_Entry[i] = new CTexture[TJAPlayer3.Skin.Characters_Title_Entry_Ptn[i]]; - Characters_Title_Normal[i] = new CTexture[TJAPlayer3.Skin.Characters_Title_Normal_Ptn[i]]; - Characters_Result_Clear[i] = new CTexture[TJAPlayer3.Skin.Characters_Result_Clear_Ptn[i]]; - Characters_Result_Failed[i] = new CTexture[TJAPlayer3.Skin.Characters_Result_Failed_Ptn[i]]; - Characters_Result_Failed_In[i] = new CTexture[TJAPlayer3.Skin.Characters_Result_Failed_In_Ptn[i]]; - Characters_Result_Normal[i] = new CTexture[TJAPlayer3.Skin.Characters_Result_Normal_Ptn[i]]; - Characters_Menu_Loop[i] = new CTexture[TJAPlayer3.Skin.Characters_Menu_Loop_Ptn[i]]; - Characters_Menu_Start[i] = new CTexture[TJAPlayer3.Skin.Characters_Menu_Start_Ptn[i]]; - Characters_Menu_Select[i] = new CTexture[TJAPlayer3.Skin.Characters_Menu_Select_Ptn[i]]; - Characters_Menu_Wait[i] = new CTexture[TJAPlayer3.Skin.Characters_Menu_Wait_Ptn[i]]; - Characters_Tower_Standing[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[i]]; - Characters_Tower_Climbing[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[i]]; - Characters_Tower_Running[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Running_Ptn[i]]; - Characters_Tower_Clear[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[i]]; - Characters_Tower_Fail[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[i]]; - Characters_Tower_Standing_Tired[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn[i]]; - Characters_Tower_Climbing_Tired[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Climbing_Tired_Ptn[i]]; - Characters_Tower_Running_Tired[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Running_Tired_Ptn[i]]; - Characters_Tower_Clear_Tired[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[i]]; - - #endregion - - #region [Characters asset loading] - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Menu_Loop_Ptn[i]; j++) - Characters_Menu_Loop[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Menu_Loop{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Menu_Select_Ptn[i]; j++) - Characters_Menu_Select[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Menu_Select{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Menu_Start_Ptn[i]; j++) - Characters_Menu_Start[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Menu_Start{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Menu_Wait_Ptn[i]; j++) - Characters_Menu_Wait[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Menu_Wait{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Result_Normal_Ptn[i]; j++) - Characters_Result_Normal[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Normal{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Result_Failed_In_Ptn[i]; j++) - Characters_Result_Failed_In[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Failed_In{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Result_Failed_Ptn[i]; j++) - Characters_Result_Failed[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Failed{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Result_Clear_Ptn[i]; j++) - Characters_Result_Clear[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Title_Normal_Ptn[i]; j++) - Characters_Title_Normal[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Title_Normal{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Title_Entry_Ptn[i]; j++) - Characters_Title_Entry[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Title_Entry{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_Ptn[i]; j++) - Characters_Normal[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Normal{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_Missed_Ptn[i]; j++) - Characters_Normal_Missed[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Miss{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_MissedDown_Ptn[i]; j++) - Characters_Normal_MissedDown[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}MissDown{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Kusudama_Broke_Ptn[i]; j++) + Characters_Kusudama_Broke[i][j]?.Dispose(); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Kusudama_Miss_Ptn[i]; j++) + Characters_Kusudama_Miss[i][j]?.Dispose(); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[i]; j++) + Characters_Tower_Standing[i][j]?.Dispose(); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[i]; j++) + Characters_Tower_Climbing[i][j]?.Dispose(); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Running_Ptn[i]; j++) + Characters_Tower_Running[i][j]?.Dispose(); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[i]; j++) + Characters_Tower_Clear[i][j]?.Dispose(); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[i]; j++) + Characters_Tower_Fail[i][j]?.Dispose(); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn[i]; j++) + Characters_Tower_Standing_Tired[i][j]?.Dispose(); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Climbing_Tired_Ptn[i]; j++) + Characters_Tower_Climbing_Tired[i][j]?.Dispose(); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Running_Tired_Ptn[i]; j++) + Characters_Tower_Running_Tired[i][j]?.Dispose(); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[i]; j++) + Characters_Tower_Clear_Tired[i][j]?.Dispose(); + #endregion + } + + string charaPath = TJAPlayer3.strEXEのあるフォルダ + GLOBAL + CHARACTERS + TJAPlayer3.Skin.Characters_DirName[newC]; + + if ((newC >= 0 && + TJAPlayer3.SaveFileInstances[0].data.Character != newC && + TJAPlayer3.SaveFileInstances[1].data.Character != newC && + TJAPlayer3.SaveFileInstances[2].data.Character != newC && + TJAPlayer3.SaveFileInstances[3].data.Character != newC && + TJAPlayer3.SaveFileInstances[4].data.Character != newC) || primary) { + int i = newC; + + #region [Allocate the new character] + + #region [Character individual values count initialisation] + + TJAPlayer3.Skin.Characters_Normal_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Normal{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Normal_Missed_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Miss{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Normal_MissedDown_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}MissDown{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_MissIn_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}MissIn{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_MissDownIn_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}MissDownIn{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Normal_Cleared_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Normal_Maxed_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Clear_Max{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_GoGoTime_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGo{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_GoGoTime_Maxed_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGo_Max{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_10Combo_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}10combo{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_10Combo_Clear_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}10combo_Clear{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_10Combo_Maxed_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}10combo_Max{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_GoGoStart_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGoStart{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_GoGoStart_Clear_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGoStart_Clear{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_GoGoStart_Maxed_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGoStart_Max{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Become_Cleared_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Clearin{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Become_Maxed_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Soulin{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_SoulOut_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}SoulOut{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_ClearOut_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}ClearOut{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Return_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Return{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Balloon_Breaking_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Balloon_Breaking{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Balloon_Broke{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Balloon_Miss{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Kusudama_Idle_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Kusudama_Idle{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Kusudama_Breaking_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Kusudama_Breaking{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Kusudama_Broke_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Kusudama_Broke{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Kusudama_Miss_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Kusudama_Miss{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Title_Entry_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Title_Entry{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Title_Normal_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Title_Normal{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Menu_Loop_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Menu_Loop{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Menu_Select_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Menu_Select{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Menu_Start_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Menu_Start{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Menu_Wait_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Menu_Wait{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Result_Clear_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Result_Clear{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Result_Failed_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Result_Failed{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Result_Failed_In_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Result_Failed_In{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Result_Normal_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Result_Normal{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Standing{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Climbing{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Tower_Running_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Running{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Fail{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Standing_Tired{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Tower_Climbing_Tired_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Climbing_Tired{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Tower_Running_Tired_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Running_Tired{Path.DirectorySeparatorChar}"); + TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[i] = TJAPlayer3.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Clear_Tired{Path.DirectorySeparatorChar}"); + + Characters_Normal[i] = new CTexture[TJAPlayer3.Skin.Characters_Normal_Ptn[i]]; + Characters_Normal_Missed[i] = new CTexture[TJAPlayer3.Skin.Characters_Normal_Missed_Ptn[i]]; + Characters_Normal_MissedDown[i] = new CTexture[TJAPlayer3.Skin.Characters_Normal_MissedDown_Ptn[i]]; + Characters_Normal_Cleared[i] = new CTexture[TJAPlayer3.Skin.Characters_Normal_Cleared_Ptn[i]]; + Characters_Normal_Maxed[i] = new CTexture[TJAPlayer3.Skin.Characters_Normal_Maxed_Ptn[i]]; + Characters_MissIn[i] = new CTexture[TJAPlayer3.Skin.Characters_MissIn_Ptn[i]]; + Characters_MissDownIn[i] = new CTexture[TJAPlayer3.Skin.Characters_MissDownIn_Ptn[i]]; + Characters_GoGoTime[i] = new CTexture[TJAPlayer3.Skin.Characters_GoGoTime_Ptn[i]]; + Characters_GoGoTime_Maxed[i] = new CTexture[TJAPlayer3.Skin.Characters_GoGoTime_Maxed_Ptn[i]]; + Characters_10Combo[i] = new CTexture[TJAPlayer3.Skin.Characters_10Combo_Ptn[i]]; + Characters_10Combo_Clear[i] = new CTexture[TJAPlayer3.Skin.Characters_10Combo_Clear_Ptn[i]]; + Characters_10Combo_Maxed[i] = new CTexture[TJAPlayer3.Skin.Characters_10Combo_Maxed_Ptn[i]]; + Characters_GoGoStart[i] = new CTexture[TJAPlayer3.Skin.Characters_GoGoStart_Ptn[i]]; + Characters_GoGoStart_Clear[i] = new CTexture[TJAPlayer3.Skin.Characters_GoGoStart_Clear_Ptn[i]]; + Characters_GoGoStart_Maxed[i] = new CTexture[TJAPlayer3.Skin.Characters_GoGoStart_Maxed_Ptn[i]]; + Characters_Become_Cleared[i] = new CTexture[TJAPlayer3.Skin.Characters_Become_Cleared_Ptn[i]]; + Characters_Become_Maxed[i] = new CTexture[TJAPlayer3.Skin.Characters_Become_Maxed_Ptn[i]]; + Characters_SoulOut[i] = new CTexture[TJAPlayer3.Skin.Characters_SoulOut_Ptn[i]]; + Characters_ClearOut[i] = new CTexture[TJAPlayer3.Skin.Characters_ClearOut_Ptn[i]]; + Characters_Return[i] = new CTexture[TJAPlayer3.Skin.Characters_Return_Ptn[i]]; + Characters_Balloon_Breaking[i] = new CTexture[TJAPlayer3.Skin.Characters_Balloon_Breaking_Ptn[i]]; + Characters_Balloon_Broke[i] = new CTexture[TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn[i]]; + Characters_Balloon_Miss[i] = new CTexture[TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn[i]]; + Characters_Kusudama_Idle[i] = new CTexture[TJAPlayer3.Skin.Characters_Kusudama_Idle_Ptn[i]]; + Characters_Kusudama_Breaking[i] = new CTexture[TJAPlayer3.Skin.Characters_Kusudama_Breaking_Ptn[i]]; + Characters_Kusudama_Broke[i] = new CTexture[TJAPlayer3.Skin.Characters_Kusudama_Broke_Ptn[i]]; + Characters_Kusudama_Miss[i] = new CTexture[TJAPlayer3.Skin.Characters_Kusudama_Miss_Ptn[i]]; + Characters_Title_Entry[i] = new CTexture[TJAPlayer3.Skin.Characters_Title_Entry_Ptn[i]]; + Characters_Title_Normal[i] = new CTexture[TJAPlayer3.Skin.Characters_Title_Normal_Ptn[i]]; + Characters_Result_Clear[i] = new CTexture[TJAPlayer3.Skin.Characters_Result_Clear_Ptn[i]]; + Characters_Result_Failed[i] = new CTexture[TJAPlayer3.Skin.Characters_Result_Failed_Ptn[i]]; + Characters_Result_Failed_In[i] = new CTexture[TJAPlayer3.Skin.Characters_Result_Failed_In_Ptn[i]]; + Characters_Result_Normal[i] = new CTexture[TJAPlayer3.Skin.Characters_Result_Normal_Ptn[i]]; + Characters_Menu_Loop[i] = new CTexture[TJAPlayer3.Skin.Characters_Menu_Loop_Ptn[i]]; + Characters_Menu_Start[i] = new CTexture[TJAPlayer3.Skin.Characters_Menu_Start_Ptn[i]]; + Characters_Menu_Select[i] = new CTexture[TJAPlayer3.Skin.Characters_Menu_Select_Ptn[i]]; + Characters_Menu_Wait[i] = new CTexture[TJAPlayer3.Skin.Characters_Menu_Wait_Ptn[i]]; + Characters_Tower_Standing[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[i]]; + Characters_Tower_Climbing[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[i]]; + Characters_Tower_Running[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Running_Ptn[i]]; + Characters_Tower_Clear[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[i]]; + Characters_Tower_Fail[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[i]]; + Characters_Tower_Standing_Tired[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn[i]]; + Characters_Tower_Climbing_Tired[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Climbing_Tired_Ptn[i]]; + Characters_Tower_Running_Tired[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Running_Tired_Ptn[i]]; + Characters_Tower_Clear_Tired[i] = new CTexture[TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[i]]; + + #endregion + + #region [Characters asset loading] + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Menu_Loop_Ptn[i]; j++) + Characters_Menu_Loop[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Menu_Loop{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Menu_Select_Ptn[i]; j++) + Characters_Menu_Select[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Menu_Select{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Menu_Start_Ptn[i]; j++) + Characters_Menu_Start[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Menu_Start{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Menu_Wait_Ptn[i]; j++) + Characters_Menu_Wait[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Menu_Wait{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Result_Normal_Ptn[i]; j++) + Characters_Result_Normal[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Normal{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Result_Failed_In_Ptn[i]; j++) + Characters_Result_Failed_In[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Failed_In{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Result_Failed_Ptn[i]; j++) + Characters_Result_Failed[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Failed{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Result_Clear_Ptn[i]; j++) + Characters_Result_Clear[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Title_Normal_Ptn[i]; j++) + Characters_Title_Normal[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Title_Normal{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Title_Entry_Ptn[i]; j++) + Characters_Title_Entry[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Title_Entry{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_Ptn[i]; j++) + Characters_Normal[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Normal{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_Missed_Ptn[i]; j++) + Characters_Normal_Missed[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Miss{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_MissedDown_Ptn[i]; j++) + Characters_Normal_MissedDown[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}MissDown{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_Cleared_Ptn[i]; j++) - Characters_Normal_Cleared[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_Cleared_Ptn[i]; j++) + Characters_Normal_Cleared[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_Maxed_Ptn[i]; j++) - Characters_Normal_Maxed[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Clear_Max{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Normal_Maxed_Ptn[i]; j++) + Characters_Normal_Maxed[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Clear_Max{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_MissIn_Ptn[i]; j++) - Characters_MissIn[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}MissIn{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_MissIn_Ptn[i]; j++) + Characters_MissIn[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}MissIn{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_MissDownIn_Ptn[i]; j++) - Characters_MissDownIn[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}MissDownIn{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_MissDownIn_Ptn[i]; j++) + Characters_MissDownIn[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}MissDownIn{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoTime_Ptn[i]; j++) - Characters_GoGoTime[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGo{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoTime_Ptn[i]; j++) + Characters_GoGoTime[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGo{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoTime_Maxed_Ptn[i]; j++) - Characters_GoGoTime_Maxed[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGo_Max{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoTime_Maxed_Ptn[i]; j++) + Characters_GoGoTime_Maxed[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGo_Max{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoStart_Ptn[i]; j++) - Characters_GoGoStart[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGoStart{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoStart_Ptn[i]; j++) + Characters_GoGoStart[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGoStart{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoStart_Clear_Ptn[i]; j++) - Characters_GoGoStart_Clear[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGoStart_Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoStart_Clear_Ptn[i]; j++) + Characters_GoGoStart_Clear[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGoStart_Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoStart_Maxed_Ptn[i]; j++) - Characters_GoGoStart_Maxed[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGoStart_Max{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_GoGoStart_Maxed_Ptn[i]; j++) + Characters_GoGoStart_Maxed[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGoStart_Max{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_10Combo_Ptn[i]; j++) - Characters_10Combo[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}10combo{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_10Combo_Ptn[i]; j++) + Characters_10Combo[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}10combo{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_10Combo_Clear_Ptn[i]; j++) - Characters_10Combo_Clear[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}10combo_Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_10Combo_Clear_Ptn[i]; j++) + Characters_10Combo_Clear[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}10combo_Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_10Combo_Maxed_Ptn[i]; j++) - Characters_10Combo_Maxed[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}10combo_Max{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_10Combo_Maxed_Ptn[i]; j++) + Characters_10Combo_Maxed[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}10combo_Max{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Become_Cleared_Ptn[i]; j++) - Characters_Become_Cleared[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Clearin{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Become_Cleared_Ptn[i]; j++) + Characters_Become_Cleared[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Clearin{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Become_Maxed_Ptn[i]; j++) - Characters_Become_Maxed[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Soulin{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Become_Maxed_Ptn[i]; j++) + Characters_Become_Maxed[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Soulin{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_SoulOut_Ptn[i]; j++) - Characters_SoulOut[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Soulout{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_SoulOut_Ptn[i]; j++) + Characters_SoulOut[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Soulout{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_ClearOut_Ptn[i]; j++) - Characters_ClearOut[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Clearout{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_ClearOut_Ptn[i]; j++) + Characters_ClearOut[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Clearout{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Return_Ptn[i]; j++) - Characters_Return[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Return{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Return_Ptn[i]; j++) + Characters_Return[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Return{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Balloon_Breaking_Ptn[i]; j++) - Characters_Balloon_Breaking[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Balloon_Breaking{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Balloon_Breaking_Ptn[i]; j++) + Characters_Balloon_Breaking[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Balloon_Breaking{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn[i]; j++) - Characters_Balloon_Broke[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Balloon_Broke{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn[i]; j++) + Characters_Balloon_Broke[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Balloon_Broke{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn[i]; j++) - Characters_Balloon_Miss[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Balloon_Miss{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn[i]; j++) + Characters_Balloon_Miss[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Balloon_Miss{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Kusudama_Idle_Ptn[i]; j++) - Characters_Kusudama_Idle[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Kusudama_Idle{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Kusudama_Idle_Ptn[i]; j++) + Characters_Kusudama_Idle[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Kusudama_Idle{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Kusudama_Breaking_Ptn[i]; j++) - Characters_Kusudama_Breaking[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Kusudama_Breaking{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Kusudama_Breaking_Ptn[i]; j++) + Characters_Kusudama_Breaking[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Kusudama_Breaking{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Kusudama_Broke_Ptn[i]; j++) - Characters_Kusudama_Broke[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Kusudama_Broke{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Kusudama_Broke_Ptn[i]; j++) + Characters_Kusudama_Broke[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Kusudama_Broke{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Kusudama_Miss_Ptn[i]; j++) - Characters_Kusudama_Miss[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Kusudama_Miss{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Kusudama_Miss_Ptn[i]; j++) + Characters_Kusudama_Miss[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Kusudama_Miss{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[i]; j++) - Characters_Tower_Standing[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Standing{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[i]; j++) + Characters_Tower_Standing[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Standing{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[i]; j++) - Characters_Tower_Climbing[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Climbing{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[i]; j++) + Characters_Tower_Climbing[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Climbing{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Running_Ptn[i]; j++) - Characters_Tower_Running[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Running{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Running_Ptn[i]; j++) + Characters_Tower_Running[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Running{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[i]; j++) - Characters_Tower_Clear[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[i]; j++) + Characters_Tower_Clear[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[i]; j++) - Characters_Tower_Fail[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Fail{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[i]; j++) + Characters_Tower_Fail[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Fail{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn[i]; j++) - Characters_Tower_Standing_Tired[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Standing_Tired{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn[i]; j++) + Characters_Tower_Standing_Tired[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Standing_Tired{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Climbing_Tired_Ptn[i]; j++) - Characters_Tower_Climbing_Tired[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Climbing_Tired{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Climbing_Tired_Ptn[i]; j++) + Characters_Tower_Climbing_Tired[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Climbing_Tired{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Running_Tired_Ptn[i]; j++) - Characters_Tower_Running_Tired[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Running_Tired{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Running_Tired_Ptn[i]; j++) + Characters_Tower_Running_Tired[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Running_Tired{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[i]; j++) - Characters_Tower_Clear_Tired[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Clear_Tired{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + for (int j = 0; j < TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[i]; j++) + Characters_Tower_Clear_Tired[i][j] = TxCGlobal(CHARACTERS + TJAPlayer3.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Clear_Tired{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - #endregion + #endregion - #region [Parse individual character parameters] + #region [Parse individual character parameters] - #region [Default values] + #region [Default values] - TJAPlayer3.Skin.Characters_X[i] = new int[] { 0, 0 }; - TJAPlayer3.Skin.Characters_Y[i] = new int[] { 0, 537 }; - TJAPlayer3.Skin.Characters_4P[i] = new int[] { 165, 68 }; - TJAPlayer3.Skin.Characters_5P[i] = new int[] { 165, 40 }; - TJAPlayer3.Skin.Characters_X_AI[i] = new int[] { 472, 602 }; - TJAPlayer3.Skin.Characters_Y_AI[i] = new int[] { 152, 152 }; - TJAPlayer3.Skin.Characters_Balloon_X[i] = new int[] { 240, 240, 0, 0 }; - TJAPlayer3.Skin.Characters_Balloon_Y[i] = new int[] { 0, 297, 0, 0 }; - TJAPlayer3.Skin.Characters_Balloon_4P[i] = new int[] { 0, -176 }; - TJAPlayer3.Skin.Characters_Balloon_5P[i] = new int[] { 0, -168 }; - TJAPlayer3.Skin.Characters_Kusudama_X[i] = new int[] { 290, 690, 90, 890, 490 }; - TJAPlayer3.Skin.Characters_Kusudama_Y[i] = new int[] { 420, 420, 420, 420, 420 }; - TJAPlayer3.Skin.Characters_Motion_Normal[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Normal_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_10Combo[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_10Combo_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_10Combo_Clear[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_10Combo_Clear_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_10ComboMax[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_10Combo_Maxed_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_Miss[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Normal_Missed_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_MissDown[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Normal_MissedDown_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_ClearIn[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Become_Cleared_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_Clear[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Normal_Cleared_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_ClearMax[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Normal_Maxed_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_MissIn[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_MissIn_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_MissDownIn[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_MissDownIn_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_GoGoStart[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_GoGoStart_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_GoGoStart_Clear[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_GoGoStart_Clear_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_GoGoStartMax[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_GoGoStart_Maxed_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_GoGo[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_GoGoTime_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_GoGoMax[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_GoGoTime_Maxed_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_SoulIn[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Become_Maxed_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_SoulOut[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_SoulOut_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_ClearOut[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_ClearOut_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_Return[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Return_Ptn[i]); - /* + TJAPlayer3.Skin.Characters_X[i] = new int[] { 0, 0 }; + TJAPlayer3.Skin.Characters_Y[i] = new int[] { 0, 537 }; + TJAPlayer3.Skin.Characters_4P[i] = new int[] { 165, 68 }; + TJAPlayer3.Skin.Characters_5P[i] = new int[] { 165, 40 }; + TJAPlayer3.Skin.Characters_X_AI[i] = new int[] { 472, 602 }; + TJAPlayer3.Skin.Characters_Y_AI[i] = new int[] { 152, 152 }; + TJAPlayer3.Skin.Characters_Balloon_X[i] = new int[] { 240, 240, 0, 0 }; + TJAPlayer3.Skin.Characters_Balloon_Y[i] = new int[] { 0, 297, 0, 0 }; + TJAPlayer3.Skin.Characters_Balloon_4P[i] = new int[] { 0, -176 }; + TJAPlayer3.Skin.Characters_Balloon_5P[i] = new int[] { 0, -168 }; + TJAPlayer3.Skin.Characters_Kusudama_X[i] = new int[] { 290, 690, 90, 890, 490 }; + TJAPlayer3.Skin.Characters_Kusudama_Y[i] = new int[] { 420, 420, 420, 420, 420 }; + TJAPlayer3.Skin.Characters_Motion_Normal[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Normal_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_10Combo[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_10Combo_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_10Combo_Clear[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_10Combo_Clear_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_10ComboMax[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_10Combo_Maxed_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_Miss[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Normal_Missed_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_MissDown[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Normal_MissedDown_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_ClearIn[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Become_Cleared_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_Clear[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Normal_Cleared_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_ClearMax[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Normal_Maxed_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_MissIn[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_MissIn_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_MissDownIn[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_MissDownIn_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_GoGoStart[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_GoGoStart_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_GoGoStart_Clear[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_GoGoStart_Clear_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_GoGoStartMax[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_GoGoStart_Maxed_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_GoGo[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_GoGoTime_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_GoGoMax[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_GoGoTime_Maxed_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_SoulIn[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Become_Maxed_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_SoulOut[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_SoulOut_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_ClearOut[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_ClearOut_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_Return[i] = CreateNumberedArrayFromInt(TJAPlayer3.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]); @@ -1925,302 +1846,250 @@ namespace TJAPlayer3 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]); */ - TJAPlayer3.Skin.Characters_Beat_Normal[i] = 1; - TJAPlayer3.Skin.Characters_Beat_Miss[i] = 1; - TJAPlayer3.Skin.Characters_Beat_MissDown[i] = 1; - TJAPlayer3.Skin.Characters_Beat_Clear[i] = 2; - TJAPlayer3.Skin.Characters_Beat_GoGo[i] = 2; - TJAPlayer3.Skin.Characters_Beat_MissIn[i] = 1.5f; - TJAPlayer3.Skin.Characters_Beat_MissDownIn[i] = 1.5f; - TJAPlayer3.Skin.Characters_Beat_10Combo[i] = 1.5f; - TJAPlayer3.Skin.Characters_Beat_10Combo_Clear[i] = 1.5f; - TJAPlayer3.Skin.Characters_Beat_10ComboMax[i] = 1.5f; - TJAPlayer3.Skin.Characters_Beat_ClearIn[i] = 1.5f; - TJAPlayer3.Skin.Characters_Beat_ClearMax[i] = 1.5f; - TJAPlayer3.Skin.Characters_Beat_GoGoStart[i] = 1.5f; - TJAPlayer3.Skin.Characters_Beat_GoGoStart_Clear[i] = 1.5f; - TJAPlayer3.Skin.Characters_Beat_GoGoStartMax[i] = 1.5f; - TJAPlayer3.Skin.Characters_Beat_GoGoMax[i] = 2; - TJAPlayer3.Skin.Characters_Beat_SoulIn[i] = 1.5f; - TJAPlayer3.Skin.Characters_Beat_SoulOut[i] = 1.5f; - TJAPlayer3.Skin.Characters_Beat_ClearOut[i] = 1.5f; - TJAPlayer3.Skin.Characters_Beat_Return[i] = 1.5f; - TJAPlayer3.Skin.Characters_Beat_Tower_Standing[i] = 1; - TJAPlayer3.Skin.Characters_Beat_Tower_Clear[i] = 1; - TJAPlayer3.Skin.Characters_Beat_Tower_Fail[i] = 1; - TJAPlayer3.Skin.Characters_Beat_Tower_Standing_Tired[i] = 1; - TJAPlayer3.Skin.Characters_Beat_Tower_Clear_Tired[i] = 1; - TJAPlayer3.Skin.Characters_Balloon_Timer[i] = 28; - TJAPlayer3.Skin.Characters_Balloon_Delay[i] = 500; - TJAPlayer3.Skin.Characters_Balloon_FadeOut[i] = 84; - TJAPlayer3.Skin.Characters_Title_Entry_AnimationDuration[i] = 1000; - TJAPlayer3.Skin.Characters_Title_Normal_AnimationDuration[i] = 1000; - TJAPlayer3.Skin.Characters_Menu_Loop_AnimationDuration[i] = 1000; - TJAPlayer3.Skin.Characters_Menu_Select_AnimationDuration[i] = 1000; - TJAPlayer3.Skin.Characters_Menu_Start_AnimationDuration[i] = 1000; - TJAPlayer3.Skin.Characters_Menu_Wait_AnimationDuration[i] = 1000; - TJAPlayer3.Skin.Characters_Result_Normal_AnimationDuration[i] = 1000; - TJAPlayer3.Skin.Characters_Result_Clear_AnimationDuration[i] = 1000; - TJAPlayer3.Skin.Characters_Result_Failed_In_AnimationDuration[i] = 1000; - TJAPlayer3.Skin.Characters_Result_Failed_AnimationDuration[i] = 1000; + TJAPlayer3.Skin.Characters_Beat_Normal[i] = 1; + TJAPlayer3.Skin.Characters_Beat_Miss[i] = 1; + TJAPlayer3.Skin.Characters_Beat_MissDown[i] = 1; + TJAPlayer3.Skin.Characters_Beat_Clear[i] = 2; + TJAPlayer3.Skin.Characters_Beat_GoGo[i] = 2; + TJAPlayer3.Skin.Characters_Beat_MissIn[i] = 1.5f; + TJAPlayer3.Skin.Characters_Beat_MissDownIn[i] = 1.5f; + TJAPlayer3.Skin.Characters_Beat_10Combo[i] = 1.5f; + TJAPlayer3.Skin.Characters_Beat_10Combo_Clear[i] = 1.5f; + TJAPlayer3.Skin.Characters_Beat_10ComboMax[i] = 1.5f; + TJAPlayer3.Skin.Characters_Beat_ClearIn[i] = 1.5f; + TJAPlayer3.Skin.Characters_Beat_ClearMax[i] = 1.5f; + TJAPlayer3.Skin.Characters_Beat_GoGoStart[i] = 1.5f; + TJAPlayer3.Skin.Characters_Beat_GoGoStart_Clear[i] = 1.5f; + TJAPlayer3.Skin.Characters_Beat_GoGoStartMax[i] = 1.5f; + TJAPlayer3.Skin.Characters_Beat_GoGoMax[i] = 2; + TJAPlayer3.Skin.Characters_Beat_SoulIn[i] = 1.5f; + TJAPlayer3.Skin.Characters_Beat_SoulOut[i] = 1.5f; + TJAPlayer3.Skin.Characters_Beat_ClearOut[i] = 1.5f; + TJAPlayer3.Skin.Characters_Beat_Return[i] = 1.5f; + TJAPlayer3.Skin.Characters_Beat_Tower_Standing[i] = 1; + TJAPlayer3.Skin.Characters_Beat_Tower_Clear[i] = 1; + TJAPlayer3.Skin.Characters_Beat_Tower_Fail[i] = 1; + TJAPlayer3.Skin.Characters_Beat_Tower_Standing_Tired[i] = 1; + TJAPlayer3.Skin.Characters_Beat_Tower_Clear_Tired[i] = 1; + TJAPlayer3.Skin.Characters_Balloon_Timer[i] = 28; + TJAPlayer3.Skin.Characters_Balloon_Delay[i] = 500; + TJAPlayer3.Skin.Characters_Balloon_FadeOut[i] = 84; + TJAPlayer3.Skin.Characters_Title_Entry_AnimationDuration[i] = 1000; + TJAPlayer3.Skin.Characters_Title_Normal_AnimationDuration[i] = 1000; + TJAPlayer3.Skin.Characters_Menu_Loop_AnimationDuration[i] = 1000; + TJAPlayer3.Skin.Characters_Menu_Select_AnimationDuration[i] = 1000; + TJAPlayer3.Skin.Characters_Menu_Start_AnimationDuration[i] = 1000; + TJAPlayer3.Skin.Characters_Menu_Wait_AnimationDuration[i] = 1000; + TJAPlayer3.Skin.Characters_Result_Normal_AnimationDuration[i] = 1000; + TJAPlayer3.Skin.Characters_Result_Clear_AnimationDuration[i] = 1000; + TJAPlayer3.Skin.Characters_Result_Failed_In_AnimationDuration[i] = 1000; + TJAPlayer3.Skin.Characters_Result_Failed_AnimationDuration[i] = 1000; - #endregion + #endregion - var _str = ""; - TJAPlayer3.Skin.LoadSkinConfigFromFile(charaPath + @$"{Path.DirectorySeparatorChar}CharaConfig.txt", ref _str); + var _str = ""; + TJAPlayer3.Skin.LoadSkinConfigFromFile(charaPath + @$"{Path.DirectorySeparatorChar}CharaConfig.txt", ref _str); - string[] delimiter = { "\n" }; - string[] strSingleLine = _str.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); + 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[] { '=' }); + 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 (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++) - { - TJAPlayer3.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++) - { - TJAPlayer3.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++) - { - TJAPlayer3.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++) - { - TJAPlayer3.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++) - { - TJAPlayer3.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++) - { - TJAPlayer3.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++) - { - TJAPlayer3.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++) - { - TJAPlayer3.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++) - { - TJAPlayer3.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++) - { - TJAPlayer3.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++) - { - TJAPlayer3.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++) - { - TJAPlayer3.Skin.Characters_Kusudama_Y[i][k] = int.Parse(strSplit[k]); - } - break; - } - case "Game_Chara_Balloon_Timer": - { - if (int.Parse(strParam) > 0) - TJAPlayer3.Skin.Characters_Balloon_Timer[i] = int.Parse(strParam); - break; - } - case "Game_Chara_Balloon_Delay": - { - if (int.Parse(strParam) > 0) - TJAPlayer3.Skin.Characters_Balloon_Delay[i] = int.Parse(strParam); - break; - } - case "Game_Chara_Balloon_FadeOut": - { - if (int.Parse(strParam) > 0) - TJAPlayer3.Skin.Characters_Balloon_FadeOut[i] = int.Parse(strParam); - break; - } - // パターン数の設定はTextureLoader.csで反映されます。 - case "Game_Chara_Motion_Normal": - { - TJAPlayer3.Skin.Characters_Motion_Normal[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_10Combo": - { - TJAPlayer3.Skin.Characters_Motion_10Combo[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_10Combo_Clear": - { - TJAPlayer3.Skin.Characters_Motion_10Combo_Clear[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_10Combo_Max": - { - TJAPlayer3.Skin.Characters_Motion_10ComboMax[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_Miss": - { - TJAPlayer3.Skin.Characters_Motion_Miss[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_MissDown": - { - TJAPlayer3.Skin.Characters_Motion_MissDown[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_ClearIn": - { - TJAPlayer3.Skin.Characters_Motion_ClearIn[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_Clear": - { - TJAPlayer3.Skin.Characters_Motion_Clear[i] = CConversion.StringToIntArray(strParam); - TJAPlayer3.Skin.Characters_Motion_ClearMax[i] = TJAPlayer3.Skin.Characters_Motion_Clear[i]; - break; - } - case "Game_Chara_Motion_ClearMax": - { - TJAPlayer3.Skin.Characters_Motion_ClearMax[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_MissIn": - { - TJAPlayer3.Skin.Characters_Motion_MissIn[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_MissDownIn": - { - TJAPlayer3.Skin.Characters_Motion_MissDownIn[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_GoGoStart": - { - TJAPlayer3.Skin.Characters_Motion_GoGoStart[i] = CConversion.StringToIntArray(strParam); - TJAPlayer3.Skin.Characters_Motion_GoGoStartMax[i] = TJAPlayer3.Skin.Characters_Motion_GoGoStart[i]; - break; - } - case "Game_Chara_Motion_GoGoStart_Clear": - { - TJAPlayer3.Skin.Characters_Motion_GoGoStart_Clear[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_GoGoStart_Max": - { - TJAPlayer3.Skin.Characters_Motion_GoGoStartMax[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_GoGo": - { - TJAPlayer3.Skin.Characters_Motion_GoGo[i] = CConversion.StringToIntArray(strParam); - TJAPlayer3.Skin.Characters_Motion_GoGoMax[i] = TJAPlayer3.Skin.Characters_Motion_GoGo[i]; - break; - } - case "Game_Chara_Motion_GoGo_Max": - { - TJAPlayer3.Skin.Characters_Motion_GoGoMax[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_SoulIn": - { - TJAPlayer3.Skin.Characters_Motion_SoulIn[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_SoulOut": - { - TJAPlayer3.Skin.Characters_Motion_SoulOut[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_ClearOut": - { - TJAPlayer3.Skin.Characters_Motion_ClearOut[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_Return": - { - TJAPlayer3.Skin.Characters_Motion_Return[i] = CConversion.StringToIntArray(strParam); - break; - } - /*case "Game_Chara_Motion_Tower_Standing": + switch (strCommand) { + case "Game_Chara_X": { + string[] strSplit = strParam.Split(','); + for (int k = 0; k < 2; k++) { + TJAPlayer3.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++) { + TJAPlayer3.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++) { + TJAPlayer3.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++) { + TJAPlayer3.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++) { + TJAPlayer3.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++) { + TJAPlayer3.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++) { + TJAPlayer3.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++) { + TJAPlayer3.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++) { + TJAPlayer3.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++) { + TJAPlayer3.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++) { + TJAPlayer3.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++) { + TJAPlayer3.Skin.Characters_Kusudama_Y[i][k] = int.Parse(strSplit[k]); + } + break; + } + case "Game_Chara_Balloon_Timer": { + if (int.Parse(strParam) > 0) + TJAPlayer3.Skin.Characters_Balloon_Timer[i] = int.Parse(strParam); + break; + } + case "Game_Chara_Balloon_Delay": { + if (int.Parse(strParam) > 0) + TJAPlayer3.Skin.Characters_Balloon_Delay[i] = int.Parse(strParam); + break; + } + case "Game_Chara_Balloon_FadeOut": { + if (int.Parse(strParam) > 0) + TJAPlayer3.Skin.Characters_Balloon_FadeOut[i] = int.Parse(strParam); + break; + } + // パターン数の設定はTextureLoader.csで反映されます。 + case "Game_Chara_Motion_Normal": { + TJAPlayer3.Skin.Characters_Motion_Normal[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_10Combo": { + TJAPlayer3.Skin.Characters_Motion_10Combo[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_10Combo_Clear": { + TJAPlayer3.Skin.Characters_Motion_10Combo_Clear[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_10Combo_Max": { + TJAPlayer3.Skin.Characters_Motion_10ComboMax[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_Miss": { + TJAPlayer3.Skin.Characters_Motion_Miss[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_MissDown": { + TJAPlayer3.Skin.Characters_Motion_MissDown[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_ClearIn": { + TJAPlayer3.Skin.Characters_Motion_ClearIn[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_Clear": { + TJAPlayer3.Skin.Characters_Motion_Clear[i] = CConversion.StringToIntArray(strParam); + TJAPlayer3.Skin.Characters_Motion_ClearMax[i] = TJAPlayer3.Skin.Characters_Motion_Clear[i]; + break; + } + case "Game_Chara_Motion_ClearMax": { + TJAPlayer3.Skin.Characters_Motion_ClearMax[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_MissIn": { + TJAPlayer3.Skin.Characters_Motion_MissIn[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_MissDownIn": { + TJAPlayer3.Skin.Characters_Motion_MissDownIn[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_GoGoStart": { + TJAPlayer3.Skin.Characters_Motion_GoGoStart[i] = CConversion.StringToIntArray(strParam); + TJAPlayer3.Skin.Characters_Motion_GoGoStartMax[i] = TJAPlayer3.Skin.Characters_Motion_GoGoStart[i]; + break; + } + case "Game_Chara_Motion_GoGoStart_Clear": { + TJAPlayer3.Skin.Characters_Motion_GoGoStart_Clear[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_GoGoStart_Max": { + TJAPlayer3.Skin.Characters_Motion_GoGoStartMax[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_GoGo": { + TJAPlayer3.Skin.Characters_Motion_GoGo[i] = CConversion.StringToIntArray(strParam); + TJAPlayer3.Skin.Characters_Motion_GoGoMax[i] = TJAPlayer3.Skin.Characters_Motion_GoGo[i]; + break; + } + case "Game_Chara_Motion_GoGo_Max": { + TJAPlayer3.Skin.Characters_Motion_GoGoMax[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_SoulIn": { + TJAPlayer3.Skin.Characters_Motion_SoulIn[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_SoulOut": { + TJAPlayer3.Skin.Characters_Motion_SoulOut[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_ClearOut": { + TJAPlayer3.Skin.Characters_Motion_ClearOut[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_Return": { + TJAPlayer3.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; @@ -2265,184 +2134,149 @@ namespace TJAPlayer3 TJAPlayer3.Skin.Characters_Motion_Tower_Clear_Tired[i] = CConversion.StringToIntArray(strParam); break; }*/ - case "Game_Chara_Beat_Normal": - { - TJAPlayer3.Skin.Characters_Beat_Normal[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_10Combo": - { - TJAPlayer3.Skin.Characters_Beat_10Combo[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_10ComboMax": - { - TJAPlayer3.Skin.Characters_Beat_10ComboMax[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_Miss": - { - TJAPlayer3.Skin.Characters_Beat_Miss[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_MissDown": - { - TJAPlayer3.Skin.Characters_Beat_MissDown[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_ClearIn": - { - TJAPlayer3.Skin.Characters_Beat_ClearIn[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_Clear": - { - TJAPlayer3.Skin.Characters_Beat_Clear[i] = float.Parse(strParam); - TJAPlayer3.Skin.Characters_Beat_ClearMax[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_ClearMax": - { - TJAPlayer3.Skin.Characters_Beat_ClearMax[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_MissIn": - { - TJAPlayer3.Skin.Characters_Beat_MissIn[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_MissDownIn": - { - TJAPlayer3.Skin.Characters_Beat_MissDownIn[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_GoGoStart": - { - TJAPlayer3.Skin.Characters_Beat_GoGoStart[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_GoGoStartClear": - { - TJAPlayer3.Skin.Characters_Beat_GoGoStart_Clear[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_GoGoStartMax": - { - TJAPlayer3.Skin.Characters_Beat_GoGoStartMax[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_GoGo": - { - TJAPlayer3.Skin.Characters_Beat_GoGo[i] = float.Parse(strParam); - TJAPlayer3.Skin.Characters_Beat_GoGoMax[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_GoGoMax": - { - TJAPlayer3.Skin.Characters_Beat_GoGoMax[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_SoulIn": - { - TJAPlayer3.Skin.Characters_Beat_SoulIn[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_Return": - { - TJAPlayer3.Skin.Characters_Beat_Return[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_Tower_Standing": - { - TJAPlayer3.Skin.Characters_Beat_Tower_Standing[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_Tower_Standing_Tired": - { - TJAPlayer3.Skin.Characters_Beat_Tower_Standing_Tired[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_Tower_Fail": - { - TJAPlayer3.Skin.Characters_Beat_Tower_Fail[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_Tower_Clear": - { - TJAPlayer3.Skin.Characters_Beat_Tower_Clear[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_Tower_Clear_Tired": - { - TJAPlayer3.Skin.Characters_Beat_Tower_Clear_Tired[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Tower_Clear_IsLooping": - { - TJAPlayer3.Skin.Characters_Tower_Clear_IsLooping[i] = int.Parse(strParam) != 0; - break; - } - case "Game_Chara_Tower_Clear_Tired_IsLooping": - { - TJAPlayer3.Skin.Characters_Tower_Clear_Tired_IsLooping[i] = int.Parse(strParam) != 0; - break; - } - case "Game_Chara_Tower_Fail_IsLooping": - { - TJAPlayer3.Skin.Characters_Tower_Fail_IsLooping[i] = int.Parse(strParam) != 0; - break; - } - case "Chara_Entry_AnimationDuration": - { - TJAPlayer3.Skin.Characters_Title_Entry_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Normal_AnimationDuration": - { - TJAPlayer3.Skin.Characters_Title_Normal_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Menu_Loop_AnimationDuration": - { - TJAPlayer3.Skin.Characters_Menu_Loop_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Menu_Select_AnimationDuration": - { - TJAPlayer3.Skin.Characters_Menu_Select_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Menu_Start_AnimationDuration": - { - TJAPlayer3.Skin.Characters_Menu_Start_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Menu_Wait_AnimationDuration": - { - TJAPlayer3.Skin.Characters_Menu_Wait_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Result_Normal_AnimationDuration": - { - TJAPlayer3.Skin.Characters_Result_Normal_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Result_Clear_AnimationDuration": - { - TJAPlayer3.Skin.Characters_Result_Clear_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Result_Failed_In_AnimationDuration": - { - TJAPlayer3.Skin.Characters_Result_Failed_In_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Result_Failed_AnimationDuration": - { - TJAPlayer3.Skin.Characters_Result_Failed_AnimationDuration[i] = int.Parse(strParam); - break; - } - /* + case "Game_Chara_Beat_Normal": { + TJAPlayer3.Skin.Characters_Beat_Normal[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_10Combo": { + TJAPlayer3.Skin.Characters_Beat_10Combo[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_10ComboMax": { + TJAPlayer3.Skin.Characters_Beat_10ComboMax[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_Miss": { + TJAPlayer3.Skin.Characters_Beat_Miss[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_MissDown": { + TJAPlayer3.Skin.Characters_Beat_MissDown[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_ClearIn": { + TJAPlayer3.Skin.Characters_Beat_ClearIn[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_Clear": { + TJAPlayer3.Skin.Characters_Beat_Clear[i] = float.Parse(strParam); + TJAPlayer3.Skin.Characters_Beat_ClearMax[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_ClearMax": { + TJAPlayer3.Skin.Characters_Beat_ClearMax[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_MissIn": { + TJAPlayer3.Skin.Characters_Beat_MissIn[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_MissDownIn": { + TJAPlayer3.Skin.Characters_Beat_MissDownIn[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_GoGoStart": { + TJAPlayer3.Skin.Characters_Beat_GoGoStart[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_GoGoStartClear": { + TJAPlayer3.Skin.Characters_Beat_GoGoStart_Clear[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_GoGoStartMax": { + TJAPlayer3.Skin.Characters_Beat_GoGoStartMax[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_GoGo": { + TJAPlayer3.Skin.Characters_Beat_GoGo[i] = float.Parse(strParam); + TJAPlayer3.Skin.Characters_Beat_GoGoMax[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_GoGoMax": { + TJAPlayer3.Skin.Characters_Beat_GoGoMax[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_SoulIn": { + TJAPlayer3.Skin.Characters_Beat_SoulIn[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_Return": { + TJAPlayer3.Skin.Characters_Beat_Return[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_Tower_Standing": { + TJAPlayer3.Skin.Characters_Beat_Tower_Standing[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_Tower_Standing_Tired": { + TJAPlayer3.Skin.Characters_Beat_Tower_Standing_Tired[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_Tower_Fail": { + TJAPlayer3.Skin.Characters_Beat_Tower_Fail[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_Tower_Clear": { + TJAPlayer3.Skin.Characters_Beat_Tower_Clear[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_Tower_Clear_Tired": { + TJAPlayer3.Skin.Characters_Beat_Tower_Clear_Tired[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Tower_Clear_IsLooping": { + TJAPlayer3.Skin.Characters_Tower_Clear_IsLooping[i] = int.Parse(strParam) != 0; + break; + } + case "Game_Chara_Tower_Clear_Tired_IsLooping": { + TJAPlayer3.Skin.Characters_Tower_Clear_Tired_IsLooping[i] = int.Parse(strParam) != 0; + break; + } + case "Game_Chara_Tower_Fail_IsLooping": { + TJAPlayer3.Skin.Characters_Tower_Fail_IsLooping[i] = int.Parse(strParam) != 0; + break; + } + case "Chara_Entry_AnimationDuration": { + TJAPlayer3.Skin.Characters_Title_Entry_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Normal_AnimationDuration": { + TJAPlayer3.Skin.Characters_Title_Normal_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Menu_Loop_AnimationDuration": { + TJAPlayer3.Skin.Characters_Menu_Loop_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Menu_Select_AnimationDuration": { + TJAPlayer3.Skin.Characters_Menu_Select_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Menu_Start_AnimationDuration": { + TJAPlayer3.Skin.Characters_Menu_Start_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Menu_Wait_AnimationDuration": { + TJAPlayer3.Skin.Characters_Menu_Wait_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Result_Normal_AnimationDuration": { + TJAPlayer3.Skin.Characters_Result_Normal_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Result_Clear_AnimationDuration": { + TJAPlayer3.Skin.Characters_Result_Clear_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Result_Failed_In_AnimationDuration": { + TJAPlayer3.Skin.Characters_Result_Failed_In_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Result_Failed_AnimationDuration": { + TJAPlayer3.Skin.Characters_Result_Failed_AnimationDuration[i] = int.Parse(strParam); + break; + } + /* case "Chara_Result_SpeechText": { string[] strSplit = strParam.Split(','); @@ -2453,699 +2287,694 @@ namespace TJAPlayer3 break; } */ - default: { break; } - } - } - continue; - } - catch (Exception exception) - { - Trace.TraceError(exception.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (6a32cc37-1527-412e-968a-512c1f0135cd)"); - continue; - } - } - } + default: { break; } + } + } + continue; + } catch (Exception exception) { + Trace.TraceError(exception.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (6a32cc37-1527-412e-968a-512c1f0135cd)"); + continue; + } + } + } - #endregion + #endregion - #endregion - } + #endregion + } - #region [Voice samples] + #region [Voice samples] - var _skin = TJAPlayer3.Skin; + var _skin = TJAPlayer3.Skin; - #region [Dispose previously allocated sound effects] + #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(); + _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 + #endregion - #region [Allocate and load the new samples] + #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"); + _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 - #endregion - } + #endregion + } + + public void DisposeTexture() { + foreach (var tex in listTexture) { + var texture = tex; + TJAPlayer3.tテクスチャの解放(ref texture); + texture?.Dispose(); + texture = null; + } + listTexture.Clear(); - public void DisposeTexture() - { - foreach (var tex in listTexture) - { - var texture = tex; - TJAPlayer3.tテクスチャの解放(ref texture); - texture?.Dispose(); - texture = null; - } - listTexture.Clear(); - //if (TJAPlayer3.ConfigIni.PreAssetsLoading) { - foreach(var act in TJAPlayer3.app.listトップレベルActivities) - { + foreach (var act in TJAPlayer3.app.listトップレベルActivities) { act.ReleaseManagedResource(); act.ReleaseUnmanagedResource(); } } - } - #region Calibration + } + #region Calibration - public CTexture CalibrateFG, - CalibrateBG; + public CTexture CalibrateFG, + CalibrateBG; - #endregion + #endregion - #region 共通 - public CTexture Tile_Black, - Menu_Title, - Menu_Highlight, - Enum_Song, - Loading, - Scanning_Loudness, - NamePlateBase, - NamePlate_Extension, - Overlay, - Readme, - Network_Connection; - public CTexture[] NamePlate; + #region 共通 + public CTexture Tile_Black, + Menu_Title, + Menu_Highlight, + Enum_Song, + Loading, + Scanning_Loudness, + NamePlateBase, + NamePlate_Extension, + Overlay, + Readme, + Network_Connection; + public CTexture[] NamePlate; - public CTexture[] NamePlate_Effect = new CTexture[5]; + public CTexture[] NamePlate_Effect = new CTexture[5]; - public CTexture[][] NamePlate_Title; - public CTexture[] NamePlate_Title_Big; - public CTexture[] NamePlate_Title_Small; + public CTexture[][] NamePlate_Title; + public CTexture[] NamePlate_Title_Big; + public CTexture[] NamePlate_Title_Small; - #endregion + #endregion - #region 1_タイトル画面 + #region 1_タイトル画面 - public CTexture - //Title_Background, - Entry_Bar, - Entry_Bar_Text; + 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; + 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 + #endregion - #region 2_コンフィグ画面 - public CTexture - /*Config_Background, + #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 + Config_Cursor, + Config_ItemBox, + Config_Arrow, + Config_KeyAssign, + Config_Font, + Config_Font_Bold, + Config_Enum_Song; + #endregion - #region 3_選曲画面 + #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, + 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_Favorite, + SongSelect_High_Score, - SongSelect_Level_Icons, - SongSelect_Search_Arrow, - SongSelect_Search_Arrow_Glow, - SongSelect_Search_Window, + 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]; + 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; + #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[] 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; + 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 + #endregion - #region 3_段位選択画面 + #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 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[] Challenge_Select = new CTexture[3]; - //public CTexture Dani_Dan_In; - //public CTexture Dani_Dan_Text; + //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]; + 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 + #endregion - #region 4_読み込み画面 - public CTexture SongLoading_Plate, - SongLoading_Bg, - SongLoading_BgWait, - SongLoading_Chara, - SongLoading_Bg_Dan, - SongLoading_Fade, + #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 + 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 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_Flash, - 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; + #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_Flash, + 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 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[] 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 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 + public CPuchichara[] Puchichara; - #region [20_Tower] + #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 - public CTexture Tower_Sky_Gradient, - Tower_Miss; + #region [20_Tower] - public CTexture[] Tower_Top; + public CTexture Tower_Sky_Gradient, + Tower_Miss; - public CTexture[][] Tower_Base, - Tower_Deco, - Tower_Don_Running, - Tower_Don_Standing, - Tower_Don_Climbing, - Tower_Don_Jump; + public CTexture[] Tower_Top; + + public CTexture[][] Tower_Base, + Tower_Deco, + Tower_Don_Running, + Tower_Don_Standing, + Tower_Don_Climbing, + Tower_Don_Jump; - #endregion + #endregion - #region [21_ModIcons] + #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; + 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 + #endregion - #region [22_AIBattle] + #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_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]; + public CTexture[] AIBattle_Judge_Meter = new CTexture[2]; - #endregion + #endregion - #endregion + #endregion - #region 6_結果発表 - public CTexture Result_FadeIn, - Result_Header, - Result_Number, - Result_Panel, - Result_Panel_2P, - Result_Soul_Text, - Result_Soul_Fire, - Result_Diff_Bar, - Result_Score_Number, + #region 6_結果発表 + public CTexture Result_FadeIn, + 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_CrownEffect, + Result_ScoreRankEffect, - //Result_Cloud, - Result_Flower, - Result_Shine, - Result_Gauge_Frame, - Result_Gauge_Clear, - Result_Gauge_Clear_Base, - Result_Gauge_Killzone, + //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_Dan; - Result_Flower_Rotate = new CTexture[5], - //Result_Work = new CTexture[3], + 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_Gauge = new CTexture[5], - Result_Gauge_Base = new CTexture[5], - Result_Speech_Bubble = new CTexture[2], - Result_Speech_Bubble_V2 = 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 + #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_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_終了画面 + //public CTexture Exit_Background/* , */ + /*Exit_Text; */ + #endregion - #region [7_DanResults] + #region [7_DanResults] - public CTexture - //DanResult_Background, - DanResult_Rank, - DanResult_SongPanel_Base, - DanResult_StatePanel_Base, - DanResult_SongPanel_Main, - DanResult_StatePanel_Main; + public CTexture + //DanResult_Background, + DanResult_Rank, + DanResult_SongPanel_Base, + DanResult_StatePanel_Base, + DanResult_SongPanel_Main, + DanResult_StatePanel_Main; - #endregion + #endregion - #region [8_TowerResults] + #region [8_TowerResults] - public CTexture TowerResult_Background, - TowerResult_ScoreRankEffect, - TowerResult_Panel; - public CTexture[] - TowerResult_Tower; + public CTexture TowerResult_Background, + TowerResult_ScoreRankEffect, + TowerResult_Panel; + public CTexture[] + TowerResult_Tower; - #endregion + #endregion - #region [10_Heya] + #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; + 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 + #endregion - #region [11_Characters] + #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; + 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 + #endregion - #region [11_Modals] + #region [11_Modals] - public CTexture[] Modal_Full, - Modal_Half, - Modal_Half_4P, - Modal_Half_5P; + public CTexture[] Modal_Full, + Modal_Half, + Modal_Half_4P, + Modal_Half_5P; - #endregion + #endregion - #region [12_OnlineLounge] + #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; + 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 + #endregion - #region [13_TowerSelect] + #region [13_TowerSelect] - public CTexture - TowerSelect_Tower; + public CTexture + TowerSelect_Tower; - #endregion + #endregion - #region [15_OpenEncyclopedia] + #region [15_OpenEncyclopedia] - public CTexture - //OpenEncyclopedia_Background, - OpenEncyclopedia_Context, - OpenEncyclopedia_Return_Box, - OpenEncyclopedia_Side_Menu; + public CTexture + //OpenEncyclopedia_Background, + OpenEncyclopedia_Context, + OpenEncyclopedia_Return_Box, + OpenEncyclopedia_Side_Menu; - #endregion + #endregion - #region [ 解放用 ] - public List listTexture = new List(); - #endregion + #region [ 解放用 ] + public List listTexture = new List(); + #endregion - } -} \ No newline at end of file + } +} diff --git a/OpenTaiko/src/Stages/02.Title/CActEnumSongs.cs b/OpenTaiko/src/Stages/02.Title/CActEnumSongs.cs index 642cb3d8..06086562 100644 --- a/OpenTaiko/src/Stages/02.Title/CActEnumSongs.cs +++ b/OpenTaiko/src/Stages/02.Title/CActEnumSongs.cs @@ -1,70 +1,51 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; -using System.Runtime.InteropServices; -using System.IO; +using System.Diagnostics; using System.Drawing; -using System.Threading; using System.Globalization; -using System.Runtime.Serialization.Formatters.Binary; +using FDK; using Silk.NET.Maths; using SkiaSharp; -using FDK; -using SampleFramework; -namespace TJAPlayer3 -{ - internal class CActEnumSongs : CActivity - { +namespace TJAPlayer3 { + internal class CActEnumSongs : CActivity { public bool bコマンドでの曲データ取得; /// /// Constructor /// - public CActEnumSongs() - { - Init( false ); + public CActEnumSongs() { + Init(false); } - public CActEnumSongs( bool _bコマンドでの曲データ取得 ) - { - Init( _bコマンドでの曲データ取得 ); + public CActEnumSongs(bool _bコマンドでの曲データ取得) { + Init(_bコマンドでの曲データ取得); } - private void Init( bool _bコマンドでの曲データ取得 ) - { + private void Init(bool _bコマンドでの曲データ取得) { base.IsDeActivated = true; bコマンドでの曲データ取得 = _bコマンドでの曲データ取得; } // CActivity 実装 - public override void Activate() - { - if ( this.IsActivated ) + 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, TJAPlayer3.Timer ); - } - finally - { + try { + this.ctNowEnumeratingSongs = new CCounter(); // 0, 1000, 17, CDTXMania.Timer ); + this.ctNowEnumeratingSongs.Start(0, 100, 17, TJAPlayer3.Timer); + } finally { } } - public override void DeActivate() - { - if ( this.IsDeActivated ) + public override void DeActivate() { + if (this.IsDeActivated) return; - + base.DeActivate(); this.ctNowEnumeratingSongs = null; } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { //string pathNowEnumeratingSongs = CSkin.Path( @"Graphics\ScreenTitle NowEnumeratingSongs.png" ); //if ( File.Exists( pathNowEnumeratingSongs ) ) //{ @@ -84,62 +65,51 @@ namespace TJAPlayer3 // this.txDialogNowEnumeratingSongs = null; //} - try - { - CCachedFontRenderer ftMessage = new CCachedFontRenderer(CFontRenderer.DefaultFontName, 40, CCachedFontRenderer.FontStyle.Bold ); - string[] strMessage = + 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 ); + 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(); - TJAPlayer3.tDisposeSafely( ref ftMessage ); - } - else - { + TJAPlayer3.tDisposeSafely(ref ftMessage); + } else { this.txMessage = null; } - } - catch ( CTextureCreateFailedException e ) - { - Trace.TraceError( "テクスチャの生成に失敗しました。(txMessage)" ); - Trace.TraceError( e.ToString() ); - Trace.TraceError( "例外が発生しましたが処理を継続します。 (761b726d-d27c-470d-be0b-a702971601b5)" ); + } catch (CTextureCreateFailedException e) { + Trace.TraceError("テクスチャの生成に失敗しました。(txMessage)"); + Trace.TraceError(e.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (761b726d-d27c-470d-be0b-a702971601b5)"); this.txMessage = null; } - + base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { //CDTXMania.t安全にDisposeする( ref this.txDialogNowEnumeratingSongs ); //CDTXMania.t安全にDisposeする( ref this.txNowEnumeratingSongs ); - TJAPlayer3.tDisposeSafely( ref this.txMessage ); + TJAPlayer3.tDisposeSafely(ref this.txMessage); base.ReleaseManagedResource(); } - public override int Draw() - { - if ( this.IsDeActivated ) - { + public override int Draw() { + if (this.IsDeActivated) { return 0; } this.ctNowEnumeratingSongs.TickLoop(); - if ( TJAPlayer3.Tx.Enum_Song != null ) - { - TJAPlayer3.Tx.Enum_Song.Opacity = (int) ( 176.0 + 80.0 * Math.Sin( (double) (2 * Math.PI * this.ctNowEnumeratingSongs.CurrentValue * 2 / 100.0 ) ) ); - TJAPlayer3.Tx.Enum_Song.t2D描画( 18, 7 ); + if (TJAPlayer3.Tx.Enum_Song != null) { + TJAPlayer3.Tx.Enum_Song.Opacity = (int)(176.0 + 80.0 * Math.Sin((double)(2 * Math.PI * this.ctNowEnumeratingSongs.CurrentValue * 2 / 100.0))); + TJAPlayer3.Tx.Enum_Song.t2D描画(18, 7); } - if ( bコマンドでの曲データ取得 && TJAPlayer3.Tx.Config_Enum_Song != null ) - { - TJAPlayer3.Tx.Config_Enum_Song.t2D描画( 180, 177 ); - this.txMessage.t2D描画( 190, 197 ); + if (bコマンドでの曲データ取得 && TJAPlayer3.Tx.Config_Enum_Song != null) { + TJAPlayer3.Tx.Config_Enum_Song.t2D描画(180, 177); + this.txMessage.t2D描画(190, 197); } return 0; diff --git a/OpenTaiko/src/Stages/02.Title/CActScanningLoudness.cs b/OpenTaiko/src/Stages/02.Title/CActScanningLoudness.cs index f1254aba..bb746a36 100644 --- a/OpenTaiko/src/Stages/02.Title/CActScanningLoudness.cs +++ b/OpenTaiko/src/Stages/02.Title/CActScanningLoudness.cs @@ -1,49 +1,38 @@ -using System; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - internal class CActScanningLoudness : CActivity - { - public bool bIsActivelyScanning; +namespace TJAPlayer3 { + internal class CActScanningLoudness : CActivity { + public bool bIsActivelyScanning; // CActivity 実装 - public override void Activate() - { - if ( this.IsActivated ) + public override void Activate() { + if (this.IsActivated) return; base.Activate(); - try - { + try { this.ctNowScanningLoudness = new CCounter(); - this.ctNowScanningLoudness.Start( 0, 200, 29, TJAPlayer3.Timer ); - } - finally - { + this.ctNowScanningLoudness.Start(0, 200, 29, TJAPlayer3.Timer); + } finally { } } - public override void DeActivate() - { - if ( this.IsDeActivated ) + public override void DeActivate() { + if (this.IsDeActivated) return; base.DeActivate(); this.ctNowScanningLoudness = null; } - public override int Draw() - { - if ( this.IsDeActivated ) - { + public override int Draw() { + if (this.IsDeActivated) { return 0; } this.ctNowScanningLoudness.TickLoop(); - if ( bIsActivelyScanning && TJAPlayer3.Tx.Scanning_Loudness != null ) - { - TJAPlayer3.Tx.Scanning_Loudness.Opacity = (int) ( 176.0 + 80.0 * Math.Sin( (double) (2 * Math.PI * this.ctNowScanningLoudness.CurrentValue / 100.0 ) ) ); - TJAPlayer3.Tx.Scanning_Loudness.t2D描画( 18 + 89 + 18, 7 ); // 2018-09-03 twopointzero: display right of Enum_Song, using its width and margin + if (bIsActivelyScanning && TJAPlayer3.Tx.Scanning_Loudness != null) { + TJAPlayer3.Tx.Scanning_Loudness.Opacity = (int)(176.0 + 80.0 * Math.Sin((double)(2 * Math.PI * this.ctNowScanningLoudness.CurrentValue / 100.0))); + TJAPlayer3.Tx.Scanning_Loudness.t2D描画(18 + 89 + 18, 7); // 2018-09-03 twopointzero: display right of Enum_Song, using its width and margin } return 0; diff --git a/OpenTaiko/src/Stages/02.Title/CEnumSongs.cs b/OpenTaiko/src/Stages/02.Title/CEnumSongs.cs index 108b311b..956555d8 100644 --- a/OpenTaiko/src/Stages/02.Title/CEnumSongs.cs +++ b/OpenTaiko/src/Stages/02.Title/CEnumSongs.cs @@ -1,95 +1,74 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; -using System.Runtime.InteropServices; -using System.IO; -using System.Threading; +using System.Diagnostics; using System.Runtime.Serialization.Formatters.Binary; -using System.Text.Json; -namespace TJAPlayer3 -{ - internal class CEnumSongs // #27060 2011.2.7 yyagi 曲リストを取得するクラス - { // ファイルキャッシュ(songslist.db)からの取得と、ディスクからの取得を、この一つのクラスに集約。 +namespace TJAPlayer3 { + internal class CEnumSongs // #27060 2011.2.7 yyagi 曲リストを取得するクラス + { // ファイルキャッシュ(songslist.db)からの取得と、ディスクからの取得を、この一つのクラスに集約。 - public CSongs管理 Songs管理 // 曲の探索結果はこのSongs管理に読み込まれる + public CSongs管理 Songs管理 // 曲の探索結果はこのSongs管理に読み込まれる { get; private set; } - public bool IsSongListEnumCompletelyDone // 曲リスト探索と、実際の曲リストへの反映が完了した? + public bool IsSongListEnumCompletelyDone // 曲リスト探索と、実際の曲リストへの反映が完了した? { - get - { - return ( this.state == DTXEnumState.CompletelyDone ); + get { + return (this.state == DTXEnumState.CompletelyDone); } } - public bool IsEnumerating - { - get - { - if ( thDTXFileEnumerate == null ) - { + public bool IsEnumerating { + get { + if (thDTXFileEnumerate == null) { return false; } return thDTXFileEnumerate.IsAlive; } } - public bool IsSongListEnumerated // 曲リスト探索が完了したが、実際の曲リストへの反映はまだ? + public bool IsSongListEnumerated // 曲リスト探索が完了したが、実際の曲リストへの反映はまだ? { - get - { - return ( this.state == DTXEnumState.Enumeratad ); + get { + return (this.state == DTXEnumState.Enumeratad); } } - public bool IsSongListEnumStarted // 曲リスト探索開始後?(探索完了も含む) + public bool IsSongListEnumStarted // 曲リスト探索開始後?(探索完了も含む) { - get - { - return ( this.state != DTXEnumState.None ); + get { + return (this.state != DTXEnumState.None); } } - public void SongListEnumCompletelyDone() - { + public void SongListEnumCompletelyDone() { this.state = DTXEnumState.CompletelyDone; - this.Songs管理 = null; // GCはOSに任せる + this.Songs管理 = null; // GCはOSに任せる } - public bool IsSlowdown // #PREMOVIE再生中は検索負荷を落とす + public bool IsSlowdown // #PREMOVIE再生中は検索負荷を落とす { - get - { + get { return this.Songs管理.bIsSlowdown; } - set - { + set { this.Songs管理.bIsSlowdown = value; } } - public void ChangeEnumeratePriority( ThreadPriority tp ) - { - if ( this.thDTXFileEnumerate != null && this.thDTXFileEnumerate.IsAlive == true ) - { + public void ChangeEnumeratePriority(ThreadPriority tp) { + if (this.thDTXFileEnumerate != null && this.thDTXFileEnumerate.IsAlive == true) { this.thDTXFileEnumerate.Priority = tp; } } private readonly string strPathSongsDB = TJAPlayer3.strEXEのあるフォルダ + "songs.db"; private readonly string strPathSongList = TJAPlayer3.strEXEのあるフォルダ + "songlist.db"; - public Thread thDTXFileEnumerate - { + public Thread thDTXFileEnumerate { get; private set; } - private enum DTXEnumState - { + private enum DTXEnumState { None, Ongoing, Suspended, - Enumeratad, // 探索完了、現在の曲リストに未反映 - CompletelyDone // 探索完了、現在の曲リストに反映完了 + Enumeratad, // 探索完了、現在の曲リストに未反映 + CompletelyDone // 探索完了、現在の曲リストに反映完了 } private DTXEnumState state = DTXEnumState.None; @@ -97,22 +76,19 @@ namespace TJAPlayer3 /// /// Constractor /// - public CEnumSongs() - { + public CEnumSongs() { this.Songs管理 = new CSongs管理(); } - public void Init() - { + public void Init() { } /// /// 曲リストのキャッシュ(songlist.db)取得スレッドの開始 /// - public void StartEnumFromCache() - { - this.thDTXFileEnumerate = new Thread( new ThreadStart( this.t曲リストの構築1 ) ); + public void StartEnumFromCache() { + this.thDTXFileEnumerate = new Thread(new ThreadStart(this.t曲リストの構築1)); this.thDTXFileEnumerate.Name = "曲リストの構築"; this.thDTXFileEnumerate.IsBackground = true; this.thDTXFileEnumerate.Start(); @@ -126,25 +102,22 @@ namespace TJAPlayer3 /// /// 曲検索スレッドの開始 /// - public void StartEnumFromDisk(bool hard_reload = false) - { - if ( state == DTXEnumState.None || state == DTXEnumState.CompletelyDone ) - { - Trace.TraceInformation( "★曲データ検索スレッドを起動しました。" ); - lock ( this ) - { + 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画面から再スキャンしたときにこうなる + if (this.Songs管理 == null) // Enumerating Songs完了後、CONFIG画面から再スキャンしたときにこうなる { this.Songs管理 = new CSongs管理(); } if (hard_reload) - this.thDTXFileEnumerate = new Thread( new ThreadStart( this.HardReloadSongList ) ); + this.thDTXFileEnumerate = new Thread(new ThreadStart(this.HardReloadSongList)); else - this.thDTXFileEnumerate = new Thread( new ThreadStart( this.ReloadSongList ) ); + this.thDTXFileEnumerate = new Thread(new ThreadStart(this.ReloadSongList)); this.thDTXFileEnumerate.Name = "曲リストの構築"; this.thDTXFileEnumerate.IsBackground = true; this.thDTXFileEnumerate.Priority = System.Threading.ThreadPriority.Lowest; @@ -152,44 +125,38 @@ namespace TJAPlayer3 } } - private void HardReloadSongList() - { + private void HardReloadSongList() { this.t曲リストの構築2(true); } - private void ReloadSongList() - { + private void ReloadSongList() { this.t曲リストの構築2(false); } /// /// 曲探索スレッドのサスペンド /// - public void Suspend() - { - if ( this.state != DTXEnumState.CompletelyDone && - ( ( thDTXFileEnumerate.ThreadState & ( System.Threading.ThreadState.Background ) ) != 0 ) ) - { + 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( "★曲データ検索スレッドを中断しました。" ); + Trace.TraceInformation("★曲データ検索スレッドを中断しました。"); } } /// /// 曲探索スレッドのレジューム /// - public void Resume() - { - if ( this.state == DTXEnumState.Suspended ) - { - if ( ( this.thDTXFileEnumerate.ThreadState & ( System.Threading.ThreadState.WaitSleepJoin | System.Threading.ThreadState.StopRequested ) ) != 0 ) // + 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( "★曲データ検索スレッドを再開しました。" ); + Trace.TraceInformation("★曲データ検索スレッドを再開しました。"); } } } @@ -198,18 +165,15 @@ namespace TJAPlayer3 /// 曲探索スレッドにサスペンド指示を出してから、本当にサスペンド状態に遷移するまでの間、ブロックする /// 500ms * 10回=5秒でタイムアウトし、サスペンド完了して無くてもブロック解除する /// - public void WaitUntilSuspended() - { + 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 ) - { + 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 ); + Trace.TraceInformation("★曲データ検索スレッドの中断待ちです: {0}", this.thDTXFileEnumerate.ThreadState.ToString()); + Thread.Sleep(500); } } @@ -217,15 +181,13 @@ namespace TJAPlayer3 /// /// 曲探索スレッドを強制終了する /// - public void Abort() - { - if ( thDTXFileEnumerate != null ) - { + public void Abort() { + if (thDTXFileEnumerate != null) { thDTXFileEnumerate.Abort(); thDTXFileEnumerate = null; this.state = DTXEnumState.None; - this.Songs管理 = null; // Songs管理を再初期化する (途中まで作った曲リストの最後に、一から重複して追記することにならないようにする。) + this.Songs管理 = null; // Songs管理を再初期化する (途中まで作った曲リストの最後に、一から重複して追記することにならないようにする。) this.Songs管理 = new CSongs管理(); } } @@ -235,78 +197,62 @@ namespace TJAPlayer3 /// /// songlist.dbからの曲リスト構築 /// - public void t曲リストの構築1() - { + public void t曲リストの構築1() { // !注意! // 本メソッドは別スレッドで動作するが、プラグイン側でカレントディレクトリを変更しても大丈夫なように、 // すべてのファイルアクセスは「絶対パス」で行うこと。(2010.9.16) // 構築が完了したら、DTXEnumerateState state を DTXEnumerateState.Done にすること。(2012.2.9) DateTime now = DateTime.Now; - try - { + try { #region [ 0) システムサウンドの構築 ] //----------------------------- TJAPlayer3.stage起動.ePhaseID = CStage.EPhase.Startup_0_CreateSystemSound; - Trace.TraceInformation( "0) システムサウンドを構築します。" ); + Trace.TraceInformation("0) システムサウンドを構築します。"); Trace.Indent(); - try - { + try { TJAPlayer3.Skin.bgm起動画面.tPlay(); - for ( int i = 0; i < TJAPlayer3.Skin.nシステムサウンド数; i++ ) - { - if ( !TJAPlayer3.Skin[ i ].bExclusive ) // BGM系以外のみ読み込む。(BGM系は必要になったときに読み込む) + for (int i = 0; i < TJAPlayer3.Skin.nシステムサウンド数; i++) { + if (!TJAPlayer3.Skin[i].bExclusive) // BGM系以外のみ読み込む。(BGM系は必要になったときに読み込む) { - CSkin.CSystemSound cシステムサウンド = TJAPlayer3.Skin[ i ]; - if ( !TJAPlayer3.bコンパクトモード || cシステムサウンド.bCompact対象 ) - { - try - { + CSkin.CSystemSound cシステムサウンド = TJAPlayer3.Skin[i]; + if (!TJAPlayer3.bコンパクトモード || cシステムサウンド.bCompact対象) { + try { cシステムサウンド.tLoading(); - Trace.TraceInformation( "システムサウンドを読み込みました。({0})", cシステムサウンド.strFileName ); + 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 ); + } catch (FileNotFoundException) { + Trace.TraceWarning("システムサウンドが存在しません。({0})", cシステムサウンド.strFileName); + } catch (Exception e) { + Trace.TraceWarning(e.ToString()); + Trace.TraceWarning("システムサウンドの読み込みに失敗しました。({0})", cシステムサウンド.strFileName); } } } } - lock ( TJAPlayer3.stage起動.list進行文字列 ) - { - TJAPlayer3.stage起動.list進行文字列.Add( "SYSTEM SOUND...OK" ); + lock (TJAPlayer3.stage起動.list進行文字列) { + TJAPlayer3.stage起動.list進行文字列.Add("SYSTEM SOUND...OK"); } - } - finally - { + } finally { Trace.Unindent(); } //----------------------------- #endregion - if ( TJAPlayer3.bコンパクトモード ) - { - Trace.TraceInformation( "コンパクトモードなので残りの起動処理は省略します。" ); + if (TJAPlayer3.bコンパクトモード) { + Trace.TraceInformation("コンパクトモードなので残りの起動処理は省略します。"); return; } - } - finally - { + } finally { TJAPlayer3.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. + 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; } @@ -318,8 +264,7 @@ namespace TJAPlayer3 /// 起動してタイトル画面に遷移した後にバックグラウンドで発生させる曲検索 /// #27060 2012.2.6 yyagi /// - private void t曲リストの構築2(bool hard_reload = false) - { + private void t曲リストの構築2(bool hard_reload = false) { // !注意! // 本メソッドは別スレッドで動作するが、プラグイン側でカレントディレクトリを変更しても大丈夫なように、 // すべてのファイルアクセスは「絶対パス」で行うこと。(2010.9.16) @@ -327,10 +272,8 @@ namespace TJAPlayer3 DateTime now = DateTime.Now; - try - { - if (hard_reload) - { + try { + if (hard_reload) { if (File.Exists($"{TJAPlayer3.strEXEのあるフォルダ}songlist.db")) File.Delete($"{TJAPlayer3.strEXEのあるフォルダ}songlist.db"); } @@ -340,56 +283,41 @@ namespace TJAPlayer3 //----------------------------- // base.eフェーズID = CStage.Eフェーズ.起動2_曲を検索してリストを作成する; - Trace.TraceInformation( "enum2) 曲データを検索します。" ); + Trace.TraceInformation("enum2) 曲データを検索します。"); Trace.Indent(); - try - { - if ( !string.IsNullOrEmpty( TJAPlayer3.ConfigIni.strSongsPath ) ) - { + try { + if (!string.IsNullOrEmpty(TJAPlayer3.ConfigIni.strSongsPath)) { CSongDict.tClearSongNodes(); - string[] strArray = TJAPlayer3.ConfigIni.strSongsPath.Split( new char[] { ';' } ); - if ( strArray.Length > 0 ) - { + string[] strArray = TJAPlayer3.ConfigIni.strSongsPath.Split(new char[] { ';' }); + if (strArray.Length > 0) { // 全パスについて… - foreach ( string str in strArray ) - { + foreach (string str in strArray) { string path = str; - if ( !Path.IsPathRooted( path ) ) - { - path = TJAPlayer3.strEXEのあるフォルダ + str; // 相対パスの場合、絶対パスに直す(2010.9.16) + if (!Path.IsPathRooted(path)) { + path = TJAPlayer3.strEXEのあるフォルダ + str; // 相対パスの場合、絶対パスに直す(2010.9.16) } - if ( !string.IsNullOrEmpty( path ) ) - { - Trace.TraceInformation( "検索パス: " + path ); + 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 - { + 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)の指定がありません。"); } - else - { - Trace.TraceWarning( "曲データの検索パス(TJAPath)の指定がありません。" ); - } - } - finally - { - Trace.TraceInformation( "曲データの検索を完了しました。[{0}曲{1}スコア]", this.Songs管理.n検索された曲ノード数, this.Songs管理.n検索されたスコア数 ); + } finally { + Trace.TraceInformation("曲データの検索を完了しました。[{0}曲{1}スコア]", this.Songs管理.n検索された曲ノード数, this.Songs管理.n検索されたスコア数); Trace.Unindent(); } // lock ( this.list進行文字列 ) @@ -434,21 +362,16 @@ namespace TJAPlayer3 //----------------------------- // base.eフェーズID = CStage.Eフェーズ.起動5_曲リストへ後処理を適用する; - Trace.TraceInformation( "enum5) 曲リストへの後処理を適用します。" ); + Trace.TraceInformation("enum5) 曲リストへの後処理を適用します。"); Trace.Indent(); - try - { + try { this.Songs管理.t曲リストへ後処理を適用する(); - } - catch ( Exception e ) - { - Trace.TraceError( e.ToString() ); - Trace.TraceError( "例外が発生しましたが処理を継続します。 (6480ffa0-1cc1-40d4-9cc9-aceeecd0264b)" ); - } - finally - { - Trace.TraceInformation( "曲リストへの後処理を完了しました。" ); + } catch (Exception e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (6480ffa0-1cc1-40d4-9cc9-aceeecd0264b)"); + } finally { + Trace.TraceInformation("曲リストへの後処理を完了しました。"); Trace.Unindent(); } // lock ( this.list進行文字列 ) @@ -460,7 +383,7 @@ namespace TJAPlayer3 // if ( !bSucceededFastBoot ) // songs2.db読み込みに成功したなら、songs2.dbを新たに作らない #region [ 7) songs2.db への保存 ] // #27060 2012.1.26 yyagi - Trace.TraceInformation( "enum7) 曲データの情報を songlist.db へ出力します。" ); + Trace.TraceInformation("enum7) 曲データの情報を songlist.db へ出力します。"); Trace.Indent(); SerializeSongList(); @@ -470,15 +393,12 @@ namespace TJAPlayer3 #endregion // } - } - finally - { + } finally { // base.eフェーズID = CStage.Eフェーズ.起動7_完了; - TimeSpan span = (TimeSpan) ( DateTime.Now - now ); - Trace.TraceInformation( "曲探索所要時間: {0}", span.ToString() ); + TimeSpan span = (TimeSpan)(DateTime.Now - now); + Trace.TraceInformation("曲探索所要時間: {0}", span.ToString()); } - lock ( this ) - { + lock (this) { // state = DTXEnumState.Done; // DoneにするのはCDTXMania.cs側にて。 state = DTXEnumState.Enumeratad; } @@ -489,8 +409,7 @@ namespace TJAPlayer3 /// /// 曲リストのserialize /// - private void SerializeSongList() - { + private void SerializeSongList() { BinaryFormatter songlistdb_ = new BinaryFormatter(); using Stream songlistdb = File.OpenWrite($"{TJAPlayer3.strEXEのあるフォルダ}songlist.db"); songlistdb_.Serialize(songlistdb, Songs管理.listSongsDB); @@ -501,25 +420,18 @@ namespace TJAPlayer3 /// /// /// - public void Deserialize() - { - try - { - if (File.Exists($"{TJAPlayer3.strEXEのあるフォルダ}songlist.db")) - { - BinaryFormatter songlistdb_ = new BinaryFormatter(); - using Stream songlistdb = File.OpenRead($"{TJAPlayer3.strEXEのあるフォルダ}songlist.db"); - this.Songs管理.listSongsDB = (Dictionary)songlistdb_.Deserialize(songlistdb); - } - } - catch(Exception exception) - { - this.Songs管理.listSongsDB = new(); - } - finally - { + public void Deserialize() { + try { + if (File.Exists($"{TJAPlayer3.strEXEのあるフォルダ}songlist.db")) { + BinaryFormatter songlistdb_ = new BinaryFormatter(); + using Stream songlistdb = File.OpenRead($"{TJAPlayer3.strEXEのあるフォルダ}songlist.db"); + this.Songs管理.listSongsDB = (Dictionary)songlistdb_.Deserialize(songlistdb); } + } catch (Exception exception) { + this.Songs管理.listSongsDB = new(); + } finally { + } } - #pragma warning restore SYSLIB0011 +#pragma warning restore SYSLIB0011 } } diff --git a/OpenTaiko/src/Stages/02.Title/CMainMenuTab.cs b/OpenTaiko/src/Stages/02.Title/CMainMenuTab.cs index 7c609707..785c2c63 100644 --- a/OpenTaiko/src/Stages/02.Title/CMainMenuTab.cs +++ b/OpenTaiko/src/Stages/02.Title/CMainMenuTab.cs @@ -1,107 +1,95 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Drawing; -using static TJAPlayer3.CActSelect曲リスト; +using System.Drawing; using FDK; +using static TJAPlayer3.CActSelect曲リスト; -namespace TJAPlayer3 -{ - class CMainMenuTab - { - public static int __MenuCount = 14; // Number of existing menus - public static CMainMenuTab[] __Menus; - public static bool __BoxesProcessed = false; +namespace TJAPlayer3 { + class CMainMenuTab { + public static int __MenuCount = 14; // Number of existing menus + public static CMainMenuTab[] __Menus; + public static bool __BoxesProcessed = false; - public TitleTextureKey ttkTitle; - public TitleTextureKey ttkBoxText; - public bool _1pRestricted; - public bool implemented; - public CTexture barTex; - public CTexture barChara; - public CStageタイトル.E戻り値 rp; + public TitleTextureKey ttkTitle; + public TitleTextureKey ttkBoxText; + public bool _1pRestricted; + public bool implemented; + public CTexture barTex; + public CTexture barChara; + public CStageタイトル.E戻り値 rp; - 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 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); - ttkTitle = new TitleTextureKey(title, tpf, Color.White, col, 1280, Color.Black); + ttkTitle = new TitleTextureKey(title, tpf, Color.White, col, 1280, Color.Black); - string boxText = GetBoxText(boxId, false); + string boxText = GetBoxText(boxId, false); - ttkBoxText = new TitleTextureKey(boxText, boxpf, Color.White, Color.Black, 1000); + ttkBoxText = new TitleTextureKey(boxText, boxpf, Color.White, Color.Black, 1000); - rp = returnPoint; + 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; - } + _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}"); - } - } + 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 + 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]; + if (__BoxesProcessed == false) { + __Menus = new CMainMenuTab[__MenuCount]; - // Removed to avoid having to reload the game when changing language - //__BoxesProcessed = true; + // Removed to avoid having to reload the game when changing language + //__BoxesProcessed = true; - #region [Menu Colors] + #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[] __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 @@ -109,84 +97,83 @@ namespace TJAPlayer3 Color.FromArgb(120, 104, 56), // Toolbox brown }; - #endregion + #endregion - #region [Return points] + #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, - }; + 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 + #endregion - #region [Extra bools] + #region [Extra bools] - bool[] _1PRestricts = - { - false, - true, - true, - false, - true, - false, - false, - false, - false, - false, - false, - false, - true, - false, - }; + 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, - true, - true, - false, - false, - false, - }; + // To edit while new features are implemented + bool[] _implemented = + { + true, + true, + true, + false, + false, + true, + true, + true, + true, + true, + true, + false, + false, + false, + }; - #endregion + #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]; + 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); - - } - } - - } + __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 f45c3060..c699f361 100644 --- a/OpenTaiko/src/Stages/02.Title/CStageタイトル.cs +++ b/OpenTaiko/src/Stages/02.Title/CStageタイトル.cs @@ -1,21 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; -using System.Diagnostics; +using System.Diagnostics; using System.Drawing; -using FDK; using System.Reflection; -using static TJAPlayer3.CActSelect曲リスト; +using FDK; -namespace TJAPlayer3 -{ - internal class CStageタイトル : CStage - { +namespace TJAPlayer3 { + internal class CStageタイトル : CStage { // コンストラクタ - public CStageタイトル() - { + public CStageタイトル() { base.eStageID = CStage.EStage.Title; base.IsDeActivated = true; base.ChildActivities.Add(this.actFIfromSetup = new CActFIFOBlack()); @@ -29,12 +21,10 @@ namespace TJAPlayer3 // CStage 実装 - public override void Activate() - { + public override void Activate() { Trace.TraceInformation("タイトルステージを活性化します。"); Trace.Indent(); - try - { + try { UnloadSaveFile(); this.PuchiChara.IdleAnimation(); @@ -64,8 +54,7 @@ namespace TJAPlayer3 usedMenusCount = usedMenus.Length; usedMenusPos = new int[usedMenusCount]; - for (int i = 0; i < usedMenusCount; i++) - { + for (int i = 0; i < usedMenusCount; i++) { usedMenusPos[i] = i + 1 - n現在の選択行モード選択; } @@ -82,65 +71,50 @@ namespace TJAPlayer3 if (TJAPlayer3.ConfigIni.bBGM音を発声する) TJAPlayer3.Skin.bgmタイトルイン.tPlay(); base.Activate(); - } - finally - { + } finally { Trace.TraceInformation("タイトルステージの活性化を完了しました。"); Trace.Unindent(); } } - public override void DeActivate() - { + public override void DeActivate() { Trace.TraceInformation("タイトルステージを非活性化します。"); Trace.Indent(); - try - { + try { TJAPlayer3.tDisposeSafely(ref Background); - } - finally - { + } finally { Trace.TraceInformation("タイトルステージの非活性化を完了しました。"); Trace.Unindent(); } base.DeActivate(); } - public void tReloadMenus() - { + public void tReloadMenus() { if (this.pfMenuTitle != null && this.pfBoxText != null) CMainMenuTab.tInitMenus(this.pfMenuTitle, this.pfBoxText, TJAPlayer3.Tx.ModeSelect_Bar, TJAPlayer3.Tx.ModeSelect_Bar_Chara); } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { this.pfMenuTitle = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Title_ModeSelect_Title_Scale[0]); this.pfBoxText = HPrivateFastFont.tInstantiateBoxFont(TJAPlayer3.Skin.Title_ModeSelect_Title_Scale[1]); base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { - + public override void ReleaseManagedResource() { + TJAPlayer3.tDisposeSafely(ref pfMenuTitle); TJAPlayer3.tDisposeSafely(ref pfBoxText); base.ReleaseManagedResource(); } - public override int Draw() - { - if (!base.IsDeActivated) - { + public override int Draw() { + if (!base.IsDeActivated) { #region [ 初めての進行描画 ] //--------------------- - if (base.IsFirstDraw) - { - if (TJAPlayer3.r直前のステージ == TJAPlayer3.stage起動) - { + if (base.IsFirstDraw) { + if (TJAPlayer3.r直前のステージ == TJAPlayer3.stage起動) { this.actFIfromSetup.tフェードイン開始(); base.ePhaseID = CStage.EPhase.Title_FadeIn; - } - else - { + } else { this.actFI.tフェードイン開始(); base.ePhaseID = CStage.EPhase.Common_FADEIN; } @@ -157,10 +131,8 @@ namespace TJAPlayer3 this.ctキャライン.Tick(); this.ctBarMove.Tick(); - if (!TJAPlayer3.Skin.bgmタイトルイン.bIsPlaying) - { - if (TJAPlayer3.ConfigIni.bBGM音を発声する && !b音声再生) - { + if (!TJAPlayer3.Skin.bgmタイトルイン.bIsPlaying) { + if (TJAPlayer3.ConfigIni.bBGM音を発声する && !b音声再生) { TJAPlayer3.Skin.bgmタイトル.tPlay(); b音声再生 = true; } @@ -173,18 +145,14 @@ namespace TJAPlayer3 if (base.ePhaseID == CStage.EPhase.Common_NORMAL // 通常状態、かつ && TJAPlayer3.act現在入力を占有中のプラグイン == null) // プラグインの入力占有がない { - if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Cancel)) - { - if (bモード選択) - { + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Cancel)) { + if (bモード選択) { TJAPlayer3.Skin.soundCancelSFX.tPlay(); bSaveFileLoaded = false; UnloadSaveFile(); if (bSaveFileLoaded == false) TJAPlayer3.Skin.soundEntry.tPlay(); - } - else - { + } else { TJAPlayer3.Skin.soundDecideSFX.tPlay(); n現在の選択行モード選択 = (int)E戻り値.EXIT + 1; this.actFO.tフェードアウト開始(0, 500); @@ -192,8 +160,7 @@ namespace TJAPlayer3 } } #if DEBUG - if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F8)) - { + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F8)) { CScoreIni_Importer.ImportScoreInisToSavesDb3(); } #endif @@ -214,12 +181,10 @@ namespace TJAPlayer3 */ // 1st step (Save file loading) - if (!bSaveIsLoading && !bSaveFailedToLoad) - { + if (!bSaveIsLoading && !bSaveFailedToLoad) { if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Decide) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed)) - { + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed)) { // Hit 1P save TJAPlayer3.SaveFile = 0; CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.ENTRY_NORMAL); @@ -227,9 +192,7 @@ namespace TJAPlayer3 this.ctSaveLoading.CurrentValue = (int)this.ctSaveLoading.EndValue; for (int i = 0; i < 2; i++) TJAPlayer3.NamePlate.tNamePlateRefreshTitles(i); - } - else if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed2P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed2P)) - { + } else if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed2P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed2P)) { // Hit 2P save TJAPlayer3.SaveFile = 1; CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.ENTRY_NORMAL); @@ -237,9 +200,8 @@ namespace TJAPlayer3 this.ctSaveLoading.CurrentValue = (int)this.ctSaveLoading.EndValue; for (int i = 0; i < 2; i++) TJAPlayer3.NamePlate.tNamePlateRefreshTitles(i); - } - else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.P)) // In case "P" is already binded to another pad - { + } else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.P)) // In case "P" is already binded to another pad + { // Hit 1P save TJAPlayer3.SaveFile = 0; CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.ENTRY_NORMAL); @@ -250,57 +212,45 @@ namespace TJAPlayer3 } } - if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) - { - if (bプレイヤーエントリー && !bプレイヤーエントリー決定 && this.ctSaveLoaded.IsEnded) - { - if (n現在の選択行プレイヤーエントリー + 1 <= 2) - { + if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) { + if (bプレイヤーエントリー && !bプレイヤーエントリー決定 && this.ctSaveLoaded.IsEnded) { + if (n現在の選択行プレイヤーエントリー + 1 <= 2) { TJAPlayer3.Skin.soundChangeSFX.tPlay(); n現在の選択行プレイヤーエントリー += 1; } } - if (bモード選択) - { + if (bモード選択) { //if (n現在の選択行モード選択 < this.nbModes - 1) - if (n現在の選択行モード選択 < usedMenusCount - 1) - { + if (n現在の選択行モード選択 < usedMenusCount - 1) { TJAPlayer3.Skin.soundChangeSFX.tPlay(); ctBarMove.Start(0, 250, 1.2f, TJAPlayer3.Timer); n現在の選択行モード選択++; this.bDownPushed = true; - for (int i = 0; i < usedMenusCount; i++) - { + for (int i = 0; i < usedMenusCount; i++) { usedMenusPos[i] = i + 1 - n現在の選択行モード選択; } } } } - if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) - { - if (bプレイヤーエントリー && !bプレイヤーエントリー決定 && this.ctSaveLoaded.IsEnded) - { - if (n現在の選択行プレイヤーエントリー - 1 >= 0) - { + if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) { + if (bプレイヤーエントリー && !bプレイヤーエントリー決定 && this.ctSaveLoaded.IsEnded) { + if (n現在の選択行プレイヤーエントリー - 1 >= 0) { TJAPlayer3.Skin.soundChangeSFX.tPlay(); n現在の選択行プレイヤーエントリー -= 1; } } - if (bモード選択) - { - if (n現在の選択行モード選択 > 0) - { + if (bモード選択) { + if (n現在の選択行モード選択 > 0) { TJAPlayer3.Skin.soundChangeSFX.tPlay(); ctBarMove.Start(0, 250, 1.2f, TJAPlayer3.Timer); n現在の選択行モード選択--; this.bDownPushed = false; - for (int i = 0; i < usedMenusCount; i++) - { + for (int i = 0; i < usedMenusCount; i++) { usedMenusPos[i] = i + 1 - n現在の選択行モード選択; } } @@ -309,14 +259,10 @@ namespace TJAPlayer3 if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Decide) - || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)) - { - if (bプレイヤーエントリー && this.ctSaveLoaded.IsEnded) - { - if (n現在の選択行プレイヤーエントリー == 0 || n現在の選択行プレイヤーエントリー == 2) - { - if (!bプレイヤーエントリー決定) - { + || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)) { + if (bプレイヤーエントリー && this.ctSaveLoaded.IsEnded) { + if (n現在の選択行プレイヤーエントリー == 0 || n現在の選択行プレイヤーエントリー == 2) { + if (!bプレイヤーエントリー決定) { TJAPlayer3.Skin.soundDecideSFX.tPlay(); ctエントリーバー決定点滅.Start(0, 1055, 1, TJAPlayer3.Timer); bプレイヤーエントリー決定 = true; @@ -325,9 +271,7 @@ namespace TJAPlayer3 TJAPlayer3.ConfigIni.nPlayerCount = 1; bSaveFileLoaded = true; } - } - else - { + } else { TJAPlayer3.Skin.soundDecideSFX.tPlay(); bプレイヤーエントリー = false; bSaveIsLoading = false; @@ -336,35 +280,28 @@ namespace TJAPlayer3 ctSaveLoading = new CCounter(); } } - if (bモード選択) - { + if (bモード選択) { bool operationSucceded = false; - if (CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]].rp == E戻り値.DANGAMESTART || CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]].rp == E戻り値.TAIKOTOWERSSTART) - { + if (CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]].rp == E戻り値.DANGAMESTART || CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]].rp == E戻り値.TAIKOTOWERSSTART) { if (TJAPlayer3.Songs管理.list曲ルート_Dan.Count > 0 && TJAPlayer3.ConfigIni.nPlayerCount == 1) operationSucceded = true; - } - else if (CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]].implemented == true - && (CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]]._1pRestricted == false - || TJAPlayer3.ConfigIni.nPlayerCount == 1)) + } else if (CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]].implemented == true + && (CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]]._1pRestricted == false + || TJAPlayer3.ConfigIni.nPlayerCount == 1)) operationSucceded = true; - if (operationSucceded == true) - { + if (operationSucceded == true) { TJAPlayer3.Skin.soundDecideSFX.tPlay(); this.actFO.tフェードアウト開始(0, 500); base.ePhaseID = CStage.EPhase.Common_FADEOUT; - } - else + } else TJAPlayer3.Skin.soundError.tPlay(); } } - if (ctSaveLoading.CurrentValue >= 500) - { - if (!bSaveIsLoading) - { + if (ctSaveLoading.CurrentValue >= 500) { + if (!bSaveIsLoading) { TJAPlayer3.Skin.soundEntry.tStop(); ctSaveLoaded.Start(0, 3655, 1, TJAPlayer3.Timer); bSaveIsLoading = true; @@ -372,10 +309,8 @@ namespace TJAPlayer3 } } - if (ctエントリーバー決定点滅.CurrentValue >= 1055) - { - if (!bモード選択) - { + if (ctエントリーバー決定点滅.CurrentValue >= 1055) { + if (!bモード選択) { /* if (!TJAPlayer3.Skin.soundsanka.bPlayed) TJAPlayer3.Skin.soundsanka.t再生する(); @@ -403,12 +338,10 @@ namespace TJAPlayer3 #endregion - if (bSaveFileLoaded == false) - { + if (bSaveFileLoaded == false) { #region [ Save Loading ] - if (!bSaveIsLoading && !bSaveFailedToLoad) - { + if (!bSaveIsLoading && !bSaveFailedToLoad) { TJAPlayer3.Tx.Entry_Bar.t2D描画(0, 0); if (this.ctコインイン待機.CurrentValue <= 255) @@ -420,13 +353,9 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Entry_Bar_Text.t2D描画(TJAPlayer3.Skin.Title_Entry_Bar_Text_X[0], TJAPlayer3.Skin.Title_Entry_Bar_Text_Y[0], new RectangleF(0, 0, TJAPlayer3.Tx.Entry_Bar_Text.sz画像サイズ.Width, TJAPlayer3.Tx.Entry_Bar_Text.sz画像サイズ.Height / 2)); TJAPlayer3.Tx.Entry_Bar_Text.t2D描画(TJAPlayer3.Skin.Title_Entry_Bar_Text_X[1], TJAPlayer3.Skin.Title_Entry_Bar_Text_Y[1], new RectangleF(0, TJAPlayer3.Tx.Entry_Bar_Text.sz画像サイズ.Height / 2, TJAPlayer3.Tx.Entry_Bar_Text.sz画像サイズ.Width, TJAPlayer3.Tx.Entry_Bar_Text.sz画像サイズ.Height / 2)); - } - else - { - if (this.ctSaveLoaded.CurrentValue <= 1000 && this.ctSaveLoadingFailed.CurrentValue <= 1128) - { - if (bSaveIsLoading) - { + } else { + if (this.ctSaveLoaded.CurrentValue <= 1000 && this.ctSaveLoadingFailed.CurrentValue <= 1128) { + if (bSaveIsLoading) { TJAPlayer3.Tx.Tile_Black.Opacity = this.ctSaveLoaded.CurrentValue <= 2972 ? 128 : 128 - (this.ctSaveLoaded.CurrentValue - 2972); for (int i = 0; i < TJAPlayer3.Skin.Resolution[0] / TJAPlayer3.Tx.Tile_Black.szTextureSize.Width + 1; i++) @@ -440,35 +369,32 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Banapas_Load[1].Opacity = ctSaveLoaded.CurrentValue >= 872 ? 255 - (ctSaveLoaded.CurrentValue - 872) * 2 : ctSaveLoaded.CurrentValue <= 96 ? (int)((ctSaveLoaded.CurrentValue - 96) * 7.96875f) : 255; TJAPlayer3.Tx.Banapas_Load[1].t2D描画(0, 0); - if (TJAPlayer3.Tx.Banapas_Load[2] != null) - { - int step = TJAPlayer3.Tx.Banapas_Load[2].szTextureSize.Width / TJAPlayer3.Skin.Title_LoadingPinFrameCount; + if (TJAPlayer3.Tx.Banapas_Load[2] != null) { + int step = TJAPlayer3.Tx.Banapas_Load[2].szTextureSize.Width / TJAPlayer3.Skin.Title_LoadingPinFrameCount; int cycle = TJAPlayer3.Skin.Title_LoadingPinCycle; int _stamp = (ctSaveLoaded.CurrentValue - 200) % (TJAPlayer3.Skin.Title_LoadingPinInstances * cycle); - for (int i = 0; i < TJAPlayer3.Skin.Title_LoadingPinInstances; i++) - { - TJAPlayer3.Tx.Banapas_Load[2].Opacity = ctSaveLoaded.CurrentValue >= 872 ? 255 - (ctSaveLoaded.CurrentValue - 872) * 2 : ctSaveLoaded.CurrentValue <= 96 ? (int)((ctSaveLoaded.CurrentValue - 96) * 7.96875f) : 255; + for (int i = 0; i < TJAPlayer3.Skin.Title_LoadingPinInstances; i++) { + TJAPlayer3.Tx.Banapas_Load[2].Opacity = ctSaveLoaded.CurrentValue >= 872 ? 255 - (ctSaveLoaded.CurrentValue - 872) * 2 : ctSaveLoaded.CurrentValue <= 96 ? (int)((ctSaveLoaded.CurrentValue - 96) * 7.96875f) : 255; - TJAPlayer3.Tx.Banapas_Load[2].t2D拡大率考慮中央基準描画( - TJAPlayer3.Skin.Title_LoadingPinBase[0] + TJAPlayer3.Skin.Title_LoadingPinDiff[0] * i, - TJAPlayer3.Skin.Title_LoadingPinBase[1] + TJAPlayer3.Skin.Title_LoadingPinDiff[1] * i, - new Rectangle(step - * (_stamp >= i * cycle - ? _stamp <= (i + 1) * cycle - ? (_stamp + i * cycle) / (cycle / TJAPlayer3.Skin.Title_LoadingPinFrameCount) - : 0 - : 0), - 0, - step, - TJAPlayer3.Tx.Banapas_Load[2].szTextureSize.Height)); - } - } - + TJAPlayer3.Tx.Banapas_Load[2].t2D拡大率考慮中央基準描画( + TJAPlayer3.Skin.Title_LoadingPinBase[0] + TJAPlayer3.Skin.Title_LoadingPinDiff[0] * i, + TJAPlayer3.Skin.Title_LoadingPinBase[1] + TJAPlayer3.Skin.Title_LoadingPinDiff[1] * i, + new Rectangle(step + * (_stamp >= i * cycle + ? _stamp <= (i + 1) * cycle + ? (_stamp + i * cycle) / (cycle / TJAPlayer3.Skin.Title_LoadingPinFrameCount) + : 0 + : 0), + 0, + step, + TJAPlayer3.Tx.Banapas_Load[2].szTextureSize.Height)); + } + } + } - if (bSaveFailedToLoad) - { + if (bSaveFailedToLoad) { TJAPlayer3.Tx.Tile_Black.Opacity = this.ctSaveLoadingFailed.CurrentValue <= 1000 ? 128 : 128 - (this.ctSaveLoadingFailed.CurrentValue - 1000); for (int i = 0; i < TJAPlayer3.Skin.Resolution[0] / TJAPlayer3.Tx.Tile_Black.szTextureSize.Width + 1; i++) @@ -483,17 +409,13 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Banapas_Load_Failure[0].vcScaleRatio.Y = count <= 100 ? count * 0.01f : 1.0f; TJAPlayer3.Tx.Banapas_Load_Failure[0].t2D描画(0, 0); - if (ctSaveLoadingFailed.CurrentValue >= 1128) - { + if (ctSaveLoadingFailed.CurrentValue >= 1128) { bSaveFailedToLoad = false; TJAPlayer3.Skin.soundError.bPlayed = false; } } - } - else - { - if (bSaveIsLoading) - { + } else { + if (bSaveIsLoading) { TJAPlayer3.Tx.Tile_Black.Opacity = this.ctSaveLoaded.CurrentValue <= 2972 ? 128 : 128 - (this.ctSaveLoaded.CurrentValue - 2972); for (int i = 0; i < TJAPlayer3.Skin.Resolution[0] / TJAPlayer3.Tx.Tile_Black.szTextureSize.Width + 1; i++) @@ -512,28 +434,20 @@ namespace TJAPlayer3 float scalex = 0f; float scaley = 0f; - if (count >= 300) - { - if (count <= 300 + 270) - { + 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) - { + } 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) - { + } 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) - { + } 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; } @@ -544,8 +458,7 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Banapas_Load_Clear[1].Opacity = count >= 1872 ? 255 - (count - 1872) * 2 : count * 2; TJAPlayer3.Tx.Banapas_Load_Clear[1].t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Title_Banapas_Load_Clear_Anime[0], TJAPlayer3.Skin.Title_Banapas_Load_Clear_Anime[1] - anime); - if (ctSaveLoaded.CurrentValue >= 2000) - { + if (ctSaveLoaded.CurrentValue >= 2000) { bプレイヤーエントリー = true; } } @@ -557,10 +470,8 @@ namespace TJAPlayer3 #region [ プレイヤーエントリー ] - if (bプレイヤーエントリー) - { - if (!this.bキャラカウンター初期化) - { + if (bプレイヤーエントリー) { + if (!this.bキャラカウンター初期化) { //this.ctキャラエントリーループ = new CCounter(0, Chara_Entry.Length - 1, 1000 / 60, TJAPlayer3.Timer); CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.ENTRY); @@ -586,18 +497,18 @@ namespace TJAPlayer3 int _actual = TJAPlayer3.GetActualPlayer(0); - int _charaId = TJAPlayer3.SaveFileInstances[_actual].data.Character; + int _charaId = TJAPlayer3.SaveFileInstances[_actual].data.Character; int chara_x = TJAPlayer3.Skin.Title_Entry_NamePlate[0] + TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2; int chara_y = TJAPlayer3.Skin.Title_Entry_NamePlate[1]; - int puchi_x = chara_x + TJAPlayer3.Skin.Adjustments_MenuPuchichara_X[0]; - int puchi_y = chara_y + TJAPlayer3.Skin.Adjustments_MenuPuchichara_Y[0]; + int puchi_x = chara_x + TJAPlayer3.Skin.Adjustments_MenuPuchichara_X[0]; + int puchi_y = chara_y + TJAPlayer3.Skin.Adjustments_MenuPuchichara_Y[0]; - CMenuCharacter.tMenuDisplayCharacter( - 0, - chara_x, - chara_y, + CMenuCharacter.tMenuDisplayCharacter( + 0, + chara_x, + chara_y, CMenuCharacter.ECharacterAnimation.ENTRY, alpha ); @@ -610,13 +521,13 @@ namespace TJAPlayer3 ); */ - //___ttx.Opacity = 255; + //___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); - TJAPlayer3.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)); + TJAPlayer3.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)); TJAPlayer3.Tx.Entry_Player[2].t2D描画(TJAPlayer3.Skin.Title_Entry_Player_Select_X[n現在の選択行プレイヤーエントリー], TJAPlayer3.Skin.Title_Entry_Player_Select_Y[n現在の選択行プレイヤーエントリー], new RectangleF(TJAPlayer3.Skin.Title_Entry_Player_Select_Rect[0][n現在の選択行プレイヤーエントリー == 1 ? 1 : 0][0], TJAPlayer3.Skin.Title_Entry_Player_Select_Rect[0][n現在の選択行プレイヤーエントリー == 1 ? 1 : 0][1], @@ -670,14 +581,12 @@ namespace TJAPlayer3 #region [ モード選択 ] - if (bモード選択) - { + if (bモード選択) { this.ctBarAnimeIn.Tick(); #region [ キャラ描画 ] - for (int player = 0; player < TJAPlayer3.ConfigIni.nPlayerCount; player++) - { + for (int player = 0; player < TJAPlayer3.ConfigIni.nPlayerCount; player++) { if (player >= 2) continue; float CharaX = 0f, CharaY = 0f; @@ -692,30 +601,28 @@ namespace TJAPlayer3 //int chara_y = (int)(TJAPlayer3.Skin.Characters_Title_Normal_Y[_charaId][player] - CharaY); - int chara_x = (int)CharaX + TJAPlayer3.Skin.SongSelect_NamePlate_X[player] + TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2; - int chara_y = TJAPlayer3.Skin.SongSelect_NamePlate_Y[player] - (int)CharaY; + int chara_x = (int)CharaX + TJAPlayer3.Skin.SongSelect_NamePlate_X[player] + TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2; + int chara_y = TJAPlayer3.Skin.SongSelect_NamePlate_Y[player] - (int)CharaY; - int puchi_x = chara_x + TJAPlayer3.Skin.Adjustments_MenuPuchichara_X[player]; - int puchi_y = chara_y + TJAPlayer3.Skin.Adjustments_MenuPuchichara_Y[player]; + int puchi_x = chara_x + TJAPlayer3.Skin.Adjustments_MenuPuchichara_X[player]; + int puchi_y = chara_y + TJAPlayer3.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); + //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); + this.PuchiChara.On進行描画(puchi_x, puchi_y, false, player: player); } #endregion - if (ctBarAnimeIn.CurrentValue >= (int)(16 * 16.6f)) - { + 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++) - { + for (int i = 0; i < usedMenusCount; i++) { // Get Menu reference CMainMenuTab _menu = CMainMenuTab.__Menus[usedMenus[i]]; CTexture _bar = _menu.barTex; @@ -724,17 +631,14 @@ namespace TJAPlayer3 #region [Disable visualy 1p specific buttons if 2p] if ((_menu._1pRestricted == true && TJAPlayer3.ConfigIni.nPlayerCount > 1) - || _menu.implemented == false) - { + || _menu.implemented == false) { if (_bar != null) _bar.color4 = CConversion.ColorToColor4(Color.DarkGray); if (_chara != null) _chara.color4 = CConversion.ColorToColor4(Color.DarkGray); TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(_menu.ttkBoxText, TJAPlayer3.Skin.Title_VerticalText, true).color4 = CConversion.ColorToColor4(Color.DarkGray); TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(_menu.ttkTitle, TJAPlayer3.Skin.Title_VerticalText).color4 = CConversion.ColorToColor4(Color.DarkGray); - } - else - { + } else { if (_bar != null) _bar.color4 = CConversion.ColorToColor4(Color.White); if (_chara != null) @@ -746,8 +650,7 @@ namespace TJAPlayer3 #endregion // if (this.stModeBar[i].n現在存在している行 == 1 && ctBarMove.n現在の値 >= 150) - if (usedMenusPos[i] == 1 && ctBarMove.CurrentValue >= 150) - { + if (usedMenusPos[i] == 1 && ctBarMove.CurrentValue >= 150) { float barAnimef = (ctBarMove.CurrentValue / 100.0f) - 1.5f; float barAnime = TJAPlayer3.Skin.Title_ModeSelect_Bar_Move[0] + @@ -767,34 +670,30 @@ namespace TJAPlayer3 //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) - { + if (_bar != null) { _bar.Opacity = 255; _bar.vcScaleRatio.X = 1.0f; _bar.vcScaleRatio.Y = 1.0f; - _bar.t2D描画(TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_X[0] - (TJAPlayer3.Skin.Title_VerticalBar ? barAnimeX : 0), - TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Y[0] - (TJAPlayer3.Skin.Title_VerticalBar ? 0 : barAnime), - new Rectangle(TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Rect[0][0], - TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Rect[0][1], + _bar.t2D描画(TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_X[0] - (TJAPlayer3.Skin.Title_VerticalBar ? barAnimeX : 0), + TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Y[0] - (TJAPlayer3.Skin.Title_VerticalBar ? 0 : barAnime), + new Rectangle(TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Rect[0][0], + TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Rect[0][1], TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Rect[0][2], TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Rect[0][3])); - _bar.t2D描画(TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_X[1] + (TJAPlayer3.Skin.Title_VerticalBar ? barAnimeX : 0), - TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Y[1] + (TJAPlayer3.Skin.Title_VerticalBar ? 0 : barAnime), + _bar.t2D描画(TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_X[1] + (TJAPlayer3.Skin.Title_VerticalBar ? barAnimeX : 0), + TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Y[1] + (TJAPlayer3.Skin.Title_VerticalBar ? 0 : barAnime), new Rectangle(TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Rect[1][0], TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Rect[1][1], TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Rect[1][2], TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Rect[1][3])); - if (TJAPlayer3.Skin.Title_VerticalBar) - { + if (TJAPlayer3.Skin.Title_VerticalBar) { _bar.vcScaleRatio.X = (barAnimeX / TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Rect[2][2]) * 2.0f; - } - else - { + } else { _bar.vcScaleRatio.Y = (barAnime / TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Rect[2][3]) * 2.0f; } - _bar.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_X[2], TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Y[2], + _bar.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_X[2], TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Y[2], new Rectangle(TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Rect[2][0], TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Rect[2][1], TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Rect[2][2], @@ -802,34 +701,30 @@ namespace TJAPlayer3 } - if (TJAPlayer3.Tx.ModeSelect_Bar[CMainMenuTab.__MenuCount] != null) - { + if (TJAPlayer3.Tx.ModeSelect_Bar[CMainMenuTab.__MenuCount] != null) { CTexture _overlap = TJAPlayer3.Tx.ModeSelect_Bar[CMainMenuTab.__MenuCount]; _overlap.vcScaleRatio.X = 1.0f; _overlap.vcScaleRatio.Y = 1.0f; - _overlap.t2D描画(TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_X[0], TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Y[0], + _overlap.t2D描画(TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_X[0], TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Y[0], new Rectangle(TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Rect[0][0], TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Rect[0][1], TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Rect[0][2], TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Rect[0][3])); - _overlap.t2D描画(TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_X[1] + (TJAPlayer3.Skin.Title_VerticalBar ? overlayAnimeX : 0), - TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Y[1] + (TJAPlayer3.Skin.Title_VerticalBar ? 0 : overlayAnime), + _overlap.t2D描画(TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_X[1] + (TJAPlayer3.Skin.Title_VerticalBar ? overlayAnimeX : 0), + TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Y[1] + (TJAPlayer3.Skin.Title_VerticalBar ? 0 : overlayAnime), new Rectangle(TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Rect[1][0], TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Rect[1][1], TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Rect[1][2], TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Rect[1][3])); - if (TJAPlayer3.Skin.Title_VerticalBar) - { + if (TJAPlayer3.Skin.Title_VerticalBar) { _overlap.vcScaleRatio.X = (overlayAnimeX / TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Rect[2][2]); - } - else - { + } else { _overlap.vcScaleRatio.Y = (overlayAnime / TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Rect[2][3]); } - _overlap.t2D拡大率考慮上中央基準描画(TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_X[2], TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Y[2], + _overlap.t2D拡大率考慮上中央基準描画(TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_X[2], TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Y[2], new Rectangle(TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Rect[2][0], TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Rect[2][1], TJAPlayer3.Skin.Title_ModeSelect_Bar_Overlay_Rect[2][2], @@ -847,8 +742,7 @@ namespace TJAPlayer3 anime = 1.50f - (BarAnimeCount - 0.45f) * 0.61764705f; anime *= TJAPlayer3.Skin.Title_ModeSelect_Bar_Chara_Move; - if (_chara != null) - { + if (_chara != null) { _chara.Opacity = (int)(BarAnimeCount * 255f) + (int)(barAnimef * 2.5f); _chara.t2D中心基準描画(TJAPlayer3.Skin.Title_ModeSelect_Bar_Chara_X[0] - anime, TJAPlayer3.Skin.Title_ModeSelect_Bar_Chara_Y[0], new Rectangle(0, 0, _chara.szTextureSize.Width / 2, _chara.szTextureSize.Height)); @@ -861,15 +755,12 @@ namespace TJAPlayer3 TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Title[1] - (TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_Title_Move * BarAnimeCount)); CTexture currentText = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(_menu.ttkBoxText, TJAPlayer3.Skin.Title_VerticalText, true); - if (currentText != null) - { + if (currentText != null) { currentText.Opacity = (int)(BarAnimeCount * 255f); currentText?.t2D中心基準描画(TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_BoxText[0], TJAPlayer3.Skin.Title_ModeSelect_Bar_Center_BoxText[1]); } - } - else - { + } 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; @@ -896,15 +787,13 @@ namespace TJAPlayer3 BarMoveY = ctBarMove.CurrentValue <= 100 ? (int)(pos.Y - posSelect.Y) - (int)(ctBarMove.CurrentValue / 100f * (pos.Y - posSelect.Y)) : 0; - if (_bar != null) - { + if (_bar != null) { _bar.vcScaleRatio.X = 1.0f; _bar.vcScaleRatio.Y = 1.0f; _bar.t2D描画(pos.X + BarAnimeX - BarMoveX, pos.Y + BarAnimeY - BarMoveY); } - if (TJAPlayer3.Tx.ModeSelect_Bar[CMainMenuTab.__MenuCount] != null) - { + if (TJAPlayer3.Tx.ModeSelect_Bar[CMainMenuTab.__MenuCount] != null) { CTexture _overlap = TJAPlayer3.Tx.ModeSelect_Bar[CMainMenuTab.__MenuCount]; _overlap.vcScaleRatio.X = 1.0f; @@ -919,8 +808,7 @@ namespace TJAPlayer3 } } - for (int player = 0; player < TJAPlayer3.ConfigIni.nPlayerCount; player++) - { + for (int player = 0; player < TJAPlayer3.ConfigIni.nPlayerCount; player++) { if (player >= 2) continue; TJAPlayer3.NamePlate.tNamePlateDraw(TJAPlayer3.Skin.SongSelect_NamePlate_X[player], TJAPlayer3.Skin.SongSelect_NamePlate_Y[player], player, false, 255); @@ -944,21 +832,18 @@ namespace TJAPlayer3 #endif //TJAPlayer3.actTextConsole.tPrint(4, 64, CTextConsole.EFontType.White, CScoreIni_Importer.Status); - #endregion + #endregion - CStage.EPhase eフェーズid = base.ePhaseID; - switch (eフェーズid) - { + CStage.EPhase eフェーズid = base.ePhaseID; + switch (eフェーズid) { case CStage.EPhase.Common_FADEIN: - if (this.actFI.Draw() != 0) - { + if (this.actFI.Draw() != 0) { base.ePhaseID = CStage.EPhase.Common_NORMAL; } break; case CStage.EPhase.Common_FADEOUT: - if (this.actFO.Draw() == 0) - { + if (this.actFO.Draw() == 0) { TJAPlayer3.Skin.bgmタイトル.tStop(); TJAPlayer3.Skin.bgmタイトルイン.tStop(); break; @@ -971,8 +856,7 @@ namespace TJAPlayer3 return ((int)CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]].rp); case CStage.EPhase.Title_FadeIn: - if (this.actFIfromSetup.Draw() != 0) - { + if (this.actFIfromSetup.Draw() != 0) { base.ePhaseID = CStage.EPhase.Common_NORMAL; } break; @@ -980,8 +864,7 @@ namespace TJAPlayer3 } return 0; } - public enum E戻り値 - { + public enum E戻り値 { 継続 = 0, GAMESTART, DANGAMESTART, @@ -1008,10 +891,8 @@ namespace TJAPlayer3 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) - { + private void SkipSaveFileStep() { + if (bSaveFileLoaded == true) { bモード選択 = true; // bプレイヤーエントリー = true; bSaveIsLoading = true; @@ -1033,15 +914,14 @@ namespace TJAPlayer3 TJAPlayer3.Skin.SoundBanapas.bPlayed = true; //TJAPlayer3.Skin.soundsanka.bPlayed = true; - + if (TJAPlayer3.Skin.voiceTitleSanka[TJAPlayer3.SaveFile] != null) TJAPlayer3.Skin.voiceTitleSanka[TJAPlayer3.SaveFile].bPlayed = true; } } // Restore the title screen to the "Taiko hit start" screen - private void UnloadSaveFile() - { + private void UnloadSaveFile() { this.ctSaveLoading = new CCounter(); this.ctコインイン待機 = new CCounter(0, 2000, 1, TJAPlayer3.Timer); this.ctSaveLoaded = new CCounter(); @@ -1117,23 +997,17 @@ namespace TJAPlayer3 private Point[] ptモード選択バー座標 = { new Point(290, 107), new Point(319, 306), new Point(356, 513) };*/ - private Point getFixedPositionForBar(int CurrentPos) - { + private Point getFixedPositionForBar(int CurrentPos) { int posX; int posY; - if (CurrentPos >= 0 && CurrentPos < 3) - { + if (CurrentPos >= 0 && CurrentPos < 3) { posX = TJAPlayer3.Skin.Title_ModeSelect_Bar_X[CurrentPos]; posY = TJAPlayer3.Skin.Title_ModeSelect_Bar_Y[CurrentPos]; - } - else if (CurrentPos < 0) - { + } else if (CurrentPos < 0) { posX = TJAPlayer3.Skin.Title_ModeSelect_Bar_X[0] + CurrentPos * TJAPlayer3.Skin.Title_ModeSelect_Bar_Offset[0]; posY = TJAPlayer3.Skin.Title_ModeSelect_Bar_Y[0] + CurrentPos * TJAPlayer3.Skin.Title_ModeSelect_Bar_Offset[1]; - } - else - { + } else { posX = TJAPlayer3.Skin.Title_ModeSelect_Bar_X[2] + (CurrentPos - 2) * TJAPlayer3.Skin.Title_ModeSelect_Bar_Offset[0]; posY = TJAPlayer3.Skin.Title_ModeSelect_Bar_Y[2] + (CurrentPos - 2) * TJAPlayer3.Skin.Title_ModeSelect_Bar_Offset[1]; } diff --git a/OpenTaiko/src/Stages/04.Config/CActCalibrationMode.cs b/OpenTaiko/src/Stages/04.Config/CActCalibrationMode.cs index 6b96c68a..e83b707b 100644 --- a/OpenTaiko/src/Stages/04.Config/CActCalibrationMode.cs +++ b/OpenTaiko/src/Stages/04.Config/CActCalibrationMode.cs @@ -1,232 +1,200 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Drawing; using FDK; -namespace TJAPlayer3 -{ - internal class CActCalibrationMode : CActivity - { - public CActCalibrationMode() { } +namespace TJAPlayer3 { + internal class CActCalibrationMode : CActivity { + public CActCalibrationMode() { } - 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 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(); + public override void DeActivate() { + Stop(); + Offsets.Clear(); + font?.Dispose(); + offsettext?.Dispose(); + //hitSound?.tDispose(); - base.DeActivate(); - } + base.DeActivate(); + } - public void Start() - { - CalibrateTick = new CCounter(0, 500, 1, TJAPlayer3.Timer); - UpdateText(); - } + public void Start() { + CalibrateTick = new CCounter(0, 500, 1, TJAPlayer3.Timer); + UpdateText(); + } - public void Stop() - { - CalibrateTick = new CCounter(); - Offsets.Clear(); - LastOffset = 0; - buttonIndex = 1; - } + public void Stop() { + CalibrateTick = new CCounter(); + Offsets.Clear(); + LastOffset = 0; + buttonIndex = 1; + } - public int Update() - { - if (IsDeActivated || CalibrateTick.IsStoped) - return 1; + public int Update() { + if (IsDeActivated || CalibrateTick.IsStoped) + return 1; - CalibrateTick.Tick(); + CalibrateTick.Tick(); - bool decide = TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Decide) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed) || - TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return); + bool decide = TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Decide) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed) || + TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return); - if (CalibrateTick.IsEnded) - { - TJAPlayer3.Skin.calibrationTick.tPlay(); - CalibrateTick.Start(0, 500, 1, TJAPlayer3.Timer); - } + if (CalibrateTick.IsEnded) { + TJAPlayer3.Skin.calibrationTick.tPlay(); + CalibrateTick.Start(0, 500, 1, TJAPlayer3.Timer); + } - if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue) || - TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) - { - buttonIndex = Math.Max(buttonIndex - 1, 0); - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - } - else if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue) || - TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) - { - buttonIndex = Math.Min(buttonIndex + 1, 2); - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - } - else if (buttonIndex == 0 && decide) // Cancel - { - TJAPlayer3.Skin.soundCancelSFX.tPlay(); - Stop(); - } - else if (buttonIndex == 1 && decide) // Hit! - { - //hitSound?.PlayStart(); - AddOffset(); - UpdateText(); - } - else if (buttonIndex == 2 && decide) // Save - { - TJAPlayer3.ConfigIni.nGlobalOffsetMs = GetMedianOffset(); - TJAPlayer3.stageコンフィグ.actList.iGlobalOffsetMs.n現在の値 = GetMedianOffset(); - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - Stop(); + if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue) || + TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) { + buttonIndex = Math.Max(buttonIndex - 1, 0); + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + } else if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue) || + TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) { + buttonIndex = Math.Min(buttonIndex + 1, 2); + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + } else if (buttonIndex == 0 && decide) // Cancel + { + TJAPlayer3.Skin.soundCancelSFX.tPlay(); + Stop(); + } else if (buttonIndex == 1 && decide) // Hit! + { + //hitSound?.PlayStart(); + AddOffset(); + UpdateText(); + } else if (buttonIndex == 2 && decide) // Save + { + TJAPlayer3.ConfigIni.nGlobalOffsetMs = GetMedianOffset(); + TJAPlayer3.stageコンフィグ.actList.iGlobalOffsetMs.n現在の値 = GetMedianOffset(); + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + Stop(); - return 0; - } - else if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.Cancel) || - TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) - { - TJAPlayer3.Skin.soundCancelSFX.tPlay(); - Stop(); + return 0; + } else if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.Cancel) || + TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) { + TJAPlayer3.Skin.soundCancelSFX.tPlay(); + Stop(); - return 0; - } + return 0; + } - return 0; - } + return 0; + } - public override int Draw() - { - if (IsDeActivated || CalibrateTick.IsStoped) - return 1; + public override int Draw() { + if (IsDeActivated || CalibrateTick.IsStoped) + return 1; - if (TJAPlayer3.Tx.Tile_Black != null) - { - TJAPlayer3.Tx.Tile_Black.Opacity = 128; - for (int i = 0; i <= SampleFramework.GameWindowSize.Width; i += TJAPlayer3.Tx.Tile_Black.szTextureSize.Width) - { - for (int j = 0; j <= SampleFramework.GameWindowSize.Height; j += TJAPlayer3.Tx.Tile_Black.szTextureSize.Height) - { - TJAPlayer3.Tx.Tile_Black.t2D描画(i, j); - } - } - TJAPlayer3.Tx.Tile_Black.Opacity = 255; - } + if (TJAPlayer3.Tx.Tile_Black != null) { + TJAPlayer3.Tx.Tile_Black.Opacity = 128; + for (int i = 0; i <= SampleFramework.GameWindowSize.Width; i += TJAPlayer3.Tx.Tile_Black.szTextureSize.Width) { + for (int j = 0; j <= SampleFramework.GameWindowSize.Height; j += TJAPlayer3.Tx.Tile_Black.szTextureSize.Height) { + TJAPlayer3.Tx.Tile_Black.t2D描画(i, j); + } + } + TJAPlayer3.Tx.Tile_Black.Opacity = 255; + } - TJAPlayer3.Tx.CalibrateBG?.t2D描画(TJAPlayer3.Skin.Config_Calibration_Highlights[buttonIndex].X, - TJAPlayer3.Skin.Config_Calibration_Highlights[buttonIndex].Y, - TJAPlayer3.Skin.Config_Calibration_Highlights[buttonIndex]); - TJAPlayer3.Tx.CalibrateFG?.t2D描画(0, 0); + TJAPlayer3.Tx.CalibrateBG?.t2D描画(TJAPlayer3.Skin.Config_Calibration_Highlights[buttonIndex].X, + TJAPlayer3.Skin.Config_Calibration_Highlights[buttonIndex].Y, + TJAPlayer3.Skin.Config_Calibration_Highlights[buttonIndex]); + TJAPlayer3.Tx.CalibrateFG?.t2D描画(0, 0); - TJAPlayer3.Tx.Lane_Background_Main?.t2D描画(TJAPlayer3.Skin.Game_Lane_X[0], TJAPlayer3.Skin.Game_Lane_Y[0]); - TJAPlayer3.Tx.Lane_Background_Sub?.t2D描画(TJAPlayer3.Skin.Game_Lane_Sub_X[0], TJAPlayer3.Skin.Game_Lane_Sub_Y[0]); - TJAPlayer3.Tx.Taiko_Frame[2]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Frame_X[0], TJAPlayer3.Skin.Game_Taiko_Frame_Y[0]); + TJAPlayer3.Tx.Lane_Background_Main?.t2D描画(TJAPlayer3.Skin.Game_Lane_X[0], TJAPlayer3.Skin.Game_Lane_Y[0]); + TJAPlayer3.Tx.Lane_Background_Sub?.t2D描画(TJAPlayer3.Skin.Game_Lane_Sub_X[0], TJAPlayer3.Skin.Game_Lane_Sub_Y[0]); + TJAPlayer3.Tx.Taiko_Frame[2]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Frame_X[0], TJAPlayer3.Skin.Game_Taiko_Frame_Y[0]); - TJAPlayer3.Tx.Notes[0]?.t2D描画(TJAPlayer3.Skin.nScrollFieldX[0], TJAPlayer3.Skin.nScrollFieldY[0], new RectangleF(0, 0, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); + TJAPlayer3.Tx.Notes[0]?.t2D描画(TJAPlayer3.Skin.nScrollFieldX[0], TJAPlayer3.Skin.nScrollFieldY[0], new RectangleF(0, 0, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); - for (int x = TJAPlayer3.Skin.nScrollFieldX[0]; x < SampleFramework.GameWindowSize.Width + 500; x += 500) - { - TJAPlayer3.Tx.Bar?.t2D描画( - (x - CalibrateTick.CurrentValue) + ((TJAPlayer3.Skin.Game_Notes_Size[0] - TJAPlayer3.Tx.Bar.szTextureSize.Width) / 2), - TJAPlayer3.Skin.nScrollFieldY[0], - new Rectangle(0, 0, TJAPlayer3.Tx.Bar.szTextureSize.Width, TJAPlayer3.Skin.Game_Notes_Size[1]) - ); - TJAPlayer3.Tx.Notes[0]?.t2D描画( - (x - CalibrateTick.CurrentValue), - TJAPlayer3.Skin.nScrollFieldY[0], - new Rectangle(TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1], TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1]) - ); - } + for (int x = TJAPlayer3.Skin.nScrollFieldX[0]; x < SampleFramework.GameWindowSize.Width + 500; x += 500) { + TJAPlayer3.Tx.Bar?.t2D描画( + (x - CalibrateTick.CurrentValue) + ((TJAPlayer3.Skin.Game_Notes_Size[0] - TJAPlayer3.Tx.Bar.szTextureSize.Width) / 2), + TJAPlayer3.Skin.nScrollFieldY[0], + new Rectangle(0, 0, TJAPlayer3.Tx.Bar.szTextureSize.Width, TJAPlayer3.Skin.Game_Notes_Size[1]) + ); + TJAPlayer3.Tx.Notes[0]?.t2D描画( + (x - CalibrateTick.CurrentValue), + TJAPlayer3.Skin.nScrollFieldY[0], + new Rectangle(TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1], TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1]) + ); + } - if (TJAPlayer3.P1IsBlue()) - TJAPlayer3.Tx.Taiko_Background[4]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Background_X[0], TJAPlayer3.Skin.Game_Taiko_Background_Y[0]); - else - TJAPlayer3.Tx.Taiko_Background[0]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Background_X[0], TJAPlayer3.Skin.Game_Taiko_Background_Y[0]); + if (TJAPlayer3.P1IsBlue()) + TJAPlayer3.Tx.Taiko_Background[4]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Background_X[0], TJAPlayer3.Skin.Game_Taiko_Background_Y[0]); + else + TJAPlayer3.Tx.Taiko_Background[0]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Background_X[0], TJAPlayer3.Skin.Game_Taiko_Background_Y[0]); - #region Calibration Info + #region Calibration Info - offsettext?.t2D描画(TJAPlayer3.Skin.Config_Calibration_OffsetText[0] - offsettext.szTextureSize.Width, TJAPlayer3.Skin.Config_Calibration_OffsetText[1]); + offsettext?.t2D描画(TJAPlayer3.Skin.Config_Calibration_OffsetText[0] - offsettext.szTextureSize.Width, TJAPlayer3.Skin.Config_Calibration_OffsetText[1]); - TJAPlayer3.actTextConsole.tPrint(TJAPlayer3.Skin.Config_Calibration_InfoText[0], TJAPlayer3.Skin.Config_Calibration_InfoText[1], CTextConsole.EFontType.Cyan, - "MEDIAN OFFSET : " + GetMedianOffset() + "ms\n"); - TJAPlayer3.actTextConsole.tPrint(TJAPlayer3.Skin.Config_Calibration_InfoText[0], TJAPlayer3.Skin.Config_Calibration_InfoText[1] + TJAPlayer3.actTextConsole.nFontHeight, 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)); - TJAPlayer3.actTextConsole.tPrint(TJAPlayer3.Skin.Config_Calibration_InfoText[0], TJAPlayer3.Skin.Config_Calibration_InfoText[1] + (TJAPlayer3.actTextConsole.nFontHeight * 5), CTextConsole.EFontType.White, - "CURRENT OFFSET: " + CurrentOffset() + "ms"); + TJAPlayer3.actTextConsole.tPrint(TJAPlayer3.Skin.Config_Calibration_InfoText[0], TJAPlayer3.Skin.Config_Calibration_InfoText[1], CTextConsole.EFontType.Cyan, + "MEDIAN OFFSET : " + GetMedianOffset() + "ms\n"); + TJAPlayer3.actTextConsole.tPrint(TJAPlayer3.Skin.Config_Calibration_InfoText[0], TJAPlayer3.Skin.Config_Calibration_InfoText[1] + TJAPlayer3.actTextConsole.nFontHeight, 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)); + TJAPlayer3.actTextConsole.tPrint(TJAPlayer3.Skin.Config_Calibration_InfoText[0], TJAPlayer3.Skin.Config_Calibration_InfoText[1] + (TJAPlayer3.actTextConsole.nFontHeight * 5), CTextConsole.EFontType.White, + "CURRENT OFFSET: " + CurrentOffset() + "ms"); - #endregion + #endregion - return 0; - } + return 0; + } - public void AddOffset() { Offsets.Add(CurrentOffset()); LastOffset = CurrentOffset(); } + 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; - } + 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)); - } + 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; + 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 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 - } + 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 e2cad666..93db6c85 100644 --- a/OpenTaiko/src/Stages/04.Config/CActConfigKeyAssign.cs +++ b/OpenTaiko/src/Stages/04.Config/CActConfigKeyAssign.cs @@ -1,20 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; -using System.Drawing; +using System.Runtime.InteropServices; using FDK; -namespace TJAPlayer3 -{ - internal class CActConfigKeyAssign : CActivity - { +namespace TJAPlayer3 { + internal class CActConfigKeyAssign : CActivity { // プロパティ - public bool bキー入力待ちの最中である - { - get - { + public bool bキー入力待ちの最中である { + get { return this.bキー入力待ち; } } @@ -22,35 +14,28 @@ namespace TJAPlayer3 // メソッド - public void t開始( EKeyConfigPart part, EKeyConfigPad pad, string strパッド名 ) - { - if( part != EKeyConfigPart.UNKNOWN ) - { + 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 ].入力デバイス = TJAPlayer3.ConfigIni.KeyAssign[ (int) part ][ (int) pad ][ i ].入力デバイス; - this.structReset用KeyAssign[ i ].ID = TJAPlayer3.ConfigIni.KeyAssign[ (int) part ][ (int) pad ][ i ].ID; - this.structReset用KeyAssign[ i ].コード = TJAPlayer3.ConfigIni.KeyAssign[ (int) part ][ (int) pad ][ i ].コード; + for (int i = 0; i < 0x10; i++) { + this.structReset用KeyAssign[i].入力デバイス = TJAPlayer3.ConfigIni.KeyAssign[(int)part][(int)pad][i].入力デバイス; + this.structReset用KeyAssign[i].ID = TJAPlayer3.ConfigIni.KeyAssign[(int)part][(int)pad][i].ID; + this.structReset用KeyAssign[i].コード = TJAPlayer3.ConfigIni.KeyAssign[(int)part][(int)pad][i].コード; } } } - - public void tEnter押下() - { - if( !this.bキー入力待ち ) - { + + public void tEnter押下() { + if (!this.bキー入力待ち) { TJAPlayer3.Skin.soundDecideSFX.tPlay(); - switch( this.n現在の選択行 ) - { + switch (this.n現在の選択行) { case 0x10: - for( int i = 0; i < 0x10; i++ ) - { - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ i ].入力デバイス = this.structReset用KeyAssign[ i ].入力デバイス; - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ i ].ID = this.structReset用KeyAssign[ i ].ID; - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ i ].コード = this.structReset用KeyAssign[ i ].コード; + for (int i = 0; i < 0x10; i++) { + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][i].入力デバイス = this.structReset用KeyAssign[i].入力デバイス; + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][i].ID = this.structReset用KeyAssign[i].ID; + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][i].コード = this.structReset用KeyAssign[i].コード; } return; @@ -61,93 +46,74 @@ namespace TJAPlayer3 this.bキー入力待ち = true; } } - public void t次に移動() - { - if( !this.bキー入力待ち ) - { + public void t次に移動() { + if (!this.bキー入力待ち) { TJAPlayer3.Skin.soundカーソル移動音.tPlay(); - this.n現在の選択行 = ( this.n現在の選択行 + 1 ) % 0x12; + this.n現在の選択行 = (this.n現在の選択行 + 1) % 0x12; } } - public void t前に移動() - { - if( !this.bキー入力待ち ) - { + public void t前に移動() { + if (!this.bキー入力待ち) { TJAPlayer3.Skin.soundカーソル移動音.tPlay(); - this.n現在の選択行 = ( ( this.n現在の選択行 - 1 ) + 0x12 ) % 0x12; + this.n現在の選択行 = ((this.n現在の選択行 - 1) + 0x12) % 0x12; } } - + // CActivity 実装 - public override void Activate() - { + 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 ]; + this.structReset用KeyAssign = new CConfigIni.CKeyAssign.STKEYASSIGN[0x10]; base.Activate(); } - public override void DeActivate() - { - if( !base.IsDeActivated ) - { + public override void DeActivate() { + if (!base.IsDeActivated) { //CDTXMania.tテクスチャの解放( ref this.txカーソル ); //CDTXMania.tテクスチャの解放( ref this.txHitKeyダイアログ ); base.DeActivate(); } } - public override void CreateManagedResource() - { + 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() - { + public override void ReleaseManagedResource() { base.ReleaseManagedResource(); } - public override int Draw() - { - if( !base.IsDeActivated ) - { - if( this.bキー入力待ち ) - { - if( TJAPlayer3.InputManager.Keyboard.KeyPressed( (int)SlimDXKeys.Key.Escape ) ) - { + public override int Draw() { + if (!base.IsDeActivated) { + if (this.bキー入力待ち) { + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) { TJAPlayer3.Skin.soundCancelSFX.tPlay(); this.bキー入力待ち = false; - TJAPlayer3.InputManager.Polling( false ); - } - else if( ( this.tキーチェックとアサイン_Keyboard() || this.tキーチェックとアサイン_MidiIn() ) || ( this.tキーチェックとアサイン_Joypad() || tキーチェックとアサイン_Gamepad() || this.tキーチェックとアサイン_Mouse() ) ) - { + TJAPlayer3.InputManager.Polling(false); + } else if ((this.tキーチェックとアサイン_Keyboard() || this.tキーチェックとアサイン_MidiIn()) || (this.tキーチェックとアサイン_Joypad() || tキーチェックとアサイン_Gamepad() || this.tキーチェックとアサイン_Mouse())) { this.bキー入力待ち = false; - TJAPlayer3.InputManager.Polling( false ); + TJAPlayer3.InputManager.Polling(false); } - } - else if( ( TJAPlayer3.InputManager.Keyboard.KeyPressed( (int)SlimDXKeys.Key.Delete ) && ( this.n現在の選択行 >= 0 ) ) && ( this.n現在の選択行 <= 15 ) ) - { + } else if ((TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Delete) && (this.n現在の選択行 >= 0)) && (this.n現在の選択行 <= 15)) { TJAPlayer3.Skin.soundDecideSFX.tPlay(); - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].入力デバイス = EInputDevice.Unknown; - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].ID = 0; - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].コード = 0; + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].入力デバイス = EInputDevice.Unknown; + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = 0; + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].コード = 0; } - if(TJAPlayer3.Tx.Menu_Highlight != null ) - { + if (TJAPlayer3.Tx.Menu_Highlight != null) { int num = TJAPlayer3.Skin.Config_KeyAssign_Move; int num2 = TJAPlayer3.Skin.Config_KeyAssign_Menu_Highlight[0]; - int num3 = TJAPlayer3.Skin.Config_KeyAssign_Menu_Highlight[1] + ( num * ( this.n現在の選択行 + 1 ) ); + int num3 = TJAPlayer3.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++ ) - { + for (int j = 0; j < 14; j++) { TJAPlayer3.Tx.Menu_Highlight.vcScaleRatio.X = scale; TJAPlayer3.Tx.Menu_Highlight.vcScaleRatio.Y = scale; - TJAPlayer3.Tx.Menu_Highlight.t2D描画( num2, num3 ); + TJAPlayer3.Tx.Menu_Highlight.t2D描画(num2, num3); num2 += (int)(TJAPlayer3.Tx.Menu_Highlight.szTextureSize.Width * scale); TJAPlayer3.Tx.Menu_Highlight.vcScaleRatio.X = 1; @@ -158,46 +124,43 @@ namespace TJAPlayer3 int num5 = TJAPlayer3.Skin.Config_KeyAssign_Move; int x = TJAPlayer3.Skin.Config_KeyAssign_Font[0]; int y = TJAPlayer3.Skin.Config_KeyAssign_Font[1]; - TJAPlayer3.stageコンフィグ.actFont.t文字列描画( x, y, this.strパッド名, false, 0.75f ); + TJAPlayer3.stageコンフィグ.actFont.t文字列描画(x, y, this.strパッド名, false, 0.75f); y += num5; - CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ]; - for( int i = 0; i < 0x10; i++ ) - { - switch( stkeyassignArray[ i ].入力デバイス ) - { + CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad]; + for (int i = 0; i < 0x10; i++) { + switch (stkeyassignArray[i].入力デバイス) { case EInputDevice.Keyboard: - this.tアサインコードの描画_Keyboard( i + 1, x + num5, y, stkeyassignArray[ i ].ID, stkeyassignArray[ i ].コード, this.n現在の選択行 == i ); + this.tアサインコードの描画_Keyboard(i + 1, x + num5, y, stkeyassignArray[i].ID, stkeyassignArray[i].コード, this.n現在の選択行 == i); break; case EInputDevice.MIDIInput: - this.tアサインコードの描画_MidiIn( i + 1, x + num5, y, stkeyassignArray[ i ].ID, stkeyassignArray[ i ].コード, this.n現在の選択行 == i ); + this.tアサインコードの描画_MidiIn(i + 1, x + num5, y, stkeyassignArray[i].ID, stkeyassignArray[i].コード, this.n現在の選択行 == i); break; case EInputDevice.Joypad: - this.tアサインコードの描画_Joypad( i + 1, x + num5, y, stkeyassignArray[ i ].ID, stkeyassignArray[ i ].コード, this.n現在の選択行 == i ); + this.tアサインコードの描画_Joypad(i + 1, x + num5, y, stkeyassignArray[i].ID, stkeyassignArray[i].コード, this.n現在の選択行 == i); break; case EInputDevice.Gamepad: - this.tアサインコードの描画_Gamepad( i + 1, x + num5, y, stkeyassignArray[ i ].ID, stkeyassignArray[ i ].コード, this.n現在の選択行 == i ); + this.tアサインコードの描画_Gamepad(i + 1, x + num5, y, stkeyassignArray[i].ID, stkeyassignArray[i].コード, this.n現在の選択行 == i); break; case EInputDevice.Mouse: - this.tアサインコードの描画_Mouse( i + 1, x + num5, y, stkeyassignArray[ i ].ID, stkeyassignArray[ i ].コード, this.n現在の選択行 == i ); + this.tアサインコードの描画_Mouse(i + 1, x + num5, y, stkeyassignArray[i].ID, stkeyassignArray[i].コード, this.n現在の選択行 == i); break; default: - TJAPlayer3.stageコンフィグ.actFont.t文字列描画( x + num5, y, string.Format( "{0,2}.", i + 1 ), this.n現在の選択行 == i, 0.75f ); + TJAPlayer3.stageコンフィグ.actFont.t文字列描画(x + num5, y, string.Format("{0,2}.", i + 1), this.n現在の選択行 == i, 0.75f); break; } y += num5; } - TJAPlayer3.stageコンフィグ.actFont.t文字列描画( x + num5, y, "Reset", this.n現在の選択行 == 0x10, 0.75f ); + TJAPlayer3.stageコンフィグ.actFont.t文字列描画(x + num5, y, "Reset", this.n現在の選択行 == 0x10, 0.75f); y += num5; - TJAPlayer3.stageコンフィグ.actFont.t文字列描画( x + num5, y, "<< Returnto List", this.n現在の選択行 == 0x11, 0.75f ); + TJAPlayer3.stageコンフィグ.actFont.t文字列描画(x + num5, y, "<< Returnto List", this.n現在の選択行 == 0x11, 0.75f); y += num5; - if( this.bキー入力待ち && ( TJAPlayer3.Tx.Config_KeyAssign != null ) ) - { - TJAPlayer3.Tx.Config_KeyAssign.t2D描画( TJAPlayer3.Skin.Config_KeyAssign[0], TJAPlayer3.Skin.Config_KeyAssign[1]); + if (this.bキー入力待ち && (TJAPlayer3.Tx.Config_KeyAssign != null)) { + TJAPlayer3.Tx.Config_KeyAssign.t2D描画(TJAPlayer3.Skin.Config_KeyAssign[0], TJAPlayer3.Skin.Config_KeyAssign[1]); } } return 0; @@ -208,28 +171,26 @@ namespace TJAPlayer3 #region [ private ] //----------------- - [StructLayout( LayoutKind.Sequential )] - private struct STKEYLABEL - { + [StructLayout(LayoutKind.Sequential)] + private struct STKEYLABEL { public int nCode; public string strLabel; - public STKEYLABEL( int nCode, 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]"), + 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現在の選択行; @@ -240,11 +201,9 @@ namespace TJAPlayer3 //private CTexture txHitKeyダイアログ; //private CTexture txカーソル; - private void tアサインコードの描画_Joypad( int line, int x, int y, int nID, int nCode, bool b強調 ) - { + private void tアサインコードの描画_Joypad(int line, int x, int y, int nID, int nCode, bool b強調) { string str = ""; - switch( nCode ) - { + switch (nCode) { case 0: str = "Left"; break; @@ -281,77 +240,60 @@ namespace TJAPlayer3 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) - { + } 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 ); + } else { + str = string.Format("Code{0}", nCode); } break; } - TJAPlayer3.stageコンフィグ.actFont.t文字列描画( x, y, string.Format( "{0,2}. Joypad #{1} ", line, nID ) + str, b強調, 0.75f ); + TJAPlayer3.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強調 ) - { + 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 ); - } - TJAPlayer3.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 ((8 <= nCode) && (nCode < 8 + 128)) // other buttons (128 types) { - if( stkeylabel.nCode == nCode ) - { - str = string.Format( "{0,2}. Key {1}", line, stkeylabel.strLabel ); + 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); + } + TJAPlayer3.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 ); + if (str == null) { + str = string.Format("{0,2}. Key 0x{1:X2}", line, nCode); } - TJAPlayer3.stageコンフィグ.actFont.t文字列描画( x, y, str, b強調, 0.75f ); + TJAPlayer3.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強調 ) - { - TJAPlayer3.stageコンフィグ.actFont.t文字列描画( x, y, string.Format( "{0,2}. MidiIn #{1} code.{2}", line, nID, nCode ), b強調, 0.75f ); + private void tアサインコードの描画_MidiIn(int line, int x, int y, int nID, int nCode, bool b強調) { + TJAPlayer3.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強調 ) - { - TJAPlayer3.stageコンフィグ.actFont.t文字列描画( x, y, string.Format( "{0,2}. Mouse Button{1}", line, nCode ), b強調, 0.75f ); + private void tアサインコードの描画_Mouse(int line, int x, int y, int nID, int nCode, bool b強調) { + TJAPlayer3.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 TJAPlayer3.InputManager.InputDevices ) - { - if( device.CurrentType == InputDeviceType.Gamepad ) - { + + private bool tキーチェックとアサイン_Gamepad() { + foreach (IInputDevice device in TJAPlayer3.InputManager.InputDevices) { + if (device.CurrentType == InputDeviceType.Gamepad) { for (int i = 0; i < 15; i++) // +8 for Axis, +8 for HAT { - if (device.KeyPressed(i)) - { + if (device.KeyPressed(i)) { TJAPlayer3.Skin.soundDecideSFX.tPlay(); - TJAPlayer3.ConfigIni.t指定した入力が既にアサイン済みである場合はそれを全削除する( EInputDevice.Gamepad, device.ID, i, this.pad); - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].入力デバイス = EInputDevice.Gamepad; - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].ID = device.ID; - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].コード = i; + TJAPlayer3.ConfigIni.t指定した入力が既にアサイン済みである場合はそれを全削除する(EInputDevice.Gamepad, device.ID, i, this.pad); + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].入力デバイス = EInputDevice.Gamepad; + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = device.ID; + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].コード = i; return true; } } @@ -359,21 +301,17 @@ namespace TJAPlayer3 } return false; } - private bool tキーチェックとアサイン_Joypad() - { - foreach( IInputDevice device in TJAPlayer3.InputManager.InputDevices ) - { - if( device.CurrentType == InputDeviceType.Joystick ) - { + private bool tキーチェックとアサイン_Joypad() { + foreach (IInputDevice device in TJAPlayer3.InputManager.InputDevices) { + if (device.CurrentType == InputDeviceType.Joystick) { for (int i = 0; i < 15; i++) // +8 for Axis, +8 for HAT { - if (device.KeyPressed(i)) - { + if (device.KeyPressed(i)) { TJAPlayer3.Skin.soundDecideSFX.tPlay(); - TJAPlayer3.ConfigIni.t指定した入力が既にアサイン済みである場合はそれを全削除する( EInputDevice.Joypad, device.ID, i, this.pad); - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].入力デバイス = EInputDevice.Joypad; - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].ID = device.ID; - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].コード = i; + TJAPlayer3.ConfigIni.t指定した入力が既にアサイン済みである場合はそれを全削除する(EInputDevice.Joypad, device.ID, i, this.pad); + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].入力デバイス = EInputDevice.Joypad; + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = device.ID; + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].コード = i; return true; } } @@ -381,56 +319,47 @@ namespace TJAPlayer3 } 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 && - TJAPlayer3.InputManager.Keyboard.KeyPressed(i)) - { - TJAPlayer3.Skin.soundDecideSFX.tPlay(); + 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 && + TJAPlayer3.InputManager.Keyboard.KeyPressed(i)) { + TJAPlayer3.Skin.soundDecideSFX.tPlay(); if (pad < EKeyConfigPad.Capture) - TJAPlayer3.ConfigIni.t指定した入力が既にアサイン済みである場合はそれを全削除する( EInputDevice.Keyboard, 0, i, this.pad); - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].入力デバイス = EInputDevice.Keyboard; - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].ID = 0; - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].コード = i; + TJAPlayer3.ConfigIni.t指定した入力が既にアサイン済みである場合はそれを全削除する(EInputDevice.Keyboard, 0, i, this.pad); + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].入力デバイス = EInputDevice.Keyboard; + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = 0; + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].コード = i; + return true; + } else if (i == (int)SlimDXKeys.Key.Return && TJAPlayer3.InputManager.Keyboard.KeyPressed(i)) // Remove keybind + { + TJAPlayer3.Skin.soundCancelSFX.tPlay(); + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].入力デバイス = EInputDevice.Unknown; + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = 0; + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].コード = 0; return true; } - else if (i == (int)SlimDXKeys.Key.Return && TJAPlayer3.InputManager.Keyboard.KeyPressed(i)) // Remove keybind - { - TJAPlayer3.Skin.soundCancelSFX.tPlay(); - TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].入力デバイス = EInputDevice.Unknown; - TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = 0; - TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].コード = 0; - return true; - } } return false; } - private bool tキーチェックとアサイン_MidiIn() - { - foreach( IInputDevice device in TJAPlayer3.InputManager.InputDevices ) - { - if( device.CurrentType == InputDeviceType.MidiIn ) - { - for( int i = 0; i < 0x100; i++ ) - { - if( device.KeyPressed( i ) ) - { + private bool tキーチェックとアサイン_MidiIn() { + foreach (IInputDevice device in TJAPlayer3.InputManager.InputDevices) { + if (device.CurrentType == InputDeviceType.MidiIn) { + for (int i = 0; i < 0x100; i++) { + if (device.KeyPressed(i)) { TJAPlayer3.Skin.soundDecideSFX.tPlay(); - TJAPlayer3.ConfigIni.t指定した入力が既にアサイン済みである場合はそれを全削除する( EInputDevice.MIDIInput, device.ID, i, this.pad); - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].入力デバイス = EInputDevice.MIDIInput; - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].ID = device.ID; - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].コード = i; + TJAPlayer3.ConfigIni.t指定した入力が既にアサイン済みである場合はそれを全削除する(EInputDevice.MIDIInput, device.ID, i, this.pad); + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].入力デバイス = EInputDevice.MIDIInput; + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = device.ID; + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].コード = i; return true; } } @@ -438,16 +367,13 @@ namespace TJAPlayer3 } return false; } - private bool tキーチェックとアサイン_Mouse() - { - for( int i = 0; i < 8; i++ ) - { - if( TJAPlayer3.InputManager.Mouse.KeyPressed( i ) ) - { - TJAPlayer3.ConfigIni.t指定した入力が既にアサイン済みである場合はそれを全削除する( EInputDevice.Mouse, 0, i, this.pad); - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].入力デバイス = EInputDevice.Mouse; - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].ID = 0; - TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].コード = i; + private bool tキーチェックとアサイン_Mouse() { + for (int i = 0; i < 8; i++) { + if (TJAPlayer3.InputManager.Mouse.KeyPressed(i)) { + TJAPlayer3.ConfigIni.t指定した入力が既にアサイン済みである場合はそれを全削除する(EInputDevice.Mouse, 0, i, this.pad); + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].入力デバイス = EInputDevice.Mouse; + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = 0; + TJAPlayer3.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].コード = i; } } return false; diff --git a/OpenTaiko/src/Stages/04.Config/CActConfigList.cs b/OpenTaiko/src/Stages/04.Config/CActConfigList.cs index 0a70297f..31008b3b 100644 --- a/OpenTaiko/src/Stages/04.Config/CActConfigList.cs +++ b/OpenTaiko/src/Stages/04.Config/CActConfigList.cs @@ -1,60 +1,41 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using System.Drawing; -using System.Threading; +using System.Drawing; using FDK; using SkiaSharp; -namespace TJAPlayer3 -{ - internal class CActConfigList : CActivity - { +namespace TJAPlayer3 { + internal class CActConfigList : CActivity { // プロパティ - public bool bIsKeyAssignSelected // #24525 2011.3.15 yyagi + public bool bIsKeyAssignSelected // #24525 2011.3.15 yyagi { - get - { + get { Eメニュー種別 e = this.eメニュー種別; - if (e == Eメニュー種別.KeyAssignDrums || e == Eメニュー種別.KeyAssignSystem || e == Eメニュー種別.KeyAssignTraining) - { + if (e == Eメニュー種別.KeyAssignDrums || e == Eメニュー種別.KeyAssignSystem || e == Eメニュー種別.KeyAssignTraining) { return true; - } - else - { + } else { return false; } } } - public bool bIsFocusingParameter // #32059 2013.9.17 yyagi + public bool bIsFocusingParameter // #32059 2013.9.17 yyagi { - get - { + get { return b要素値にフォーカス中; } } - public bool b現在選択されている項目はReturnToMenuである - { - get - { - CItemBase currentItem = this.list項目リスト[ this.n現在の選択項目 ]; - if (currentItem == this.iSystemReturnToMenu || currentItem == this.iDrumsReturnToMenu) - { + public bool b現在選択されている項目はReturnToMenuである { + get { + CItemBase currentItem = this.list項目リスト[this.n現在の選択項目]; + if (currentItem == this.iSystemReturnToMenu || currentItem == this.iDrumsReturnToMenu) { return true; - } - else - { + } else { return false; } } } - public CItemBase ib現在の選択項目 - { - get - { - return this.list項目リスト[ this.n現在の選択項目 ]; + public CItemBase ib現在の選択項目 { + get { + return this.list項目リスト[this.n現在の選択項目]; } } public int n現在の選択項目; @@ -63,8 +44,7 @@ namespace TJAPlayer3 // General system options #region [ t項目リストの設定_System() ] - public void t項目リストの設定_System(bool refresh = true) - { + public void t項目リストの設定_System(bool refresh = true) { this.tConfigIniへ記録する(); this.list項目リスト.Clear(); @@ -72,15 +52,15 @@ namespace TJAPlayer3 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.list項目リスト.Add(this.iSystemReturnToMenu); 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.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 ); + this.list項目リスト.Add(this.iSystemHardReloadDTX); this.iSystemLanguage = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LANGUAGE"), CItemList.EPanelType.Normal, CLangManager.langToInt(TJAPlayer3.ConfigIni.sLang), CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LANGUAGE_DESC"), @@ -93,7 +73,7 @@ namespace TJAPlayer3 this.iTaikoPlayerCount = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_PLAYERCOUNT"), 1, 5, TJAPlayer3.ConfigIni.nPlayerCount, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_PLAYERCOUNT_DESC")); - this.list項目リスト.Add( this.iTaikoPlayerCount ); + this.list項目リスト.Add(this.iTaikoPlayerCount); this.iDanTowerHide = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_HIDEDANTOWER"), TJAPlayer3.ConfigIni.bDanTowerHide, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_HIDEDANTOWER_DESC")); @@ -107,11 +87,11 @@ namespace TJAPlayer3 this.iCommonPlaySpeed = new CItemInteger(CLangManager.LangInstance.GetString("MOD_SONGSPEED"), 5, 400, TJAPlayer3.ConfigIni.nSongSpeed, CLangManager.LangInstance.GetString("SETTINGS_MOD_SONGSPEED_DESC")); - this.list項目リスト.Add( this.iCommonPlaySpeed ); + this.list項目リスト.Add(this.iCommonPlaySpeed); this.iSystemTimeStretch = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_TIMESTRETCH"), TJAPlayer3.ConfigIni.bTimeStretch, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_TIMESTRETCH_DESC")); - this.list項目リスト.Add( this.iSystemTimeStretch ); + this.list項目リスト.Add(this.iSystemTimeStretch); this.iSystemGraphicsType = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_GRAPHICSAPI"), CItemList.EPanelType.Normal, TJAPlayer3.ConfigIni.nGraphicsDeviceType, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_GRAPHICSAPI_DESC"), @@ -121,19 +101,19 @@ namespace TJAPlayer3 this.iSystemFullscreen = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_FULLSCREEN"), TJAPlayer3.ConfigIni.bFullScreen, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_FULLSCREEN_DESC")); - this.list項目リスト.Add( this.iSystemFullscreen ); + this.list項目リスト.Add(this.iSystemFullscreen); this.iSystemRandomFromSubBox = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_RANDOMSUBFOLDER"), TJAPlayer3.ConfigIni.bIncludeSubfoldersOnRandomSelect, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_RANDOMSUBFOLDER_DESC")); - this.list項目リスト.Add( this.iSystemRandomFromSubBox ); + this.list項目リスト.Add(this.iSystemRandomFromSubBox); this.iSystemVSyncWait = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VSYNC"), TJAPlayer3.ConfigIni.bEnableVSync, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VSYNC_DESC")); - this.list項目リスト.Add( this.iSystemVSyncWait ); + this.list項目リスト.Add(this.iSystemVSyncWait); this.iSystemAVI = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGMOVIE"), TJAPlayer3.ConfigIni.bEnableAVI, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGMOVIE_DESC")); - this.list項目リスト.Add( this.iSystemAVI ); + this.list項目リスト.Add(this.iSystemAVI); //if (CLangManager.fetchLang() == "ja") //{ @@ -145,86 +125,86 @@ namespace TJAPlayer3 //else this.iSystemAVIDisplayMode = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGMOVIEDISPLAY"), CItemList.EPanelType.Normal, (int)TJAPlayer3.ConfigIni.eClipDispType, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGMOVIEDISPLAY_DESC"), - new string[] { + 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") + 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"), TJAPlayer3.ConfigIni.bEnableBGA, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGA_DESC")); - this.list項目リスト.Add( this.iSystemBGA ); + this.list項目リスト.Add(this.iSystemBGA); this.iSystemPreviewSoundWait = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPREVIEWBUFFER"), 0, 0x2710, TJAPlayer3.ConfigIni.n曲が選択されてからプレビュー音が鳴るまでのウェイトms, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPREVIEWBUFFER_DESC")); - this.list項目リスト.Add( this.iSystemPreviewSoundWait ); + this.list項目リスト.Add(this.iSystemPreviewSoundWait); this.iSystemPreviewImageWait = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_IMAGEPREVIEWBUFFER"), 0, 0x2710, TJAPlayer3.ConfigIni.n曲が選択されてからプレビュー画像が表示開始されるまでのウェイトms, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_IMAGEPREVIEWBUFFER_DESC")); - this.list項目リスト.Add( this.iSystemPreviewImageWait ); + this.list項目リスト.Add(this.iSystemPreviewImageWait); this.iSystemDebugInfo = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DEBUGMODE"), TJAPlayer3.ConfigIni.bDisplayDebugInfo, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DEBUGMODE_DESC")); - this.list項目リスト.Add( this.iSystemDebugInfo ); + this.list項目リスト.Add(this.iSystemDebugInfo); this.iSystemBGAlpha = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LANEOPACITY"), 0, 0xff, TJAPlayer3.ConfigIni.n背景の透過度, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LANEOPACITY_DESC")); - this.list項目リスト.Add( this.iSystemBGAlpha ); + this.list項目リスト.Add(this.iSystemBGAlpha); this.iSystemBGMSound = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPLAYBACK"), TJAPlayer3.ConfigIni.bBGM音を発声する, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPLAYBACK_DESC")); - this.list項目リスト.Add( this.iSystemBGMSound ); + this.list項目リスト.Add(this.iSystemBGMSound); - this.iSystemApplySongVol = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_USESONGVOL"), TJAPlayer3.ConfigIni.ApplySongVol, + this.iSystemApplySongVol = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_USESONGVOL"), TJAPlayer3.ConfigIni.ApplySongVol, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_USESONGVOL_DESC")); - this.list項目リスト.Add( this.iSystemApplySongVol ); + this.list項目リスト.Add(this.iSystemApplySongVol); - this.iSystemSoundEffectLevel = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SEVOL"), CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, TJAPlayer3.ConfigIni.SoundEffectLevel, + this.iSystemSoundEffectLevel = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SEVOL"), CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, TJAPlayer3.ConfigIni.SoundEffectLevel, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SEVOL_DESC")); - this.list項目リスト.Add( this.iSystemSoundEffectLevel ); + this.list項目リスト.Add(this.iSystemSoundEffectLevel); - this.iSystemVoiceLevel = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VOICEVOL"), CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, TJAPlayer3.ConfigIni.VoiceLevel, + this.iSystemVoiceLevel = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VOICEVOL"), CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, TJAPlayer3.ConfigIni.VoiceLevel, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VOICEVOL_DESC")); - this.list項目リスト.Add( this.iSystemVoiceLevel ); + this.list項目リスト.Add(this.iSystemVoiceLevel); - this.iSystemSongPreviewLevel = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPREVIEWVOL"), CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, TJAPlayer3.ConfigIni.SongPreviewLevel, + this.iSystemSongPreviewLevel = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPREVIEWVOL"), CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, TJAPlayer3.ConfigIni.SongPreviewLevel, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPREVIEWVOL_DESC")); - this.list項目リスト.Add( this.iSystemSongPreviewLevel ); - + this.list項目リスト.Add(this.iSystemSongPreviewLevel); + this.iSystemSongPlaybackLevel = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGVOL"), CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, TJAPlayer3.ConfigIni.SongPlaybackLevel, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGVOL_DESC")); - this.list項目リスト.Add( this.iSystemSongPlaybackLevel ); + this.list項目リスト.Add(this.iSystemSongPlaybackLevel); - this.iSystemKeyboardSoundLevelIncrement = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VOLINCREMENT"), 1, 20, TJAPlayer3.ConfigIni.KeyboardSoundLevelIncrement, + this.iSystemKeyboardSoundLevelIncrement = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VOLINCREMENT"), 1, 20, TJAPlayer3.ConfigIni.KeyboardSoundLevelIncrement, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VOLINCREMENT_DESC")); - this.list項目リスト.Add( this.iSystemKeyboardSoundLevelIncrement ); + this.list項目リスト.Add(this.iSystemKeyboardSoundLevelIncrement); - this.MusicPreTimeMs = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPLAYBACKBUFFER"), 0, 10000, TJAPlayer3.ConfigIni.MusicPreTimeMs, + this.MusicPreTimeMs = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPLAYBACKBUFFER"), 0, 10000, TJAPlayer3.ConfigIni.MusicPreTimeMs, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPLAYBACKBUFFER_DESC")); - this.list項目リスト.Add(this.MusicPreTimeMs); + this.list項目リスト.Add(this.MusicPreTimeMs); - //this.iSystemStoicMode = new CItemToggle( "StoicMode", CDTXMania.ConfigIni.bストイックモード, - // "ストイック(禁欲)モード:\n以下をまとめて表示ON/OFFします。\n_プレビュー画像/動画\n_リザルト画像/動画\n_NowLoading画像\n_演奏画面の背景画像\n_BGA 画像 / AVI 動画\n_グラフ画像\n", - // "Turn ON to disable drawing\n * preview image / movie\n * result image / movie\n * nowloading image\n * wallpaper (in playing screen)\n * BGA / AVI (in playing screen)" ); - //this.list項目リスト.Add( this.iSystemStoicMode ); + //this.iSystemStoicMode = new CItemToggle( "StoicMode", CDTXMania.ConfigIni.bストイックモード, + // "ストイック(禁欲)モード:\n以下をまとめて表示ON/OFFします。\n_プレビュー画像/動画\n_リザルト画像/動画\n_NowLoading画像\n_演奏画面の背景画像\n_BGA 画像 / AVI 動画\n_グラフ画像\n", + // "Turn ON to disable drawing\n * preview image / movie\n * result image / movie\n * nowloading image\n * wallpaper (in playing screen)\n * BGA / AVI (in playing screen)" ); + //this.list項目リスト.Add( this.iSystemStoicMode ); - this.iSystemAutoResultCapture = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_AUTOSCREENSHOT"), TJAPlayer3.ConfigIni.bIsAutoResultCapture, + this.iSystemAutoResultCapture = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_AUTOSCREENSHOT"), TJAPlayer3.ConfigIni.bIsAutoResultCapture, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_AUTOSCREENSHOT_DESC")); - this.list項目リスト.Add( this.iSystemAutoResultCapture ); + this.list項目リスト.Add(this.iSystemAutoResultCapture); - SendDiscordPlayingInformation = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISCORDRPC"), - TJAPlayer3.ConfigIni.SendDiscordPlayingInformation, + SendDiscordPlayingInformation = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISCORDRPC"), + TJAPlayer3.ConfigIni.SendDiscordPlayingInformation, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISCORDRPC_DESC")); - list項目リスト.Add(SendDiscordPlayingInformation); + list項目リスト.Add(SendDiscordPlayingInformation); - this.iSystemBufferedInput = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BUFFEREDINPUT"), TJAPlayer3.ConfigIni.bBufferedInputs, + this.iSystemBufferedInput = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BUFFEREDINPUT"), TJAPlayer3.ConfigIni.bBufferedInputs, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BUFFEREDINPUT_DESC")); - this.list項目リスト.Add( this.iSystemBufferedInput ); + this.list項目リスト.Add(this.iSystemBufferedInput); this.iLogOutputLog = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LOG"), TJAPlayer3.ConfigIni.bOutputLogs, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LOG_DESC")); - this.list項目リスト.Add( this.iLogOutputLog ); + this.list項目リスト.Add(this.iLogOutputLog); // #24820 2013.1.3 yyagi @@ -237,83 +217,82 @@ namespace TJAPlayer3 // #24820 2013.1.15 yyagi this.iSystemBassBufferSizeMs = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BASSBUFFER"), 0, 99999, TJAPlayer3.ConfigIni.nBassBufferSizeMs, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BASSBUFFER_DESC")); - this.list項目リスト.Add( this.iSystemBassBufferSizeMs ); + this.list項目リスト.Add(this.iSystemBassBufferSizeMs); // #24820 2013.1.15 yyagi this.iSystemWASAPIBufferSizeMs = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_WASAPIBUFFER"), 0, 99999, TJAPlayer3.ConfigIni.nWASAPIBufferSizeMs, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_WASAPIBUFFER_DESC")); - this.list項目リスト.Add( this.iSystemWASAPIBufferSizeMs ); + this.list項目リスト.Add(this.iSystemWASAPIBufferSizeMs); // #24820 2013.1.17 yyagi this.iSystemASIODevice = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_ASIOPLAYBACK"), CItemList.EPanelType.Normal, TJAPlayer3.ConfigIni.nASIODevice, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_ASIOPLAYBACK_DESC"), - CEnumerateAllAsioDevices.GetAllASIODevices() ); - this.list項目リスト.Add( this.iSystemASIODevice ); + CEnumerateAllAsioDevices.GetAllASIODevices()); + this.list項目リスト.Add(this.iSystemASIODevice); // #33689 2014.6.17 yyagi this.iSystemSoundTimerType = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_OSTIMER"), TJAPlayer3.ConfigIni.bUseOSTimer, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_OSTIMER_DESC")); - this.list項目リスト.Add( this.iSystemSoundTimerType ); + this.list項目リスト.Add(this.iSystemSoundTimerType); - ShowChara = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYCHARA"), TJAPlayer3.ConfigIni.ShowChara, + ShowChara = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYCHARA"), TJAPlayer3.ConfigIni.ShowChara, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYCHARA_DESC")); - this.list項目リスト.Add(ShowChara); + this.list項目リスト.Add(ShowChara); - ShowDancer = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYDANCER"), TJAPlayer3.ConfigIni.ShowDancer, + ShowDancer = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYDANCER"), TJAPlayer3.ConfigIni.ShowDancer, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYDANCER_DESC")); - this.list項目リスト.Add(ShowDancer); + this.list項目リスト.Add(ShowDancer); - ShowMob = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYMOB"), TJAPlayer3.ConfigIni.ShowMob, + ShowMob = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYMOB"), TJAPlayer3.ConfigIni.ShowMob, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYMOB_DESC")); - this.list項目リスト.Add(ShowMob); + this.list項目リスト.Add(ShowMob); - ShowRunner = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYRUNNER"), TJAPlayer3.ConfigIni.ShowRunner, + ShowRunner = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYRUNNER"), TJAPlayer3.ConfigIni.ShowRunner, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYRUNNER_DESC")); - this.list項目リスト.Add(ShowRunner); + this.list項目リスト.Add(ShowRunner); - ShowFooter = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYFOOTER"), TJAPlayer3.ConfigIni.ShowFooter, + ShowFooter = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYFOOTER"), TJAPlayer3.ConfigIni.ShowFooter, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYFOOTER_DESC")); - this.list項目リスト.Add(ShowFooter); + this.list項目リスト.Add(ShowFooter); - FastRender = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_FASTRENDER"), TJAPlayer3.ConfigIni.FastRender, + FastRender = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_FASTRENDER"), TJAPlayer3.ConfigIni.FastRender, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_FASTRENDER_DESC")); - this.list項目リスト.Add(FastRender); + this.list項目リスト.Add(FastRender); - ShowPuchiChara = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYPUCHI"), TJAPlayer3.ConfigIni.ShowPuchiChara, + ShowPuchiChara = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYPUCHI"), TJAPlayer3.ConfigIni.ShowPuchiChara, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYPUCHI_DESC")); - this.list項目リスト.Add(ShowPuchiChara); + this.list項目リスト.Add(ShowPuchiChara); - SimpleMode = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SIMPLEMODE"), TJAPlayer3.ConfigIni.SimpleMode, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SIMPLEMODE_DESC")); - this.list項目リスト.Add(SimpleMode); + SimpleMode = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SIMPLEMODE"), TJAPlayer3.ConfigIni.SimpleMode, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SIMPLEMODE_DESC")); + this.list項目リスト.Add(SimpleMode); - ASyncTextureLoad = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_TEXTUREASYNC"), TJAPlayer3.ConfigIni.ASyncTextureLoad, + ASyncTextureLoad = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_TEXTUREASYNC"), TJAPlayer3.ConfigIni.ASyncTextureLoad, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_TEXTUREASYNC_DESC")); - this.list項目リスト.Add(ASyncTextureLoad); + this.list項目リスト.Add(ASyncTextureLoad); - this.iSystemSkinSubfolder = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SKIN"), CItemBase.EPanelType.Normal, nSkinIndex, + this.iSystemSkinSubfolder = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SKIN"), CItemBase.EPanelType.Normal, nSkinIndex, CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SKIN_DESC"), - //"CONFIGURATIONを抜けると、設定した\n" + - //"スキンに変更されます。", - skinNames); - this.list項目リスト.Add(this.iSystemSkinSubfolder); + //"CONFIGURATIONを抜けると、設定した\n" + + //"スキンに変更されます。", + skinNames); + this.list項目リスト.Add(this.iSystemSkinSubfolder); - this.iSystemGoToKeyAssign = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM"), CItemBase.EPanelType.Normal, + 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); OnListMenuの初期化(); - if (refresh) - { + if (refresh) { this.n現在の選択項目 = 0; this.eメニュー種別 = Eメニュー種別.System; } - + } #endregion @@ -321,8 +300,7 @@ namespace TJAPlayer3 // Gameplay options #region [ t項目リストの設定_Drums() ] - public void t項目リストの設定_Drums() - { + public void t項目リストの設定_Drums() { this.tConfigIniへ記録する(); this.list項目リスト.Clear(); @@ -330,7 +308,7 @@ namespace TJAPlayer3 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.list項目リスト.Add(this.iDrumsReturnToMenu); this.iDrumsGoToCalibration = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_GAME_CALIBRATION"), CItemBase.EPanelType.Other, CLangManager.LangInstance.GetString("SETTINGS_GAME_CALIBRATION_DESC")); @@ -346,23 +324,23 @@ namespace TJAPlayer3 this.iSystemRisky = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_GAME_BADCOUNT"), 0, 10, TJAPlayer3.ConfigIni.nRisky, CLangManager.LangInstance.GetString("SETTINGS_GAME_BADCOUNT_DESC")); - this.list項目リスト.Add( this.iSystemRisky ); + this.list項目リスト.Add(this.iSystemRisky); this.iTaikoNoInfo = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_NOINFO"), TJAPlayer3.ConfigIni.bNoInfo, CLangManager.LangInstance.GetString("SETTINGS_GAME_NOINFO_DESC")); - this.list項目リスト.Add( this.iTaikoNoInfo ); + this.list項目リスト.Add(this.iTaikoNoInfo); this.iDrumsTight = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_NOTELOCK"), TJAPlayer3.ConfigIni.bTight, CLangManager.LangInstance.GetString("SETTINGS_GAME_NOTELOCK_DESC")); - this.list項目リスト.Add( this.iDrumsTight ); - + this.list項目リスト.Add(this.iDrumsTight); + this.iSystemMinComboDrums = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_GAME_COMBODISPLAY"), 1, 0x1869f, TJAPlayer3.ConfigIni.n表示可能な最小コンボ数.Drums, CLangManager.LangInstance.GetString("SETTINGS_GAME_COMBODISPLAY_DESC")); - this.list項目リスト.Add( this.iSystemMinComboDrums ); + this.list項目リスト.Add(this.iSystemMinComboDrums); // #23580 2011.1.3 yyagi - + /* this.iInputAdjustTimeMs = new CItemInteger(CLangManager.LangInstance.GetString(78), -9999, 9999, TJAPlayer3.ConfigIni.nInputAdjustTimeMs, CLangManager.LangInstance.GetString(79)); @@ -376,72 +354,72 @@ namespace TJAPlayer3 this.iTaikoDefaultCourse = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_DEFAULTDIFF"), CItemBase.EPanelType.Normal, TJAPlayer3.ConfigIni.nDefaultCourse, CLangManager.LangInstance.GetString("SETTINGS_GAME_DEFAULTDIFF_DESC"), - new string[] { + 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.list項目リスト.Add(this.iTaikoDefaultCourse); - this.iTaikoScoreMode = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_SCOREMODE"), CItemBase.EPanelType.Normal, TJAPlayer3.ConfigIni.nScoreMode, + this.iTaikoScoreMode = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_SCOREMODE"), CItemBase.EPanelType.Normal, TJAPlayer3.ConfigIni.nScoreMode, CLangManager.LangInstance.GetString("SETTINGS_GAME_SCOREMODE_DESC"), - new string[] { "TYPE-A", "TYPE-B", "TYPE-C"}); - this.list項目リスト.Add(this.iTaikoScoreMode); + new string[] { "TYPE-A", "TYPE-B", "TYPE-C" }); + this.list項目リスト.Add(this.iTaikoScoreMode); - this.ShinuchiMode = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_SHINUCHI"), TJAPlayer3.ConfigIni.ShinuchiMode, CItemBase.EPanelType.Normal, + this.ShinuchiMode = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_SHINUCHI"), TJAPlayer3.ConfigIni.ShinuchiMode, CItemBase.EPanelType.Normal, CLangManager.LangInstance.GetString("SETTINGS_GAME_SHINUCHI_DESC")); - this.list項目リスト.Add(this.ShinuchiMode); + this.list項目リスト.Add(this.ShinuchiMode); // This does nothing vvv - this.iTaikoBranchGuide = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_BRANCHGUIDE"), TJAPlayer3.ConfigIni.bBranchGuide, + this.iTaikoBranchGuide = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_BRANCHGUIDE"), TJAPlayer3.ConfigIni.bBranchGuide, CLangManager.LangInstance.GetString("SETTINGS_GAME_BRANCHGUIDE_DESC")); - this.list項目リスト.Add(this.iTaikoBranchGuide); + this.list項目リスト.Add(this.iTaikoBranchGuide); - this.iTaikoBranchAnime = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_BRANCHANIME"), CItemBase.EPanelType.Normal, TJAPlayer3.ConfigIni.nBranchAnime, + this.iTaikoBranchAnime = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_BRANCHANIME"), CItemBase.EPanelType.Normal, TJAPlayer3.ConfigIni.nBranchAnime, CLangManager.LangInstance.GetString("SETTINGS_GAME_BRANCHANIME_DESC"), - new string[] { "TYPE-A", "TYPE-B" }); - this.list項目リスト.Add(this.iTaikoBranchAnime); + 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)TJAPlayer3.ConfigIni.eGameMode, + this.iTaikoGameMode = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_SURVIVAL"), CItemBase.EPanelType.Normal, (int)TJAPlayer3.ConfigIni.eGameMode, CLangManager.LangInstance.GetString("SETTINGS_GAME_SURVIVAL_DESC"), - new string[] { "OFF", "TYPE-A", "TYPE-B" }); - this.list項目リスト.Add( this.iTaikoGameMode ); + new string[] { "OFF", "TYPE-A", "TYPE-B" }); + this.list項目リスト.Add(this.iTaikoGameMode); - this.iTaikoBigNotesJudge = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_BIGNOTEJUDGE"), TJAPlayer3.ConfigIni.bJudgeBigNotes, + this.iTaikoBigNotesJudge = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_BIGNOTEJUDGE"), TJAPlayer3.ConfigIni.bJudgeBigNotes, CLangManager.LangInstance.GetString("SETTINGS_GAME_BIGNOTEJUDGE_DESC")); - this.list項目リスト.Add( this.iTaikoBigNotesJudge ); + this.list項目リスト.Add(this.iTaikoBigNotesJudge); - this.iTaikoForceNormalGauge = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_NORMALGAUGE"), TJAPlayer3.ConfigIni.bForceNormalGauge, + this.iTaikoForceNormalGauge = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_NORMALGAUGE"), TJAPlayer3.ConfigIni.bForceNormalGauge, CLangManager.LangInstance.GetString("SETTINGS_GAME_NORMALGAUGE_DESC")); - this.list項目リスト.Add( this.iTaikoForceNormalGauge ); + this.list項目リスト.Add(this.iTaikoForceNormalGauge); - this.iTaikoJudgeCountDisp = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_SCOREDISPLAY"), TJAPlayer3.ConfigIni.bJudgeCountDisplay, + this.iTaikoJudgeCountDisp = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_SCOREDISPLAY"), TJAPlayer3.ConfigIni.bJudgeCountDisplay, CLangManager.LangInstance.GetString("SETTINGS_GAME_SCOREDISPLAY_DESC")); - this.list項目リスト.Add( this.iTaikoJudgeCountDisp ); + this.list項目リスト.Add(this.iTaikoJudgeCountDisp); this.iShowExExtraAnime = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_EXEXTRAANIME"), TJAPlayer3.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, TJAPlayer3.ConfigIni.TokkunSkipMeasures, - CLangManager.LangInstance.GetString("SETTINGS_TRAINING_SKIPCOUNT_DESC")); + CLangManager.LangInstance.GetString("SETTINGS_TRAINING_SKIPCOUNT_DESC")); this.list項目リスト.Add(TokkunSkipCount); - this.TokkunMashInterval = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_TRAINING_JUMPINTERVAL"), 1, 9999, TJAPlayer3.ConfigIni.TokkunMashInterval, - CLangManager.LangInstance.GetString("SETTINGS_TRAINING_JUMPINTERVAL_DESC")); - this.list項目リスト.Add(TokkunMashInterval); + this.TokkunMashInterval = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_TRAINING_JUMPINTERVAL"), 1, 9999, TJAPlayer3.ConfigIni.TokkunMashInterval, + CLangManager.LangInstance.GetString("SETTINGS_TRAINING_JUMPINTERVAL_DESC")); + this.list項目リスト.Add(TokkunMashInterval); - this.iDrumsGoToKeyAssign = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME"), CItemBase.EPanelType.Normal, + 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.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 ); + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_DESC")); + this.list項目リスト.Add(this.iDrumsGoToTrainingKeyAssign); - OnListMenuの初期化(); + OnListMenuの初期化(); this.n現在の選択項目 = 0; this.eメニュー種別 = Eメニュー種別.Drums; } @@ -452,304 +430,189 @@ namespace TJAPlayer3 /// /// ESC押下時の右メニュー描画 /// - public void tEsc押下() - { - if ( this.b要素値にフォーカス中 ) // #32059 2013.9.17 add yyagi + public void tEsc押下() { + if (this.b要素値にフォーカス中) // #32059 2013.9.17 add yyagi { this.b要素値にフォーカス中 = false; } - switch (eメニュー種別) - { + switch (eメニュー種別) { case Eメニュー種別.KeyAssignSystem: - t項目リストの設定_System(); + t項目リストの設定_System(); break; case Eメニュー種別.KeyAssignDrums: case Eメニュー種別.KeyAssignTraining: t項目リストの設定_Drums(); break; - } + } // これ以外なら何もしない } - public void tEnter押下() - { + public void tEnter押下() { TJAPlayer3.Skin.soundDecideSFX.tPlay(); - if( this.b要素値にフォーカス中 ) - { + if (this.b要素値にフォーカス中) { this.b要素値にフォーカス中 = false; - } - else if( this.list項目リスト[ this.n現在の選択項目 ].e種別 == CItemBase.E種別.整数 ) - { + } else if (this.list項目リスト[this.n現在の選択項目].e種別 == CItemBase.E種別.整数) { this.b要素値にフォーカス中 = true; - } - else if( this.b現在選択されている項目はReturnToMenuである ) - { + } else if (this.b現在選択されている項目はReturnToMenuである) { //this.tConfigIniへ記録する(); //CONFIG中にスキン変化が発生すると面倒なので、一旦マスクした。 } #region [ 個々のキーアサイン ] - //太鼓のキー設定。 - else if( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignTaikoLRed ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.DRUMS, EKeyConfigPad.LRed ); - } - else if( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignTaikoRRed ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.DRUMS, EKeyConfigPad.RRed ); - } - else if( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignTaikoLBlue ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.DRUMS, EKeyConfigPad.LBlue ); - } - else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignTaikoRBlue ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.DRUMS, EKeyConfigPad.RBlue ); + //太鼓のキー設定。 + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.LRed); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.RRed); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.LBlue); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.RBlue); } - //太鼓のキー設定。2P - else if( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignTaikoLRed2P ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.DRUMS, EKeyConfigPad.LRed2P ); - } - else if( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignTaikoRRed2P ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.DRUMS, EKeyConfigPad.RRed2P ); - } - else if( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignTaikoLBlue2P ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.DRUMS, EKeyConfigPad.LBlue2P ); - } - else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignTaikoRBlue2P ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.DRUMS, EKeyConfigPad.RBlue2P ); + //太鼓のキー設定。2P + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed2P) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.LRed2P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed2P) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.RRed2P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue2P) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.LBlue2P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue2P) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.RBlue2P); } - //太鼓のキー設定。3P - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed3P) - { + //太鼓のキー設定。3P + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed3P) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.LRed3P); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed3P) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed3P) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.RRed3P); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue3P) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue3P) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.LBlue3P); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue3P) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue3P) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.RBlue3P); } - //太鼓のキー設定。4P - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed4P) - { + //太鼓のキー設定。4P + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed4P) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.LRed4P); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed4P) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed4P) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.RRed4P); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue4P) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue4P) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.LBlue4P); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue4P) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue4P) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.RBlue4P); } - //太鼓のキー設定。5P - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed5P) - { + //太鼓のキー設定。5P + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed5P) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.LRed5P); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed5P) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed5P) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.RRed5P); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue5P) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue5P) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.LBlue5P); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue5P) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue5P) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.RBlue5P); } - // Konga claps - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap) - { + // Konga claps + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.Clap); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap2P) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap2P) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.Clap2P); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap3P) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap3P) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.Clap3P); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap4P) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap4P) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.Clap4P); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap5P) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap5P) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.Clap5P); } - // Menu controls - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignDecide) - { + // Menu controls + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignDecide) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.Decide); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignCancel) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignCancel) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.Cancel); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignLeftChange) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignLeftChange) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.LeftChange); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignRightChange) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignRightChange) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.RightChange); } - // System controls - else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignSystemCapture ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.SYSTEM, EKeyConfigPad.Capture); - } - else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignSystemSongVolIncrease ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.SYSTEM, EKeyConfigPad.SongVolumeIncrease); - } - else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignSystemSongVolDecrease ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.SYSTEM, EKeyConfigPad.SongVolumeDecrease); - } - else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignSystemDisplayHit ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.SYSTEM, EKeyConfigPad.DisplayHits); - } - else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignSystemDisplayDebug ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.SYSTEM, EKeyConfigPad.DisplayDebug); - } - else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignSystemQuickConfig ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.SYSTEM, EKeyConfigPad.QuickConfig); - } - else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignSystemNewHeya ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.SYSTEM, EKeyConfigPad.NewHeya); - } - else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignSystemSortSongs ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.SYSTEM, EKeyConfigPad.SortSongs); - } - else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignSystemToggleAutoP1 ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.SYSTEM, EKeyConfigPad.ToggleAutoP1); - } - else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignSystemToggleAutoP2 ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.SYSTEM, EKeyConfigPad.ToggleAutoP2); - } - else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignSystemToggleTrainingMode ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.SYSTEM, EKeyConfigPad.ToggleTrainingMode); - } - else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignSystemCycleVideoDisplayMode ) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知( EKeyConfigPart.SYSTEM, EKeyConfigPad.CycleVideoDisplayMode); + // System controls + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemCapture) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.SYSTEM, EKeyConfigPad.Capture); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemSongVolIncrease) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.SYSTEM, EKeyConfigPad.SongVolumeIncrease); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemSongVolDecrease) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.SYSTEM, EKeyConfigPad.SongVolumeDecrease); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemDisplayHit) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.SYSTEM, EKeyConfigPad.DisplayHits); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemDisplayDebug) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.SYSTEM, EKeyConfigPad.DisplayDebug); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemQuickConfig) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.SYSTEM, EKeyConfigPad.QuickConfig); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemNewHeya) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.SYSTEM, EKeyConfigPad.NewHeya); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemSortSongs) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.SYSTEM, EKeyConfigPad.SortSongs); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemToggleAutoP1) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.SYSTEM, EKeyConfigPad.ToggleAutoP1); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemToggleAutoP2) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.SYSTEM, EKeyConfigPad.ToggleAutoP2); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemToggleTrainingMode) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.SYSTEM, EKeyConfigPad.ToggleTrainingMode); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemCycleVideoDisplayMode) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.SYSTEM, EKeyConfigPad.CycleVideoDisplayMode); } - // Training controls - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingPause) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingPause); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingToggleAuto) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingToggleAuto); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingBookmark) - { + // Training controls + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingPause) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingPause); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingToggleAuto) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingToggleAuto); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingBookmark) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingBookmark); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingIncreaseScrollSpeed) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingIncreaseScrollSpeed) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingIncreaseScrollSpeed); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingDecreaseScrollSpeed) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingDecreaseScrollSpeed) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingDecreaseScrollSpeed); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingIncreaseSongSpeed) - { - TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingIncreaseSongSpeed); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingDecreaseSongSpeed) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingIncreaseSongSpeed) { + TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingIncreaseSongSpeed); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingDecreaseSongSpeed) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingDecreaseSongSpeed); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingBranchNormal) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingBranchNormal) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingBranchNormal); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingBranchExpert) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingBranchExpert) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingBranchExpert); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingBranchMaster) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingBranchMaster) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingBranchMaster); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingMoveForwardMeasure) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingMoveForwardMeasure) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingMoveForwardMeasure); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingMoveBackMeasure) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingMoveBackMeasure) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingMoveBackMeasure); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingSkipForwardMeasure) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingSkipForwardMeasure) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingSkipForwardMeasure); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingSkipBackMeasure) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingSkipBackMeasure) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingSkipBackMeasure); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingJumpToFirstMeasure) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingJumpToFirstMeasure) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingJumpToFirstMeasure); - } - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingJumpToLastMeasure) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingJumpToLastMeasure) { TJAPlayer3.stageコンフィグ.tパッド選択通知(EKeyConfigPart.DRUMS, EKeyConfigPad.TrainingJumpToLastMeasure); - } - #endregion - else - { - // #27029 2012.1.5 from - //if( ( this.iSystemBDGroup.n現在選択されている項目番号 == (int) EBDGroup.どっちもBD ) && - // ( ( this.list項目リスト[ this.n現在の選択項目 ] == this.iSystemHHGroup ) || ( this.list項目リスト[ this.n現在の選択項目 ] == this.iSystemHitSoundPriorityHH ) ) ) - //{ - // // 変更禁止(何もしない) - //} - //else - //{ - // // 変更許可 - this.list項目リスト[ this.n現在の選択項目 ].tEnter押下(); + } + #endregion + else { + // #27029 2012.1.5 from + //if( ( this.iSystemBDGroup.n現在選択されている項目番号 == (int) EBDGroup.どっちもBD ) && + // ( ( this.list項目リスト[ this.n現在の選択項目 ] == this.iSystemHHGroup ) || ( this.list項目リスト[ this.n現在の選択項目 ] == this.iSystemHitSoundPriorityHH ) ) ) + //{ + // // 変更禁止(何もしない) + //} + //else + //{ + // // 変更許可 + this.list項目リスト[this.n現在の選択項目].tEnter押下(); - if (this.list項目リスト[this.n現在の選択項目] == this.iSystemLanguage) - { + if (this.list項目リスト[this.n現在の選択項目] == this.iSystemLanguage) { TJAPlayer3.ConfigIni.sLang = CLangManager.intToLang(this.iSystemLanguage.n現在選択されている項目番号); CLangManager.langAttach(TJAPlayer3.ConfigIni.sLang); @@ -758,93 +621,80 @@ namespace TJAPlayer3 TJAPlayer3.stageタイトル.pfMenuTitle?.Dispose(); TJAPlayer3.stageタイトル.pfBoxText?.Dispose(); - prvFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Config_Font_Scale); + prvFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Config_Font_Scale); TJAPlayer3.stageコンフィグ.ftフォント = HPrivateFastFont.tInstantiateMainFont((int)TJAPlayer3.Skin.Config_Font_Scale_Description, CFontRenderer.FontStyle.Bold); TJAPlayer3.stageタイトル.pfMenuTitle = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Title_ModeSelect_Title_Scale[0]); - TJAPlayer3.stageタイトル.pfBoxText = HPrivateFastFont.tInstantiateBoxFont(TJAPlayer3.Skin.Title_ModeSelect_Title_Scale[1]); + TJAPlayer3.stageタイトル.pfBoxText = HPrivateFastFont.tInstantiateBoxFont(TJAPlayer3.Skin.Title_ModeSelect_Title_Scale[1]); - t項目リストの設定_System(refresh : false); + t項目リストの設定_System(refresh: false); TJAPlayer3.stageコンフィグ.ReloadMenus(); } - //} + //} // Enter押下後の後処理 - if( this.list項目リスト[ this.n現在の選択項目 ] == this.iSystemFullscreen ) - { + if (this.list項目リスト[this.n現在の選択項目] == this.iSystemFullscreen) { TJAPlayer3.app.b次のタイミングで全画面_ウィンドウ切り替えを行う = true; - } - else if( this.list項目リスト[ this.n現在の選択項目 ] == this.iSystemVSyncWait ) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iSystemVSyncWait) { TJAPlayer3.ConfigIni.bEnableVSync = this.iSystemVSyncWait.bON; TJAPlayer3.app.b次のタイミングで垂直帰線同期切り替えを行う = true; } #region [ キーアサインへの遷移と脱出 ] - else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iSystemGoToKeyAssign ) // #24609 2011.4.12 yyagi - { + 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 - { + } 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 ) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iDrumsGoToTrainingKeyAssign) { + tConfigIniへ記録する(); + t項目リストの設定_KeyAssignTraining(); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iDrumsGoToCalibration) { TJAPlayer3.stageコンフィグ.actCalibrationMode.Start(); - } - else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignDrumsReturnToMenu || - this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignTrainingReturnToMenu ) // #24525 2011.3.15 yyagi - { + } 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 - { + 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 ( TJAPlayer3.EnumSongs.IsEnumerating ) - { + else if (this.list項目リスト[this.n現在の選択項目] == this.iSystemReloadDTX) // #32081 2013.10.21 yyagi + { + if (TJAPlayer3.EnumSongs.IsEnumerating) { // Debug.WriteLine( "バックグラウンドでEnumeratingSongs中だったので、一旦中断します。" ); TJAPlayer3.EnumSongs.Abort(); TJAPlayer3.actEnumSongs.DeActivate(); } TJAPlayer3.EnumSongs.StartEnumFromDisk(); - TJAPlayer3.EnumSongs.ChangeEnumeratePriority( ThreadPriority.Normal ); + TJAPlayer3.EnumSongs.ChangeEnumeratePriority(ThreadPriority.Normal); TJAPlayer3.actEnumSongs.bコマンドでの曲データ取得 = true; TJAPlayer3.actEnumSongs.Activate(); // TJAPlayer3.stage選曲.Refresh(TJAPlayer3.EnumSongs.Songs管理, true); TJAPlayer3.stageSongSelect.actSongList.ResetSongIndex(); - } - else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iSystemHardReloadDTX ) // #32081 2013.10.21 yyagi - { - if ( TJAPlayer3.EnumSongs.IsEnumerating ) - { + } else if (this.list項目リスト[this.n現在の選択項目] == this.iSystemHardReloadDTX) // #32081 2013.10.21 yyagi + { + if (TJAPlayer3.EnumSongs.IsEnumerating) { // Debug.WriteLine( "バックグラウンドでEnumeratingSongs中だったので、一旦中断します。" ); TJAPlayer3.EnumSongs.Abort(); TJAPlayer3.actEnumSongs.DeActivate(); } TJAPlayer3.EnumSongs.StartEnumFromDisk(true); - TJAPlayer3.EnumSongs.ChangeEnumeratePriority( ThreadPriority.Normal ); + TJAPlayer3.EnumSongs.ChangeEnumeratePriority(ThreadPriority.Normal); TJAPlayer3.actEnumSongs.bコマンドでの曲データ取得 = true; TJAPlayer3.actEnumSongs.Activate(); // TJAPlayer3.stage選曲.Refresh(TJAPlayer3.EnumSongs.Songs管理, true); @@ -855,24 +705,21 @@ namespace TJAPlayer3 } } - private void tGenerateSkinSample() - { + 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" ); + 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 = TJAPlayer3.Skin.Resolution[0] / 4;// bmSrc.Width / 4; int _h = TJAPlayer3.Skin.Resolution[1] / 4;// bmSrc.Height / 4; - if ( txSkinSample1 != null ) - { - TJAPlayer3.tDisposeSafely( ref txSkinSample1 ); + if (txSkinSample1 != null) { + TJAPlayer3.tDisposeSafely(ref txSkinSample1); } - txSkinSample1 = TJAPlayer3.tテクスチャの生成( bmSrc, false ); + txSkinSample1 = TJAPlayer3.tテクスチャの生成(bmSrc, false); txSkinSample1.vcScaleRatio = new Silk.NET.Maths.Vector3D(_w / (float)txSkinSample1.szTextureSize.Width, _h / (float)txSkinSample1.szTextureSize.Height, 0); @@ -882,13 +729,11 @@ namespace TJAPlayer3 } #region [ 項目リストの設定 ( Exit, KeyAssignSystem/Drums) ] - public void t項目リストの設定_Exit() - { + public void t項目リストの設定_Exit() { this.tConfigIniへ記録する(); this.eメニュー種別 = Eメニュー種別.Unknown; } - public void t項目リストの設定_KeyAssignSystem() - { + public void t項目リストの設定_KeyAssignSystem() { //this.tConfigIniへ記録する(); this.list項目リスト.Clear(); @@ -896,52 +741,51 @@ namespace TJAPlayer3 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.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.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.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.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.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.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.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.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.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.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.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.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); + this.list項目リスト.Add(this.iKeyAssignSystemCycleVideoDisplayMode); - OnListMenuの初期化(); + OnListMenuの初期化(); this.n現在の選択項目 = 0; this.eメニュー種別 = Eメニュー種別.KeyAssignSystem; } - public void t項目リストの設定_KeyAssignDrums() - { -// this.tConfigIniへ記録する(); + public void t項目リストの設定_KeyAssignDrums() { + // this.tConfigIniへ記録する(); this.list項目リスト.Clear(); // #27029 2012.1.5 from: 説明文は最大9行→13行に変更。 @@ -958,31 +802,31 @@ namespace TJAPlayer3 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"), + 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.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"), + 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.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.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"), + 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.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"), + 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"), @@ -994,11 +838,11 @@ namespace TJAPlayer3 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.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"), + 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"), @@ -1010,11 +854,11 @@ namespace TJAPlayer3 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.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"), + 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"), @@ -1026,11 +870,11 @@ namespace TJAPlayer3 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.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"), + 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"), @@ -1048,112 +892,102 @@ namespace TJAPlayer3 this.n現在の選択項目 = 0; this.eメニュー種別 = Eメニュー種別.KeyAssignDrums; } - public void t項目リストの設定_KeyAssignTraining() - { - this.list項目リスト.Clear(); + 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.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.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.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.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.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); + 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.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.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.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.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.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.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.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.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.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.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); + 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次に移動() - { + OnListMenuの初期化(); + this.n現在の選択項目 = 0; + this.eメニュー種別 = Eメニュー種別.KeyAssignTraining; + } + #endregion + public void t次に移動() { TJAPlayer3.Skin.soundカーソル移動音.tPlay(); - if( this.b要素値にフォーカス中 ) - { - this.list項目リスト[ this.n現在の選択項目 ].t項目値を前へ移動(); + if (this.b要素値にフォーカス中) { + this.list項目リスト[this.n現在の選択項目].t項目値を前へ移動(); t要素値を上下に変更中の処理(); - } - else - { + } else { this.n目標のスクロールカウンタ += 100; } } - public void t前に移動() - { + public void t前に移動() { TJAPlayer3.Skin.soundカーソル移動音.tPlay(); - if( this.b要素値にフォーカス中 ) - { - this.list項目リスト[ this.n現在の選択項目 ].t項目値を次へ移動(); + if (this.b要素値にフォーカス中) { + this.list項目リスト[this.n現在の選択項目].t項目値を次へ移動(); t要素値を上下に変更中の処理(); - } - else - { + } else { this.n目標のスクロールカウンタ -= 100; } } - private void t要素値を上下に変更中の処理() - { + private void t要素値を上下に変更中の処理() { //if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iSystemMasterVolume ) // #33700 2014.4.26 yyagi //{ // CDTXMania.Sound管理.nMasterVolume = this.iSystemMasterVolume.n現在の値; @@ -1163,85 +997,78 @@ namespace TJAPlayer3 // CActivity 実装 - public override void Activate() - { - if( this.IsActivated ) + 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 = ( TJAPlayer3.Skin.strSystemSkinSubfolders == null ) ? 0 : TJAPlayer3.Skin.strSystemSkinSubfolders.Length; - int nb = ( TJAPlayer3.Skin.strBoxDefSkinSubfolders == null ) ? 0 : TJAPlayer3.Skin.strBoxDefSkinSubfolders.Length; - skinSubFolders = new string[ ns + nb ]; - for ( int i = 0; i < ns; i++ ) - { - skinSubFolders[ i ] = TJAPlayer3.Skin.strSystemSkinSubfolders[ i ]; + int ns = (TJAPlayer3.Skin.strSystemSkinSubfolders == null) ? 0 : TJAPlayer3.Skin.strSystemSkinSubfolders.Length; + int nb = (TJAPlayer3.Skin.strBoxDefSkinSubfolders == null) ? 0 : TJAPlayer3.Skin.strBoxDefSkinSubfolders.Length; + skinSubFolders = new string[ns + nb]; + for (int i = 0; i < ns; i++) { + skinSubFolders[i] = TJAPlayer3.Skin.strSystemSkinSubfolders[i]; } - for ( int i = 0; i < nb; i++ ) - { - skinSubFolders[ ns + i ] = TJAPlayer3.Skin.strBoxDefSkinSubfolders[ i ]; + for (int i = 0; i < nb; i++) { + skinSubFolders[ns + i] = TJAPlayer3.Skin.strBoxDefSkinSubfolders[i]; } - skinSubFolder_org = TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName( true ); - Array.Sort( skinSubFolders ); - skinNames = CSkin.GetSkinName( skinSubFolders ); - nSkinIndex = Array.BinarySearch( skinSubFolders, skinSubFolder_org ); - if ( nSkinIndex < 0 ) // 念のため + skinSubFolder_org = TJAPlayer3.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.listMenu = new List(); + // this.listMenu = new List(); - this.t項目リストの設定_Drums(); // - this.t項目リストの設定_System(); // 順番として、最後にSystemを持ってくること。設定一覧の初期位置がSystemのため。 + 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.iSystemASIOBufferSizeMs_initial = this.iSystemASIOBufferSizeMs.n現在の値; // サウンドデバイスを再構築する - this.iSystemASIODevice_initial = this.iSystemASIODevice.n現在選択されている項目番号; // - this.iSystemSoundTimerType_initial = this.iSystemSoundTimerType.GetIndex(); // + this.iSystemSoundType_initial = this.iSystemSoundType.n現在選択されている項目番号; // CONFIGに入ったときの値を保持しておく + this.iSystemBassBufferSizeMs_initial = this.iSystemBassBufferSizeMs.n現在の値; // CONFIG脱出時にこの値から変更されているようなら + this.iSystemWASAPIBufferSizeMs_initial = this.iSystemWASAPIBufferSizeMs.n現在の値; // CONFIG脱出時にこの値から変更されているようなら + // this.iSystemASIOBufferSizeMs_initial = this.iSystemASIOBufferSizeMs.n現在の値; // サウンドデバイスを再構築する + this.iSystemASIODevice_initial = this.iSystemASIODevice.n現在選択されている項目番号; // + this.iSystemSoundTimerType_initial = this.iSystemSoundTimerType.GetIndex(); // base.Activate(); } - public override void DeActivate() - { - if( this.IsDeActivated ) + public override void DeActivate() { + if (this.IsDeActivated) return; this.tConfigIniへ記録する(); this.list項目リスト.Clear(); this.ct三角矢印アニメ = null; - + base.DeActivate(); #region [ Skin変更 ] - if ( TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName( true ) != this.skinSubFolder_org ) - { - TJAPlayer3.app.RefreshSkin(); - } + if (TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName(true) != this.skinSubFolder_org) { + TJAPlayer3.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現在選択されている項目番号 || + if (this.iSystemSoundType_initial != this.iSystemSoundType.n現在選択されている項目番号 || this.iSystemBassBufferSizeMs_initial != this.iSystemBassBufferSizeMs.n現在の値 || this.iSystemWASAPIBufferSizeMs_initial != this.iSystemWASAPIBufferSizeMs.n現在の値 || // this.iSystemASIOBufferSizeMs_initial != this.iSystemASIOBufferSizeMs.n現在の値 || this.iSystemASIODevice_initial != this.iSystemASIODevice.n現在選択されている項目番号 || - this.iSystemSoundTimerType_initial != this.iSystemSoundTimerType.GetIndex() ) - { + this.iSystemSoundTimerType_initial != this.iSystemSoundTimerType.GetIndex()) { ESoundDeviceType soundDeviceType; - switch (this.iSystemSoundType.n現在選択されている項目番号) - { + switch (this.iSystemSoundType.n現在選択されている項目番号) { case 0: soundDeviceType = ESoundDeviceType.Bass; break; @@ -1258,13 +1085,13 @@ namespace TJAPlayer3 soundDeviceType = ESoundDeviceType.Unknown; break; } - TJAPlayer3.SoundManager.tInitialize( soundDeviceType, + TJAPlayer3.SoundManager.tInitialize(soundDeviceType, this.iSystemBassBufferSizeMs.n現在の値, this.iSystemWASAPIBufferSizeMs.n現在の値, 0, // this.iSystemASIOBufferSizeMs.n現在の値, this.iSystemASIODevice.n現在選択されている項目番号, - this.iSystemSoundTimerType.bON ); + this.iSystemSoundTimerType.bON); TJAPlayer3.app.ShowWindowTitleWithSoundType(); TJAPlayer3.Skin.ReloadSkin();// 音声の再読み込みをすることによって、音量の初期化を防ぐ } @@ -1273,126 +1100,102 @@ namespace TJAPlayer3 FDK.SoundManager.bIsTimeStretch = this.iSystemTimeStretch.bON; #endregion } - public override void CreateManagedResource() - { - this.prvFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Config_Font_Scale); // t項目リストの設定 の前に必要 + public override void CreateManagedResource() { + this.prvFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Config_Font_Scale); // t項目リストの設定 の前に必要 //this.tx通常項目行パネル = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\4_itembox.png" ), false ); //this.txその他項目行パネル = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\4_itembox other.png" ), false ); //this.tx三角矢印 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\4_triangle arrow.png" ), false ); - this.txSkinSample1 = null; // スキン選択時に動的に設定するため、ここでは初期化しない + this.txSkinSample1 = null; // スキン選択時に動的に設定するため、ここでは初期化しない base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { prvFont.Dispose(); - - TJAPlayer3.tテクスチャの解放( ref this.txSkinSample1 ); + + TJAPlayer3.tテクスチャの解放(ref this.txSkinSample1); //CDTXMania.tテクスチャの解放( ref this.tx通常項目行パネル ); //CDTXMania.tテクスチャの解放( ref this.txその他項目行パネル ); //CDTXMania.tテクスチャの解放( ref this.tx三角矢印 ); - + base.ReleaseManagedResource(); } - private void OnListMenuの初期化() - { + private void OnListMenuの初期化() { OnListMenuの解放(); - this.listMenu = new stMenuItemRight[ this.list項目リスト.Count ]; + 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(); + 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(); + if (listMenu[i].txMenuItemRight != null) { + listMenu[i].txMenuItemRight.Dispose(); } } this.listMenu = null; } } - public override int Draw() - { - throw new InvalidOperationException( "t進行描画(bool)のほうを使用してください。" ); + public override int Draw() { + throw new InvalidOperationException("t進行描画(bool)のほうを使用してください。"); } - public int t進行描画( bool b項目リスト側にフォーカスがある ) - { - if( this.IsDeActivated ) + public int t進行描画(bool b項目リスト側にフォーカスがある) { + if (this.IsDeActivated) return 0; // 進行 #region [ 初めての進行描画 ] //----------------- - if( base.IsFirstDraw ) - { + if (base.IsFirstDraw) { this.nスクロール用タイマ値 = (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - this.ct三角矢印アニメ.Start( 0, 9, 50, TJAPlayer3.Timer ); - + this.ct三角矢印アニメ.Start(0, 9, 50, TJAPlayer3.Timer); + base.IsFirstDraw = false; } //----------------- #endregion - this.b項目リスト側にフォーカスがある = b項目リスト側にフォーカスがある; // 記憶 + this.b項目リスト側にフォーカスがある = b項目リスト側にフォーカスがある; // 記憶 #region [ 項目スクロールの進行 ] //----------------- long n現在時刻 = TJAPlayer3.Timer.NowTime; - if( n現在時刻 < this.nスクロール用タイマ値 ) this.nスクロール用タイマ値 = n現在時刻; + 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現在のスクロールカウンタ ) ); + 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 ) - { + if (n目標項目までのスクロール量 <= 100) { n加速度 = 2; - } - else if( n目標項目までのスクロール量 <= 300 ) - { + } else if (n目標項目までのスクロール量 <= 300) { n加速度 = 3; - } - else if( n目標項目までのスクロール量 <= 500 ) - { + } else if (n目標項目までのスクロール量 <= 500) { n加速度 = 4; - } - else - { + } else { n加速度 = 8; } //----------------- #endregion #region [ this.n現在のスクロールカウンタに n加速度 を加減算。] //----------------- - if( this.n現在のスクロールカウンタ < this.n目標のスクロールカウンタ ) - { + if (this.n現在のスクロールカウンタ < this.n目標のスクロールカウンタ) { this.n現在のスクロールカウンタ += n加速度; - if( this.n現在のスクロールカウンタ > this.n目標のスクロールカウンタ ) - { + if (this.n現在のスクロールカウンタ > this.n目標のスクロールカウンタ) { // 目標を超えたら目標値で停止。 this.n現在のスクロールカウンタ = this.n目標のスクロールカウンタ; } - } - else if( this.n現在のスクロールカウンタ > this.n目標のスクロールカウンタ ) - { + } else if (this.n現在のスクロールカウンタ > this.n目標のスクロールカウンタ) { this.n現在のスクロールカウンタ -= n加速度; - if( this.n現在のスクロールカウンタ < this.n目標のスクロールカウンタ ) - { + if (this.n現在のスクロールカウンタ < this.n目標のスクロールカウンタ) { // 目標を超えたら目標値で停止。 this.n現在のスクロールカウンタ = this.n目標のスクロールカウンタ; } @@ -1401,23 +1204,18 @@ namespace TJAPlayer3 #endregion #region [ 行超え処理、ならびに目標位置に到達したらスクロールを停止して項目変更通知を発行。] //----------------- - if( this.n現在のスクロールカウンタ >= 100 ) - { - this.n現在の選択項目 = this.t次の項目( this.n現在の選択項目 ); + if (this.n現在のスクロールカウンタ >= 100) { + this.n現在の選択項目 = this.t次の項目(this.n現在の選択項目); this.n現在のスクロールカウンタ -= 100; this.n目標のスクロールカウンタ -= 100; - if( this.n目標のスクロールカウンタ == 0 ) - { + if (this.n目標のスクロールカウンタ == 0) { TJAPlayer3.stageコンフィグ.t項目変更通知(); } - } - else if( this.n現在のスクロールカウンタ <= -100 ) - { - this.n現在の選択項目 = this.t前の項目( this.n現在の選択項目 ); + } else if (this.n現在のスクロールカウンタ <= -100) { + this.n現在の選択項目 = this.t前の項目(this.n現在の選択項目); this.n現在のスクロールカウンタ += 100; this.n目標のスクロールカウンタ += 100; - if( this.n目標のスクロールカウンタ == 0 ) - { + if (this.n目標のスクロールカウンタ == 0) { TJAPlayer3.stageコンフィグ.t項目変更通知(); } } @@ -1428,10 +1226,10 @@ namespace TJAPlayer3 } //----------------- #endregion - + #region [ ▲印アニメの進行 ] //----------------- - if( this.b項目リスト側にフォーカスがある && ( this.n目標のスクロールカウンタ == 0 ) ) + if (this.b項目リスト側にフォーカスがある && (this.n目標のスクロールカウンタ == 0)) this.ct三角矢印アニメ.TickLoop(); //----------------- #endregion @@ -1444,53 +1242,49 @@ namespace TJAPlayer3 #region [ 計11個の項目パネルを描画する。] //----------------- int nItem = this.n現在の選択項目; - for( int i = 0; i < (TJAPlayer3.Skin.Config_ItemBox_Count / 2) - 1; i++ ) - nItem = this.t前の項目( nItem ); + for (int i = 0; i < (TJAPlayer3.Skin.Config_ItemBox_Count / 2) - 1; i++) + nItem = this.t前の項目(nItem); - for( int i = 0; i < TJAPlayer3.Skin.Config_ItemBox_Count; i++ ) // n行番号 == 0 がフォーカスされている項目パネル。 + for (int i = 0; i < TJAPlayer3.Skin.Config_ItemBox_Count; i++) // n行番号 == 0 がフォーカスされている項目パネル。 { bool centerFlag = i == (TJAPlayer3.Skin.Config_ItemBox_Count / 2) - 1; #region [ 今まさに画面外に飛びだそうとしている項目パネルは描画しない。] //----------------- - if ( ( ( i == 0 ) && ( this.n現在のスクロールカウンタ > 0 ) ) || // 上に飛び出そうとしている - ( ( i == TJAPlayer3.Skin.Config_ItemBox_Count - 1) && ( this.n現在のスクロールカウンタ < 0 ) ) ) // 下に飛び出そうとしている + if (((i == 0) && (this.n現在のスクロールカウンタ > 0)) || // 上に飛び出そうとしている + ((i == TJAPlayer3.Skin.Config_ItemBox_Count - 1) && (this.n現在のスクロールカウンタ < 0))) // 下に飛び出そうとしている { - nItem = this.t次の項目( nItem ); + nItem = this.t次の項目(nItem); continue; } //----------------- #endregion - int n移動先の行の基本位置 = ( this.n現在のスクロールカウンタ <= 0 ) ? ( ( i + 1 ) % TJAPlayer3.Skin.Config_ItemBox_Count) : ( ( ( i - 1 ) + TJAPlayer3.Skin.Config_ItemBox_Count) % TJAPlayer3.Skin.Config_ItemBox_Count); - int x = TJAPlayer3.Skin.Config_ItemBox_X[ i ] + ( (int) ( (TJAPlayer3.Skin.Config_ItemBox_X[ n移動先の行の基本位置 ] - TJAPlayer3.Skin.Config_ItemBox_X[ i ] ) * ( ( (double) Math.Abs( this.n現在のスクロールカウンタ ) ) / 100.0 ) ) ); - int y = TJAPlayer3.Skin.Config_ItemBox_Y[ i ] + ( (int) ( (TJAPlayer3.Skin.Config_ItemBox_Y[ n移動先の行の基本位置 ] - TJAPlayer3.Skin.Config_ItemBox_Y[ i ] ) * ( ( (double) Math.Abs( this.n現在のスクロールカウンタ ) ) / 100.0 ) ) ); + int n移動先の行の基本位置 = (this.n現在のスクロールカウンタ <= 0) ? ((i + 1) % TJAPlayer3.Skin.Config_ItemBox_Count) : (((i - 1) + TJAPlayer3.Skin.Config_ItemBox_Count) % TJAPlayer3.Skin.Config_ItemBox_Count); + int x = TJAPlayer3.Skin.Config_ItemBox_X[i] + ((int)((TJAPlayer3.Skin.Config_ItemBox_X[n移動先の行の基本位置] - TJAPlayer3.Skin.Config_ItemBox_X[i]) * (((double)Math.Abs(this.n現在のスクロールカウンタ)) / 100.0))); + int y = TJAPlayer3.Skin.Config_ItemBox_Y[i] + ((int)((TJAPlayer3.Skin.Config_ItemBox_Y[n移動先の行の基本位置] - TJAPlayer3.Skin.Config_ItemBox_Y[i]) * (((double)Math.Abs(this.n現在のスクロールカウンタ)) / 100.0))); #region [ 現在の行の項目パネル枠を描画。] //----------------- - switch( this.list項目リスト[ nItem ].eパネル種別 ) - { + switch (this.list項目リスト[nItem].eパネル種別) { case CItemBase.EPanelType.Normal: - case CItemBase.EPanelType.Other: - if ( TJAPlayer3.Tx.Config_ItemBox != null ) - TJAPlayer3.Tx.Config_ItemBox.t2D描画( x, y ); + case CItemBase.EPanelType.Other: + if (TJAPlayer3.Tx.Config_ItemBox != null) + TJAPlayer3.Tx.Config_ItemBox.t2D描画(x, y); break; } //----------------- #endregion #region [ 現在の行の項目名を描画。] //----------------- - if ( listMenu[ nItem ].txMenuItemRight != null ) // 自前のキャッシュに含まれているようなら、再レンダリングせずキャッシュを使用 + if (listMenu[nItem].txMenuItemRight != null) // 自前のキャッシュに含まれているようなら、再レンダリングせずキャッシュを使用 { - listMenu[nItem].txMenuItemRight.t2D描画(x + TJAPlayer3.Skin.Config_ItemBox_Font_Offset[0], y + TJAPlayer3.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 = TJAPlayer3.tテクスチャの生成( bmpItem ); - // ctItem.t2D描画( CDTXMania.app.Device, ( x + 0x12 ) * Scale.X, ( y + 12 ) * Scale.Y - 20 ); - // CDTXMania.tテクスチャの解放( ref ctItem ); + listMenu[nItem].txMenuItemRight.t2D描画(x + TJAPlayer3.Skin.Config_ItemBox_Font_Offset[0], y + TJAPlayer3.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 = TJAPlayer3.tテクスチャの生成(bmpItem); + // ctItem.t2D描画( CDTXMania.app.Device, ( x + 0x12 ) * Scale.X, ( y + 12 ) * Scale.Y - 20 ); + // CDTXMania.tテクスチャの解放( ref ctItem ); } } //CDTXMania.stageコンフィグ.actFont.t文字列描画( x + 0x12, y + 12, this.list項目リスト[ nItem ].str項目名 ); @@ -1500,22 +1294,20 @@ namespace TJAPlayer3 //----------------- string strParam = null; bool b強調 = false; - switch ( this.list項目リスト[ nItem ].e種別 ) - { + switch (this.list項目リスト[nItem].e種別) { case CItemBase.E種別.ONorOFFトグル: #region [ *** ] //----------------- //CDTXMania.stageコンフィグ.actFont.t文字列描画( x + 210, y + 12, ( (CItemToggle) this.list項目リスト[ nItem ] ).bON ? "ON" : "OFF" ); - strParam = ( (CItemToggle) this.list項目リスト[ nItem ] ).bON ? "ON" : "OFF"; + strParam = ((CItemToggle)this.list項目リスト[nItem]).bON ? "ON" : "OFF"; break; //----------------- - #endregion + #endregion case CItemBase.E種別.ONorOFFor不定スリーステート: #region [ *** ] //----------------- - switch ( ( (CItemThreeState) this.list項目リスト[ nItem ] ).e現在の状態 ) - { + switch (((CItemThreeState)this.list項目リスト[nItem]).e現在の状態) { case CItemThreeState.E状態.ON: strParam = "ON"; break; @@ -1531,16 +1323,15 @@ namespace TJAPlayer3 //CDTXMania.stageコンフィグ.actFont.t文字列描画( x + 210, y + 12, "ON" ); break; //----------------- - #endregion + #endregion - case CItemBase.E種別.整数: // #24789 2011.4.8 yyagi: add PlaySpeed supports (copied them from OPTION) + 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; + if (this.list項目リスト[nItem] == this.iCommonPlaySpeed) { + double d = ((double)((CItemInteger)this.list項目リスト[nItem]).n現在の値) / 20.0; //CDTXMania.stageコンフィグ.actFont.t文字列描画( x + 210, y + 12, d.ToString( "0.000" ), ( n行番号 == 0 ) && this.b要素値にフォーカス中 ); - strParam = d.ToString( "0.000" ); + strParam = d.ToString("0.000"); } /*else if ( this.list項目リスト[ nItem ] == this.iDrumsScrollSpeed) { @@ -1548,102 +1339,88 @@ namespace TJAPlayer3 //CDTXMania.stageコンフィグ.actFont.t文字列描画( x + 210, y + 12, f.ToString( "x0.0" ), ( n行番号 == 0 ) && this.b要素値にフォーカス中 ); strParam = f.ToString( "x0.0" ); }*/ - else - { + else { //CDTXMania.stageコンフィグ.actFont.t文字列描画( x + 210, y + 12, ( (CItemInteger) this.list項目リスト[ nItem ] ).n現在の値.ToString(), ( n行番号 == 0 ) && this.b要素値にフォーカス中 ); - strParam = ( (CItemInteger) this.list項目リスト[ nItem ] ).n現在の値.ToString(); + strParam = ((CItemInteger)this.list項目リスト[nItem]).n現在の値.ToString(); } b強調 = centerFlag && this.b要素値にフォーカス中; break; //----------------- - #endregion + #endregion - case CItemBase.E種別.リスト: // #28195 2012.5.2 yyagi: add Skin supports + case CItemBase.E種別.リスト: // #28195 2012.5.2 yyagi: add Skin supports #region [ *** ] //----------------- { - CItemList list = (CItemList) this.list項目リスト[ nItem ]; + CItemList list = (CItemList)this.list項目リスト[nItem]; //CDTXMania.stageコンフィグ.actFont.t文字列描画( x + 210, y + 12, list.list項目値[ list.n現在選択されている項目番号 ] ); - strParam = list.list項目値[ list.n現在選択されている項目番号 ]; + 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描画( TJAPlayer3.Skin.Config_SkinSample1[0], TJAPlayer3.Skin.Config_SkinSample1[1]); + if (this.list項目リスト[this.n現在の選択項目] == this.iSystemSkinSubfolder) { + tGenerateSkinSample(); // 最初にSkinの選択肢にきたとき(Enterを押す前)に限り、サンプル生成が発生する。 + if (txSkinSample1 != null) { + txSkinSample1.t2D描画(TJAPlayer3.Skin.Config_SkinSample1[0], TJAPlayer3.Skin.Config_SkinSample1[1]); } } #endregion break; } - //----------------- + //----------------- #endregion } - if ( b強調 ) - { - using (var bmpStr = prvFont.DrawText(strParam, - Color.Black, - Color.White, - null, - TJAPlayer3.Skin.Config_Selected_Menu_Text_Grad_Color_1, + if (b強調) { + using (var bmpStr = prvFont.DrawText(strParam, + Color.Black, + Color.White, + null, + TJAPlayer3.Skin.Config_Selected_Menu_Text_Grad_Color_1, TJAPlayer3.Skin.Config_Selected_Menu_Text_Grad_Color_2, - 30)) - { - using (var txStr = TJAPlayer3.tテクスチャの生成( bmpStr, false )) - { - txStr.t2D描画( x + TJAPlayer3.Skin.Config_ItemBox_ItemValue_Font_Offset[0], y + TJAPlayer3.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 ]; + 30)) { + using (var txStr = TJAPlayer3.tテクスチャの生成(bmpStr, false)) { + txStr.t2D描画(x + TJAPlayer3.Skin.Config_ItemBox_ItemValue_Font_Offset[0], y + TJAPlayer3.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(); + 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 = TJAPlayer3.tテクスチャの生成( bmpStr, false ); + using (var bmpStr = prvFont.DrawText(strParam, Color.White, Color.Black, null, 30)) { + stm.txParam = TJAPlayer3.tテクスチャの生成(bmpStr, false); } - listMenu[ nItem ] = stm; + listMenu[nItem] = stm; } - listMenu[ nItem ].txParam.t2D描画( x + TJAPlayer3.Skin.Config_ItemBox_ItemValue_Font_Offset[0], y + TJAPlayer3.Skin.Config_ItemBox_ItemValue_Font_Offset[1]); + listMenu[nItem].txParam.t2D描画(x + TJAPlayer3.Skin.Config_ItemBox_ItemValue_Font_Offset[0], y + TJAPlayer3.Skin.Config_ItemBox_ItemValue_Font_Offset[1]); } //----------------- #endregion - - nItem = this.t次の項目( nItem ); + + nItem = this.t次の項目(nItem); } //----------------- #endregion - + #region [ 項目リストにフォーカスがあって、かつスクロールが停止しているなら、パネルの上下に▲印を描画する。] //----------------- - if( this.b項目リスト側にフォーカスがある && ( this.n目標のスクロールカウンタ == 0 ) ) - { + if (this.b項目リスト側にフォーカスがある && (this.n目標のスクロールカウンタ == 0)) { int x_upper; int x_lower; int y_upper; int y_lower; - + // 位置決定。 - if( this.b要素値にフォーカス中 ) - { + if (this.b要素値にフォーカス中) { x_upper = TJAPlayer3.Skin.Config_Arrow_Focus_X[0]; // 要素値の上下あたり。 x_lower = TJAPlayer3.Skin.Config_Arrow_Focus_X[1]; // 要素値の上下あたり。 y_upper = TJAPlayer3.Skin.Config_Arrow_Focus_Y[0] - this.ct三角矢印アニメ.CurrentValue; y_lower = TJAPlayer3.Skin.Config_Arrow_Focus_Y[1] + this.ct三角矢印アニメ.CurrentValue; - } - else - { + } else { x_upper = TJAPlayer3.Skin.Config_Arrow_X[0]; // 要素値の上下あたり。 x_lower = TJAPlayer3.Skin.Config_Arrow_X[1]; // 要素値の上下あたり。 y_upper = TJAPlayer3.Skin.Config_Arrow_Y[0] - this.ct三角矢印アニメ.CurrentValue; @@ -1651,28 +1428,26 @@ namespace TJAPlayer3 } // 描画。 - - if( TJAPlayer3.Tx.Config_Arrow != null ) - { - TJAPlayer3.Tx.Config_Arrow.t2D描画( x_upper, y_upper, new Rectangle( 0, 0, TJAPlayer3.Tx.Config_Arrow.sz画像サイズ.Width, TJAPlayer3.Tx.Config_Arrow.sz画像サイズ.Height / 2) ); - TJAPlayer3.Tx.Config_Arrow.t2D描画( x_lower, y_lower, new Rectangle( 0, TJAPlayer3.Tx.Config_Arrow.sz画像サイズ.Height / 2, TJAPlayer3.Tx.Config_Arrow.sz画像サイズ.Width, TJAPlayer3.Tx.Config_Arrow.sz画像サイズ.Height / 2) ); + + if (TJAPlayer3.Tx.Config_Arrow != null) { + TJAPlayer3.Tx.Config_Arrow.t2D描画(x_upper, y_upper, new Rectangle(0, 0, TJAPlayer3.Tx.Config_Arrow.sz画像サイズ.Width, TJAPlayer3.Tx.Config_Arrow.sz画像サイズ.Height / 2)); + TJAPlayer3.Tx.Config_Arrow.t2D描画(x_lower, y_lower, new Rectangle(0, TJAPlayer3.Tx.Config_Arrow.sz画像サイズ.Height / 2, TJAPlayer3.Tx.Config_Arrow.sz画像サイズ.Width, TJAPlayer3.Tx.Config_Arrow.sz画像サイズ.Height / 2)); } } //----------------- #endregion return 0; } - + // その他 #region [ private ] //----------------- - private enum Eメニュー種別 - { + private enum Eメニュー種別 { System, Drums, - KeyAssignSystem, // #24609 2011.4.12 yyagi: 画面キャプチャキーのアサイン + KeyAssignSystem, // #24609 2011.4.12 yyagi: 画面キャプチャキーのアサイン KeyAssignDrums, KeyAssignTraining, Unknown @@ -1683,14 +1458,14 @@ namespace TJAPlayer3 private bool b要素値にフォーカス中; private CCounter ct三角矢印アニメ; private Eメニュー種別 eメニュー種別; - #region [ Key Config ] + #region [ Key Config ] - private CItemBase iKeyAssignSystemReturnToMenu; // #24609 - private CItemBase iKeyAssignDrumsReturnToMenu; - private CItemBase iKeyAssignTrainingReturnToMenu; + private CItemBase iKeyAssignSystemReturnToMenu; // #24609 + private CItemBase iKeyAssignDrumsReturnToMenu; + private CItemBase iKeyAssignTrainingReturnToMenu; - #region [System] - private CItemBase iKeyAssignSystemCapture; // #24609 + #region [System] + private CItemBase iKeyAssignSystemCapture; // #24609 private CItemBase iKeyAssignSystemSongVolIncrease; private CItemBase iKeyAssignSystemSongVolDecrease; private CItemBase iKeyAssignSystemDisplayHit; @@ -1702,10 +1477,10 @@ namespace TJAPlayer3 private CItemBase iKeyAssignSystemToggleAutoP2; private CItemBase iKeyAssignSystemToggleTrainingMode; private CItemBase iKeyAssignSystemCycleVideoDisplayMode; - #endregion + #endregion - #region [Drum] - private CItemBase iKeyAssignTaikoLRed; + #region [Drum] + private CItemBase iKeyAssignTaikoLRed; private CItemBase iKeyAssignTaikoRRed; private CItemBase iKeyAssignTaikoLBlue; private CItemBase iKeyAssignTaikoRBlue; @@ -1744,32 +1519,32 @@ namespace TJAPlayer3 #region [Training] private CItemBase iKeyAssignTrainingIncreaseScrollSpeed; - private CItemBase iKeyAssignTrainingDecreaseScrollSpeed; + private CItemBase iKeyAssignTrainingDecreaseScrollSpeed; private CItemBase iKeyAssignTrainingToggleAuto; private CItemBase iKeyAssignTrainingBranchNormal; - private CItemBase iKeyAssignTrainingBranchExpert; - private CItemBase iKeyAssignTrainingBranchMaster; + 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 iKeyAssignTrainingSkipBackMeasure; private CItemBase iKeyAssignTrainingIncreaseSongSpeed; private CItemBase iKeyAssignTrainingDecreaseSongSpeed; private CItemBase iKeyAssignTrainingJumpToFirstMeasure; private CItemBase iKeyAssignTrainingJumpToLastMeasure; - #endregion + #endregion - #endregion - private CItemToggle iLogOutputLog; + #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 iSystemSongPreviewLevel; + private CItemInteger iSystemSongPlaybackLevel; private CItemInteger iSystemKeyboardSoundLevelIncrement; private CItemToggle iSystemAVI; private CItemList iSystemAVIDisplayMode; @@ -1785,29 +1560,29 @@ namespace TJAPlayer3 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 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 CItemInteger iSystemASIOBufferSizeMs; // #24820 2013.1.3 yyagi - private CItemList iSystemASIODevice; // #24820 2013.1.17 yyagi + + private CItemInteger iSystemBassBufferSizeMs; // #24820 2013.1.15 yyagi + private CItemInteger iSystemWASAPIBufferSizeMs; // #24820 2013.1.15 yyagi + // private CItemInteger iSystemASIOBufferSizeMs; // #24820 2013.1.3 yyagi + private CItemList iSystemASIODevice; // #24820 2013.1.17 yyagi private int iSystemSoundType_initial; private int iSystemBassBufferSizeMs_initial; private int iSystemWASAPIBufferSizeMs_initial; -// private int iSystemASIOBufferSizeMs_initial; + // private int iSystemASIOBufferSizeMs_initial; private int iSystemASIODevice_initial; - private CItemToggle iSystemSoundTimerType; // #33689 2014.6.17 yyagi - private int iSystemSoundTimerType_initial; // #33689 2014.6.17 yyagi + 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 CItemToggle iSystemTimeStretch; // #23664 2013.2.24 yyagi private List list項目リスト; private long nスクロール用タイマ値; @@ -1827,8 +1602,7 @@ namespace TJAPlayer3 private CCachedFontRenderer prvFont; //private List list項目リスト_str最終描画名; - private struct stMenuItemRight - { + private struct stMenuItemRight { // public string strMenuItem; public CTexture txMenuItemRight; public int nParam; @@ -1837,12 +1611,12 @@ namespace TJAPlayer3 } 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 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; @@ -1855,69 +1629,63 @@ namespace TJAPlayer3 private CItemBase iDrumsReturnToMenu; private CItemInteger iDrumsScrollSpeed; private CItemToggle iDrumsTight; - private CItemToggle iTaikoAutoPlay; - private CItemToggle iTaikoAutoPlay2P; - private CItemToggle iTaikoAutoRoll; + private CItemToggle iTaikoAutoPlay; + private CItemToggle iTaikoAutoPlay2P; + private CItemToggle iTaikoAutoRoll; 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 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; + 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 CItemList iSystemSkinSubfolder; // #28195 2012.5.2 yyagi + private CItemBase iSystemReloadDTX; // #32081 2013.10.21 yyagi private CItemBase iSystemHardReloadDTX; //private CItemInteger iSystemMasterVolume; // #33700 2014.4.26 yyagi - private int t前の項目( int nItem ) - { - if( --nItem < 0 ) - { + 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 ) - { + private int t次の項目(int nItem) { + if (++nItem >= this.list項目リスト.Count) { nItem = 0; } return nItem; } - private void tConfigIniへ記録する() - { - switch( this.eメニュー種別 ) - { + private void tConfigIniへ記録する() { + switch (this.eメニュー種別) { case Eメニュー種別.System: this.tConfigIniへ記録する_System(); return; @@ -1927,8 +1695,7 @@ namespace TJAPlayer3 return; } } - private void tConfigIniへ記録する_System() - { + private void tConfigIniへ記録する_System() { TJAPlayer3.ConfigIni.nSongSpeed = this.iCommonPlaySpeed.n現在の値; TJAPlayer3.ConfigIni.nGraphicsDeviceType = this.iSystemGraphicsType.n現在選択されている項目番号; @@ -1949,36 +1716,36 @@ namespace TJAPlayer3 TJAPlayer3.ConfigIni.bDanTowerHide = this.iDanTowerHide.bON; - // TJAPlayer3.ConfigIni.ApplyLoudnessMetadata = this.iSystemApplyLoudnessMetadata.bON; - // TJAPlayer3.ConfigIni.TargetLoudness = this.iSystemTargetLoudness.n現在の値 / 10.0; - TJAPlayer3.ConfigIni.ApplySongVol = this.iSystemApplySongVol.bON; - TJAPlayer3.ConfigIni.SoundEffectLevel = this.iSystemSoundEffectLevel.n現在の値; - TJAPlayer3.ConfigIni.VoiceLevel = this.iSystemVoiceLevel.n現在の値; - TJAPlayer3.ConfigIni.SongPreviewLevel = this.iSystemSongPreviewLevel.n現在の値; - TJAPlayer3.ConfigIni.SongPlaybackLevel = this.iSystemSongPlaybackLevel.n現在の値; - TJAPlayer3.ConfigIni.KeyboardSoundLevelIncrement = this.iSystemKeyboardSoundLevelIncrement.n現在の値; - TJAPlayer3.ConfigIni.MusicPreTimeMs = this.MusicPreTimeMs.n現在の値; + // TJAPlayer3.ConfigIni.ApplyLoudnessMetadata = this.iSystemApplyLoudnessMetadata.bON; + // TJAPlayer3.ConfigIni.TargetLoudness = this.iSystemTargetLoudness.n現在の値 / 10.0; + TJAPlayer3.ConfigIni.ApplySongVol = this.iSystemApplySongVol.bON; + TJAPlayer3.ConfigIni.SoundEffectLevel = this.iSystemSoundEffectLevel.n現在の値; + TJAPlayer3.ConfigIni.VoiceLevel = this.iSystemVoiceLevel.n現在の値; + TJAPlayer3.ConfigIni.SongPreviewLevel = this.iSystemSongPreviewLevel.n現在の値; + TJAPlayer3.ConfigIni.SongPlaybackLevel = this.iSystemSongPlaybackLevel.n現在の値; + TJAPlayer3.ConfigIni.KeyboardSoundLevelIncrement = this.iSystemKeyboardSoundLevelIncrement.n現在の値; + TJAPlayer3.ConfigIni.MusicPreTimeMs = this.MusicPreTimeMs.n現在の値; TJAPlayer3.ConfigIni.bOutputLogs = this.iLogOutputLog.bON; //CDTXMania.ConfigIni.bストイックモード = this.iSystemStoicMode.bON; //CDTXMania.ConfigIni.nShowLagType = this.iSystemShowLag.n現在選択されている項目番号; // #25370 2011.6.3 yyagi - TJAPlayer3.ConfigIni.bIsAutoResultCapture = this.iSystemAutoResultCapture.bON; // #25399 2011.6.9 yyagi - TJAPlayer3.ConfigIni.SendDiscordPlayingInformation = this.SendDiscordPlayingInformation.bON; + TJAPlayer3.ConfigIni.bIsAutoResultCapture = this.iSystemAutoResultCapture.bON; // #25399 2011.6.9 yyagi + TJAPlayer3.ConfigIni.SendDiscordPlayingInformation = this.SendDiscordPlayingInformation.bON; - TJAPlayer3.ConfigIni.nRisky = this.iSystemRisky.n現在の値; // #23559 2011.7.27 yyagi + TJAPlayer3.ConfigIni.nRisky = this.iSystemRisky.n現在の値; // #23559 2011.7.27 yyagi - TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName = skinSubFolders[ nSkinIndex ]; // #28195 2012.5.2 yyagi - TJAPlayer3.Skin.SetCurrentSkinSubfolderFullName( TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName, true ); + TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName = skinSubFolders[nSkinIndex]; // #28195 2012.5.2 yyagi + TJAPlayer3.Skin.SetCurrentSkinSubfolderFullName(TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName, true); - TJAPlayer3.ConfigIni.nSoundDeviceType = this.iSystemSoundType.n現在選択されている項目番号; // #24820 2013.1.3 yyagi - TJAPlayer3.ConfigIni.nBassBufferSizeMs = this.iSystemBassBufferSizeMs.n現在の値; // #24820 2013.1.15 yyagi - TJAPlayer3.ConfigIni.nWASAPIBufferSizeMs = this.iSystemWASAPIBufferSizeMs.n現在の値; // #24820 2013.1.15 yyagi -// CDTXMania.ConfigIni.nASIOBufferSizeMs = this.iSystemASIOBufferSizeMs.n現在の値; // #24820 2013.1.3 yyagi - TJAPlayer3.ConfigIni.nASIODevice = this.iSystemASIODevice.n現在選択されている項目番号; // #24820 2013.1.17 yyagi - TJAPlayer3.ConfigIni.bUseOSTimer = this.iSystemSoundTimerType.bON; // #33689 2014.6.17 yyagi + TJAPlayer3.ConfigIni.nSoundDeviceType = this.iSystemSoundType.n現在選択されている項目番号; // #24820 2013.1.3 yyagi + TJAPlayer3.ConfigIni.nBassBufferSizeMs = this.iSystemBassBufferSizeMs.n現在の値; // #24820 2013.1.15 yyagi + TJAPlayer3.ConfigIni.nWASAPIBufferSizeMs = this.iSystemWASAPIBufferSizeMs.n現在の値; // #24820 2013.1.15 yyagi + // CDTXMania.ConfigIni.nASIOBufferSizeMs = this.iSystemASIOBufferSizeMs.n現在の値; // #24820 2013.1.3 yyagi + TJAPlayer3.ConfigIni.nASIODevice = this.iSystemASIODevice.n現在選択されている項目番号; // #24820 2013.1.17 yyagi + TJAPlayer3.ConfigIni.bUseOSTimer = this.iSystemSoundTimerType.bON; // #33689 2014.6.17 yyagi - TJAPlayer3.ConfigIni.bTimeStretch = this.iSystemTimeStretch.bON; // #23664 2013.2.24 yyagi + TJAPlayer3.ConfigIni.bTimeStretch = this.iSystemTimeStretch.bON; // #23664 2013.2.24 yyagi TJAPlayer3.ConfigIni.sLang = CLangManager.intToLang(this.iSystemLanguage.n現在選択されている項目番号); @@ -1992,23 +1759,22 @@ namespace TJAPlayer3 //CDTXMania.ConfigIni.nMasterVolume = this.iSystemMasterVolume.n現在の値; // #33700 2014.4.26 yyagi //CDTXMania.ConfigIni.e判定表示優先度 = (E判定表示優先度) this.iSystemJudgeDispPriority.n現在選択されている項目番号; TJAPlayer3.ConfigIni.ShowChara = this.ShowChara.bON; - TJAPlayer3.ConfigIni.ShowDancer = this.ShowDancer.bON; - TJAPlayer3.ConfigIni.ShowRunner = this.ShowRunner.bON; - TJAPlayer3.ConfigIni.ShowMob = this.ShowMob.bON; - TJAPlayer3.ConfigIni.ShowFooter = this.ShowFooter.bON; - TJAPlayer3.ConfigIni.ShowPuchiChara = this.ShowPuchiChara.bON; + TJAPlayer3.ConfigIni.ShowDancer = this.ShowDancer.bON; + TJAPlayer3.ConfigIni.ShowRunner = this.ShowRunner.bON; + TJAPlayer3.ConfigIni.ShowMob = this.ShowMob.bON; + TJAPlayer3.ConfigIni.ShowFooter = this.ShowFooter.bON; + TJAPlayer3.ConfigIni.ShowPuchiChara = this.ShowPuchiChara.bON; TJAPlayer3.ConfigIni.nPlayerCount = this.iTaikoPlayerCount.n現在の値; //TJAPlayer3.ConfigIni.nLayoutType = this.iLayoutType.n現在の値; TJAPlayer3.ConfigIni.FastRender = this.FastRender.bON; - TJAPlayer3.ConfigIni.ASyncTextureLoad = this.ASyncTextureLoad.bON; - TJAPlayer3.ConfigIni.SimpleMode = this.SimpleMode.bON; - } - private void tConfigIniへ記録する_Drums() - { - //TJAPlayer3.ConfigIni.b太鼓パートAutoPlay = this.iTaikoAutoPlay.bON; - //TJAPlayer3.ConfigIni.b太鼓パートAutoPlay2P = this.iTaikoAutoPlay2P.bON; + TJAPlayer3.ConfigIni.ASyncTextureLoad = this.ASyncTextureLoad.bON; + TJAPlayer3.ConfigIni.SimpleMode = this.SimpleMode.bON; + } + private void tConfigIniへ記録する_Drums() { + //TJAPlayer3.ConfigIni.b太鼓パートAutoPlay = this.iTaikoAutoPlay.bON; + //TJAPlayer3.ConfigIni.b太鼓パートAutoPlay2P = this.iTaikoAutoPlay2P.bON; //TJAPlayer3.ConfigIni.bAuto先生の連打 = this.iTaikoAutoRoll.bON; TJAPlayer3.ConfigIni.nRollsPerSec = this.iRollsPerSec.n現在の値; @@ -2017,31 +1783,31 @@ namespace TJAPlayer3 TJAPlayer3.NamePlate.tNamePlateRefreshTitles(i); //TJAPlayer3.ConfigIni.nScrollSpeed[TJAPlayer3.SaveFile] = this.iDrumsScrollSpeed.n現在の値; - + TJAPlayer3.ConfigIni.bTight = this.iDrumsTight.bON; - //TJAPlayer3.ConfigIni.nInputAdjustTimeMs = this.iInputAdjustTimeMs.n現在の値; + //TJAPlayer3.ConfigIni.nInputAdjustTimeMs = this.iInputAdjustTimeMs.n現在の値; TJAPlayer3.ConfigIni.nGlobalOffsetMs = this.iGlobalOffsetMs.n現在の値; TJAPlayer3.ConfigIni.n表示可能な最小コンボ数.Drums = this.iSystemMinComboDrums.n現在の値; - TJAPlayer3.ConfigIni.nRisky = this.iSystemRisky.n現在の値; // #23559 2911.7.27 yyagi - //CDTXMania.ConfigIni.e判定表示優先度.Drums = (E判定表示優先度) this.iDrumsJudgeDispPriority.n現在選択されている項目番号; + TJAPlayer3.ConfigIni.nRisky = this.iSystemRisky.n現在の値; // #23559 2911.7.27 yyagi + //CDTXMania.ConfigIni.e判定表示優先度.Drums = (E判定表示優先度) this.iDrumsJudgeDispPriority.n現在選択されている項目番号; - TJAPlayer3.ConfigIni.bBranchGuide = this.iTaikoBranchGuide.bON; - TJAPlayer3.ConfigIni.nDefaultCourse = this.iTaikoDefaultCourse.n現在選択されている項目番号; - TJAPlayer3.ConfigIni.nScoreMode = this.iTaikoScoreMode.n現在選択されている項目番号; - TJAPlayer3.ConfigIni.ShinuchiMode = this.ShinuchiMode.bON; - TJAPlayer3.ConfigIni.nBranchAnime = this.iTaikoBranchAnime.n現在選択されている項目番号; - //CDTXMania.ConfigIni.bHispeedRandom = this.iTaikoHispeedRandom.bON; - TJAPlayer3.ConfigIni.bNoInfo = this.iTaikoNoInfo.bON; + TJAPlayer3.ConfigIni.bBranchGuide = this.iTaikoBranchGuide.bON; + TJAPlayer3.ConfigIni.nDefaultCourse = this.iTaikoDefaultCourse.n現在選択されている項目番号; + TJAPlayer3.ConfigIni.nScoreMode = this.iTaikoScoreMode.n現在選択されている項目番号; + TJAPlayer3.ConfigIni.ShinuchiMode = this.ShinuchiMode.bON; + TJAPlayer3.ConfigIni.nBranchAnime = this.iTaikoBranchAnime.n現在選択されている項目番号; + //CDTXMania.ConfigIni.bHispeedRandom = this.iTaikoHispeedRandom.bON; + TJAPlayer3.ConfigIni.bNoInfo = this.iTaikoNoInfo.bON; - //TJAPlayer3.ConfigIni.eRandom.Taiko = (Eランダムモード)this.iTaikoRandom.n現在選択されている項目番号; - //TJAPlayer3.ConfigIni.eSTEALTH = (Eステルスモード)this.iTaikoStealth.n現在選択されている項目番号; + //TJAPlayer3.ConfigIni.eRandom.Taiko = (Eランダムモード)this.iTaikoRandom.n現在選択されている項目番号; + //TJAPlayer3.ConfigIni.eSTEALTH = (Eステルスモード)this.iTaikoStealth.n現在選択されている項目番号; - TJAPlayer3.ConfigIni.eGameMode = (EGame)this.iTaikoGameMode.n現在選択されている項目番号; - //TJAPlayer3.ConfigIni.bJust = this.iTaikoJust.bON; - TJAPlayer3.ConfigIni.bJudgeCountDisplay = this.iTaikoJudgeCountDisp.bON; + TJAPlayer3.ConfigIni.eGameMode = (EGame)this.iTaikoGameMode.n現在選択されている項目番号; + //TJAPlayer3.ConfigIni.bJust = this.iTaikoJust.bON; + TJAPlayer3.ConfigIni.bJudgeCountDisplay = this.iTaikoJudgeCountDisp.bON; TJAPlayer3.ConfigIni.ShowExExtraAnime = this.iShowExExtraAnime.bON; TJAPlayer3.ConfigIni.bJudgeBigNotes = this.iTaikoBigNotesJudge.bON; TJAPlayer3.ConfigIni.bForceNormalGauge = this.iTaikoForceNormalGauge.bON; diff --git a/OpenTaiko/src/Stages/04.Config/CStageコンフィグ.cs b/OpenTaiko/src/Stages/04.Config/CStageコンフィグ.cs index ec261bfc..4bb17364 100644 --- a/OpenTaiko/src/Stages/04.Config/CStageコンフィグ.cs +++ b/OpenTaiko/src/Stages/04.Config/CStageコンフィグ.cs @@ -1,17 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Globalization; -using System.Runtime.InteropServices; +using System.Diagnostics; using System.Drawing; -using System.Diagnostics; -using SkiaSharp; +using System.Runtime.InteropServices; using FDK; +using SkiaSharp; -namespace TJAPlayer3 -{ - internal class CStageコンフィグ : CStage - { +namespace TJAPlayer3 { + internal class CStageコンフィグ : CStage { // プロパティ public CActDFPFont actFont { get; private set; } @@ -20,126 +14,107 @@ namespace TJAPlayer3 // コンストラクタ - public CStageコンフィグ() - { + 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.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 実装 - public override void Activate() - { - Trace.TraceInformation( "コンフィグステージを活性化します。" ); + public override void Activate() { + Trace.TraceInformation("コンフィグステージを活性化します。"); Trace.Indent(); - try - { + try { TJAPlayer3.Skin.bgmコンフィグ画面.tPlay(); this.n現在のメニュー番号 = 0; // - for( int i = 0; i < 4; i++ ) // - { // - this.ctキー反復用[ i ] = new CCounter( 0, 0, 0, TJAPlayer3.Timer ); // - } // - this.bメニューにフォーカス中 = true; // ここまでOPTIONと共通 + for (int i = 0; i < 4; i++) // + { // + this.ctキー反復用[i] = new CCounter(0, 0, 0, TJAPlayer3.Timer); // + } // + this.bメニューにフォーカス中 = true; // ここまでOPTIONと共通 this.eItemPanelモード = EItemPanelモード.パッド一覧; - + ReloadMenus(); Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.CONFIG}Script.lua")); Background.Init(); - - if( this.bメニューにフォーカス中 ) - { + + if (this.bメニューにフォーカス中) { this.t説明文パネルに現在選択されているメニューの説明を描画する(); - } - else - { + } else { this.t説明文パネルに現在選択されている項目の説明を描画する(); } - } - finally - { - Trace.TraceInformation( "コンフィグステージの活性化を完了しました。" ); + } finally { + Trace.TraceInformation("コンフィグステージの活性化を完了しました。"); Trace.Unindent(); } - base.Activate(); // 2011.3.14 yyagi: On活性化()をtryの中から外に移動 + base.Activate(); // 2011.3.14 yyagi: On活性化()をtryの中から外に移動 } - public override void DeActivate() - { - Trace.TraceInformation( "コンフィグステージを非活性化します。" ); + public override void DeActivate() { + Trace.TraceInformation("コンフィグステージを非活性化します。"); Trace.Indent(); - try - { + try { TJAPlayer3.Skin.bgmコンフィグ画面.tStop(); - TJAPlayer3.ConfigIni.t書き出し( TJAPlayer3.strEXEのあるフォルダ + "Config.ini" ); // CONFIGだけ - for( int i = 0; i < 4; i++ ) - { - this.ctキー反復用[ i ] = null; + TJAPlayer3.ConfigIni.t書き出し(TJAPlayer3.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; + + 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; TJAPlayer3.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( "コンフィグステージの非活性化を完了しました。" ); + } 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() - { + public void ReloadMenus() { string[] strMenuItem = { CLangManager.LangInstance.GetString("SETTINGS_SYSTEM"), CLangManager.LangInstance.GetString("SETTINGS_GAME"), @@ -148,23 +123,19 @@ namespace TJAPlayer3 txMenuItemLeft = new CTexture[strMenuItem.Length, 2]; - using (var prvFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.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)) - { + using (var prvFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.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] = TJAPlayer3.tテクスチャの生成(bmpStr, false); } - using (var bmpStr = prvFont.DrawText(strMenuItem[i], - Color.White, + using (var bmpStr = prvFont.DrawText(strMenuItem[i], + Color.White, Color.Black, null, - TJAPlayer3.Skin.Config_Selected_Menu_Text_Grad_Color_1, - TJAPlayer3.Skin.Config_Selected_Menu_Text_Grad_Color_2, - 30)) - { + TJAPlayer3.Skin.Config_Selected_Menu_Text_Grad_Color_1, + TJAPlayer3.Skin.Config_Selected_Menu_Text_Grad_Color_2, + 30)) { txMenuItemLeft[i, 1]?.Dispose(); txMenuItemLeft[i, 1] = TJAPlayer3.tテクスチャの生成(bmpStr, false); } @@ -172,71 +143,68 @@ namespace TJAPlayer3 } } - public override void CreateManagedResource() // OPTIONと画像以外共通 + 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); - //} + //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)TJAPlayer3.Skin.Config_Font_Scale_Description, CFontRenderer.FontStyle.Bold); - TJAPlayer3.Tx.Config_Cursor = TJAPlayer3.tテクスチャの生成(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.CONFIG}Cursor.png")); + TJAPlayer3.Tx.Config_Cursor = TJAPlayer3.tテクスチャの生成(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.CONFIG}Cursor.png")); - //ctBackgroundAnime = new CCounter(0, TJAPlayer3.Tx.Config_Background.szテクスチャサイズ.Width, 20, TJAPlayer3.Timer); + //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]; + /* + string[] strMenuItem = { + CLangManager.LangInstance.GetString(10085), + CLangManager.LangInstance.GetString(10086), + CLangManager.LangInstance.GetString(10087) + }; - 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); - } - } - } - */ + 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の書き出しタイミングのみ異なるが、無視して良い) + public override void ReleaseManagedResource() // OPTIONと同じ(COnfig.iniの書き出しタイミングのみ異なるが、無視して良い) { - if( this.ftフォント != null ) - { + 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カーソル ); + //CDTXMania.tテクスチャの解放( ref this.tx背景 ); + //CDTXMania.tテクスチャの解放( ref this.tx上部パネル ); + //CDTXMania.tテクスチャの解放( ref this.tx下部パネル ); + //CDTXMania.tテクスチャの解放( ref this.txMenuカーソル ); - TJAPlayer3.tテクスチャの解放( ref this.tx説明文パネル ); + TJAPlayer3.tテクスチャの解放(ref this.tx説明文パネル); base.ReleaseManagedResource(); } - public override int Draw() - { - if( base.IsDeActivated ) + public override int Draw() { + if (base.IsDeActivated) return 0; - if( base.IsFirstDraw ) - { + if (base.IsFirstDraw) { base.ePhaseID = CStage.EPhase.Common_FADEIN; this.actFIFO.tフェードイン開始(); base.IsFirstDraw = false; @@ -264,8 +232,7 @@ namespace TJAPlayer3 #region [ Menu Cursor ] //--------------------- - if ( TJAPlayer3.Tx.Config_Cursor != null ) - { + if (TJAPlayer3.Tx.Config_Cursor != null) { #region Old /* Rectangle rectangle; @@ -299,29 +266,28 @@ namespace TJAPlayer3 int move = TJAPlayer3.Skin.Config_Item_Width; //Left - TJAPlayer3.Tx.Config_Cursor.t2D中心基準描画(x - (width / 2) - move, y, + TJAPlayer3.Tx.Config_Cursor.t2D中心基準描画(x - (width / 2) - move, y, new Rectangle(0, 0, width, height)); //Right - TJAPlayer3.Tx.Config_Cursor.t2D中心基準描画(x + (width / 2) + move, y, + TJAPlayer3.Tx.Config_Cursor.t2D中心基準描画(x + (width / 2) + move, y, new Rectangle(width * 2, 0, width, height)); //Center TJAPlayer3.Tx.Config_Cursor.vcScaleRatio.X = (move / (float)width) * 2.0f; - TJAPlayer3.Tx.Config_Cursor.t2D拡大率考慮中央基準描画(x, y, + TJAPlayer3.Tx.Config_Cursor.t2D拡大率考慮中央基準描画(x, y, new Rectangle(width, 0, width, height)); TJAPlayer3.Tx.Config_Cursor.vcScaleRatio.X = 1.0f; } - //--------------------- - #endregion + //--------------------- + #endregion - #region [ Menu ] - //--------------------- - //int menuY = 162 - 22 + 13; - //int stepY = 39; - for ( int i = 0; i < txMenuItemLeft.GetLength( 0 ); i++ ) - { + #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 ); @@ -329,25 +295,24 @@ namespace TJAPlayer3 int flag = (this.n現在のメニュー番号 == i) ? 1 : 0; txMenuItemLeft[i, flag].t2D中心基準描画(TJAPlayer3.Skin.Config_Item_X[i] + TJAPlayer3.Skin.Config_Item_Font_Offset[0], TJAPlayer3.Skin.Config_Item_Y[i] + TJAPlayer3.Skin.Config_Item_Font_Offset[1]); //55 - //txMenuItem.Dispose(); - //menuY += stepY; + //txMenuItem.Dispose(); + //menuY += stepY; } //--------------------- #endregion - + #region [ Explanation Panel ] //--------------------- - if( this.tx説明文パネル != null ) - this.tx説明文パネル.t2D描画( TJAPlayer3.Skin.Config_ExplanationPanel[0], TJAPlayer3.Skin.Config_ExplanationPanel[1]); + if (this.tx説明文パネル != null) + this.tx説明文パネル.t2D描画(TJAPlayer3.Skin.Config_ExplanationPanel[0], TJAPlayer3.Skin.Config_ExplanationPanel[1]); //--------------------- #endregion - + #region [ Item ] //--------------------- - switch( this.eItemPanelモード ) - { + switch (this.eItemPanelモード) { case EItemPanelモード.パッド一覧: - this.actList.t進行描画( !this.bメニューにフォーカス中 ); + this.actList.t進行描画(!this.bメニューにフォーカス中); break; case EItemPanelモード.キーコード一覧: @@ -356,7 +321,7 @@ namespace TJAPlayer3 } //--------------------- #endregion - + //#region [ 上部パネル ] ////--------------------- //if( this.tx上部パネル != null ) @@ -372,24 +337,21 @@ namespace TJAPlayer3 #region [ Option Panel ] //--------------------- - //this.actオプションパネル.On進行描画(); + //this.actオプションパネル.On進行描画(); //--------------------- #endregion #region [ FadeOut ] //--------------------- - switch( base.ePhaseID ) - { + switch (base.ePhaseID) { case CStage.EPhase.Common_FADEIN: - if( this.actFIFO.Draw() != 0 ) - { + if (this.actFIFO.Draw() != 0) { base.ePhaseID = CStage.EPhase.Common_NORMAL; } break; case CStage.EPhase.Common_FADEOUT: - if( this.actFIFO.Draw() == 0 ) - { + if (this.actFIFO.Draw() == 0) { break; } return 1; @@ -403,13 +365,12 @@ namespace TJAPlayer3 // キー入力 - if( ( base.ePhaseID != CStage.EPhase.Common_NORMAL ) + if ((base.ePhaseID != CStage.EPhase.Common_NORMAL) || this.actKeyAssign.bキー入力待ちの最中である - || TJAPlayer3.act現在入力を占有中のプラグイン != null ) + || TJAPlayer3.act現在入力を占有中のプラグイン != null) return 0; - if (actCalibrationMode.IsStarted) - { + if (actCalibrationMode.IsStarted) { if (TJAPlayer3.Skin.bgmコンフィグ画面.bIsPlaying) TJAPlayer3.Skin.bgmコンフィグ画面.tStop(); @@ -417,63 +378,48 @@ namespace TJAPlayer3 actCalibrationMode.Draw(); } // 曲データの一覧取得中は、キー入力を無効化する - else if ( !TJAPlayer3.EnumSongs.IsEnumerating || TJAPlayer3.actEnumSongs.bコマンドでの曲データ取得 != true ) - { - if (!TJAPlayer3.Skin.bgmコンフィグ画面.bIsPlaying) - TJAPlayer3.Skin.bgmコンフィグ画面.tPlay(); + else if (!TJAPlayer3.EnumSongs.IsEnumerating || TJAPlayer3.actEnumSongs.bコマンドでの曲データ取得 != true) { + if (!TJAPlayer3.Skin.bgmコンフィグ画面.bIsPlaying) + TJAPlayer3.Skin.bgmコンフィグ画面.tPlay(); - if ( ( TJAPlayer3.InputManager.Keyboard.KeyPressed( (int)SlimDXKeys.Key.Escape ) || TJAPlayer3.Pad.bPressed( EInstrumentPad.DRUMS, EPad.FT ) ) || TJAPlayer3.Pad.bPressedGB( EPad.FT ) ) - { + if ((TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.FT)) || TJAPlayer3.Pad.bPressedGB(EPad.FT)) { TJAPlayer3.Skin.soundCancelSFX.tPlay(); - if ( !this.bメニューにフォーカス中 ) - { - if ( this.eItemPanelモード == EItemPanelモード.キーコード一覧 ) - { + if (!this.bメニューにフォーカス中) { + if (this.eItemPanelモード == EItemPanelモード.キーコード一覧) { TJAPlayer3.stageコンフィグ.tアサイン完了通知(); return 0; } - if ( !this.actList.bIsKeyAssignSelected && !this.actList.bIsFocusingParameter ) // #24525 2011.3.15 yyagi, #32059 2013.9.17 yyagi + 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.actList.tEsc押下(); // #24525 2011.3.15 yyagi ESC押下時の右メニュー描画用 + } else { this.actFIFO.tフェードアウト開始(); base.ePhaseID = CStage.EPhase.Common_FADEOUT; } - } - else if ( ( TJAPlayer3.Pad.bPressedDGB( EPad.CY ) || TJAPlayer3.Pad.bPressed( EInstrumentPad.DRUMS, EPad.RD ) ) || ( TJAPlayer3.Pad.bPressed( EInstrumentPad.DRUMS, EPad.LC ) || ( TJAPlayer3.ConfigIni.bEnterがキー割り当てのどこにも使用されていない && TJAPlayer3.InputManager.Keyboard.KeyPressed( (int)SlimDXKeys.Key.Return ) ) ) ) - { - if ( this.n現在のメニュー番号 == 2 ) - { + } else if ((TJAPlayer3.Pad.bPressedDGB(EPad.CY) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RD)) || (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LC) || (TJAPlayer3.ConfigIni.bEnterがキー割り当てのどこにも使用されていない && TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)))) { + if (this.n現在のメニュー番号 == 2) { // Exit TJAPlayer3.Skin.soundDecideSFX.tPlay(); this.actFIFO.tフェードアウト開始(); base.ePhaseID = CStage.EPhase.Common_FADEOUT; - } - else if ( this.bメニューにフォーカス中 ) - { + } else if (this.bメニューにフォーカス中) { TJAPlayer3.Skin.soundDecideSFX.tPlay(); this.bメニューにフォーカス中 = false; this.t説明文パネルに現在選択されている項目の説明を描画する(); - } - else - { - switch ( this.eItemPanelモード ) - { + } else { + switch (this.eItemPanelモード) { case EItemPanelモード.パッド一覧: - bool bIsKeyAssignSelectedBeforeHitEnter = this.actList.bIsKeyAssignSelected; // #24525 2011.3.15 yyagi + bool bIsKeyAssignSelectedBeforeHitEnter = this.actList.bIsKeyAssignSelected; // #24525 2011.3.15 yyagi this.actList.tEnter押下(); this.t説明文パネルに現在選択されている項目の説明を描画する(); - if ( this.actList.b現在選択されている項目はReturnToMenuである ) - { + if (this.actList.b現在選択されている項目はReturnToMenuである) { this.t説明文パネルに現在選択されているメニューの説明を描画する(); - if ( bIsKeyAssignSelectedBeforeHitEnter == false ) // #24525 2011.3.15 yyagi + if (bIsKeyAssignSelectedBeforeHitEnter == false) // #24525 2011.3.15 yyagi { this.bメニューにフォーカス中 = true; } @@ -486,16 +432,14 @@ namespace TJAPlayer3 } } } - this.ctキー反復用.Up.KeyIntervalFunc( TJAPlayer3.InputManager.Keyboard.KeyPressing( (int)SlimDXKeys.Key.UpArrow ), new CCounter.KeyProcess( this.tカーソルを上へ移動する ) ); - this.ctキー反復用.R.KeyIntervalFunc( TJAPlayer3.Pad.b押されているGB( EPad.HH ), new CCounter.KeyProcess( this.tカーソルを上へ移動する ) ); - if ( TJAPlayer3.Pad.bPressed( EInstrumentPad.DRUMS, EPad.SD ) ) - { + this.ctキー反復用.Up.KeyIntervalFunc(TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.UpArrow), new CCounter.KeyProcess(this.tカーソルを上へ移動する)); + this.ctキー反復用.R.KeyIntervalFunc(TJAPlayer3.Pad.b押されているGB(EPad.HH), new CCounter.KeyProcess(this.tカーソルを上へ移動する)); + if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.SD)) { this.tカーソルを上へ移動する(); } - this.ctキー反復用.Down.KeyIntervalFunc( TJAPlayer3.InputManager.Keyboard.KeyPressing( (int)SlimDXKeys.Key.DownArrow ), new CCounter.KeyProcess( this.tカーソルを下へ移動する ) ); - this.ctキー反復用.B.KeyIntervalFunc( TJAPlayer3.Pad.b押されているGB( EPad.BD ), new CCounter.KeyProcess( this.tカーソルを下へ移動する ) ); - if ( TJAPlayer3.Pad.bPressed( EInstrumentPad.DRUMS, EPad.LT ) ) - { + this.ctキー反復用.Down.KeyIntervalFunc(TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.DownArrow), new CCounter.KeyProcess(this.tカーソルを下へ移動する)); + this.ctキー反復用.B.KeyIntervalFunc(TJAPlayer3.Pad.b押されているGB(EPad.BD), new CCounter.KeyProcess(this.tカーソルを下へ移動する)); + if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LT)) { this.tカーソルを下へ移動する(); } } @@ -507,25 +451,20 @@ namespace TJAPlayer3 #region [ private ] //----------------- - private enum EItemPanelモード - { + private enum EItemPanelモード { パッド一覧, キーコード一覧 } - [StructLayout( LayoutKind.Sequential )] - private struct STキー反復用カウンタ - { + [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 ) - { + public CCounter this[int index] { + get { + switch (index) { case 0: return this.Up; @@ -540,10 +479,8 @@ namespace TJAPlayer3 } throw new IndexOutOfRangeException(); } - set - { - switch( index ) - { + set { + switch (index) { case 0: this.Up = value; return; @@ -582,16 +519,13 @@ namespace TJAPlayer3 //private CTexture tx上部パネル; private CTexture tx説明文パネル; //private CTexture tx背景; - private CTexture[ , ] txMenuItemLeft; + private CTexture[,] txMenuItemLeft; private ScriptBG Background; - private void tカーソルを下へ移動する() - { - if( !this.bメニューにフォーカス中 ) - { - switch( this.eItemPanelモード ) - { + private void tカーソルを下へ移動する() { + if (!this.bメニューにフォーカス中) { + switch (this.eItemPanelモード) { case EItemPanelモード.パッド一覧: this.actList.t次に移動(); return; @@ -600,13 +534,10 @@ namespace TJAPlayer3 this.actKeyAssign.t次に移動(); return; } - } - else - { + } else { TJAPlayer3.Skin.soundカーソル移動音.tPlay(); - this.n現在のメニュー番号 = ( this.n現在のメニュー番号 + 1 ) % 3; - switch( this.n現在のメニュー番号 ) - { + this.n現在のメニュー番号 = (this.n現在のメニュー番号 + 1) % 3; + switch (this.n現在のメニュー番号) { case 0: this.actList.t項目リストの設定_System(); break; @@ -622,12 +553,9 @@ namespace TJAPlayer3 this.t説明文パネルに現在選択されているメニューの説明を描画する(); } } - private void tカーソルを上へ移動する() - { - if( !this.bメニューにフォーカス中 ) - { - switch( this.eItemPanelモード ) - { + private void tカーソルを上へ移動する() { + if (!this.bメニューにフォーカス中) { + switch (this.eItemPanelモード) { case EItemPanelモード.パッド一覧: this.actList.t前に移動(); return; @@ -636,13 +564,10 @@ namespace TJAPlayer3 this.actKeyAssign.t前に移動(); return; } - } - else - { + } else { TJAPlayer3.Skin.soundカーソル移動音.tPlay(); this.n現在のメニュー番号 = ((this.n現在のメニュー番号 - 1) + 3) % 3; - switch ( this.n現在のメニュー番号 ) - { + switch (this.n現在のメニュー番号) { case 0: this.actList.t項目リストの設定_System(); break; @@ -658,13 +583,10 @@ namespace TJAPlayer3 this.t説明文パネルに現在選択されているメニューの説明を描画する(); } } - private void t説明文パネルに現在選択されているメニューの説明を描画する() - { - try - { + private void t説明文パネルに現在選択されているメニューの説明を描画する() { + try { string text = ""; - switch( this.n現在のメニュー番号 ) - { + switch (this.n現在のメニュー番号) { case 0: text = CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DESC"); break; @@ -674,45 +596,36 @@ namespace TJAPlayer3 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 ) - { + if (this.tx説明文パネル != null) { this.tx説明文パネル.Dispose(); } - this.tx説明文パネル = new CTexture( image ); + this.tx説明文パネル = new CTexture(image); image.Dispose(); - } - catch( CTextureCreateFailedException e) - { - Trace.TraceError( e.ToString() ); - Trace.TraceError( "説明文テクスチャの作成に失敗しました。" ); + } 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 倍で表示する___のは中止。処理速度向上のため。) + 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 ) ) - { + 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 ) - { + if (this.tx説明文パネル != null) { this.tx説明文パネル.Dispose(); } - this.tx説明文パネル = new CTexture( image ); + this.tx説明文パネル = new CTexture(image); image.Dispose(); - } - catch( CTextureCreateFailedException e ) - { - Trace.TraceError( e.ToString() ); - Trace.TraceError( "説明文パネルテクスチャの作成に失敗しました。" ); + } catch (CTextureCreateFailedException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("説明文パネルテクスチャの作成に失敗しました。"); this.tx説明文パネル = null; } } diff --git a/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位リスト.cs b/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位リスト.cs index 102eab3b..029c735c 100644 --- a/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位リスト.cs +++ b/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位リスト.cs @@ -1,526 +1,469 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Silk.NET.Maths; +using System.Drawing; using FDK; +using Silk.NET.Maths; using static TJAPlayer3.CActSelect曲リスト; - using Rectangle = System.Drawing.Rectangle; -namespace TJAPlayer3 -{ - 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); - - 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, TJAPlayer3.Timer); - - ctDanTick = new CCounter(0, 510, 3, TJAPlayer3.Timer); - - ctExamConditionsAnim = new CCounter(0, 4000, 1, TJAPlayer3.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 = TJAPlayer3.Songs管理.list曲ルート_Dan; - tUpdateSongs(); - - base.Activate(); - } - - public override void DeActivate() - { - - base.DeActivate(); - } - - public override void CreateManagedResource() - { - this.pfDanFolder = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.DaniSelect_Font_DanFolder_Size[0]); - this.pfDanFolderDesc = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.DaniSelect_Font_DanFolder_Size[1]); - this.pfDanSong = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.DaniSelect_Font_DanSong_Size); - this.pfExamFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.DaniSelect_Font_Exam_Size); - - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() - { - TJAPlayer3.tDisposeSafely(ref pfDanFolder); - TJAPlayer3.tDisposeSafely(ref pfDanFolderDesc); - TJAPlayer3.tDisposeSafely(ref pfDanSong); - TJAPlayer3.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, TJAPlayer3.Timer); - DaniInAnime = true; - } - } - - #region [ バー表示 ] - - if (stバー情報.Length != 0 && ctDaniIn.CurrentValue == 6000) - { - TJAPlayer3.Tx.DanC_ExamType.vcScaleRatio.X = 0.81f; - TJAPlayer3.Tx.DanC_ExamType.vcScaleRatio.Y = 0.81f; - - float Anime = ctDanAnimeIn.CurrentValue == 90 ? bLeftMove ? (float)Math.Sin(ctDaniMoveAnime.CurrentValue * (Math.PI / 180)) * TJAPlayer3.Skin.Resolution[0] : -((float)Math.Sin(ctDaniMoveAnime.CurrentValue * (Math.PI / 180)) * TJAPlayer3.Skin.Resolution[0]) : TJAPlayer3.Skin.Resolution[0] - (float)Math.Sin(ctDanAnimeIn.CurrentValue * (Math.PI / 180)) * TJAPlayer3.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 = TJAPlayer3.Tx.Dani_Plate.szTextureSize.Width / 7; - int tickHeight = TJAPlayer3.Tx.Dani_Plate.szTextureSize.Height; - int tickExtraWidth = TJAPlayer3.Tx.Dani_Plate_Extra.szTextureSize.Width / 3; - int tickExtraHeight = TJAPlayer3.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 = TJAPlayer3.Skin.DaniSelect_Plate[0] + (idx == 0 ? TJAPlayer3.Skin.DaniSelect_Plate_Center_Move[0] : 0) + idx * TJAPlayer3.Skin.DaniSelect_Plate_Move[0]; - int yPos = TJAPlayer3.Skin.DaniSelect_Plate[1] + (idx == 0 ? TJAPlayer3.Skin.DaniSelect_Plate_Center_Move[1] : 0) + idx * TJAPlayer3.Skin.DaniSelect_Plate_Move[1]; +namespace TJAPlayer3 { + 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); + 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); + } + } - #region [Plate background] + public bool bスクロール中 { + get { + return ctDaniMoveAnime.IsTicked; + } + } - int tick = Math.Max(0, Math.Min(5, stバー情報[currentSong].nDanTick)); - Color tickColor = stバー情報[currentSong].cDanTickColor; + public override void Activate() { + if (this.IsActivated) + return; - switch (stバー情報[currentSong].eノード種別) - { - case CSongListNode.ENodeType.BACKBOX: - { - TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateOpacity(255); - TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateColor4(CConversion.ColorToColor4(tickColor)); - TJAPlayer3.Tx.Dani_Plate_Extra?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(0, 0, tickExtraWidth, tickExtraHeight)); - break; - } - case CSongListNode.ENodeType.BOX: - { - TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateOpacity(255); - TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateColor4(CConversion.ColorToColor4(tickColor)); - TJAPlayer3.Tx.Dani_Plate_Extra?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickExtraWidth, 0, tickExtraWidth, tickExtraHeight)); - break; - } - case CSongListNode.ENodeType.RANDOM: - { - TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateOpacity(255); - TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateColor4(CConversion.ColorToColor4(tickColor)); - TJAPlayer3.Tx.Dani_Plate_Extra?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickExtraWidth * 2, 0, tickExtraWidth, tickExtraHeight)); - break; - } - default: - { - TJAPlayer3.Tx.Dani_Plate?.tUpdateOpacity(255); - TJAPlayer3.Tx.Dani_Plate?.tUpdateColor4(CConversion.ColorToColor4(tickColor)); - TJAPlayer3.Tx.Dani_Plate?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickWidth * tick, 0, tickWidth, tickHeight)); - break; - } - } + DaniInAnime = false; - // Reset color for plate flash - TJAPlayer3.Tx.Dani_Plate?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + ctDaniMoveAnime = new CCounter(); + ctDanAnimeIn = new CCounter(); + ctDaniIn = new CCounter(0, 6000, 1, TJAPlayer3.Timer); - #endregion + ctDanTick = new CCounter(0, 510, 3, TJAPlayer3.Timer); - #region [Dan grade title] - if (stバー情報[currentSong].eノード種別 == CSongListNode.ENodeType.SCORE) - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTextureTate(stバー情報[currentSong].ttkタイトル[stバー情報[currentSong].ttkタイトル.Length - 1]) - .t2D拡大率考慮上中央基準描画(xPos + TJAPlayer3.Skin.DaniSelect_Plate_Title_Offset[0], yPos + TJAPlayer3.Skin.DaniSelect_Plate_Title_Offset[1]); - - #endregion - - - #region [Plate flash] - - if (idx == 0) - { - TJAPlayer3.Tx.Dani_Plate?.tUpdateOpacity(Math.Abs(255 - ctDanTick.CurrentValue)); - TJAPlayer3.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) - { - TJAPlayer3.Tx.DanResult_Rank.vcScaleRatio.X = 0.20f; - TJAPlayer3.Tx.DanResult_Rank.vcScaleRatio.Y = 0.20f; - int rank_width = TJAPlayer3.Tx.DanResult_Rank.szTextureSize.Width / 7; - int rank_height = TJAPlayer3.Tx.DanResult_Rank.szTextureSize.Height; - TJAPlayer3.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() - { - TJAPlayer3.tDisposeSafely(ref pfDanPlateTitle); - TJAPlayer3.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 (TJAPlayer3.stageSongSelect.r確定されたスコア != null) - { - danTick = TJAPlayer3.stageSongSelect.r確定されたスコア.譜面情報.nDanTick; - danTickColor = TJAPlayer3.stageSongSelect.r確定されたスコア.譜面情報.cDanTickColor; - } - if (songNode != null) - { - STバー情報 stNode = (STバー情報)songNode; - - danTick = stNode.nDanTick; - danTickColor = stNode.cDanTickColor; - } - - - int unit = TJAPlayer3.Tx.Dani_DanPlates.szTextureSize.Width / 6; - - if (TJAPlayer3.Tx.Dani_DanPlates != null) - { - TJAPlayer3.Tx.Dani_DanPlates.Opacity = 255; - TJAPlayer3.Tx.Dani_DanPlates.color4 = CConversion.ColorToColor4(danTickColor); - } - TJAPlayer3.Tx.Dani_DanPlates_Back?.t2D中心基準描画(x, y, new Rectangle( - unit * danTick, - 0, - unit, - TJAPlayer3.Tx.Dani_DanPlates_Back.szTextureSize.Height - )); - TJAPlayer3.Tx.Dani_DanPlates?.t2D中心基準描画(x, y, new Rectangle( - unit * danTick, - 0, - unit, - TJAPlayer3.Tx.Dani_DanPlates.szTextureSize.Height - )); - - if (pfDanPlateTitle == null) - pfDanPlateTitle = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.DaniSelect_DanPlateTitle_Size); - - string titleTmp = ""; - - if (TJAPlayer3.stageSongSelect.r確定されたスコア != null) - titleTmp = TJAPlayer3.stageSongSelect.rChoosenSong.ldTitle.GetString(""); - if (songNode != null) - { - STバー情報 stNode = (STバー情報)songNode; - - titleTmp = stNode.ttkタイトル[stNode.ttkタイトル.Length - 1].str文字; - } - - TitleTextureKey ttkTmp = new TitleTextureKey(titleTmp.Substring(0, 2), pfDanPlateTitle, Color.White, Color.Black, 1000); - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTextureTate(ttkTmp).t2D中心基準描画(x + TJAPlayer3.Skin.DaniSelect_DanPlateTitle_Offset[0], y + TJAPlayer3.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(TJAPlayer3.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) - { - TJAPlayer3.Tx.Dani_DanIcon_Fade.vcScaleRatio = new Vector3D(scale, scale, 1.0f); - TJAPlayer3.Tx.Dani_DanIcon_Fade.Opacity = opacity; - TJAPlayer3.Tx.Dani_DanIcon_Fade.color4 = CConversion.ColorToColor4(TJAPlayer3.Skin.DaniSelect_DanIcon_Color[Math.Min(count - 1, TJAPlayer3.Skin.DaniSelect_DanIcon_Color.Length - 1)]); - TJAPlayer3.Tx.Dani_DanIcon_Fade.t2D拡大率考慮描画(CTexture.RefPnt.Left, x - ((TJAPlayer3.Tx.Dani_DanIcon.szTextureSize.Width / 2) * scale), y); - TJAPlayer3.Tx.Dani_DanIcon_Fade.Opacity = 255; - } - - TJAPlayer3.Tx.Dani_DanIcon.vcScaleRatio = new Vector3D(scale, scale, 1.0f); - TJAPlayer3.Tx.Dani_DanIcon.Opacity = opacity; - TJAPlayer3.Tx.Dani_DanIcon.color4 = CConversion.ColorToColor4(TJAPlayer3.Skin.DaniSelect_DanIcon_Color[Math.Min(count - 1, TJAPlayer3.Skin.DaniSelect_DanIcon_Color.Length - 1)]); - TJAPlayer3.Tx.Dani_DanIcon.t2D拡大率考慮中央基準描画(x, y); - TJAPlayer3.Tx.Dani_DanIcon.Opacity = 255; - - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkTmp).vcScaleRatio = new Vector3D(scale, scale, 1.0f); - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkTmp).Opacity = opacity; - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkTmp).t2D拡大率考慮中央基準描画(x + TJAPlayer3.Skin.DaniSelect_DanIconTitle_Offset[0], y + TJAPlayer3.Skin.DaniSelect_DanIconTitle_Offset[1]); - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkTmp).Opacity = 255; - } - - private void tDrawDanSelectedLevel(float Anime, int modifier = 0) - { - int scroll = TJAPlayer3.Skin.Resolution[0] * modifier; - int currentSong = n現在の選択行 + modifier; - 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 = TJAPlayer3.Tx.Dani_DanSides.szTextureSize.Width / 6; - TJAPlayer3.Tx.Dani_DanSides.color4 = CConversion.ColorToColor4(danTickColor); - - TJAPlayer3.Tx.Dani_Bar_Center.t2D描画(scroll + Anime, 0); - - // Bar sides - TJAPlayer3.Tx.Dani_DanSides.t2D描画((int)(scroll + Anime) + TJAPlayer3.Skin.DaniSelect_DanSides_X[0], TJAPlayer3.Skin.DaniSelect_DanSides_Y[0], new Rectangle( - unit * danTick, - 0, - unit, - TJAPlayer3.Tx.Dani_DanSides.szTextureSize.Height - )); - - TJAPlayer3.Tx.Dani_DanSides.t2D左右反転描画((int)(scroll + Anime) + TJAPlayer3.Skin.DaniSelect_DanSides_X[1], TJAPlayer3.Skin.DaniSelect_DanSides_Y[1], new Rectangle( - unit * danTick, - 0, - unit, - TJAPlayer3.Tx.Dani_DanSides.szTextureSize.Height - )); - } - - CActSelect段位リスト.tDisplayDanPlate(stバー情報[currentSong].txDanPlate, stバー情報[currentSong], (int)(scroll + Anime) + TJAPlayer3.Skin.DaniSelect_DanPlate[0], TJAPlayer3.Skin.DaniSelect_DanPlate[1]); - - #endregion - - #region [Goukaku plate] - - int currentRank = Math.Min(stバー情報[currentSong].clearGrade, 8) - 3; - - if (currentRank >= 0) - { - TJAPlayer3.Tx.DanResult_Rank.vcScaleRatio.X = 0.8f; - TJAPlayer3.Tx.DanResult_Rank.vcScaleRatio.Y = 0.8f; - - int rank_width = TJAPlayer3.Tx.DanResult_Rank.szTextureSize.Width / 7; - int rank_height = TJAPlayer3.Tx.DanResult_Rank.szTextureSize.Height; - - TJAPlayer3.Tx.DanResult_Rank.t2D拡大率考慮中央基準描画(scroll + Anime + TJAPlayer3.Skin.DaniSelect_Rank[0], TJAPlayer3.Skin.DaniSelect_Rank[1], new Rectangle(rank_width * (currentRank + 1), 0, rank_width, rank_height)); - } - - #endregion - - #region [Soul gauge condition] - - TJAPlayer3.Tx.Dani_Bloc[2]?.t2D描画(scroll + Anime + TJAPlayer3.Skin.DaniSelect_Bloc2[0], TJAPlayer3.Skin.DaniSelect_Bloc2[1]); - - if (stバー情報[currentSong].List_DanSongs[0].Dan_C[0] != null) - tSoulDraw(scroll + Anime + TJAPlayer3.Skin.DaniSelect_Value_Gauge[0], TJAPlayer3.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); - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkExams[0]).t2D拡大率考慮中央基準描画((int)(scroll + Anime) + TJAPlayer3.Skin.DaniSelect_Text_Gauge[0], TJAPlayer3.Skin.DaniSelect_Text_Gauge[1]); - - #endregion + ctExamConditionsAnim = new CCounter(0, 4000, 1, TJAPlayer3.Timer); - #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; + 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); + } - double sinus = Math.Abs(Math.Sin(animJauge * Math.PI / split)); + listSongs = TJAPlayer3.Songs管理.list曲ルート_Dan; + tUpdateSongs(); - if (sinus == 0) return 0; - return (int)(Math.Abs(Math.Pow(sinus, 1.2) / sinus) * 255); + base.Activate(); + } - /* + public override void DeActivate() { + + base.DeActivate(); + } + + public override void CreateManagedResource() { + this.pfDanFolder = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.DaniSelect_Font_DanFolder_Size[0]); + this.pfDanFolderDesc = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.DaniSelect_Font_DanFolder_Size[1]); + this.pfDanSong = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.DaniSelect_Font_DanSong_Size); + this.pfExamFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.DaniSelect_Font_Exam_Size); + + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + TJAPlayer3.tDisposeSafely(ref pfDanFolder); + TJAPlayer3.tDisposeSafely(ref pfDanFolderDesc); + TJAPlayer3.tDisposeSafely(ref pfDanSong); + TJAPlayer3.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, TJAPlayer3.Timer); + DaniInAnime = true; + } + } + + #region [ バー表示 ] + + if (stバー情報.Length != 0 && ctDaniIn.CurrentValue == 6000) { + TJAPlayer3.Tx.DanC_ExamType.vcScaleRatio.X = 0.81f; + TJAPlayer3.Tx.DanC_ExamType.vcScaleRatio.Y = 0.81f; + + float Anime = ctDanAnimeIn.CurrentValue == 90 ? bLeftMove ? (float)Math.Sin(ctDaniMoveAnime.CurrentValue * (Math.PI / 180)) * TJAPlayer3.Skin.Resolution[0] : -((float)Math.Sin(ctDaniMoveAnime.CurrentValue * (Math.PI / 180)) * TJAPlayer3.Skin.Resolution[0]) : TJAPlayer3.Skin.Resolution[0] - (float)Math.Sin(ctDanAnimeIn.CurrentValue * (Math.PI / 180)) * TJAPlayer3.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 = TJAPlayer3.Tx.Dani_Plate.szTextureSize.Width / 7; + int tickHeight = TJAPlayer3.Tx.Dani_Plate.szTextureSize.Height; + int tickExtraWidth = TJAPlayer3.Tx.Dani_Plate_Extra.szTextureSize.Width / 3; + int tickExtraHeight = TJAPlayer3.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 = TJAPlayer3.Skin.DaniSelect_Plate[0] + (idx == 0 ? TJAPlayer3.Skin.DaniSelect_Plate_Center_Move[0] : 0) + idx * TJAPlayer3.Skin.DaniSelect_Plate_Move[0]; + int yPos = TJAPlayer3.Skin.DaniSelect_Plate[1] + (idx == 0 ? TJAPlayer3.Skin.DaniSelect_Plate_Center_Move[1] : 0) + idx * TJAPlayer3.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: { + TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateOpacity(255); + TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateColor4(CConversion.ColorToColor4(tickColor)); + TJAPlayer3.Tx.Dani_Plate_Extra?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(0, 0, tickExtraWidth, tickExtraHeight)); + break; + } + case CSongListNode.ENodeType.BOX: { + TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateOpacity(255); + TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateColor4(CConversion.ColorToColor4(tickColor)); + TJAPlayer3.Tx.Dani_Plate_Extra?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickExtraWidth, 0, tickExtraWidth, tickExtraHeight)); + break; + } + case CSongListNode.ENodeType.RANDOM: { + TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateOpacity(255); + TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateColor4(CConversion.ColorToColor4(tickColor)); + TJAPlayer3.Tx.Dani_Plate_Extra?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickExtraWidth * 2, 0, tickExtraWidth, tickExtraHeight)); + break; + } + default: { + TJAPlayer3.Tx.Dani_Plate?.tUpdateOpacity(255); + TJAPlayer3.Tx.Dani_Plate?.tUpdateColor4(CConversion.ColorToColor4(tickColor)); + TJAPlayer3.Tx.Dani_Plate?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickWidth * tick, 0, tickWidth, tickHeight)); + break; + } + } + + // Reset color for plate flash + TJAPlayer3.Tx.Dani_Plate?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + + #endregion + + #region [Dan grade title] + if (stバー情報[currentSong].eノード種別 == CSongListNode.ENodeType.SCORE) + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTextureTate(stバー情報[currentSong].ttkタイトル[stバー情報[currentSong].ttkタイトル.Length - 1]) + .t2D拡大率考慮上中央基準描画(xPos + TJAPlayer3.Skin.DaniSelect_Plate_Title_Offset[0], yPos + TJAPlayer3.Skin.DaniSelect_Plate_Title_Offset[1]); + + #endregion + + + #region [Plate flash] + + if (idx == 0) { + TJAPlayer3.Tx.Dani_Plate?.tUpdateOpacity(Math.Abs(255 - ctDanTick.CurrentValue)); + TJAPlayer3.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) { + TJAPlayer3.Tx.DanResult_Rank.vcScaleRatio.X = 0.20f; + TJAPlayer3.Tx.DanResult_Rank.vcScaleRatio.Y = 0.20f; + int rank_width = TJAPlayer3.Tx.DanResult_Rank.szTextureSize.Width / 7; + int rank_height = TJAPlayer3.Tx.DanResult_Rank.szTextureSize.Height; + TJAPlayer3.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() { + TJAPlayer3.tDisposeSafely(ref pfDanPlateTitle); + TJAPlayer3.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 (TJAPlayer3.stageSongSelect.r確定されたスコア != null) { + danTick = TJAPlayer3.stageSongSelect.r確定されたスコア.譜面情報.nDanTick; + danTickColor = TJAPlayer3.stageSongSelect.r確定されたスコア.譜面情報.cDanTickColor; + } + if (songNode != null) { + STバー情報 stNode = (STバー情報)songNode; + + danTick = stNode.nDanTick; + danTickColor = stNode.cDanTickColor; + } + + + int unit = TJAPlayer3.Tx.Dani_DanPlates.szTextureSize.Width / 6; + + if (TJAPlayer3.Tx.Dani_DanPlates != null) { + TJAPlayer3.Tx.Dani_DanPlates.Opacity = 255; + TJAPlayer3.Tx.Dani_DanPlates.color4 = CConversion.ColorToColor4(danTickColor); + } + TJAPlayer3.Tx.Dani_DanPlates_Back?.t2D中心基準描画(x, y, new Rectangle( + unit * danTick, + 0, + unit, + TJAPlayer3.Tx.Dani_DanPlates_Back.szTextureSize.Height + )); + TJAPlayer3.Tx.Dani_DanPlates?.t2D中心基準描画(x, y, new Rectangle( + unit * danTick, + 0, + unit, + TJAPlayer3.Tx.Dani_DanPlates.szTextureSize.Height + )); + + if (pfDanPlateTitle == null) + pfDanPlateTitle = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.DaniSelect_DanPlateTitle_Size); + + string titleTmp = ""; + + if (TJAPlayer3.stageSongSelect.r確定されたスコア != null) + titleTmp = TJAPlayer3.stageSongSelect.rChoosenSong.ldTitle.GetString(""); + if (songNode != null) { + STバー情報 stNode = (STバー情報)songNode; + + titleTmp = stNode.ttkタイトル[stNode.ttkタイトル.Length - 1].str文字; + } + + TitleTextureKey ttkTmp = new TitleTextureKey(titleTmp.Substring(0, 2), pfDanPlateTitle, Color.White, Color.Black, 1000); + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTextureTate(ttkTmp).t2D中心基準描画(x + TJAPlayer3.Skin.DaniSelect_DanPlateTitle_Offset[0], y + TJAPlayer3.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(TJAPlayer3.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) { + TJAPlayer3.Tx.Dani_DanIcon_Fade.vcScaleRatio = new Vector3D(scale, scale, 1.0f); + TJAPlayer3.Tx.Dani_DanIcon_Fade.Opacity = opacity; + TJAPlayer3.Tx.Dani_DanIcon_Fade.color4 = CConversion.ColorToColor4(TJAPlayer3.Skin.DaniSelect_DanIcon_Color[Math.Min(count - 1, TJAPlayer3.Skin.DaniSelect_DanIcon_Color.Length - 1)]); + TJAPlayer3.Tx.Dani_DanIcon_Fade.t2D拡大率考慮描画(CTexture.RefPnt.Left, x - ((TJAPlayer3.Tx.Dani_DanIcon.szTextureSize.Width / 2) * scale), y); + TJAPlayer3.Tx.Dani_DanIcon_Fade.Opacity = 255; + } + + TJAPlayer3.Tx.Dani_DanIcon.vcScaleRatio = new Vector3D(scale, scale, 1.0f); + TJAPlayer3.Tx.Dani_DanIcon.Opacity = opacity; + TJAPlayer3.Tx.Dani_DanIcon.color4 = CConversion.ColorToColor4(TJAPlayer3.Skin.DaniSelect_DanIcon_Color[Math.Min(count - 1, TJAPlayer3.Skin.DaniSelect_DanIcon_Color.Length - 1)]); + TJAPlayer3.Tx.Dani_DanIcon.t2D拡大率考慮中央基準描画(x, y); + TJAPlayer3.Tx.Dani_DanIcon.Opacity = 255; + + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkTmp).vcScaleRatio = new Vector3D(scale, scale, 1.0f); + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkTmp).Opacity = opacity; + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkTmp).t2D拡大率考慮中央基準描画(x + TJAPlayer3.Skin.DaniSelect_DanIconTitle_Offset[0], y + TJAPlayer3.Skin.DaniSelect_DanIconTitle_Offset[1]); + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkTmp).Opacity = 255; + } + + private void tDrawDanSelectedLevel(float Anime, int modifier = 0) { + int scroll = TJAPlayer3.Skin.Resolution[0] * modifier; + int currentSong = n現在の選択行 + modifier; + 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 = TJAPlayer3.Tx.Dani_DanSides.szTextureSize.Width / 6; + TJAPlayer3.Tx.Dani_DanSides.color4 = CConversion.ColorToColor4(danTickColor); + + TJAPlayer3.Tx.Dani_Bar_Center.t2D描画(scroll + Anime, 0); + + // Bar sides + TJAPlayer3.Tx.Dani_DanSides.t2D描画((int)(scroll + Anime) + TJAPlayer3.Skin.DaniSelect_DanSides_X[0], TJAPlayer3.Skin.DaniSelect_DanSides_Y[0], new Rectangle( + unit * danTick, + 0, + unit, + TJAPlayer3.Tx.Dani_DanSides.szTextureSize.Height + )); + + TJAPlayer3.Tx.Dani_DanSides.t2D左右反転描画((int)(scroll + Anime) + TJAPlayer3.Skin.DaniSelect_DanSides_X[1], TJAPlayer3.Skin.DaniSelect_DanSides_Y[1], new Rectangle( + unit * danTick, + 0, + unit, + TJAPlayer3.Tx.Dani_DanSides.szTextureSize.Height + )); + } + + CActSelect段位リスト.tDisplayDanPlate(stバー情報[currentSong].txDanPlate, stバー情報[currentSong], (int)(scroll + Anime) + TJAPlayer3.Skin.DaniSelect_DanPlate[0], TJAPlayer3.Skin.DaniSelect_DanPlate[1]); + + #endregion + + #region [Goukaku plate] + + int currentRank = Math.Min(stバー情報[currentSong].clearGrade, 8) - 3; + + if (currentRank >= 0) { + TJAPlayer3.Tx.DanResult_Rank.vcScaleRatio.X = 0.8f; + TJAPlayer3.Tx.DanResult_Rank.vcScaleRatio.Y = 0.8f; + + int rank_width = TJAPlayer3.Tx.DanResult_Rank.szTextureSize.Width / 7; + int rank_height = TJAPlayer3.Tx.DanResult_Rank.szTextureSize.Height; + + TJAPlayer3.Tx.DanResult_Rank.t2D拡大率考慮中央基準描画(scroll + Anime + TJAPlayer3.Skin.DaniSelect_Rank[0], TJAPlayer3.Skin.DaniSelect_Rank[1], new Rectangle(rank_width * (currentRank + 1), 0, rank_width, rank_height)); + } + + #endregion + + #region [Soul gauge condition] + + TJAPlayer3.Tx.Dani_Bloc[2]?.t2D描画(scroll + Anime + TJAPlayer3.Skin.DaniSelect_Bloc2[0], TJAPlayer3.Skin.DaniSelect_Bloc2[1]); + + if (stバー情報[currentSong].List_DanSongs[0].Dan_C[0] != null) + tSoulDraw(scroll + Anime + TJAPlayer3.Skin.DaniSelect_Value_Gauge[0], TJAPlayer3.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); + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkExams[0]).t2D拡大率考慮中央基準描画((int)(scroll + Anime) + TJAPlayer3.Skin.DaniSelect_Text_Gauge[0], TJAPlayer3.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; @@ -545,356 +488,311 @@ namespace TJAPlayer3 return opacity; */ - } + } - int difficulty_cymbol_width = TJAPlayer3.Tx.Dani_Difficulty_Cymbol.szTextureSize.Width / 5; - int difficulty_cymbol_height = TJAPlayer3.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; - int sections_count = 1 + ((stバー情報[currentSong].n曲レベル.Length - 1) / 3); + int difficulty_cymbol_width = TJAPlayer3.Tx.Dani_Difficulty_Cymbol.szTextureSize.Width / 5; + int difficulty_cymbol_height = TJAPlayer3.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); - } - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[i]).Opacity = opacity; - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[i]).t2D描画(scroll + Anime + TJAPlayer3.Skin.DaniSelect_Title_X[pos], TJAPlayer3.Skin.DaniSelect_Title_Y[pos]); - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[i]).Opacity = 255; + 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); + } + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[i]).Opacity = opacity; + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[i]).t2D描画(scroll + Anime + TJAPlayer3.Skin.DaniSelect_Title_X[pos], TJAPlayer3.Skin.DaniSelect_Title_Y[pos]); + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[i]).Opacity = 255; - tDisplayDanIcon(i + 1, scroll + Anime + TJAPlayer3.Skin.DaniSelect_DanIcon_X[pos], TJAPlayer3.Skin.DaniSelect_DanIcon_Y[pos], opacity, 1.0f); - } + tDisplayDanIcon(i + 1, scroll + Anime + TJAPlayer3.Skin.DaniSelect_DanIcon_X[pos], TJAPlayer3.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) - { - TJAPlayer3.Tx.Dani_Difficulty_Cymbol.Opacity = getOpacity(i, sections_count); - } - TJAPlayer3.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画(scroll + Anime + TJAPlayer3.Skin.DaniSelect_Difficulty_Cymbol_X[pos], TJAPlayer3.Skin.DaniSelect_Difficulty_Cymbol_Y[pos], new Rectangle(stバー情報[currentSong].n曲難易度[i] * difficulty_cymbol_width, 0, difficulty_cymbol_width, difficulty_cymbol_height)); - TJAPlayer3.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) { + TJAPlayer3.Tx.Dani_Difficulty_Cymbol.Opacity = getOpacity(i, sections_count); + } + TJAPlayer3.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画(scroll + Anime + TJAPlayer3.Skin.DaniSelect_Difficulty_Cymbol_X[pos], TJAPlayer3.Skin.DaniSelect_Difficulty_Cymbol_Y[pos], new Rectangle(stバー情報[currentSong].n曲難易度[i] * difficulty_cymbol_width, 0, difficulty_cymbol_width, difficulty_cymbol_height)); + TJAPlayer3.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) - { - TJAPlayer3.Tx.Dani_Level_Number.Opacity = getOpacity(i, sections_count); - } - this.tLevelNumberDraw(scroll + Anime + TJAPlayer3.Skin.DaniSelect_Level_Number_X[pos], TJAPlayer3.Skin.DaniSelect_Level_Number_Y[pos], stバー情報[currentSong].n曲レベル[i]); - TJAPlayer3.Tx.Dani_Level_Number.Opacity = 255; - } + for (int i = 0; i < stバー情報[currentSong].n曲レベル.Length; i++) { + int pos = i % 3; + if (stバー情報[currentSong].n曲レベル.Length > 3) { + TJAPlayer3.Tx.Dani_Level_Number.Opacity = getOpacity(i, sections_count); + } + this.tLevelNumberDraw(scroll + Anime + TJAPlayer3.Skin.DaniSelect_Level_Number_X[pos], TJAPlayer3.Skin.DaniSelect_Level_Number_Y[pos], stバー情報[currentSong].n曲レベル[i]); + TJAPlayer3.Tx.Dani_Level_Number.Opacity = 255; + } - #endregion + #endregion - #region [Check if one of the EXAM5,6,7 slots are used] + #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; - } - } + for (int j = 4; j < CExamInfo.cMaxExam; j++) { + if (stバー情報[currentSong].List_DanSongs[0].Dan_C[j] != null) { + over4 = true; + break; + } + } - #endregion + #endregion - #region [Display dan conditions] + #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; + 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] + #region [Alter opacity if multi-screen exam display] - int opacity = 255; + int opacity = 255; - if (over4 == true) - { - int half = (j - 1) / 3; + if (over4 == true) { + int half = (j - 1) / 3; - int animJauge = ctExamConditionsAnim.CurrentValue; + 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; - } - } + 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 + #endregion - #region [Exam value (individual included)] + #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) - { - TJAPlayer3.Tx.Dani_Exam_Number.Opacity = opacity; + for (int i = 0; i < stバー情報[currentSong].List_DanSongs.Count; i++) //曲ごとのループ(魂ゲージを除く) 横(x) + { + if (stバー情報[currentSong].List_DanSongs[i].Dan_C[j] != null) { + TJAPlayer3.Tx.Dani_Exam_Number.Opacity = opacity; - if (stバー情報[currentSong].List_DanSongs[stバー情報[currentSong].List_DanSongs.Count - 1].Dan_C[j] != null) - { - //個別の条件がありますよー + if (stバー情報[currentSong].List_DanSongs[stバー情報[currentSong].List_DanSongs.Count - 1].Dan_C[j] != null) { + //個別の条件がありますよー - int moveX = TJAPlayer3.Skin.DaniSelect_Exam_Interval[0]; - int moveY = TJAPlayer3.Skin.DaniSelect_Exam_Interval[1]; - int x = TJAPlayer3.Skin.DaniSelect_Exam_Bloc_X[index]; - int y = TJAPlayer3.Skin.DaniSelect_Exam_Bloc_Y[index]; + int moveX = TJAPlayer3.Skin.DaniSelect_Exam_Interval[0]; + int moveY = TJAPlayer3.Skin.DaniSelect_Exam_Interval[1]; + int x = TJAPlayer3.Skin.DaniSelect_Exam_Bloc_X[index]; + int y = TJAPlayer3.Skin.DaniSelect_Exam_Bloc_Y[index]; - int exam_x = TJAPlayer3.Skin.DaniSelect_Exam_X[index]; - int exam_y = TJAPlayer3.Skin.DaniSelect_Exam_Y[index]; + int exam_x = TJAPlayer3.Skin.DaniSelect_Exam_X[index]; + int exam_y = TJAPlayer3.Skin.DaniSelect_Exam_Y[index]; - CTexture tex = null; - switch (stバー情報[currentSong].List_DanSongs.Count) - { - case 1: - tex = TJAPlayer3.Tx.Dani_Bloc[0]; - break; - case 2: - case 3: - tex = TJAPlayer3.Tx.Dani_Bloc[1]; - break; - case 4: - case 5: - case 6: - default: - tex = TJAPlayer3.Tx.Dani_Bloc[3]; - moveX /= 2; - moveY /= 2; - exam_x = TJAPlayer3.Skin.DaniSelect_Exam_X_Ex[index]; - exam_y = TJAPlayer3.Skin.DaniSelect_Exam_Y_Ex[index]; - break; - } + CTexture tex = null; + switch (stバー情報[currentSong].List_DanSongs.Count) { + case 1: + tex = TJAPlayer3.Tx.Dani_Bloc[0]; + break; + case 2: + case 3: + tex = TJAPlayer3.Tx.Dani_Bloc[1]; + break; + case 4: + case 5: + case 6: + default: + tex = TJAPlayer3.Tx.Dani_Bloc[3]; + moveX /= 2; + moveY /= 2; + exam_x = TJAPlayer3.Skin.DaniSelect_Exam_X_Ex[index]; + exam_y = TJAPlayer3.Skin.DaniSelect_Exam_Y_Ex[index]; + break; + } - if (i == 0) - { - if (tex != null) - tex.Opacity = opacity; - tex?.t2D描画( - scroll + Anime + x, - y); - } + 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 < 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 (TJAPlayer3.Tx.Dani_Bloc[0] != null) - TJAPlayer3.Tx.Dani_Bloc[0].Opacity = opacity; - TJAPlayer3.Tx.Dani_Bloc[0]?.t2D描画( - scroll + Anime + TJAPlayer3.Skin.DaniSelect_Exam_Bloc_X[index], - TJAPlayer3.Skin.DaniSelect_Exam_Bloc_Y[index]); - } + if (i == 0) { + if (TJAPlayer3.Tx.Dani_Bloc[0] != null) + TJAPlayer3.Tx.Dani_Bloc[0].Opacity = opacity; + TJAPlayer3.Tx.Dani_Bloc[0]?.t2D描画( + scroll + Anime + TJAPlayer3.Skin.DaniSelect_Exam_Bloc_X[index], + TJAPlayer3.Skin.DaniSelect_Exam_Bloc_Y[index]); + } - tExamDraw(scroll + Anime + TJAPlayer3.Skin.DaniSelect_Exam_X[index], TJAPlayer3.Skin.DaniSelect_Exam_Y[index], stバー情報[currentSong].List_DanSongs[0].Dan_C[j].Value[0], stバー情報[currentSong].List_DanSongs[0].Dan_C[j].GetExamRange()); + tExamDraw(scroll + Anime + TJAPlayer3.Skin.DaniSelect_Exam_X[index], TJAPlayer3.Skin.DaniSelect_Exam_Y[index], stバー情報[currentSong].List_DanSongs[0].Dan_C[j].Value[0], stバー情報[currentSong].List_DanSongs[0].Dan_C[j].GetExamRange()); - } + } - TJAPlayer3.Tx.Dani_Exam_Number.Opacity = 255; - } - } + TJAPlayer3.Tx.Dani_Exam_Number.Opacity = 255; + } + } - #endregion + #endregion - #region [Exam title] + #region [Exam title] - if (stバー情報[currentSong].List_DanSongs[0].Dan_C[j] != null) - { - CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkExams[(int)stバー情報[currentSong].List_DanSongs[0].Dan_C[j].GetExamType()]); + if (stバー情報[currentSong].List_DanSongs[0].Dan_C[j] != null) { + CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.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.Opacity = opacity; + //tmpTex.t2D下中央基準描画((int)(scroll + 614 + Anime), 452 + index * 88); - tmpTex.t2D拡大率考慮中央基準描画((int)(scroll + Anime) + TJAPlayer3.Skin.DaniSelect_Exam_Title_X[index], TJAPlayer3.Skin.DaniSelect_Exam_Title_Y[index]); - } + tmpTex.t2D拡大率考慮中央基準描画((int)(scroll + Anime) + TJAPlayer3.Skin.DaniSelect_Exam_Title_X[index], TJAPlayer3.Skin.DaniSelect_Exam_Title_Y[index]); + } - #endregion - } + #endregion + } - #endregion - } - break; - case CSongListNode.ENodeType.BACKBOX: - { - TJAPlayer3.Tx.Dani_Bar_Back?.t2D描画(scroll + Anime, 0); - break; - } - case CSongListNode.ENodeType.BOX: - { - TJAPlayer3.Tx.Dani_Bar_Folder_Back?.t2D描画(scroll + Anime, 0); - TJAPlayer3.Tx.Dani_Bar_Folder?.t2D描画(scroll + Anime, 0); - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[0]) - .t2D拡大率考慮上中央基準描画((int)(scroll + Anime + TJAPlayer3.Skin.DaniSelect_FolderText_X[0]), TJAPlayer3.Skin.DaniSelect_FolderText_Y[0]); - for (int desc = 1; desc < 4; desc++) - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[desc]) - .t2D拡大率考慮上中央基準描画((int)(scroll + Anime + TJAPlayer3.Skin.DaniSelect_FolderText_X[desc]), TJAPlayer3.Skin.DaniSelect_FolderText_Y[desc]); - break; - } - case CSongListNode.ENodeType.RANDOM: - { - TJAPlayer3.Tx.Dani_Bar_Random?.t2D描画(scroll + Anime, 0); - break; - } - } - } + #endregion + } + break; + case CSongListNode.ENodeType.BACKBOX: { + TJAPlayer3.Tx.Dani_Bar_Back?.t2D描画(scroll + Anime, 0); + break; + } + case CSongListNode.ENodeType.BOX: { + TJAPlayer3.Tx.Dani_Bar_Folder_Back?.t2D描画(scroll + Anime, 0); + TJAPlayer3.Tx.Dani_Bar_Folder?.t2D描画(scroll + Anime, 0); + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[0]) + .t2D拡大率考慮上中央基準描画((int)(scroll + Anime + TJAPlayer3.Skin.DaniSelect_FolderText_X[0]), TJAPlayer3.Skin.DaniSelect_FolderText_Y[0]); + for (int desc = 1; desc < 4; desc++) + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[desc]) + .t2D拡大率考慮上中央基準描画((int)(scroll + Anime + TJAPlayer3.Skin.DaniSelect_FolderText_X[desc]), TJAPlayer3.Skin.DaniSelect_FolderText_Y[desc]); + break; + } + case CSongListNode.ENodeType.RANDOM: { + TJAPlayer3.Tx.Dani_Bar_Random?.t2D描画(scroll + Anime, 0); + break; + } + } + } - public void tOpenFolder(CSongListNode song) - { - listSongs = song.list子リスト; - n現在の選択行 = 0; - tUpdateSongs(); - } + public void tOpenFolder(CSongListNode song) { + listSongs = song.list子リスト; + n現在の選択行 = 0; + tUpdateSongs(); + } - public void tCloseFolder(CSongListNode song) - { - listSongs = song.rParentNode.rParentNode.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 tUpdateSongs() { + stバー情報 = new STバー情報[listSongs.Count]; + this.tバーの初期化(); + } - private void tバーの初期化() - { - for (int i = 0; i < stバー情報.Length; i++) - { - var song = listSongs[i]; + 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; - } + 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("").Substring(0, 2); + // Two char header, will be used for grade unlocking too + string tmp = song.ldTitle.GetString("").Substring(0, 2); - stバー情報[i].ttkタイトル[listSongs[i].DanSongs.Count] = new TitleTextureKey(tmp, pfDanSong, Color.Black, Color.Transparent, 700); + 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].nDanTick = song.arスコア[6].譜面情報.nDanTick; + stバー情報[i].cDanTickColor = song.arスコア[6].譜面情報.cDanTickColor; - //stバー情報[i].clearGrade = song.arスコア[6].譜面情報.nクリア[0]; - var TableEntry = TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.tGetSongSelectTableEntry(song.tGetUniqueId()); - stバー情報[i].clearGrade = TableEntry.ClearStatuses[(int)Difficulty.Dan]; + //stバー情報[i].clearGrade = song.arスコア[6].譜面情報.nクリア[0]; + var TableEntry = TJAPlayer3.SaveFileInstances[TJAPlayer3.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 = TJAPlayer3.tテクスチャの生成(barCenter); - BarTexCache.Add(barCenter, stバー情報[i].txBarCenter); - } + 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 = TJAPlayer3.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 = TJAPlayer3.tテクスチャの生成(danPlate); - BarTexCache.Add(danPlate, stバー情報[i].txDanPlate); - } - } - break; - case CSongListNode.ENodeType.BOX: - { - TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.Skin.Resolution[0]); - else - stバー情報[i].ttkタイトル[boxdesc + 1] = new TitleTextureKey("", pfDanFolderDesc, Color.White, Color.Black, TJAPlayer3.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; - } + 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 = TJAPlayer3.tテクスチャの生成(danPlate); + BarTexCache.Add(danPlate, stバー情報[i].txDanPlate); + } + } + break; + case CSongListNode.ENodeType.BOX: { + TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.Skin.Resolution[0]); + else + stバー情報[i].ttkタイトル[boxdesc + 1] = new TitleTextureKey("", pfDanFolderDesc, Color.White, Color.Black, TJAPlayer3.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) - { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - this.bLeftMove = false; - this.ctDaniMoveAnime.Start(0, 90, 2f, TJAPlayer3.Timer); - } - } + } + } - public void t左に移動() - { - if (n現在の選択行 > 0) - { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - this.bLeftMove = true; - this.ctDaniMoveAnime.Start(0, 90, 2f, TJAPlayer3.Timer); - } - } + public void t右に移動() { + if (n現在の選択行 < stバー情報.Length - 1) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + this.bLeftMove = false; + this.ctDaniMoveAnime.Start(0, 90, 2f, TJAPlayer3.Timer); + } + } - public void tLevelNumberDraw(float x, float y, int num, float scale = 1.0f) - { - /* + public void t左に移動() { + if (n現在の選択行 > 0) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + this.bLeftMove = true; + this.ctDaniMoveAnime.Start(0, 90, 2f, TJAPlayer3.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++) @@ -907,29 +805,27 @@ namespace TJAPlayer3 } }*/ - float width = TJAPlayer3.Tx.Dani_Level_Number.sz画像サイズ.Width / 10.0f; - float height = TJAPlayer3.Tx.Dani_Level_Number.sz画像サイズ.Height; + float width = TJAPlayer3.Tx.Dani_Level_Number.sz画像サイズ.Width / 10.0f; + float height = TJAPlayer3.Tx.Dani_Level_Number.sz画像サイズ.Height; - int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) - { - float offset = j; + int[] nums = CConversion.SeparateDigits(num); + for (int j = 0; j < nums.Length; j++) { + float offset = j; - float _x = x - (((TJAPlayer3.Skin.DaniSelect_Level_Number_Interval[0] * offset) + (width / 2)) * scale); - float _y = y - (((TJAPlayer3.Skin.DaniSelect_Level_Number_Interval[1] * offset) - (width / 2)) * scale); + float _x = x - (((TJAPlayer3.Skin.DaniSelect_Level_Number_Interval[0] * offset) + (width / 2)) * scale); + float _y = y - (((TJAPlayer3.Skin.DaniSelect_Level_Number_Interval[1] * offset) - (width / 2)) * scale); - TJAPlayer3.Tx.Dani_Level_Number.vcScaleRatio.X = scale; - TJAPlayer3.Tx.Dani_Level_Number.vcScaleRatio.Y = scale; - TJAPlayer3.Tx.Dani_Level_Number.t2D描画(_x, _y, - new RectangleF(width * nums[j], 0, width, height)); - TJAPlayer3.Tx.Dani_Level_Number.vcScaleRatio.X = 1; - TJAPlayer3.Tx.Dani_Level_Number.vcScaleRatio.Y = 1; - } - } + TJAPlayer3.Tx.Dani_Level_Number.vcScaleRatio.X = scale; + TJAPlayer3.Tx.Dani_Level_Number.vcScaleRatio.Y = scale; + TJAPlayer3.Tx.Dani_Level_Number.t2D描画(_x, _y, + new RectangleF(width * nums[j], 0, width, height)); + TJAPlayer3.Tx.Dani_Level_Number.vcScaleRatio.X = 1; + TJAPlayer3.Tx.Dani_Level_Number.vcScaleRatio.Y = 1; + } + } - public void tSoulDraw(float x, float y, int num) - { - /* + 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++) @@ -944,32 +840,30 @@ namespace TJAPlayer3 } }*/ - int[] nums = CConversion.SeparateDigits(num); + int[] nums = CConversion.SeparateDigits(num); - float width = TJAPlayer3.Tx.Dani_Soul_Number.sz画像サイズ.Width / 10.0f; - float height = TJAPlayer3.Tx.Dani_Soul_Number.sz画像サイズ.Height / 2.0f; + float width = TJAPlayer3.Tx.Dani_Soul_Number.sz画像サイズ.Width / 10.0f; + float height = TJAPlayer3.Tx.Dani_Soul_Number.sz画像サイズ.Height / 2.0f; - float text_width = TJAPlayer3.Skin.DaniSelect_Soul_Number_Text_Width; + float text_width = TJAPlayer3.Skin.DaniSelect_Soul_Number_Text_Width; - TJAPlayer3.Tx.Dani_Soul_Number.t2D描画(x + TJAPlayer3.Skin.DaniSelect_Soul_Number_Interval[0] + (width / 2), - y + TJAPlayer3.Skin.DaniSelect_Soul_Number_Interval[1] - (height / 2), - new RectangleF(0, height, text_width, height)); + TJAPlayer3.Tx.Dani_Soul_Number.t2D描画(x + TJAPlayer3.Skin.DaniSelect_Soul_Number_Interval[0] + (width / 2), + y + TJAPlayer3.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; + for (int j = 0; j < nums.Length; j++) { + float offset = j; - float _x = x - (TJAPlayer3.Skin.DaniSelect_Soul_Number_Interval[0] * offset) + (width / 2); - float _y = y - (TJAPlayer3.Skin.DaniSelect_Soul_Number_Interval[1] * offset) - (height / 2); + float _x = x - (TJAPlayer3.Skin.DaniSelect_Soul_Number_Interval[0] * offset) + (width / 2); + float _y = y - (TJAPlayer3.Skin.DaniSelect_Soul_Number_Interval[1] * offset) - (height / 2); - TJAPlayer3.Tx.Dani_Soul_Number.t2D描画(_x, _y, - new RectangleF(width * nums[j], 0, width, height)); - } - } + TJAPlayer3.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) - { - /* + 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++) @@ -986,35 +880,34 @@ namespace TJAPlayer3 */ - int[] nums = CConversion.SeparateDigits(num); + int[] nums = CConversion.SeparateDigits(num); - float width = TJAPlayer3.Tx.Dani_Exam_Number.sz画像サイズ.Width / 10.0f; - float height = TJAPlayer3.Tx.Dani_Exam_Number.sz画像サイズ.Height / 2.0f; + float width = TJAPlayer3.Tx.Dani_Exam_Number.sz画像サイズ.Width / 10.0f; + float height = TJAPlayer3.Tx.Dani_Exam_Number.sz画像サイズ.Height / 2.0f; - float text_width = TJAPlayer3.Skin.DaniSelect_Exam_Number_Text_Width; + float text_width = TJAPlayer3.Skin.DaniSelect_Exam_Number_Text_Width; - TJAPlayer3.Tx.Dani_Exam_Number.vcScaleRatio.X = scale; - TJAPlayer3.Tx.Dani_Exam_Number.vcScaleRatio.Y = scale; + TJAPlayer3.Tx.Dani_Exam_Number.vcScaleRatio.X = scale; + TJAPlayer3.Tx.Dani_Exam_Number.vcScaleRatio.Y = scale; - TJAPlayer3.Tx.Dani_Exam_Number.t2D描画( - x + ((TJAPlayer3.Skin.DaniSelect_Exam_Number_Interval[0] + (width / 2)) * scale), - y + ((TJAPlayer3.Skin.DaniSelect_Exam_Number_Interval[1] + (height / 2)) * scale), - new RectangleF(text_width * (int)Range, height, text_width, height)); + TJAPlayer3.Tx.Dani_Exam_Number.t2D描画( + x + ((TJAPlayer3.Skin.DaniSelect_Exam_Number_Interval[0] + (width / 2)) * scale), + y + ((TJAPlayer3.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; + for (int j = 0; j < nums.Length; j++) { + float offset = j; - float _x = x - (((TJAPlayer3.Skin.DaniSelect_Exam_Number_Interval[0] * offset) + (width / 2)) * scale); - float _y = y - (((TJAPlayer3.Skin.DaniSelect_Exam_Number_Interval[1] * offset) - (height / 2)) * scale); + float _x = x - (((TJAPlayer3.Skin.DaniSelect_Exam_Number_Interval[0] * offset) + (width / 2)) * scale); + float _y = y - (((TJAPlayer3.Skin.DaniSelect_Exam_Number_Interval[1] * offset) - (height / 2)) * scale); - TJAPlayer3.Tx.Dani_Exam_Number.t2D描画(_x, _y, - new RectangleF(width * nums[j], 0, width, height)); - } - } + TJAPlayer3.Tx.Dani_Exam_Number.t2D描画(_x, _y, + new RectangleF(width * nums[j], 0, width, height)); + } + } - #endregion + #endregion - } + } } diff --git a/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位挑戦選択画面.cs b/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位挑戦選択画面.cs index f2a2c00f..83469bd2 100644 --- a/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位挑戦選択画面.cs +++ b/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位挑戦選択画面.cs @@ -1,127 +1,102 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Drawing; using FDK; -namespace TJAPlayer3 -{ - class CActSelect段位挑戦選択画面 : CActivity - { - public override void Activate() - { - ctBarIn = new CCounter(); - ctBarOut = new CCounter(); - ctBarOut.CurrentValue = 255; - TJAPlayer3.stage段位選択.bDifficultyIn = false; - bOption = false; +namespace TJAPlayer3 { + class CActSelect段位挑戦選択画面 : CActivity { + public override void Activate() { + ctBarIn = new CCounter(); + ctBarOut = new CCounter(); + ctBarOut.CurrentValue = 255; + TJAPlayer3.stage段位選択.bDifficultyIn = false; + bOption = false; - base.Activate(); - } + base.Activate(); + } - public override void DeActivate() - { - base.DeActivate(); - } + public override void DeActivate() { + 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() - { - if(TJAPlayer3.stage段位選択.bDifficultyIn || ctBarOut.CurrentValue < ctBarOut.EndValue) - { - ctBarIn.Tick(); - ctBarOut.Tick(); + public override int Draw() { + if (TJAPlayer3.stage段位選択.bDifficultyIn || ctBarOut.CurrentValue < ctBarOut.EndValue) { + ctBarIn.Tick(); + ctBarOut.Tick(); - TJAPlayer3.Tx.Challenge_Select[0].Opacity = TJAPlayer3.stage段位選択.bDifficultyIn ? ctBarIn.CurrentValue : 255 - ctBarOut.CurrentValue; - TJAPlayer3.Tx.Challenge_Select[1].Opacity = TJAPlayer3.stage段位選択.bDifficultyIn ? ctBarIn.CurrentValue : 255 - ctBarOut.CurrentValue; - TJAPlayer3.Tx.Challenge_Select[2].Opacity = TJAPlayer3.stage段位選択.bDifficultyIn ? ctBarIn.CurrentValue : 255 - ctBarOut.CurrentValue; + TJAPlayer3.Tx.Challenge_Select[0].Opacity = TJAPlayer3.stage段位選択.bDifficultyIn ? ctBarIn.CurrentValue : 255 - ctBarOut.CurrentValue; + TJAPlayer3.Tx.Challenge_Select[1].Opacity = TJAPlayer3.stage段位選択.bDifficultyIn ? ctBarIn.CurrentValue : 255 - ctBarOut.CurrentValue; + TJAPlayer3.Tx.Challenge_Select[2].Opacity = TJAPlayer3.stage段位選択.bDifficultyIn ? ctBarIn.CurrentValue : 255 - ctBarOut.CurrentValue; - TJAPlayer3.Tx.Challenge_Select[0].t2D描画(0, 0); + TJAPlayer3.Tx.Challenge_Select[0].t2D描画(0, 0); - int selectIndex = (2 - n現在の選択行); - int[] challenge_select_rect = TJAPlayer3.Skin.DaniSelect_Challenge_Select_Rect[selectIndex]; + int selectIndex = (2 - n現在の選択行); + int[] challenge_select_rect = TJAPlayer3.Skin.DaniSelect_Challenge_Select_Rect[selectIndex]; - TJAPlayer3.Tx.Challenge_Select[2].t2D描画(TJAPlayer3.Skin.DaniSelect_Challenge_Select_X[selectIndex], TJAPlayer3.Skin.DaniSelect_Challenge_Select_Y[selectIndex], - new Rectangle(challenge_select_rect[0], challenge_select_rect[1], challenge_select_rect[2], challenge_select_rect[3])); + TJAPlayer3.Tx.Challenge_Select[2].t2D描画(TJAPlayer3.Skin.DaniSelect_Challenge_Select_X[selectIndex], TJAPlayer3.Skin.DaniSelect_Challenge_Select_Y[selectIndex], + new Rectangle(challenge_select_rect[0], challenge_select_rect[1], challenge_select_rect[2], challenge_select_rect[3])); - TJAPlayer3.Tx.Challenge_Select[1].t2D描画(0, 0); + TJAPlayer3.Tx.Challenge_Select[1].t2D描画(0, 0); - if (TJAPlayer3.stage段位選択.ct待機.IsStarted) - return base.Draw(); + if (TJAPlayer3.stage段位選択.ct待機.IsStarted) + return base.Draw(); - #region [Key bindings] + #region [Key bindings] - if (ctBarIn.IsEnded && !TJAPlayer3.stage段位選択.b選択した && bOption == false) - { - if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue)) - { - if (n現在の選択行 - 1 >= 0) - { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - n現在の選択行--; - } - } + if (ctBarIn.IsEnded && !TJAPlayer3.stage段位選択.b選択した && bOption == false) { + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue)) { + if (n現在の選択行 - 1 >= 0) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + n現在の選択行--; + } + } - if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue)) - { - if (n現在の選択行 + 1 <= 2) - { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - n現在の選択行++; - } - } + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue)) { + if (n現在の選択行 + 1 <= 2) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + n現在の選択行++; + } + } - if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed)) - { - if (n現在の選択行 == 0) - { - this.ctBarOut.Start(0, 255, 0.5f, TJAPlayer3.Timer); - TJAPlayer3.Skin.soundCancelSFX.tPlay(); - TJAPlayer3.stage段位選択.bDifficultyIn = false; - } - else if (n現在の選択行 == 1) - { - //TJAPlayer3.Skin.soundDanSongSelect.t再生する(); - TJAPlayer3.ConfigIni.bTokkunMode = false; - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - TJAPlayer3.Skin.voiceMenuDanSelectConfirm[TJAPlayer3.SaveFile]?.tPlay(); - TJAPlayer3.stage段位選択.ct待機.Start(0, 3000, 1, TJAPlayer3.Timer); - } - else if (n現在の選択行 == 2) - { - bOption = true; - } - } - } + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed)) { + if (n現在の選択行 == 0) { + this.ctBarOut.Start(0, 255, 0.5f, TJAPlayer3.Timer); + TJAPlayer3.Skin.soundCancelSFX.tPlay(); + TJAPlayer3.stage段位選択.bDifficultyIn = false; + } else if (n現在の選択行 == 1) { + //TJAPlayer3.Skin.soundDanSongSelect.t再生する(); + TJAPlayer3.ConfigIni.bTokkunMode = false; + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + TJAPlayer3.Skin.voiceMenuDanSelectConfirm[TJAPlayer3.SaveFile]?.tPlay(); + TJAPlayer3.stage段位選択.ct待機.Start(0, 3000, 1, TJAPlayer3.Timer); + } else if (n現在の選択行 == 2) { + bOption = true; + } + } + } - #endregion - } + #endregion + } - return base.Draw(); - } + return base.Draw(); + } - public CCounter ctBarIn; - public CCounter ctBarOut; + public CCounter ctBarIn; + public CCounter ctBarOut; - public bool bOption; + public bool bOption; - private int n現在の選択行; - } + private int n現在の選択行; + } } diff --git a/OpenTaiko/src/Stages/05.DaniSelect/CStage段位選択.cs b/OpenTaiko/src/Stages/05.DaniSelect/CStage段位選択.cs index 06e934f2..5ae3e7c5 100644 --- a/OpenTaiko/src/Stages/05.DaniSelect/CStage段位選択.cs +++ b/OpenTaiko/src/Stages/05.DaniSelect/CStage段位選択.cs @@ -1,108 +1,92 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using System.Diagnostics; using System.Text; -using System.Threading.Tasks; -using System.Drawing; using FDK; -using static TJAPlayer3.CActSelect曲リスト; -using System.Diagnostics; -namespace TJAPlayer3 -{ - class CStage段位選択 : CStage - { - public CStage段位選択() - { - base.eStageID = EStage.DanDojoSelect; - base.ePhaseID = CStage.EPhase.Common_NORMAL; +namespace TJAPlayer3 { + class CStage段位選択 : CStage { + public CStage段位選択() { + base.eStageID = EStage.DanDojoSelect; + base.ePhaseID = CStage.EPhase.Common_NORMAL; - base.ChildActivities.Add(this.段位リスト = new CActSelect段位リスト()); + base.ChildActivities.Add(this.段位リスト = new CActSelect段位リスト()); - 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.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()); + } - public override void Activate() - { - if (base.IsActivated) - return; + public override void Activate() { + if (base.IsActivated) + return; - this.b選択した = false; + this.b選択した = false; - base.ePhaseID = CStage.EPhase.Common_NORMAL; - this.eフェードアウト完了時の戻り値 = E戻り値.継続; + base.ePhaseID = CStage.EPhase.Common_NORMAL; + this.eフェードアウト完了時の戻り値 = E戻り値.継続; - ct待機 = new CCounter(); - ctChara_In = new CCounter(); + 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); + // ctChara_Normal = new CCounter(0, TJAPlayer3.Tx.SongSelect_Chara_Normal.Length - 1, 1000 / 45, TJAPlayer3.Timer); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.NORMAL); - bInSongPlayed = false; - - this.PuchiChara.IdleAnimation(); - - Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.DANISELECT}Script.lua")); - Background.Init(); + bInSongPlayed = false; - base.Activate(); - } + this.PuchiChara.IdleAnimation(); - public override void DeActivate() - { - TJAPlayer3.tDisposeSafely(ref Background); - - base.DeActivate(); - } + Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.DANISELECT}Script.lua")); + Background.Init(); - public override void CreateManagedResource() - { + base.Activate(); + } - base.CreateManagedResource(); - } + public override void DeActivate() { + TJAPlayer3.tDisposeSafely(ref Background); - public override void ReleaseManagedResource() - { + base.DeActivate(); + } - base.ReleaseManagedResource(); - } + public override void CreateManagedResource() { - public override int Draw() - { - // ctChara_Normal.t進行Loop(); - ctChara_In.Tick(); - ct待機.Tick(); + base.CreateManagedResource(); + } - int stamp = this.段位リスト.ctDaniIn.CurrentValue; + public override void ReleaseManagedResource() { - float zoom = Math.Min(1.14f, Math.Max(1f, (float)Math.Pow(stamp / 3834f, 0.5f))); + base.ReleaseManagedResource(); + } - Background.Update(); - Background.Draw(); + public override int Draw() { + // ctChara_Normal.t進行Loop(); + ctChara_In.Tick(); + ct待機.Tick(); - //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); + int stamp = this.段位リスト.ctDaniIn.CurrentValue; - this.段位リスト.Draw(); + float zoom = Math.Min(1.14f, Math.Max(1f, (float)Math.Pow(stamp / 3834f, 0.5f))); - if (stamp < 6000) - { - #region [Dan intro anim] + Background.Update(); + Background.Draw(); - if (!bInSongPlayed) - { - this.段位リスト.ctDaniIn = new CCounter(0, 6000, 1, TJAPlayer3.Timer); - TJAPlayer3.Skin.soundDanSongSelectIn.tPlay(); - bInSongPlayed = true; - } + //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(); + + if (stamp < 6000) { + #region [Dan intro anim] + + if (!bInSongPlayed) { + this.段位リスト.ctDaniIn = new CCounter(0, 6000, 1, TJAPlayer3.Timer); + TJAPlayer3.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; @@ -119,18 +103,17 @@ namespace TJAPlayer3 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] + if (stamp <= 3834) { + #region [Dan intro letters] - //int quarter = TJAPlayer3.Tx.Dani_Dan_Text.szテクスチャサイズ.Width / 4; + //int quarter = TJAPlayer3.Tx.Dani_Dan_Text.szテクスチャサイズ.Width / 4; - /* + /* int[] xAxis = { 300, 980 }; int[] yAxis = { 198, 522 }; */ - /* + /* int[] appearStamps = { 1645, 2188, 2646, 3152 }; for (int i = 0; i < 4; i++) @@ -153,265 +136,234 @@ namespace TJAPlayer3 } */ - #endregion - } + #endregion + } - #endregion - } - else if (stamp == 6000) - { - if (!ctChara_In.IsStarted) - { - //TJAPlayer3.Skin.soundDanSelectStart.t再生する(); - TJAPlayer3.Skin.voiceMenuDanSelectStart[TJAPlayer3.SaveFile]?.tPlay(); - TJAPlayer3.Skin.soundDanSelectBGM.tPlay(); - ctChara_In.Start(0, 180, 1.25f, TJAPlayer3.Timer); - } + #endregion + } else if (stamp == 6000) { + if (!ctChara_In.IsStarted) { + //TJAPlayer3.Skin.soundDanSelectStart.t再生する(); + TJAPlayer3.Skin.voiceMenuDanSelectStart[TJAPlayer3.SaveFile]?.tPlay(); + TJAPlayer3.Skin.soundDanSelectBGM.tPlay(); + ctChara_In.Start(0, 180, 1.25f, TJAPlayer3.Timer); + } - TJAPlayer3.NamePlate.tNamePlateDraw(TJAPlayer3.Skin.SongSelect_NamePlate_X[0], TJAPlayer3.Skin.SongSelect_NamePlate_Y[0], 0); - ModIcons.tDisplayModsMenu(TJAPlayer3.Skin.SongSelect_ModIcons_X[0], TJAPlayer3.Skin.SongSelect_ModIcons_Y[0], 0);; + TJAPlayer3.NamePlate.tNamePlateDraw(TJAPlayer3.Skin.SongSelect_NamePlate_X[0], TJAPlayer3.Skin.SongSelect_NamePlate_Y[0], 0); + ModIcons.tDisplayModsMenu(TJAPlayer3.Skin.SongSelect_ModIcons_X[0], TJAPlayer3.Skin.SongSelect_ModIcons_Y[0], 0); ; - #region [ キー関連 ] + #region [ キー関連 ] - if (!this.段位リスト.bスクロール中 && !b選択した && !bDifficultyIn) - { - int returnTitle() - { - TJAPlayer3.Skin.soundDanSelectBGM.tStop(); - TJAPlayer3.Skin.soundCancelSFX.tPlay(); - this.eフェードアウト完了時の戻り値 = E戻り値.タイトルに戻る; - this.actFOtoTitle.tフェードアウト開始(); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - return 0; - } + if (!this.段位リスト.bスクロール中 && !b選択した && !bDifficultyIn) { + int returnTitle() { + TJAPlayer3.Skin.soundDanSelectBGM.tStop(); + TJAPlayer3.Skin.soundCancelSFX.tPlay(); + this.eフェードアウト完了時の戻り値 = E戻り値.タイトルに戻る; + this.actFOtoTitle.tフェードアウト開始(); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + return 0; + } - if (TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightArrow) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange)) - { - this.段位リスト.t右に移動(); - } + if (TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightArrow) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange)) { + this.段位リスト.t右に移動(); + } - if (TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftArrow) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange)) - { - this.段位リスト.t左に移動(); - } + if (TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftArrow) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange)) { + this.段位リスト.t左に移動(); + } - if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Decide)) - { - switch(段位リスト.currentBar.eノード種別) - { - case CSongListNode.ENodeType.SCORE: - case CSongListNode.ENodeType.RANDOM: - { - //this.t段位を選択する(); - //TJAPlayer3.Skin.soundDanSongSelectCheck.t再生する(); - TJAPlayer3.Skin.voiceMenuDanSelectPrompt[TJAPlayer3.SaveFile]?.tPlay(); - this.bDifficultyIn = true; - this.段位挑戦選択画面.ctBarIn.Start(0, 255, 1, TJAPlayer3.Timer); - } - break; - case CSongListNode.ENodeType.BOX: - { - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - 段位リスト.tOpenFolder(段位リスト.currentBar); - } - break; - case CSongListNode.ENodeType.BACKBOX: - { - if (TJAPlayer3.Songs管理.list曲ルート.Contains(段位リスト.currentBar.rParentNode) && 段位リスト.currentBar.rParentNode.strジャンル == "段位道場") - { - return returnTitle(); - } - else - { - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - 段位リスト.tCloseFolder(段位リスト.currentBar); - } - } - break; - } - } + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Decide)) { + switch (段位リスト.currentBar.eノード種別) { + case CSongListNode.ENodeType.SCORE: + case CSongListNode.ENodeType.RANDOM: { + //this.t段位を選択する(); + //TJAPlayer3.Skin.soundDanSongSelectCheck.t再生する(); + TJAPlayer3.Skin.voiceMenuDanSelectPrompt[TJAPlayer3.SaveFile]?.tPlay(); + this.bDifficultyIn = true; + this.段位挑戦選択画面.ctBarIn.Start(0, 255, 1, TJAPlayer3.Timer); + } + break; + case CSongListNode.ENodeType.BOX: { + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + 段位リスト.tOpenFolder(段位リスト.currentBar); + } + break; + case CSongListNode.ENodeType.BACKBOX: { + if (TJAPlayer3.Songs管理.list曲ルート.Contains(段位リスト.currentBar.rParentNode) && 段位リスト.currentBar.rParentNode.strジャンル == "段位道場") { + return returnTitle(); + } else { + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + 段位リスト.tCloseFolder(段位リスト.currentBar); + } + } + break; + } + } - if(TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Cancel)) - { - return returnTitle(); - } - } + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Cancel)) { + return returnTitle(); + } + } - #endregion + #endregion - #region [ キャラ関連 ] + #region [ キャラ関連 ] - if(ctChara_In.CurrentValue != 90) - { - float CharaX = 0f, CharaY = 0f; + 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); + 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); + // 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); + //CMenuCharacter.tMenuDisplayCharacter(0, (int)(-200 + CharaX), (int)(336 - CharaY), CMenuCharacter.ECharacterAnimation.NORMAL); - int chara_x = TJAPlayer3.Skin.SongSelect_NamePlate_X[0] + TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2; - int chara_y = TJAPlayer3.Skin.SongSelect_NamePlate_Y[0]; + int chara_x = TJAPlayer3.Skin.SongSelect_NamePlate_X[0] + TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2; + int chara_y = TJAPlayer3.Skin.SongSelect_NamePlate_Y[0]; - CMenuCharacter.tMenuDisplayCharacter( - 0, - chara_x, - chara_y, - CMenuCharacter.ECharacterAnimation.NORMAL); + CMenuCharacter.tMenuDisplayCharacter( + 0, + chara_x, + chara_y, + CMenuCharacter.ECharacterAnimation.NORMAL); - #region [PuchiChara] + #region [PuchiChara] - int puchi_x = chara_x + TJAPlayer3.Skin.Adjustments_MenuPuchichara_X[0]; - int puchi_y = chara_y + TJAPlayer3.Skin.Adjustments_MenuPuchichara_Y[0]; + int puchi_x = chara_x + TJAPlayer3.Skin.Adjustments_MenuPuchichara_X[0]; + int puchi_y = chara_y + TJAPlayer3.Skin.Adjustments_MenuPuchichara_Y[0]; - //this.PuchiChara.On進行描画(0 + 100, 336 + 230, false); - this.PuchiChara.On進行描画(puchi_x, puchi_y, false); + //this.PuchiChara.On進行描画(0 + 100, 336 + 230, false); + this.PuchiChara.On進行描画(puchi_x, puchi_y, false); - #endregion - } + #endregion + } - #endregion + #endregion - this.段位挑戦選択画面.Draw(); - } + this.段位挑戦選択画面.Draw(); + } - if (段位挑戦選択画面.bOption) actPlayOption.On進行描画(0); + if (段位挑戦選択画面.bOption) actPlayOption.On進行描画(0); - if (ct待機.CurrentValue >= 3000) - { - if (段位リスト.currentBar.eノード種別 == CSongListNode.ENodeType.RANDOM) - { - if (!tSelectSongRandomly()) - { - bDifficultyIn = false; - b選択した = false; - TJAPlayer3.Skin.soundError.tPlay(); - } - } - else - { - TJAPlayer3.stage段位選択.t段位を選択する(); - } - ct待機.CurrentValue = 0; - ct待機.Stop(); - } + if (ct待機.CurrentValue >= 3000) { + if (段位リスト.currentBar.eノード種別 == CSongListNode.ENodeType.RANDOM) { + if (!tSelectSongRandomly()) { + bDifficultyIn = false; + b選択した = false; + TJAPlayer3.Skin.soundError.tPlay(); + } + } else { + TJAPlayer3.stage段位選択.t段位を選択する(); + } + ct待機.CurrentValue = 0; + ct待機.Stop(); + } - switch (base.ePhaseID) - { - case CStage.EPhase.SongSelect_FadeOutToNowLoading: - if (this.actFOtoNowLoading.Draw() == 0) - { - break; - } - 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; - } + return 0; + } - public enum E戻り値 : int - { - 継続, - タイトルに戻る, - 選曲した - } + public enum E戻り値 : int { + 継続, + タイトルに戻る, + 選曲した + } - public void t段位を選択する() - { - this.b選択した = true; - TJAPlayer3.stageSongSelect.rChoosenSong = 段位リスト.listSongs[段位リスト.n現在の選択行]; - TJAPlayer3.stageSongSelect.r確定されたスコア = 段位リスト.listSongs[段位リスト.n現在の選択行].arスコア[(int)Difficulty.Dan]; - TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] = (int)Difficulty.Dan; - TJAPlayer3.stageSongSelect.str確定された曲のジャンル = 段位リスト.listSongs[段位リスト.n現在の選択行].strジャンル; - if ((TJAPlayer3.stageSongSelect.rChoosenSong != null) && (TJAPlayer3.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(); - } + public void t段位を選択する() { + this.b選択した = true; + TJAPlayer3.stageSongSelect.rChoosenSong = 段位リスト.listSongs[段位リスト.n現在の選択行]; + TJAPlayer3.stageSongSelect.r確定されたスコア = 段位リスト.listSongs[段位リスト.n現在の選択行].arスコア[(int)Difficulty.Dan]; + TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] = (int)Difficulty.Dan; + TJAPlayer3.stageSongSelect.str確定された曲のジャンル = 段位リスト.listSongs[段位リスト.n現在の選択行].strジャンル; + if ((TJAPlayer3.stageSongSelect.rChoosenSong != null) && (TJAPlayer3.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; + private bool tSelectSongRandomly() { + this.b選択した = true; + var mandatoryDiffs = new List(); + CSongListNode song = 段位リスト.currentBar; - List songs = new List(); - TJAPlayer3.stageSongSelect.t指定された曲の子リストの曲を列挙する_孫リスト含む(song.rParentNode, ref songs, ref mandatoryDiffs, true); - song.listランダム用ノードリスト = songs; + List songs = new List(); + TJAPlayer3.stageSongSelect.t指定された曲の子リストの曲を列挙する_孫リスト含む(song.rParentNode, ref songs, ref mandatoryDiffs, true); + song.listランダム用ノードリスト = songs; - int selectableSongCount = song.listランダム用ノードリスト.Count; + int selectableSongCount = song.listランダム用ノードリスト.Count; - if (selectableSongCount == 0) - { - return false; - } + if (selectableSongCount == 0) { + return false; + } - int randomSongIndex = TJAPlayer3.Random.Next(selectableSongCount); + int randomSongIndex = TJAPlayer3.Random.Next(selectableSongCount); - if (TJAPlayer3.ConfigIni.bLogDTX詳細ログ出力) - { - 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 (TJAPlayer3.ConfigIni.bLogDTX詳細ログ出力) { + 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 - TJAPlayer3.stageSongSelect.rChoosenSong = song.listランダム用ノードリスト[randomSongIndex]; - TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] = (int)Difficulty.Dan; + // Third assignment + TJAPlayer3.stageSongSelect.rChoosenSong = song.listランダム用ノードリスト[randomSongIndex]; + TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] = (int)Difficulty.Dan; - TJAPlayer3.stageSongSelect.r確定されたスコア = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[TJAPlayer3.stageSongSelect.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(TJAPlayer3.stageSongSelect.rChoosenSong)]; - TJAPlayer3.stageSongSelect.str確定された曲のジャンル = TJAPlayer3.stageSongSelect.rChoosenSong.strジャンル; + TJAPlayer3.stageSongSelect.r確定されたスコア = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[TJAPlayer3.stageSongSelect.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(TJAPlayer3.stageSongSelect.rChoosenSong)]; + TJAPlayer3.stageSongSelect.str確定された曲のジャンル = TJAPlayer3.stageSongSelect.rChoosenSong.strジャンル; - //TJAPlayer3.Skin.sound曲決定音.t再生する(); + //TJAPlayer3.Skin.sound曲決定音.t再生する(); - this.eフェードアウト完了時の戻り値 = E戻り値.選曲した; - this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略 - base.ePhaseID = CStage.EPhase.SongSelect_FadeOutToNowLoading; + this.eフェードアウト完了時の戻り値 = E戻り値.選曲した; + this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略 + base.ePhaseID = CStage.EPhase.SongSelect_FadeOutToNowLoading; - CSongSelectSongManager.stopSong(); + CSongSelectSongManager.stopSong(); - return true; - } + return true; + } - private ScriptBG Background; + private ScriptBG Background; - public CCounter ct待機; + public CCounter ct待機; - public bool b選択した; - public bool bDifficultyIn; + public bool b選択した; + public bool bDifficultyIn; - public bool bInSongPlayed; + public bool bInSongPlayed; - private CCounter ctChara_In; - // private CCounter ctChara_Normal; + private CCounter ctChara_In; + // private CCounter ctChara_Normal; - private PuchiChara PuchiChara; + private PuchiChara PuchiChara; - public E戻り値 eフェードアウト完了時の戻り値; + public E戻り値 eフェードアウト完了時の戻り値; - public CActFIFOStart actFOtoNowLoading; - public CActFIFOBlack actFOtoTitle; - public CActSelect段位リスト 段位リスト; - public CActSelect段位挑戦選択画面 段位挑戦選択画面; - public CActPlayOption actPlayOption; - } + 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 c2e26ef9..1f161c90 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/AnimeBG.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/AnimeBG.cs @@ -1,38 +1,24 @@ using NLua; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -namespace TJAPlayer3 -{ - 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 TJAPlayer3 { + 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) - { - } - } - } + 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 3b9c92c7..ad031574 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActPlayOption.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActPlayOption.cs @@ -1,787 +1,703 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; +using System.Drawing; using FDK; -namespace TJAPlayer3 -{ - 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); - } - - 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 = TJAPlayer3.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(); - } - - 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(TJAPlayer3.Skin.SongSelect_Option_Font_Scale); - - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() - { - OptionFont.Dispose(); - - - 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, TJAPlayer3.Timer); - - var act難易度 = TJAPlayer3.stageSongSelect.actDifficultySelectionScreen; - var danAct = TJAPlayer3.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 ? (TJAPlayer3.Tx.Difficulty_Option.szTextureSize.Width / 2) : 0; - var _rect = new Rectangle(_shift, 0, TJAPlayer3.Tx.Difficulty_Option.szTextureSize.Width / 2, TJAPlayer3.Tx.Difficulty_Option.szTextureSize.Height); - - TJAPlayer3.Tx.Difficulty_Option.t2D描画(_shift, y, _rect); - TJAPlayer3.Tx.Difficulty_Option_Select.t2D描画(_shift + TJAPlayer3.Skin.SongSelect_Option_Select_Offset[0] + NowCount * TJAPlayer3.Skin.SongSelect_Option_Interval[0], - TJAPlayer3.Skin.SongSelect_Option_Select_Offset[1] + y + NowCount * TJAPlayer3.Skin.SongSelect_Option_Interval[1], _rect); - - for (int i = 0; i < OptionType.Length; i++) - { - OptionType[i].t2D描画(TJAPlayer3.Skin.SongSelect_Option_OptionType_X[pos] + i * TJAPlayer3.Skin.SongSelect_Option_Interval[0], - TJAPlayer3.Skin.SongSelect_Option_OptionType_Y[pos] + y + i * TJAPlayer3.Skin.SongSelect_Option_Interval[1]); - } - - txModMults[0]?.t2D拡大率考慮描画(CTexture.RefPnt.Up, TJAPlayer3.Skin.SongSelect_Option_ModMults1_X[pos], TJAPlayer3.Skin.SongSelect_Option_ModMults1_Y[pos] + y); - txModMults[1]?.t2D拡大率考慮描画(CTexture.RefPnt.Up, TJAPlayer3.Skin.SongSelect_Option_ModMults2_X[pos], TJAPlayer3.Skin.SongSelect_Option_ModMults2_Y[pos] + y); - - for (int i = 0; i < _textures.Length; i++) - { - _textures[i]?.t2D拡大率考慮描画(CTexture.RefPnt.Up, TJAPlayer3.Skin.SongSelect_Option_Value_X[pos] + i * TJAPlayer3.Skin.SongSelect_Option_Interval[0], - TJAPlayer3.Skin.SongSelect_Option_Value_Y[pos] + y + i * TJAPlayer3.Skin.SongSelect_Option_Interval[1]); - } - - 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; - } - - #region [ Inputs ] - - if (!ctClose.IsTicked) - { - bool _leftDrum = false; - - bool _rightDrum = false; - - bool _centerDrum = false; - - bool _cancel = false; - - switch (player) - { - case 0: - _rightDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)); - _leftDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)); - _centerDrum = (TJAPlayer3.Pad.bPressedDGB(EPad.Decide) || - (TJAPlayer3.ConfigIni.bEnterがキー割り当てのどこにも使用されていない && TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))); - _cancel = (TJAPlayer3.Pad.bPressedDGB(EPad.Cancel) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)); - break; - case 1: - _rightDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue2P)); - _leftDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue2P)); - _centerDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed2P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed2P)); - break; - case 2: - _rightDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue3P)); - _leftDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue3P)); - _centerDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed3P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed3P)); - break; - case 3: - _rightDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue4P)); - _leftDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue4P)); - _centerDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed4P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed4P)); - break; - case 4: - _rightDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue5P)); - _leftDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue5P)); - _centerDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed5P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed5P)); - break; - } - - - if (_leftDrum || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) - { - OptionSelect(true); - tFetchMults(player); - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - } - - if (_rightDrum || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) - { - OptionSelect(false); - tFetchMults(player); - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - } - - if (_centerDrum && ctOpen.CurrentValue >= ctOpen.EndValue) - { - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - if (NowCount < nOptionCount) - { - NowCount++; - } - else if (NowCount >= nOptionCount && !bEnd) - { - bEnd = true; - ctClose.Start(0, 50, 6, TJAPlayer3.Timer); - } - } - - int cp1 = nOptionCount + 1; - - if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.UpArrow)) { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - NowCount = (NowCount + cp1 - 1) % cp1; - } - - if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.DownArrow)) { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - NowCount = (NowCount + 1) % cp1; - } - - if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) - { - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - bEnd = true; - ctClose.Start(0, 50, 6, TJAPlayer3.Timer); - } - } - - - #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 TJAPlayer3.tテクスチャの生成(bmp); - } - } - - 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 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 Init(int player) - { - int actual = TJAPlayer3.GetActualPlayer(player); - - #region [ Speed ] - - int speed = TJAPlayer3.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)TJAPlayer3.ConfigIni.eSTEALTH[actual]; - - #endregion - - #region [ Random ] - - var rand_ = TJAPlayer3.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 = TJAPlayer3.ConfigIni.nTimingZones[actual]; - - #endregion - - #region [Just] - - nJust = TJAPlayer3.ConfigIni.bJust[actual]; - - #endregion - - #region [GameType] - - nGameType = (int)TJAPlayer3.ConfigIni.nGameType[actual]; - - #endregion - - #region [Fun mods] - - nFunMods = (int)TJAPlayer3.ConfigIni.nFunMods[actual]; - - #endregion - - #region [ GameMode ] - - if (TJAPlayer3.ConfigIni.bTokkunMode == true) - nGameMode = 1; - else - nGameMode = 0; +namespace TJAPlayer3 { + 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); + } + + 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); - #endregion + 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); - #region [ AutoMode ] + 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); - bool _auto = TJAPlayer3.ConfigIni.bAutoPlay[player]; + 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); - if (_auto == true) - nAutoMode = 1; - else - nAutoMode = 0; + 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); - #region [ Hitsounds ] + 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); - nOtoiro = Math.Min(txOtoiro.Length - 1, TJAPlayer3.ConfigIni.nHitSounds[actual]); + txNone = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_BLANK"), Color.White, Color.Black); - #endregion + hsInfo = TJAPlayer3.Skin.hsHitSoundsInformations; - #region [ Song speed ] + txOtoiro = new CTexture[hsInfo.names.Length]; - nSongSpeed = Math.Max(0, Math.Min(txSongSpeed.Length - 1, (TJAPlayer3.ConfigIni.nSongSpeed / 2) - 5)); + 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); + } - #endregion + 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); - tFetchMults(player); + 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; - public void Decision(int player) - { - int actual = TJAPlayer3.GetActualPlayer(player); + 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(TJAPlayer3.Skin.SongSelect_Option_Font_Scale); - #region [ Speed ] + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + OptionFont.Dispose(); - if (nSpeedCount == 0) - { - TJAPlayer3.ConfigIni.nScrollSpeed[actual] = 4; - } - else if (nSpeedCount > 0 && nSpeedCount <= 11) - { - TJAPlayer3.ConfigIni.nScrollSpeed[actual] = nSpeedCount + 8; - } - else if (nSpeedCount == 12) - { - TJAPlayer3.ConfigIni.nScrollSpeed[actual] = 24; - } - else if (nSpeedCount == 13) - { - TJAPlayer3.ConfigIni.nScrollSpeed[actual] = 29; - } - else if (nSpeedCount == 14) - { - TJAPlayer3.ConfigIni.nScrollSpeed[actual] = 34; - } - else if (nSpeedCount == 15) - { - TJAPlayer3.ConfigIni.nScrollSpeed[actual] = 39; - } - #endregion + base.ReleaseManagedResource(); + } - #region [ Doron ] - TJAPlayer3.ConfigIni.eSTEALTH[actual] = (EStealthMode)nStealth; - #endregion + public int On進行描画(int player) { + if (this.IsDeActivated) + return 0; - #region [ Random ] + if (ctOpen.CurrentValue == 0) + Init(player); + + ctOpen.Tick(); + ctClose.Tick(); + + if (!ctOpen.IsTicked) ctOpen.Start(0, 50, 6, TJAPlayer3.Timer); + + var act難易度 = TJAPlayer3.stageSongSelect.actDifficultySelectionScreen; + var danAct = TJAPlayer3.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 ? (TJAPlayer3.Tx.Difficulty_Option.szTextureSize.Width / 2) : 0; + var _rect = new Rectangle(_shift, 0, TJAPlayer3.Tx.Difficulty_Option.szTextureSize.Width / 2, TJAPlayer3.Tx.Difficulty_Option.szTextureSize.Height); + + TJAPlayer3.Tx.Difficulty_Option.t2D描画(_shift, y, _rect); + TJAPlayer3.Tx.Difficulty_Option_Select.t2D描画(_shift + TJAPlayer3.Skin.SongSelect_Option_Select_Offset[0] + NowCount * TJAPlayer3.Skin.SongSelect_Option_Interval[0], + TJAPlayer3.Skin.SongSelect_Option_Select_Offset[1] + y + NowCount * TJAPlayer3.Skin.SongSelect_Option_Interval[1], _rect); + + for (int i = 0; i < OptionType.Length; i++) { + OptionType[i].t2D描画(TJAPlayer3.Skin.SongSelect_Option_OptionType_X[pos] + i * TJAPlayer3.Skin.SongSelect_Option_Interval[0], + TJAPlayer3.Skin.SongSelect_Option_OptionType_Y[pos] + y + i * TJAPlayer3.Skin.SongSelect_Option_Interval[1]); + } + + txModMults[0]?.t2D拡大率考慮描画(CTexture.RefPnt.Up, TJAPlayer3.Skin.SongSelect_Option_ModMults1_X[pos], TJAPlayer3.Skin.SongSelect_Option_ModMults1_Y[pos] + y); + txModMults[1]?.t2D拡大率考慮描画(CTexture.RefPnt.Up, TJAPlayer3.Skin.SongSelect_Option_ModMults2_X[pos], TJAPlayer3.Skin.SongSelect_Option_ModMults2_Y[pos] + y); + + for (int i = 0; i < _textures.Length; i++) { + _textures[i]?.t2D拡大率考慮描画(CTexture.RefPnt.Up, TJAPlayer3.Skin.SongSelect_Option_Value_X[pos] + i * TJAPlayer3.Skin.SongSelect_Option_Interval[0], + TJAPlayer3.Skin.SongSelect_Option_Value_Y[pos] + y + i * TJAPlayer3.Skin.SongSelect_Option_Interval[1]); + } + + 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; + } + + #region [ Inputs ] + + if (!ctClose.IsTicked) { + bool _leftDrum = false; + + bool _rightDrum = false; + + bool _centerDrum = false; + + bool _cancel = false; + + switch (player) { + case 0: + _rightDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)); + _leftDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)); + _centerDrum = (TJAPlayer3.Pad.bPressedDGB(EPad.Decide) || + (TJAPlayer3.ConfigIni.bEnterがキー割り当てのどこにも使用されていない && TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))); + _cancel = (TJAPlayer3.Pad.bPressedDGB(EPad.Cancel) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)); + break; + case 1: + _rightDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue2P)); + _leftDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue2P)); + _centerDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed2P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed2P)); + break; + case 2: + _rightDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue3P)); + _leftDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue3P)); + _centerDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed3P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed3P)); + break; + case 3: + _rightDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue4P)); + _leftDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue4P)); + _centerDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed4P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed4P)); + break; + case 4: + _rightDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue5P)); + _leftDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue5P)); + _centerDrum = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed5P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed5P)); + break; + } + + + if (_leftDrum || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) { + OptionSelect(true); + tFetchMults(player); + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + } + + if (_rightDrum || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) { + OptionSelect(false); + tFetchMults(player); + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + } + + if (_centerDrum && ctOpen.CurrentValue >= ctOpen.EndValue) { + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + if (NowCount < nOptionCount) { + NowCount++; + } else if (NowCount >= nOptionCount && !bEnd) { + bEnd = true; + ctClose.Start(0, 50, 6, TJAPlayer3.Timer); + } + } + + int cp1 = nOptionCount + 1; + + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.UpArrow)) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + NowCount = (NowCount + cp1 - 1) % cp1; + } + + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.DownArrow)) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + NowCount = (NowCount + 1) % cp1; + } + + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) { + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + bEnd = true; + ctClose.Start(0, 50, 6, TJAPlayer3.Timer); + } + } + + + #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 TJAPlayer3.tテクスチャの生成(bmp); + } + } + + 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 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; + } + } - if (nRandom == 2 && nAbekobe == 1) - { - TJAPlayer3.ConfigIni.eRandom[actual] = ERandomMode.MIRRORRANDOM; - } - else if (nRandom == 2 && nAbekobe == 0) - { - TJAPlayer3.ConfigIni.eRandom[actual] = ERandomMode.SUPERRANDOM; - } - else if (nRandom == 1 && nAbekobe == 1) - { - TJAPlayer3.ConfigIni.eRandom[actual] = ERandomMode.RANDOM; - } - else if (nRandom == 1 && nAbekobe == 0) - { - TJAPlayer3.ConfigIni.eRandom[actual] = ERandomMode.RANDOM; - } - else if (nRandom == 0 && nAbekobe == 1) - { - TJAPlayer3.ConfigIni.eRandom[actual] = ERandomMode.MIRROR; - } - else if (nRandom == 0 && nAbekobe == 0) - { - TJAPlayer3.ConfigIni.eRandom[actual] = ERandomMode.OFF; - } + public void Init(int player) { + int actual = TJAPlayer3.GetActualPlayer(player); - #endregion + #region [ Speed ] - #region [ Timing ] + int speed = TJAPlayer3.ConfigIni.nScrollSpeed[actual]; - TJAPlayer3.ConfigIni.nTimingZones[actual] = nTiming; + 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 + #endregion - #region [Just] + #region [ Doron ] - TJAPlayer3.ConfigIni.bJust[actual] = nJust; + nStealth = (int)TJAPlayer3.ConfigIni.eSTEALTH[actual]; + + #endregion + + #region [ Random ] + + var rand_ = TJAPlayer3.ConfigIni.eRandom[actual]; - #endregion + 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 = TJAPlayer3.ConfigIni.nTimingZones[actual]; - #region [GameType] + #endregion - TJAPlayer3.ConfigIni.nGameType[actual] = (EGameType)nGameType; + #region [Just] - #endregion + nJust = TJAPlayer3.ConfigIni.bJust[actual]; - #region [Fun mods] + #endregion - TJAPlayer3.ConfigIni.nFunMods[actual] = (EFunMods)nFunMods; + #region [GameType] - #endregion + nGameType = (int)TJAPlayer3.ConfigIni.nGameType[actual]; - #region [ GameMode ] + #endregion - if (nGameMode == 0) - { - TJAPlayer3.ConfigIni.bTokkunMode = false; - } - else - { - TJAPlayer3.ConfigIni.bTokkunMode = true; - } + #region [Fun mods] - #endregion + nFunMods = (int)TJAPlayer3.ConfigIni.nFunMods[actual]; - #region [ AutoMode ] + #endregion - if (nAutoMode == 1) - { - TJAPlayer3.ConfigIni.bAutoPlay[player] = true; - } - else - { - TJAPlayer3.ConfigIni.bAutoPlay[player] = false; - } + #region [ GameMode ] - #endregion + if (TJAPlayer3.ConfigIni.bTokkunMode == true) + nGameMode = 1; + else + nGameMode = 0; - #region [ Hitsounds ] + #endregion - TJAPlayer3.ConfigIni.nHitSounds[actual] = nOtoiro; - hsInfo.tReloadHitSounds(nOtoiro, actual); + #region [ AutoMode ] - #endregion + bool _auto = TJAPlayer3.ConfigIni.bAutoPlay[player]; - #region [ Song speed ] + if (_auto == true) + nAutoMode = 1; + else + nAutoMode = 0; - TJAPlayer3.ConfigIni.nSongSpeed = (nSongSpeed + 5) * 2; + #endregion - #endregion - } + #region [ Hitsounds ] - #region [ Balancing functions ] + nOtoiro = Math.Min(txOtoiro.Length - 1, TJAPlayer3.ConfigIni.nHitSounds[actual]); - public float tGetScrollSpeedFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0) - { - var _compare = (isMenu) ? nSpeedCount != 1 : TJAPlayer3.ConfigIni.nScrollSpeed[actual] != 9; + #endregion - if (ebt == EBalancingType.SCORE) - return (_compare) ? 0.9f : 1f; - return 1f; - } + #region [ Song speed ] - public float tGetSongSpeedFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0) - { - var _compare = ((isMenu) ? (nSongSpeed + 5) * 2 : TJAPlayer3.ConfigIni.nSongSpeed) / 20f; + nSongSpeed = Math.Max(0, Math.Min(txSongSpeed.Length - 1, (TJAPlayer3.ConfigIni.nSongSpeed / 2) - 5)); - 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)); - } + #endregion - public float tGetJustFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0) - { - var _compare = (isMenu) ? nJust : TJAPlayer3.ConfigIni.bJust[actual]; + tFetchMults(player); - if (ebt == EBalancingType.SCORE) - return (_compare == 2) ? 0.6f : 1f; + } - return (_compare > 0) ? ((_compare > 1) ? 0.5f : 1.3f) : 1f; - } + public void Decision(int player) { + int actual = TJAPlayer3.GetActualPlayer(player); - public float tGetTimingFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0) - { - var _compare = (isMenu) ? nTiming - 2 : TJAPlayer3.ConfigIni.nTimingZones[actual] - 2; + #region [ Speed ] - if (ebt == EBalancingType.SCORE) - return (_compare < 0) ? (1f + 0.2f * _compare) : 1f; + if (nSpeedCount == 0) { + TJAPlayer3.ConfigIni.nScrollSpeed[actual] = 4; + } else if (nSpeedCount > 0 && nSpeedCount <= 11) { + TJAPlayer3.ConfigIni.nScrollSpeed[actual] = nSpeedCount + 8; + } else if (nSpeedCount == 12) { + TJAPlayer3.ConfigIni.nScrollSpeed[actual] = 24; + } else if (nSpeedCount == 13) { + TJAPlayer3.ConfigIni.nScrollSpeed[actual] = 29; + } else if (nSpeedCount == 14) { + TJAPlayer3.ConfigIni.nScrollSpeed[actual] = 34; + } else if (nSpeedCount == 15) { + TJAPlayer3.ConfigIni.nScrollSpeed[actual] = 39; + } - return 1f + 0.2f * _compare; - } + #endregion - public float tGetDoronFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0) - { - var _compare = (isMenu) ? nStealth : (int)TJAPlayer3.ConfigIni.eSTEALTH[actual]; + #region [ Doron ] - if (ebt == EBalancingType.SCORE || _compare == 0) - return 1f; + TJAPlayer3.ConfigIni.eSTEALTH[actual] = (EStealthMode)nStealth; - // Doron : x1.1 coins, Stealth : x1.4 coins - return 1f + 0.1f * (float)Math.Pow(_compare, 2); - } + #endregion - public float tGetModMultiplier(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int player = 0) - { - float factor = 1f; - int actual = TJAPlayer3.GetActualPlayer(player); + #region [ Random ] - //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); + if (nRandom == 2 && nAbekobe == 1) { + TJAPlayer3.ConfigIni.eRandom[actual] = ERandomMode.MIRRORRANDOM; + } else if (nRandom == 2 && nAbekobe == 0) { + TJAPlayer3.ConfigIni.eRandom[actual] = ERandomMode.SUPERRANDOM; + } else if (nRandom == 1 && nAbekobe == 1) { + TJAPlayer3.ConfigIni.eRandom[actual] = ERandomMode.RANDOM; + } else if (nRandom == 1 && nAbekobe == 0) { + TJAPlayer3.ConfigIni.eRandom[actual] = ERandomMode.RANDOM; + } else if (nRandom == 0 && nAbekobe == 1) { + TJAPlayer3.ConfigIni.eRandom[actual] = ERandomMode.MIRROR; + } else if (nRandom == 0 && nAbekobe == 0) { + TJAPlayer3.ConfigIni.eRandom[actual] = ERandomMode.OFF; + } - return ebt == EBalancingType.SCORE ? Math.Min(factor, 1f) : factor; - } + #endregion - public enum EBalancingType - { - SCORE, - COINS - } + #region [ Timing ] - #endregion + TJAPlayer3.ConfigIni.nTimingZones[actual] = nTiming; - } + #endregion + + #region [Just] + + TJAPlayer3.ConfigIni.bJust[actual] = nJust; + + #endregion + + #region [GameType] + + TJAPlayer3.ConfigIni.nGameType[actual] = (EGameType)nGameType; + + #endregion + + #region [Fun mods] + + TJAPlayer3.ConfigIni.nFunMods[actual] = (EFunMods)nFunMods; + + #endregion + + #region [ GameMode ] + + if (nGameMode == 0) { + TJAPlayer3.ConfigIni.bTokkunMode = false; + } else { + TJAPlayer3.ConfigIni.bTokkunMode = true; + } + + #endregion + + #region [ AutoMode ] + + if (nAutoMode == 1) { + TJAPlayer3.ConfigIni.bAutoPlay[player] = true; + } else { + TJAPlayer3.ConfigIni.bAutoPlay[player] = false; + } + + #endregion + + #region [ Hitsounds ] + + TJAPlayer3.ConfigIni.nHitSounds[actual] = nOtoiro; + hsInfo.tReloadHitSounds(nOtoiro, actual); + + #endregion + + #region [ Song speed ] + + TJAPlayer3.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 : TJAPlayer3.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 : TJAPlayer3.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 : TJAPlayer3.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 : TJAPlayer3.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)TJAPlayer3.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 = TJAPlayer3.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 b7813088..187df510 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectArtistComment.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectArtistComment.cs @@ -1,25 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Diagnostics; -using Silk.NET.Maths; -using FDK; +using FDK; -using Rectangle = System.Drawing.Rectangle; - -namespace TJAPlayer3 -{ - internal class CActSelectArtistComment : CActivity - { +namespace TJAPlayer3 { + internal class CActSelectArtistComment : CActivity { // メソッド - public CActSelectArtistComment() - { + public CActSelectArtistComment() { base.IsDeActivated = true; } - public void t選択曲が変更された() - { + public void t選択曲が変更された() { /* Cスコア cスコア = TJAPlayer3.stage選曲.r現在選択中のスコア; if( cスコア != null ) @@ -127,8 +115,7 @@ namespace TJAPlayer3 // CActivity 実装 - public override void Activate() - { + public override void Activate() { this.txArtist = null; this.txComment = null; this.strArtist = ""; @@ -140,34 +127,28 @@ namespace TJAPlayer3 this.t選択曲が変更された(); base.Activate(); } - public override void DeActivate() - { - TJAPlayer3.tテクスチャの解放( ref this.txArtist ); - TJAPlayer3.tテクスチャの解放( ref this.txComment ); + public override void DeActivate() { + TJAPlayer3.tテクスチャの解放(ref this.txArtist); + TJAPlayer3.tテクスチャの解放(ref this.txComment); this.ctComment = null; base.DeActivate(); } - public override void CreateManagedResource() - { - this.ft描画用フォント = new CCachedFontRenderer(CFontRenderer.DefaultFontName, 26, CFontRenderer.FontStyle.Regular ); + public override void CreateManagedResource() { + this.ft描画用フォント = new CCachedFontRenderer(CFontRenderer.DefaultFontName, 26, CFontRenderer.FontStyle.Regular); base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { - if( this.ft描画用フォント != null ) - { + public override void ReleaseManagedResource() { + if (this.ft描画用フォント != null) { this.ft描画用フォント.Dispose(); this.ft描画用フォント = null; } - - TJAPlayer3.tテクスチャの解放( ref this.txArtist ); - TJAPlayer3.tテクスチャの解放( ref this.txComment ); + + TJAPlayer3.tテクスチャの解放(ref this.txArtist); + TJAPlayer3.tテクスチャの解放(ref this.txComment); base.ReleaseManagedResource(); } - public override int Draw() - { - if( !base.IsDeActivated ) - { + public override int Draw() { + if (!base.IsDeActivated) { /* if( this.ctComment.b進行中 ) { diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectDanInfo.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectDanInfo.cs index 47fd3fbe..9a9fc045 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectDanInfo.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectDanInfo.cs @@ -1,208 +1,168 @@ -using FDK; -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Drawing; +using FDK; // Minimalist menu class to use for custom menus -namespace TJAPlayer3 -{ - class CActSelectDanInfo : CStage - { - public CActSelectDanInfo() - { - base.IsDeActivated = true; - } +namespace TJAPlayer3 { + class CActSelectDanInfo : CStage { + public CActSelectDanInfo() { + base.IsDeActivated = true; + } - public override void Activate() - { - // On activation + public override void Activate() { + // On activation - if (base.IsActivated) - return; + if (base.IsActivated) + return; - ctStep = new CCounter(0, 1000, 2, TJAPlayer3.Timer); - ctStepFade = new CCounter(0, 255, 0.5, TJAPlayer3.Timer); + ctStep = new CCounter(0, 1000, 2, TJAPlayer3.Timer); + ctStepFade = new CCounter(0, 255, 0.5, TJAPlayer3.Timer); - ttkExams = new CActSelect曲リスト.TitleTextureKey[(int)Exam.Type.Total]; - for (int i = 0; i < ttkExams.Length; i++) - { - ttkExams[i] = new CActSelect曲リスト.TitleTextureKey(CLangManager.LangInstance.GetExamName(i), pfExamFont, Color.Black, Color.Transparent, 700); - } + ttkExams = new CActSelect曲リスト.TitleTextureKey[(int)Exam.Type.Total]; + for (int i = 0; i < ttkExams.Length; i++) { + ttkExams[i] = new CActSelect曲リスト.TitleTextureKey(CLangManager.LangInstance.GetExamName(i), pfExamFont, Color.Black, Color.Transparent, 700); + } - 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() - { - // Ressource allocation - pfTitleFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.SongSelect_DanInfo_Title_Size); - pfExamFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.SongSelect_DanInfo_Exam_Size); + public override void CreateManagedResource() { + // Ressource allocation + pfTitleFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.SongSelect_DanInfo_Title_Size); + pfExamFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.SongSelect_DanInfo_Exam_Size); - base.CreateManagedResource(); - } + base.CreateManagedResource(); + } - public override void ReleaseManagedResource() - { - // Ressource freeing - TJAPlayer3.tDisposeSafely(ref pfTitleFont); - TJAPlayer3.tDisposeSafely(ref pfExamFont); + public override void ReleaseManagedResource() { + // Ressource freeing + TJAPlayer3.tDisposeSafely(ref pfTitleFont); + TJAPlayer3.tDisposeSafely(ref pfExamFont); - base.ReleaseManagedResource(); - } + base.ReleaseManagedResource(); + } - public override int Draw() - { - ctStep.Tick(); - ctStepFade.Tick(); - if (ctStep.CurrentValue == ctStep.EndValue) - { - ctStep = new CCounter(0, 1000, 2, TJAPlayer3.Timer); - tNextStep(); - } + public override int Draw() { + ctStep.Tick(); + ctStepFade.Tick(); + if (ctStep.CurrentValue == ctStep.EndValue) { + ctStep = new CCounter(0, 1000, 2, TJAPlayer3.Timer); + tNextStep(); + } - if (TJAPlayer3.Skin.SongSelect_DanInfo_Show) - { - for(int i = 0; i < TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs.Count; i++) - { - var dan = TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs[i]; - int songIndex = i / 3; - int opacity = 255; - if (TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs.Count > 3) - { - if (nNowSongIndex == songIndex) - { - opacity = ctStepFade.CurrentValue; - } - else if (nPrevSongIndex == songIndex) - { - opacity = 255 - ctStepFade.CurrentValue; - } - else - { - opacity = 0; - } - } + if (TJAPlayer3.Skin.SongSelect_DanInfo_Show) { + for (int i = 0; i < TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs.Count; i++) { + var dan = TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs[i]; + int songIndex = i / 3; + int opacity = 255; + if (TJAPlayer3.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, TJAPlayer3.Skin.SongSelect_DanInfo_Icon_X[pos], TJAPlayer3.Skin.SongSelect_DanInfo_Icon_Y[pos], opacity, TJAPlayer3.Skin.SongSelect_DanInfo_Icon_Scale, false); + int pos = i % 3; + CActSelect段位リスト.tDisplayDanIcon(i + 1, TJAPlayer3.Skin.SongSelect_DanInfo_Icon_X[pos], TJAPlayer3.Skin.SongSelect_DanInfo_Icon_Y[pos], opacity, TJAPlayer3.Skin.SongSelect_DanInfo_Icon_Scale, false); - int difficulty_cymbol_width = TJAPlayer3.Tx.Dani_Difficulty_Cymbol.szTextureSize.Width / 5; - int difficulty_cymbol_height = TJAPlayer3.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; + int difficulty_cymbol_width = TJAPlayer3.Tx.Dani_Difficulty_Cymbol.szTextureSize.Width / 5; + int difficulty_cymbol_height = TJAPlayer3.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; - TJAPlayer3.Tx.Dani_Difficulty_Cymbol.Opacity = opacity; - TJAPlayer3.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.X = TJAPlayer3.Skin.SongSelect_DanInfo_Difficulty_Cymbol_Scale; - TJAPlayer3.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.Y = TJAPlayer3.Skin.SongSelect_DanInfo_Difficulty_Cymbol_Scale; - TJAPlayer3.Tx.Dani_Difficulty_Cymbol.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.SongSelect_DanInfo_Difficulty_Cymbol_X[pos], TJAPlayer3.Skin.SongSelect_DanInfo_Difficulty_Cymbol_Y[pos], new Rectangle(dan.Difficulty * difficulty_cymbol_width, 0, difficulty_cymbol_width, difficulty_cymbol_height)); - TJAPlayer3.Tx.Dani_Difficulty_Cymbol.Opacity = 255; - TJAPlayer3.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.X = 1; - TJAPlayer3.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.Y = 1; + TJAPlayer3.Tx.Dani_Difficulty_Cymbol.Opacity = opacity; + TJAPlayer3.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.X = TJAPlayer3.Skin.SongSelect_DanInfo_Difficulty_Cymbol_Scale; + TJAPlayer3.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.Y = TJAPlayer3.Skin.SongSelect_DanInfo_Difficulty_Cymbol_Scale; + TJAPlayer3.Tx.Dani_Difficulty_Cymbol.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.SongSelect_DanInfo_Difficulty_Cymbol_X[pos], TJAPlayer3.Skin.SongSelect_DanInfo_Difficulty_Cymbol_Y[pos], new Rectangle(dan.Difficulty * difficulty_cymbol_width, 0, difficulty_cymbol_width, difficulty_cymbol_height)); + TJAPlayer3.Tx.Dani_Difficulty_Cymbol.Opacity = 255; + TJAPlayer3.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.X = 1; + TJAPlayer3.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.Y = 1; - TJAPlayer3.Tx.Dani_Level_Number.Opacity = opacity; - TJAPlayer3.stage段位選択.段位リスト.tLevelNumberDraw(TJAPlayer3.Skin.SongSelect_DanInfo_Level_Number_X[pos], TJAPlayer3.Skin.SongSelect_DanInfo_Level_Number_Y[pos], dan.Level, TJAPlayer3.Skin.SongSelect_DanInfo_Level_Number_Scale); - TJAPlayer3.Tx.Dani_Level_Number.Opacity = 255; + TJAPlayer3.Tx.Dani_Level_Number.Opacity = opacity; + TJAPlayer3.stage段位選択.段位リスト.tLevelNumberDraw(TJAPlayer3.Skin.SongSelect_DanInfo_Level_Number_X[pos], TJAPlayer3.Skin.SongSelect_DanInfo_Level_Number_Y[pos], dan.Level, TJAPlayer3.Skin.SongSelect_DanInfo_Level_Number_Scale); + TJAPlayer3.Tx.Dani_Level_Number.Opacity = 255; - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkTitles[i]).Opacity = opacity; - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkTitles[i]).t2D描画(TJAPlayer3.Skin.SongSelect_DanInfo_Title_X[pos], TJAPlayer3.Skin.SongSelect_DanInfo_Title_Y[pos]); + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkTitles[i]).Opacity = opacity; + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkTitles[i]).t2D描画(TJAPlayer3.Skin.SongSelect_DanInfo_Title_X[pos], TJAPlayer3.Skin.SongSelect_DanInfo_Title_Y[pos]); - } + } - for (int j = 0; j < CExamInfo.cMaxExam; j++) - { - int index = j; - Dan_C danc0 = TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs[0].Dan_C[j]; + for (int j = 0; j < CExamInfo.cMaxExam; j++) { + int index = j; + Dan_C danc0 = TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs[0].Dan_C[j]; - if (danc0 != null) - { - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkExams[(int)danc0.GetExamType()]).t2D中心基準描画(TJAPlayer3.Skin.SongSelect_DanInfo_Exam_X[index], TJAPlayer3.Skin.SongSelect_DanInfo_Exam_Y[index]); - } + if (danc0 != null) { + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkExams[(int)danc0.GetExamType()]).t2D中心基準描画(TJAPlayer3.Skin.SongSelect_DanInfo_Exam_X[index], TJAPlayer3.Skin.SongSelect_DanInfo_Exam_Y[index]); + } - if (TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs[TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs.Count - 1].Dan_C[j] == null) - { - Dan_C danc = TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs[0].Dan_C[j]; - if (danc != null) - { - TJAPlayer3.stage段位選択.段位リスト.tExamDraw(TJAPlayer3.Skin.SongSelect_DanInfo_Exam_Value_X[0], TJAPlayer3.Skin.SongSelect_DanInfo_Exam_Value_Y[index], danc.Value[0], danc.GetExamRange(), TJAPlayer3.Skin.SongSelect_DanInfo_Exam_Value_Scale); - } - } - else - { - for (int i = 0; i < TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs.Count; i++) - { - Dan_C danc = TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs[i].Dan_C[j]; - if (danc != null) - { - int opacity = 255; - if (TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs.Count > 3) - { - if (nNowSongIndex == i / 3) - { - opacity = ctStepFade.CurrentValue; - } - else if (nPrevSongIndex == i / 3) - { - opacity = 255 - ctStepFade.CurrentValue; - } - else - { - opacity = 0; - } - } + if (TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs[TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs.Count - 1].Dan_C[j] == null) { + Dan_C danc = TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs[0].Dan_C[j]; + if (danc != null) { + TJAPlayer3.stage段位選択.段位リスト.tExamDraw(TJAPlayer3.Skin.SongSelect_DanInfo_Exam_Value_X[0], TJAPlayer3.Skin.SongSelect_DanInfo_Exam_Value_Y[index], danc.Value[0], danc.GetExamRange(), TJAPlayer3.Skin.SongSelect_DanInfo_Exam_Value_Scale); + } + } else { + for (int i = 0; i < TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs.Count; i++) { + Dan_C danc = TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs[i].Dan_C[j]; + if (danc != null) { + int opacity = 255; + if (TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs.Count > 3) { + if (nNowSongIndex == i / 3) { + opacity = ctStepFade.CurrentValue; + } else if (nPrevSongIndex == i / 3) { + opacity = 255 - ctStepFade.CurrentValue; + } else { + opacity = 0; + } + } - TJAPlayer3.Tx.Dani_Exam_Number.Opacity = opacity; - TJAPlayer3.stage段位選択.段位リスト.tExamDraw(TJAPlayer3.Skin.SongSelect_DanInfo_Exam_Value_X[i % 3], TJAPlayer3.Skin.SongSelect_DanInfo_Exam_Value_Y[index], danc.Value[0], danc.GetExamRange(), TJAPlayer3.Skin.SongSelect_DanInfo_Exam_Value_Scale); - TJAPlayer3.Tx.Dani_Exam_Number.Opacity = 255; - } - } - } - } - } + TJAPlayer3.Tx.Dani_Exam_Number.Opacity = opacity; + TJAPlayer3.stage段位選択.段位リスト.tExamDraw(TJAPlayer3.Skin.SongSelect_DanInfo_Exam_Value_X[i % 3], TJAPlayer3.Skin.SongSelect_DanInfo_Exam_Value_Y[index], danc.Value[0], danc.GetExamRange(), TJAPlayer3.Skin.SongSelect_DanInfo_Exam_Value_Scale); + TJAPlayer3.Tx.Dani_Exam_Number.Opacity = 255; + } + } + } + } + } - return 0; - } + return 0; + } - public void UpdateSong() - { - if (TJAPlayer3.stageSongSelect.rNowSelectedSong == null || TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs == null) return; + public void UpdateSong() { + if (TJAPlayer3.stageSongSelect.rNowSelectedSong == null || TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs == null) return; - ttkTitles = new CActSelect曲リスト.TitleTextureKey[TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs.Count]; - for (int i = 0; i < TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs.Count; i++) - { - var dan = TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs[i]; - ttkTitles[i] = new CActSelect曲リスト.TitleTextureKey(dan.bTitleShow ? "???" : dan.Title, pfTitleFont, Color.Black, Color.Transparent, 700); - } - } + ttkTitles = new CActSelect曲リスト.TitleTextureKey[TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs.Count]; + for (int i = 0; i < TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs.Count; i++) { + var dan = TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs[i]; + ttkTitles[i] = new CActSelect曲リスト.TitleTextureKey(dan.bTitleShow ? "???" : dan.Title, pfTitleFont, Color.Black, Color.Transparent, 700); + } + } - #region [Private] - - private CActSelect曲リスト.TitleTextureKey[] ttkTitles; - private CActSelect曲リスト.TitleTextureKey[] ttkExams; - private CCachedFontRenderer pfTitleFont; - private CCachedFontRenderer pfExamFont; + #region [Private] - private CCounter ctStep; - private CCounter ctStepFade; + private CActSelect曲リスト.TitleTextureKey[] ttkTitles; + private CActSelect曲リスト.TitleTextureKey[] ttkExams; + private CCachedFontRenderer pfTitleFont; + private CCachedFontRenderer pfExamFont; - private int nPrevSongIndex; - private int nNowSongIndex; + private CCounter ctStep; + private CCounter ctStepFade; - private void tNextStep() - { - nPrevSongIndex = nNowSongIndex; - nNowSongIndex = (nNowSongIndex + 1) % (int)Math.Ceiling(TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs.Count / 3.0); - ctStepFade = new CCounter(0, 255, 1, TJAPlayer3.Timer); - } + private int nPrevSongIndex; + private int nNowSongIndex; - #endregion - } + private void tNextStep() { + nPrevSongIndex = nNowSongIndex; + nNowSongIndex = (nNowSongIndex + 1) % (int)Math.Ceiling(TJAPlayer3.stageSongSelect.rNowSelectedSong.DanSongs.Count / 3.0); + ctStepFade = new CCounter(0, 255, 1, TJAPlayer3.Timer); + } + + #endregion + } } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectExExtraTransAnime.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectExExtraTransAnime.cs index 83e6b413..78393551 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectExExtraTransAnime.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectExExtraTransAnime.cs @@ -1,137 +1,119 @@ using FDK; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -namespace TJAPlayer3 -{ - internal class CActSelectExExtraTransAnime : CActivity - { - enum AnimeState - { - NotRunning = 0, - ExToExtra = 1, - ExtraToEx = 2, - } +namespace TJAPlayer3 { + 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() - { + // 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(); + } + // 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, TJAPlayer3.Skin.SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[0], TJAPlayer3.Timer); - ExtraToExCounter = new CCounter(0, 1, TJAPlayer3.Skin.SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[1], TJAPlayer3.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")); + CurrentState = AnimeState.NotRunning; - ExToExtraScript.Init(); - ExtraToExScript.Init(); - } + ExToExtraCounter = new CCounter(0, 1, TJAPlayer3.Skin.SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[0], TJAPlayer3.Timer); + ExtraToExCounter = new CCounter(0, 1, TJAPlayer3.Skin.SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[1], TJAPlayer3.Timer); - public override void ReleaseManagedResource() //On Managed Release Resource - { - base.ReleaseManagedResource(); + 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")); - ExToExtraCounter = null; - ExtraToExCounter = null; + ExToExtraScript.Init(); + ExtraToExScript.Init(); + } - if (ExToExtraScript != null) - { - ExToExtraScript.Dispose(); - ExToExtraScript = null; - } - if (ExtraToExScript != null) - { - ExtraToExScript.Dispose(); - ExtraToExScript = null; - } - } + public override void ReleaseManagedResource() //On Managed Release Resource + { + base.ReleaseManagedResource(); - public override void Activate() //On Activate - { - base.Activate(); - } + ExToExtraCounter = null; + ExtraToExCounter = null; - public override int Draw() //On Progress Draw - { - switch (CurrentState) - { - case AnimeState.ExToExtra: - ExToExtraCounter.Tick(); - if (ExToExtraCounter.IsEnded) - { - CurrentState = AnimeState.NotRunning; - ExToExtraCounter.Stop(); - return 0; - } + if (ExToExtraScript != null) { + ExToExtraScript.Dispose(); + ExToExtraScript = null; + } + if (ExtraToExScript != null) { + ExtraToExScript.Dispose(); + ExtraToExScript = null; + } + } - ExToExtraScript.Update(); - ExToExtraScript.Draw(); - return 1; + public override void Activate() //On Activate + { + base.Activate(); + } - case AnimeState.ExtraToEx: - ExtraToExCounter.Tick(); - if (ExtraToExCounter.IsEnded) - { - CurrentState = AnimeState.NotRunning; - ExtraToExCounter.Stop(); - return 0; - } + public override int Draw() //On Progress Draw + { + switch (CurrentState) { + case AnimeState.ExToExtra: + ExToExtraCounter.Tick(); + if (ExToExtraCounter.IsEnded) { + CurrentState = AnimeState.NotRunning; + ExToExtraCounter.Stop(); + return 0; + } - ExtraToExScript.Update(); - ExtraToExScript.Draw(); - return 1; + ExToExtraScript.Update(); + ExToExtraScript.Draw(); + return 1; - case AnimeState.NotRunning: - default: - return 0; - } - } + case AnimeState.ExtraToEx: + ExtraToExCounter.Tick(); + if (ExtraToExCounter.IsEnded) { + CurrentState = AnimeState.NotRunning; + ExtraToExCounter.Stop(); + return 0; + } - public override void DeActivate() //On Deactivate - { - base.DeActivate(); - } + ExtraToExScript.Update(); + ExtraToExScript.Draw(); + return 1; - public void BeginAnime(bool toExtra) - { - if (!TJAPlayer3.ConfigIni.ShowExExtraAnime) return; - else if (toExtra && !ExToExtraScript.Exists()) return; - else if (!toExtra && !ExtraToExScript.Exists()) return; + case AnimeState.NotRunning: + default: + return 0; + } + } - CurrentState = toExtra ? AnimeState.ExToExtra : AnimeState.ExtraToEx; - if (toExtra) - { - ExToExtraCounter = new CCounter(0, 1, TJAPlayer3.Skin.SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[0], TJAPlayer3.Timer); - ExToExtraScript.PlayAnimation(); - TJAPlayer3.Skin.soundExToExtra[0]?.tPlay(); // Placeholder code - } - else - { - ExtraToExCounter = new CCounter(0, 1, TJAPlayer3.Skin.SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[1], TJAPlayer3.Timer); - ExtraToExScript.PlayAnimation(); - TJAPlayer3.Skin.soundExtraToEx[0]?.tPlay(); // Placeholder code - } - } + public override void DeActivate() //On Deactivate + { + base.DeActivate(); + } - #region Private - CCounter ExToExtraCounter, ExtraToExCounter; - AnimeBG ExToExtraScript, ExtraToExScript; + public void BeginAnime(bool toExtra) { + if (!TJAPlayer3.ConfigIni.ShowExExtraAnime) return; + else if (toExtra && !ExToExtraScript.Exists()) return; + else if (!toExtra && !ExtraToExScript.Exists()) return; - AnimeState CurrentState; - #endregion - } + CurrentState = toExtra ? AnimeState.ExToExtra : AnimeState.ExtraToEx; + if (toExtra) { + ExToExtraCounter = new CCounter(0, 1, TJAPlayer3.Skin.SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[0], TJAPlayer3.Timer); + ExToExtraScript.PlayAnimation(); + TJAPlayer3.Skin.soundExToExtra[0]?.tPlay(); // Placeholder code + } else { + ExtraToExCounter = new CCounter(0, 1, TJAPlayer3.Skin.SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[1], TJAPlayer3.Timer); + ExtraToExScript.PlayAnimation(); + TJAPlayer3.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 097f155b..ad39d5ef 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectInformation.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectInformation.cs @@ -1,103 +1,79 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.Text; +using System.Drawing; using System.Runtime.InteropServices; -using System.Drawing; using FDK; -namespace TJAPlayer3 -{ - internal class CActSelectInformation : CActivity - { +namespace TJAPlayer3 { + internal class CActSelectInformation : CActivity { // コンストラクタ - public CActSelectInformation() - { + public CActSelectInformation() { base.IsDeActivated = true; } // CActivity 実装 - public override void Activate() - { + public override void Activate() { this.n画像Index上 = -1; this.n画像Index下 = 0; - this.bFirst = true; - this.ct進行用 = new CCounter( 0, 3000, 3, TJAPlayer3.Timer ); + this.bFirst = true; + this.ct進行用 = new CCounter(0, 3000, 3, TJAPlayer3.Timer); base.Activate(); } - public override void DeActivate() - { + public override void DeActivate() { this.ctスクロール用 = null; base.DeActivate(); } - public override void CreateManagedResource() - { - this.txInfo_Back = TJAPlayer3.tテクスチャの生成( CSkin.Path( @$"Graphics{Path.DirectorySeparatorChar}5_information_BG.png" ) ); - this.txInfo[ 0 ] = TJAPlayer3.tテクスチャの生成( CSkin.Path( @$"Graphics{Path.DirectorySeparatorChar}5_information.png" ) ); - this.txInfo[ 1 ] = TJAPlayer3.tテクスチャの生成( CSkin.Path( @$"Graphics{Path.DirectorySeparatorChar}5_information2.png" ) ); + public override void CreateManagedResource() { + this.txInfo_Back = TJAPlayer3.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}5_information_BG.png")); + this.txInfo[0] = TJAPlayer3.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}5_information.png")); + this.txInfo[1] = TJAPlayer3.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}5_information2.png")); base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { - TJAPlayer3.tテクスチャの解放( ref this.txInfo_Back ); - TJAPlayer3.tテクスチャの解放( ref this.txInfo[ 0 ] ); - TJAPlayer3.tテクスチャの解放( ref this.txInfo[ 1 ] ); + public override void ReleaseManagedResource() { + TJAPlayer3.tテクスチャの解放(ref this.txInfo_Back); + TJAPlayer3.tテクスチャの解放(ref this.txInfo[0]); + TJAPlayer3.tテクスチャの解放(ref this.txInfo[1]); base.ReleaseManagedResource(); } - public override int Draw() - { - if( !base.IsDeActivated ) - { - if( base.IsFirstDraw ) - { + public override int Draw() { + if (!base.IsDeActivated) { + if (base.IsFirstDraw) { base.IsFirstDraw = false; } - if( this.txInfo_Back != null ) - this.txInfo_Back.t2D描画( 340, 600 ); + if (this.txInfo_Back != null) + this.txInfo_Back.t2D描画(340, 600); this.ct進行用.TickLoop(); - if( this.bFirst ) - { - this.ct進行用.CurrentValue = 300; - } + 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; - } + #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 ); - } + this.txInfo[0].t2D描画(340, 600); + this.txInfo[1].t2D描画(340, 600); + } - #endregion + #endregion } @@ -109,15 +85,13 @@ namespace TJAPlayer3 #region [ private ] //----------------- - [StructLayout( LayoutKind.Sequential )] - private struct STINFO - { + [StructLayout(LayoutKind.Sequential)] + private struct STINFO { public int nTexture番号; public Point pt左上座標; - public STINFO( int nTexture番号, int x, int y ) - { + public STINFO(int nTexture番号, int x, int y) { this.nTexture番号 = nTexture番号; - this.pt左上座標 = new Point( x, y ); + this.pt左上座標 = new Point(x, y); } } @@ -135,10 +109,10 @@ namespace TJAPlayer3 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進行用; + 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 2bfb929c..c035206d 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectPopupMenu.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectPopupMenu.cs @@ -1,38 +1,26 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.Text; +using System.Drawing; using System.Runtime.InteropServices; -using System.Drawing; -using System.IO; using FDK; -namespace TJAPlayer3 -{ - internal class CActSelectPopupMenu : CActivity - { +namespace TJAPlayer3 { + internal class CActSelectPopupMenu : CActivity { private static List Child = new List(); - public CActSelectPopupMenu() - { + public CActSelectPopupMenu() { Child.Add(this); } // プロパティ - public int GetIndex(int pos) - { - return lciMenuItems[ pos ].cItem.GetIndex(); + public int GetIndex(int pos) { + return lciMenuItems[pos].cItem.GetIndex(); } - public object GetObj現在値( int pos ) - { - return lciMenuItems[ pos ].cItem.obj現在値(); + public object GetObj現在値(int pos) { + return lciMenuItems[pos].cItem.obj現在値(); } - public bool bGotoDetailConfig - { + public bool bGotoDetailConfig { get; internal set; } @@ -40,123 +28,97 @@ namespace TJAPlayer3 /// /// ソートメニュー機能を使用中かどうか。外部からこれをtrueにすると、ソートメニューが出現する。falseにすると消える。 /// - public bool bIsActivePopupMenu - { + 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. + 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() - { + 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) { + Initialize(menulist, showAllItems, title, 0); } - protected void Initialize( List menulist, bool showAllItems, string title, int defaultPos ) - { - ConditionallyInitializePrvFont(); + 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 = TJAPlayer3.tテクスチャの生成( bitmap, false ); - } - lciMenuItems = new stQuickMenuItem[ menulist.Count ]; - for (int i = 0; i < menulist.Count; i++ ) - { + using (var bitmap = prvFont.DrawText(title, Color.White, Color.Black, null, 30)) { + stqMenuTitle.txName = TJAPlayer3.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 = TJAPlayer3.tテクスチャの生成( bitmap, false ); - } - lciMenuItems[ i ] = stqm; + stqm.cItem = menulist[i]; + using (var bitmap = prvFont.DrawText(menulist[i].str項目名, Color.White, Color.Black, null, 30)) { + stqm.txName = TJAPlayer3.tテクスチャの生成(bitmap, false); + } + lciMenuItems[i] = stqm; } bShowAllItems = showAllItems; n現在の選択行 = defaultPos; } - private void ConditionallyInitializePrvFont() - { - if (prvFont == null) - { + private void ConditionallyInitializePrvFont() { + if (prvFont == null) { prvFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.PopupMenu_Font_Size); - } - } + } + } - public static void RefleshSkin() - { - for (int i = 0; i < Child.Count; i++) - { + public static void RefleshSkin() { + for (int i = 0; i < Child.Count; i++) { Child[i]._RefleshSkin(); } } - public void _RefleshSkin() - { + public void _RefleshSkin() { TJAPlayer3.tDisposeSafely(ref prvFont); ConditionallyInitializePrvFont(); - using (var bitmap = prvFont.DrawText(stqMenuTitle.cItem.str項目名, Color.White, Color.Black, null, 30)) - { + using (var bitmap = prvFont.DrawText(stqMenuTitle.cItem.str項目名, Color.White, Color.Black, null, 30)) { TJAPlayer3.tDisposeSafely(ref stqMenuTitle.txName); stqMenuTitle.txName = TJAPlayer3.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)) - { + for (int i = 0; i < lciMenuItems.Length; i++) { + using (var bitmap = prvFont.DrawText(lciMenuItems[i].cItem.str項目名, Color.White, Color.Black, null, 30)) { TJAPlayer3.tDisposeSafely(ref lciMenuItems[i].txName); lciMenuItems[i].txName = TJAPlayer3.tテクスチャの生成(bitmap, false); } } } - public void tEnter押下() - { - if ( this.bキー入力待ち ) - { + public void tEnter押下() { + if (this.bキー入力待ち) { TJAPlayer3.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種別.切替リスト ) - { + 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 - { + } else { throw new ArgumentException(); } nItemSelecting = n現在の選択行; } - tEnter押下Main( (int) lciMenuItems[ n現在の選択行 ].cItem.GetIndex() ); + tEnter押下Main((int)lciMenuItems[n現在の選択行].cItem.GetIndex()); this.bキー入力待ち = true; } @@ -166,53 +128,38 @@ namespace TJAPlayer3 /// Decide押下時の処理を、継承先で記述する。 /// /// CItemBaseの現在の設定値のindex - public virtual void tEnter押下Main( int val ) - { + public virtual void tEnter押下Main(int val) { } /// /// Cancel押下時の追加処理があれば、継承先で記述する。 /// - public virtual void tCancel() - { + public virtual void tCancel() { } /// /// 追加の描画処理。必要に応じて、継承先で記述する。 /// - public virtual void t進行描画sub() - { + public virtual void t進行描画sub() { } - public void t次に移動() - { - if ( this.bキー入力待ち ) - { + public void t次に移動() { + if (this.bキー入力待ち) { TJAPlayer3.Skin.soundカーソル移動音.tPlay(); - if ( bIsSelectingIntItem ) - { - lciMenuItems[ n現在の選択行 ].cItem.t項目値を前へ移動(); // 項目移動と数値上下は方向が逆になるので注意 - } - else - { - if ( ++this.n現在の選択行 >= this.lciMenuItems.Length ) - { + if (bIsSelectingIntItem) { + lciMenuItems[n現在の選択行].cItem.t項目値を前へ移動(); // 項目移動と数値上下は方向が逆になるので注意 + } else { + if (++this.n現在の選択行 >= this.lciMenuItems.Length) { this.n現在の選択行 = 0; } } } } - public void t前に移動() - { - if ( this.bキー入力待ち ) - { + public void t前に移動() { + if (this.bキー入力待ち) { TJAPlayer3.Skin.soundカーソル移動音.tPlay(); - if ( bIsSelectingIntItem ) - { - lciMenuItems[ n現在の選択行 ].cItem.t項目値を次へ移動(); // 項目移動と数値上下は方向が逆になるので注意 - } - else - { - if ( --this.n現在の選択行 < 0 ) - { + if (bIsSelectingIntItem) { + lciMenuItems[n現在の選択行].cItem.t項目値を次へ移動(); // 項目移動と数値上下は方向が逆になるので注意 + } else { + if (--this.n現在の選択行 < 0) { this.n現在の選択行 = this.lciMenuItems.Length - 1; } } @@ -221,111 +168,92 @@ namespace TJAPlayer3 // CActivity 実装 - public override void Activate() - { - // this.n現在の選択行 = 0; + 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, TJAPlayer3.Timer ); + for (int i = 0; i < 4; i++) { + this.ctキー反復用[i] = new CCounter(0, 0, 0, TJAPlayer3.Timer); } base.IsDeActivated = true; b選択した = false; this.bIsActivePopupMenu = false; this.font = new CActDFPFont(); - base.ChildActivities.Add( this.font ); + base.ChildActivities.Add(this.font); nItemSelecting = -1; base.Activate(); } - public override void DeActivate() - { - if ( !base.IsDeActivated ) - { - base.ChildActivities.Remove( this.font ); + 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; + for (int i = 0; i < 4; i++) { + this.ctキー反復用[i] = null; } base.DeActivate(); } } - public override void CreateManagedResource() - { - base.CreateManagedResource(); + public override void CreateManagedResource() { + base.CreateManagedResource(); - ConditionallyInitializePrvFont(); + ConditionallyInitializePrvFont(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { //CDTXMania.tテクスチャの解放( ref this.txPopupMenuBackground ); //CDTXMania.tテクスチャの解放( ref this.txCursor ); - TJAPlayer3.tDisposeSafely( ref this.prvFont ); + TJAPlayer3.tDisposeSafely(ref this.prvFont); base.ReleaseManagedResource(); } - public override int Draw() - { - throw new InvalidOperationException( "t進行描画(bool)のほうを使用してください。" ); + public override int Draw() { + throw new InvalidOperationException("t進行描画(bool)のほうを使用してください。"); } - public int t進行描画() - { - if ( !base.IsDeActivated && this.bIsActivePopupMenu ) - { - if ( this.bキー入力待ち ) - { + public int t進行描画() { + if (!base.IsDeActivated && this.bIsActivePopupMenu) { + if (this.bキー入力待ち) { #region [ Shift-F1: CONFIG画面 ] - if ( ( TJAPlayer3.InputManager.Keyboard.KeyPressing( (int)SlimDXKeys.Key.RightShift ) || TJAPlayer3.InputManager.Keyboard.KeyPressing( (int)SlimDXKeys.Key.LeftShift ) ) && - TJAPlayer3.InputManager.Keyboard.KeyPressed( (int)SlimDXKeys.Key.F1 ) ) - { // [SHIFT] + [F1] CONFIG + if ((TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightShift) || TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftShift)) && + TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F1)) { // [SHIFT] + [F1] CONFIG TJAPlayer3.Skin.soundCancelSFX.tPlay(); tCancel(); this.bGotoDetailConfig = true; } #endregion #region [ キー入力: キャンセル ] - else if ( ( TJAPlayer3.InputManager.Keyboard.KeyPressed( (int)SlimDXKeys.Key.Escape ) - || TJAPlayer3.Pad.bPressed( EInstrumentPad.DRUMS, EPad.FT ) - || TJAPlayer3.Pad.bPressedGB( EPad.Cancel ) ) - && this.bEsc有効 ) - { // キャンセル + else if ((TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) + || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.FT) + || TJAPlayer3.Pad.bPressedGB(EPad.Cancel)) + && this.bEsc有効) { // キャンセル TJAPlayer3.Skin.soundCancelSFX.tPlay(); tCancel(); this.bIsActivePopupMenu = false; } #endregion - if (!b選択した) - { + if (!b選択した) { #region [ キー入力: 決定 ] // E楽器パート eInst = E楽器パート.UNKNOWN; ESortAction eAction = ESortAction.END; - if (TJAPlayer3.Pad.bPressed(EInstrumentPad.GUITAR, EPad.Decide)) - { + if (TJAPlayer3.Pad.bPressed(EInstrumentPad.GUITAR, EPad.Decide)) { eInst = EInstrumentPad.GUITAR; eAction = ESortAction.Decide; - } - else if (TJAPlayer3.Pad.bPressed(EInstrumentPad.BASS, EPad.Decide)) - { + } else if (TJAPlayer3.Pad.bPressed(EInstrumentPad.BASS, EPad.Decide)) { eInst = EInstrumentPad.BASS; eAction = ESortAction.Decide; - } - else if ( - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Decide) // #24756 2011.4.1 yyagi: Add condition "Drum-Decide" to enable CY in Sort Menu. - || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RD) - || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LC) - || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed) - || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed) - || (TJAPlayer3.ConfigIni.bEnterがキー割り当てのどこにも使用されていない && TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))) - { + } else if ( + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Decide) // #24756 2011.4.1 yyagi: Add condition "Drum-Decide" to enable CY in Sort Menu. + || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RD) + || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LC) + || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed) + || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed) + || (TJAPlayer3.ConfigIni.bEnterがキー割り当てのどこにも使用されていない && TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))) { eInst = EInstrumentPad.DRUMS; eAction = ESortAction.Decide; } @@ -337,110 +265,95 @@ namespace TJAPlayer3 #region [ キー入力: 前に移動 ] this.ctキー反復用.Up.KeyIntervalFunc(TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.UpArrow), new CCounter.KeyProcess(this.t前に移動)); this.ctキー反復用.R.KeyIntervalFunc(TJAPlayer3.Pad.b押されているGB(EPad.R), new CCounter.KeyProcess(this.t前に移動)); - if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.SD) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue)) - { + if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.SD) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue)) { this.t前に移動(); } #endregion #region [ キー入力: 次に移動 ] this.ctキー反復用.Down.KeyIntervalFunc(TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.DownArrow), new CCounter.KeyProcess(this.t次に移動)); this.ctキー反復用.B.KeyIntervalFunc(TJAPlayer3.Pad.b押されているGB(EPad.B), new CCounter.KeyProcess(this.t次に移動)); - if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LT) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue)) - { + if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LT) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue)) { this.t次に移動(); } #endregion } } #region [ ポップアップメニュー 背景描画 ] - if ( TJAPlayer3.Tx.Menu_Title != null ) - { - TJAPlayer3.Tx.Menu_Title.t2D描画( TJAPlayer3.Skin.PopupMenu_Menu_Title[0], TJAPlayer3.Skin.PopupMenu_Menu_Title[1]); + if (TJAPlayer3.Tx.Menu_Title != null) { + TJAPlayer3.Tx.Menu_Title.t2D描画(TJAPlayer3.Skin.PopupMenu_Menu_Title[0], TJAPlayer3.Skin.PopupMenu_Menu_Title[1]); } #endregion #region [ ソートメニュータイトル描画 ] - stqMenuTitle.txName.t2D描画( TJAPlayer3.Skin.PopupMenu_Title[0], TJAPlayer3.Skin.PopupMenu_Title[1]); + stqMenuTitle.txName.t2D描画(TJAPlayer3.Skin.PopupMenu_Title[0], TJAPlayer3.Skin.PopupMenu_Title[1]); #endregion #region [ カーソル描画 ] - if ( TJAPlayer3.Tx.Menu_Highlight != null ) - { + if (TJAPlayer3.Tx.Menu_Highlight != null) { int curX = TJAPlayer3.Skin.PopupMenu_Menu_Highlight[0] + (TJAPlayer3.Skin.PopupMenu_Move[0] * (this.n現在の選択行 + 1)); int curY = TJAPlayer3.Skin.PopupMenu_Menu_Highlight[1] + (TJAPlayer3.Skin.PopupMenu_Move[1] * (this.n現在の選択行 + 1)); int width = TJAPlayer3.Tx.Menu_Highlight.szTextureSize.Width / 2; int height = TJAPlayer3.Tx.Menu_Highlight.szTextureSize.Height; - TJAPlayer3.Tx.Menu_Highlight.t2D描画( curX, curY, new Rectangle( 0, 0, width, height) ); + TJAPlayer3.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++ ) - { - TJAPlayer3.Tx.Menu_Highlight.t2D描画( curX, curY, rectangle ); + for (int j = 0; j < 16; j++) { + TJAPlayer3.Tx.Menu_Highlight.t2D描画(curX, curY, rectangle); curX += width; } - TJAPlayer3.Tx.Menu_Highlight.t2D描画( curX, curY, new Rectangle(width, 0, width, height) ); + TJAPlayer3.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; + 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描画( TJAPlayer3.Skin.PopupMenu_MenuItem_Name[0] + i * TJAPlayer3.Skin.PopupMenu_Move[0], + if (lciMenuItems[i].txName != null) { + lciMenuItems[i].txName.t2D描画(TJAPlayer3.Skin.PopupMenu_MenuItem_Name[0] + i * TJAPlayer3.Skin.PopupMenu_Move[0], TJAPlayer3.Skin.PopupMenu_MenuItem_Name[1] + i * TJAPlayer3.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; + 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 = TJAPlayer3.tテクスチャの生成(bmpStr, false)) - { - ctStr.t2D描画(TJAPlayer3.Skin.PopupMenu_MenuItem_Value[0] + i * TJAPlayer3.Skin.PopupMenu_Move[0], + // 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 = TJAPlayer3.tテクスチャの生成(bmpStr, false)) { + ctStr.t2D描画(TJAPlayer3.Skin.PopupMenu_MenuItem_Value[0] + i * TJAPlayer3.Skin.PopupMenu_Move[0], TJAPlayer3.Skin.PopupMenu_MenuItem_Value[1] + i * TJAPlayer3.Skin.PopupMenu_Move[1]); - } - } - } + } + } + } } #endregion t進行描画sub(); @@ -454,7 +367,7 @@ namespace TJAPlayer3 #region [ private ] //----------------- private bool bキー入力待ち; - protected bool bEsc有効; + protected bool bEsc有効; internal int n現在の選択行; internal EInstrumentPad eInst = EInstrumentPad.UNKNOWN; @@ -462,32 +375,27 @@ namespace TJAPlayer3 //private CTexture txPopupMenuBackground; //private CTexture txCursor; private CActDFPFont font; - CCachedFontRenderer prvFont; + CCachedFontRenderer prvFont; - internal struct stQuickMenuItem - { - internal CItemBase cItem; - internal CTexture txName; - } - private stQuickMenuItem[] lciMenuItems; - private stQuickMenuItem stqMenuTitle; + 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キー反復用カウンタ - { + [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 ) - { + public CCounter this[int index] { + get { + switch (index) { case 0: return this.Up; @@ -502,10 +410,8 @@ namespace TJAPlayer3 } throw new IndexOutOfRangeException(); } - set - { - switch ( index ) - { + set { + switch (index) { case 0: this.Up = value; return; @@ -528,12 +434,11 @@ namespace TJAPlayer3 } private STキー反復用カウンタ ctキー反復用; - private enum ESortAction : int - { + private enum ESortAction : int { Cancel, Decide, Previous, Next, END } - private int nItemSelecting; // 「n現在の選択行」とは別に設ける。sortでメニュー表示直後にアイテムの中身を表示しないようにするため - //----------------- + 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 1abafd37..ce34236b 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectPreimageパネル.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectPreimageパネル.cs @@ -1,36 +1,23 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.IO; -using System.Diagnostics; -using Silk.NET.Maths; +using System.Diagnostics; using FDK; - +using Silk.NET.Maths; using Rectangle = System.Drawing.Rectangle; -using Point = System.Drawing.Point; -using static TJAPlayer3.CSongListNode; -namespace TJAPlayer3 -{ - internal class CActSelectPreimageパネル : CActivity - { +namespace TJAPlayer3 { + internal class CActSelectPreimageパネル : CActivity { // メソッド - public CActSelectPreimageパネル() - { + public CActSelectPreimageパネル() { base.IsDeActivated = true; } - public void t選択曲が変更された() - { - this.ct遅延表示 = new CCounter( -TJAPlayer3.ConfigIni.n曲が選択されてからプレビュー画像が表示開始されるまでのウェイトms, 100, 1, TJAPlayer3.Timer ); + public void t選択曲が変更された() { + this.ct遅延表示 = new CCounter(-TJAPlayer3.ConfigIni.n曲が選択されてからプレビュー画像が表示開始されるまでのウェイトms, 100, 1, TJAPlayer3.Timer); this.b新しいプレビューファイルを読み込んだ = false; } // CActivity 実装 - public override void Activate() - { + public override void Activate() { this.n本体X = 8; this.n本体Y = 0x39; this.r表示するプレビュー画像 = this.txプレビュー画像がないときの画像; @@ -43,54 +30,44 @@ namespace TJAPlayer3 this.tプレビュー画像_動画の変更(); base.Activate(); } - public override void DeActivate() - { - TJAPlayer3.tテクスチャの解放( ref this.txプレビュー画像 ); + public override void DeActivate() { + TJAPlayer3.tテクスチャの解放(ref this.txプレビュー画像); this.ct登場アニメ用 = null; this.ct遅延表示 = null; base.DeActivate(); } - public override void CreateManagedResource() - { - this.txパネル本体 = TJAPlayer3.tテクスチャの生成( CSkin.Path( @$"Graphics{Path.DirectorySeparatorChar}5_preimage panel.png" ), false ); - this.txセンサ = TJAPlayer3.tテクスチャの生成( CSkin.Path( @$"Graphics{Path.DirectorySeparatorChar}5_sensor.png" ), false ); + public override void CreateManagedResource() { + this.txパネル本体 = TJAPlayer3.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}5_preimage panel.png"), false); + this.txセンサ = TJAPlayer3.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}5_sensor.png"), false); //this.txセンサ光 = CDTXMania.tテクスチャの生成( CSkin.Path( @$"Graphics{Path.DirectorySeparatorChar}5_sensor light.png" ), false ); - this.txプレビュー画像がないときの画像 = TJAPlayer3.tテクスチャの生成( CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}3_SongSelect{Path.DirectorySeparatorChar}PreImageDefault.png"), false ); + this.txプレビュー画像がないときの画像 = TJAPlayer3.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}3_SongSelect{Path.DirectorySeparatorChar}PreImageDefault.png"), false); base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { - TJAPlayer3.tテクスチャの解放( ref this.txパネル本体 ); - TJAPlayer3.tテクスチャの解放( ref this.txセンサ ); - TJAPlayer3.tテクスチャの解放( ref this.txセンサ光 ); - TJAPlayer3.tテクスチャの解放( ref this.txプレビュー画像がないときの画像 ); + public override void ReleaseManagedResource() { + TJAPlayer3.tテクスチャの解放(ref this.txパネル本体); + TJAPlayer3.tテクスチャの解放(ref this.txセンサ); + TJAPlayer3.tテクスチャの解放(ref this.txセンサ光); + TJAPlayer3.tテクスチャの解放(ref this.txプレビュー画像がないときの画像); base.ReleaseManagedResource(); } - public override int Draw() - { - if( !base.IsDeActivated ) - { - if( base.IsFirstDraw ) - { - this.ct登場アニメ用 = new CCounter( 0, 100, 5, TJAPlayer3.Timer ); - this.ctセンサ光 = new CCounter( 0, 100, 30, TJAPlayer3.Timer ); + public override int Draw() { + if (!base.IsDeActivated) { + if (base.IsFirstDraw) { + this.ct登場アニメ用 = new CCounter(0, 100, 5, TJAPlayer3.Timer); + this.ctセンサ光 = new CCounter(0, 100, 30, TJAPlayer3.Timer); this.ctセンサ光.CurrentValue = 70; base.IsFirstDraw = false; } this.ct登場アニメ用.Tick(); this.ctセンサ光.TickLoop(); - if( ( !TJAPlayer3.stageSongSelect.bCurrentlyScrolling && ( this.ct遅延表示 != null ) ) && this.ct遅延表示.IsTicked ) - { + if ((!TJAPlayer3.stageSongSelect.bCurrentlyScrolling && (this.ct遅延表示 != null)) && this.ct遅延表示.IsTicked) { this.ct遅延表示.Tick(); - if ( ( this.ct遅延表示.CurrentValue >= 0 ) && this.b新しいプレビューファイルをまだ読み込んでいない ) - { + if ((this.ct遅延表示.CurrentValue >= 0) && this.b新しいプレビューファイルをまだ読み込んでいない) { this.tプレビュー画像_動画の変更(); TJAPlayer3.Timer.Update(); this.ct遅延表示.NowTime = TJAPlayer3.Timer.NowTime; this.b新しいプレビューファイルを読み込んだ = true; - } - else if ( this.ct遅延表示.IsEnded && this.ct遅延表示.IsTicked ) - { + } else if (this.ct遅延表示.IsEnded && this.ct遅延表示.IsTicked) { this.ct遅延表示.Stop(); } } @@ -113,9 +90,9 @@ namespace TJAPlayer3 private int n本体X; private int n本体Y; private IntPtr pAVIBmp; - private readonly Rectangle rcセンサ光 = new Rectangle( 0, 0xc0, 0x40, 0x40 ); - private readonly Rectangle rcセンサ本体下半分 = new Rectangle( 0x40, 0, 0x40, 0x80 ); - private readonly Rectangle rcセンサ本体上半分 = new Rectangle( 0, 0, 0x40, 0x80 ); + private readonly Rectangle rcセンサ光 = new Rectangle(0, 0xc0, 0x40, 0x40); + private readonly Rectangle rcセンサ本体下半分 = new Rectangle(0x40, 0, 0x40, 0x80); + private readonly Rectangle rcセンサ本体上半分 = new Rectangle(0, 0, 0x40, 0x80); private CTexture r表示するプレビュー画像; private string str現在のファイル名; private CTexture txセンサ; @@ -124,78 +101,61 @@ namespace TJAPlayer3 private CTexture txプレビュー画像; private CTexture txプレビュー画像がないときの画像; private bool b新しいプレビューファイルを読み込んだ; - private bool b新しいプレビューファイルをまだ読み込んでいない - { - get - { + private bool b新しいプレビューファイルをまだ読み込んでいない { + get { return !this.b新しいプレビューファイルを読み込んだ; } - set - { + set { this.b新しいプレビューファイルを読み込んだ = !value; } } - private void tプレビュー画像_動画の変更() - { + private void tプレビュー画像_動画の変更() { this.pAVIBmp = IntPtr.Zero; - if( !TJAPlayer3.ConfigIni.bストイックモード ) - { - if( this.tプレビュー画像の指定があれば構築する() ) - { + if (!TJAPlayer3.ConfigIni.bストイックモード) { + if (this.tプレビュー画像の指定があれば構築する()) { return; } } this.r表示するプレビュー画像 = this.txプレビュー画像がないときの画像; this.str現在のファイル名 = ""; } - private bool tプレビュー画像の指定があれば構築する() - { - Cスコア cスコア = TJAPlayer3.stageSongSelect.r現在選択中のスコア; - if ((cスコア == null) || string.IsNullOrEmpty(cスコア.譜面情報.Preimage)) return false; + private bool tプレビュー画像の指定があれば構築する() { + Cスコア cスコア = TJAPlayer3.stageSongSelect.r現在選択中のスコア; + if ((cスコア == null) || string.IsNullOrEmpty(cスコア.譜面情報.Preimage)) return false; - string str = ((!Path.IsPathRooted(cスコア.譜面情報.Preimage)) ? cスコア.ファイル情報.フォルダの絶対パス : "") + cスコア.譜面情報.Preimage; - if( !str.Equals( this.str現在のファイル名 ) ) - { - TJAPlayer3.tテクスチャの解放( ref this.txプレビュー画像 ); + string str = ((!Path.IsPathRooted(cスコア.譜面情報.Preimage)) ? cスコア.ファイル情報.フォルダの絶対パス : "") + cスコア.譜面情報.Preimage; + if (!str.Equals(this.str現在のファイル名)) { + TJAPlayer3.tテクスチャの解放(ref this.txプレビュー画像); this.str現在のファイル名 = str; - if( !File.Exists( this.str現在のファイル名 ) ) - { - Trace.TraceWarning( "ファイルが存在しません。({0})", new object[] { this.str現在のファイル名 } ); + if (!File.Exists(this.str現在のファイル名)) { + Trace.TraceWarning("ファイルが存在しません。({0})", new object[] { this.str現在のファイル名 }); return false; } - this.txプレビュー画像 = TJAPlayer3.tテクスチャの生成( this.str現在のファイル名, false ); - if( this.txプレビュー画像 != null ) - { + this.txプレビュー画像 = TJAPlayer3.tテクスチャの生成(this.str現在のファイル名, false); + if (this.txプレビュー画像 != null) { this.r表示するプレビュー画像 = this.txプレビュー画像; - } - else - { + } else { this.r表示するプレビュー画像 = this.txプレビュー画像がないときの画像; } } return true; } - /// - /// 一時的に使用禁止。 - /// - private void t描画処理_ジャンル文字列() - { + /// + /// 一時的に使用禁止。 + /// + private void t描画処理_ジャンル文字列() { CSongListNode c曲リストノード = TJAPlayer3.stageSongSelect.rNowSelectedSong; Cスコア cスコア = TJAPlayer3.stageSongSelect.r現在選択中のスコア; - if( ( c曲リストノード != null ) && ( cスコア != null ) ) - { + if ((c曲リストノード != null) && (cスコア != null)) { string str = ""; - switch( c曲リストノード.eノード種別 ) - { + switch (c曲リストノード.eノード種別) { case CSongListNode.ENodeType.SCORE: - if( ( c曲リストノード.strジャンル == null ) || ( c曲リストノード.strジャンル.Length <= 0 ) ) - { - if( ( cスコア.譜面情報.ジャンル != null ) && ( cスコア.譜面情報.ジャンル.Length > 0 ) ) - { + if ((c曲リストノード.strジャンル == null) || (c曲リストノード.strジャンル.Length <= 0)) { + if ((cスコア.譜面情報.ジャンル != null) && (cスコア.譜面情報.ジャンル.Length > 0)) { str = cスコア.譜面情報.ジャンル; } -#if false // #32644 2013.12.21 yyagi "Unknown"なジャンル表示を削除。DTX/BMSなどの種別表示もしない。 +#if false // #32644 2013.12.21 yyagi "Unknown"なジャンル表示を削除。DTX/BMSなどの種別表示もしない。 else { switch( cスコア.譜面情報.曲種別 ) @@ -248,83 +208,67 @@ namespace TJAPlayer3 str = "Unknown"; break; } - TJAPlayer3.actTextConsole.tPrint( this.n本体X + 0x12, this.n本体Y - 1, CTextConsole.EFontType.CyanSlim, str ); + TJAPlayer3.actTextConsole.tPrint(this.n本体X + 0x12, this.n本体Y - 1, CTextConsole.EFontType.CyanSlim, str); } } - private void t描画処理_センサ光() - { + private void t描画処理_センサ光() { int num = (int)this.ctセンサ光.CurrentValue; - if( num < 12 ) - { + if (num < 12) { int x = this.n本体X + 0xcc; int y = this.n本体Y + 0x7b; - if( this.txセンサ光 != null ) - { - this.txセンサ光.vcScaleRatio = new Vector3D( 1f, 1f, 1f ); + if (this.txセンサ光 != null) { + this.txセンサ光.vcScaleRatio = new Vector3D(1f, 1f, 1f); this.txセンサ光.Opacity = 0xff; - this.txセンサ光.t2D描画( x, y, new Rectangle( ( num % 4 ) * 0x40, ( num / 4 ) * 0x40, 0x40, 0x40 ) ); + this.txセンサ光.t2D描画(x, y, new Rectangle((num % 4) * 0x40, (num / 4) * 0x40, 0x40, 0x40)); } - } - else if( num < 0x18 ) - { + } else if (num < 0x18) { int num4 = num - 11; - double num5 = ( (double) num4 ) / 11.0; - double num6 = 1.0 + ( num5 * 0.5 ); - int num7 = (int) ( 64.0 * num6 ); - int num8 = (int) ( 64.0 * num6 ); - int num9 = ( ( this.n本体X + 0xcc ) + 0x20 ) - ( num7 / 2 ); - int num10 = ( ( this.n本体Y + 0x7b ) + 0x20 ) - ( num8 / 2 ); - if( this.txセンサ光 != null ) - { - this.txセンサ光.vcScaleRatio = new Vector3D( (float) num6, (float) num6, 1f ); - this.txセンサ光.Opacity = (int) ( 255.0 * ( 1.0 - num5 ) ); - this.txセンサ光.t2D描画( num9, num10, this.rcセンサ光 ); + double num5 = ((double)num4) / 11.0; + double num6 = 1.0 + (num5 * 0.5); + int num7 = (int)(64.0 * num6); + int num8 = (int)(64.0 * num6); + int num9 = ((this.n本体X + 0xcc) + 0x20) - (num7 / 2); + int num10 = ((this.n本体Y + 0x7b) + 0x20) - (num8 / 2); + if (this.txセンサ光 != null) { + this.txセンサ光.vcScaleRatio = new Vector3D((float)num6, (float)num6, 1f); + this.txセンサ光.Opacity = (int)(255.0 * (1.0 - num5)); + this.txセンサ光.t2D描画(num9, num10, this.rcセンサ光); } } } - private void t描画処理_センサ本体() - { + private void t描画処理_センサ本体() { int x = this.n本体X + 0xcd; int y = this.n本体Y - 4; - if( this.txセンサ != null ) - { - this.txセンサ.t2D描画( x, y, this.rcセンサ本体上半分 ); + if (this.txセンサ != null) { + this.txセンサ.t2D描画(x, y, this.rcセンサ本体上半分); y += 0x80; - this.txセンサ.t2D描画( x, y, this.rcセンサ本体下半分 ); + this.txセンサ.t2D描画(x, y, this.rcセンサ本体下半分); } } - private void t描画処理_パネル本体() - { - if( this.ct登場アニメ用.IsEnded || ( this.txパネル本体 != null ) ) - { + private void t描画処理_パネル本体() { + if (this.ct登場アニメ用.IsEnded || (this.txパネル本体 != null)) { this.n本体X = 16; this.n本体Y = 86; - } - else - { - double num = ( (double) this.ct登場アニメ用.CurrentValue ) / 100.0; - double num2 = Math.Cos( ( 1.5 + ( 0.5 * num ) ) * Math.PI ); + } else { + double num = ((double)this.ct登場アニメ用.CurrentValue) / 100.0; + double num2 = Math.Cos((1.5 + (0.5 * num)) * Math.PI); this.n本体X = 8; if (this.txパネル本体 != null) - this.n本体Y = 0x39 - ( (int) ( this.txパネル本体.sz画像サイズ.Height * ( 1.0 - ( num2 * num2 ) ) ) ); + this.n本体Y = 0x39 - ((int)(this.txパネル本体.sz画像サイズ.Height * (1.0 - (num2 * num2)))); else this.n本体Y = 8; } - if( this.txパネル本体 != null ) - { - this.txパネル本体.t2D描画( this.n本体X, this.n本体Y ); + if (this.txパネル本体 != null) { + this.txパネル本体.t2D描画(this.n本体X, this.n本体Y); } } - private unsafe void t描画処理_プレビュー画像() - { - if( !TJAPlayer3.stageSongSelect.bCurrentlyScrolling && ( ( ( this.ct遅延表示 != null ) && ( this.ct遅延表示.CurrentValue > 0 ) ) && !this.b新しいプレビューファイルをまだ読み込んでいない ) ) - { + private unsafe void t描画処理_プレビュー画像() { + if (!TJAPlayer3.stageSongSelect.bCurrentlyScrolling && (((this.ct遅延表示 != null) && (this.ct遅延表示.CurrentValue > 0)) && !this.b新しいプレビューファイルをまだ読み込んでいない)) { int x = this.n本体X + 0x12; int y = this.n本体Y + 0x10; - float num3 = ( (float) this.ct遅延表示.CurrentValue ) / 100f; - float num4 = 0.9f + ( 0.1f * num3 ); - if( this.r表示するプレビュー画像 != null ) - { + float num3 = ((float)this.ct遅延表示.CurrentValue) / 100f; + float num4 = 0.9f + (0.1f * num3); + if (this.r表示するプレビュー画像 != null) { /* int width = this.r表示するプレビュー画像.sz画像サイズ.Width; int height = this.r表示するプレビュー画像.sz画像サイズ.Height; @@ -345,10 +289,10 @@ namespace TJAPlayer3 float xRatio = width / (float)this.r表示するプレビュー画像.sz画像サイズ.Width; float yRatio = height / (float)this.r表示するプレビュー画像.sz画像サイズ.Height; - x += ( 400 - ( (int) ( width * num4 ) ) ) / 2; - y += ( 400 - ( (int) ( height * num4 ) ) ) / 2; + x += (400 - ((int)(width * num4))) / 2; + y += (400 - ((int)(height * num4))) / 2; - this.r表示するプレビュー画像.Opacity = (int) ( 255f * num3 ); + this.r表示するプレビュー画像.Opacity = (int)(255f * num3); this.r表示するプレビュー画像.vcScaleRatio.X = num4 * xRatio; this.r表示するプレビュー画像.vcScaleRatio.Y = num4 * xRatio; diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectPresound.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectPresound.cs index ed987ee9..7faaa4fe 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectPresound.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectPresound.cs @@ -1,120 +1,95 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; +using System.Diagnostics; using FDK; -namespace TJAPlayer3 -{ - internal class CActSelectPresound : CActivity - { +namespace TJAPlayer3 { + internal class CActSelectPresound : CActivity { // メソッド - public CActSelectPresound() - { + public CActSelectPresound() { base.IsDeActivated = true; } - public void tStopSound() - { - if( this.sound != null ) - { + public void tStopSound() { + if (this.sound != null) { this.sound.Stop(); - TJAPlayer3.SoundManager.tDisposeSound( this.sound ); + TJAPlayer3.SoundManager.tDisposeSound(this.sound); this.sound = null; } } - public void t選択曲が変更された() - { + public void t選択曲が変更された() { Cスコア cスコア = TJAPlayer3.stageSongSelect.r現在選択中のスコア; - - if( ( cスコア != null ) && ( ( !( cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.strBGMファイル名 ).Equals( this.str現在のファイル名 ) || ( this.sound == null ) ) || !this.sound.IsPlaying ) ) - { + + 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.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(TJAPlayer3.SoundManager.GetCurrentSoundDeviceType() != "DirectSound") - { - this.ct再生待ちウェイト = new CCounter(0, 1, 270, TJAPlayer3.Timer); - } else - { - this.ct再生待ちウェイト = new CCounter(0, 1, 500, TJAPlayer3.Timer); - } - } + if (TJAPlayer3.SoundManager.GetCurrentSoundDeviceType() != "DirectSound") { + this.ct再生待ちウェイト = new CCounter(0, 1, 270, TJAPlayer3.Timer); + } else { + this.ct再生待ちウェイト = new CCounter(0, 1, 500, TJAPlayer3.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 ); - // } - //} + //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() - { + public override void Activate() { this.sound = null; this.str現在のファイル名 = ""; this.ct再生待ちウェイト = null; this.ctBGMフェードアウト用 = null; this.ctBGMフェードイン用 = null; - this.long再生位置 = -1; - this.long再生開始時のシステム時刻 = -1; + this.long再生位置 = -1; + this.long再生開始時のシステム時刻 = -1; base.Activate(); } - public override void DeActivate() - { + 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 ) - { + public override int Draw() { + if (!base.IsDeActivated) { + if ((this.ctBGMフェードイン用 != null) && this.ctBGMフェードイン用.IsTicked) { this.ctBGMフェードイン用.Tick(); TJAPlayer3.Skin.bgm選曲画面.nAutomationLevel_現在のサウンド = this.ctBGMフェードイン用.CurrentValue; - if( this.ctBGMフェードイン用.IsEnded ) - { + if (this.ctBGMフェードイン用.IsEnded) { this.ctBGMフェードイン用.Stop(); } } - if( ( this.ctBGMフェードアウト用 != null ) && this.ctBGMフェードアウト用.IsTicked ) - { + if ((this.ctBGMフェードアウト用 != null) && this.ctBGMフェードアウト用.IsTicked) { this.ctBGMフェードアウト用.Tick(); TJAPlayer3.Skin.bgm選曲画面.nAutomationLevel_現在のサウンド = CSound.MaximumAutomationLevel - this.ctBGMフェードアウト用.CurrentValue; - if( this.ctBGMフェードアウト用.IsEnded ) - { + if (this.ctBGMフェードアウト用.IsEnded) { this.ctBGMフェードアウト用.Stop(); } } this.t進行処理_プレビューサウンド(); - if (this.sound != null) - { - Cスコア cスコア = TJAPlayer3.stageSongSelect.r現在選択中のスコア; - if (long再生位置 == -1) - { - this.long再生開始時のシステム時刻 = SoundManager.PlayTimer.SystemTimeMs; - this.long再生位置 = cスコア.譜面情報.nデモBGMオフセット; - - this.sound.tSetPositonToBegin(cスコア.譜面情報.nデモBGMオフセット); + if (this.sound != null) { + Cスコア cスコア = TJAPlayer3.stageSongSelect.r現在選択中のスコア; + if (long再生位置 == -1) { + this.long再生開始時のシステム時刻 = SoundManager.PlayTimer.SystemTimeMs; + this.long再生位置 = cスコア.譜面情報.nデモBGMオフセット; - } - else - { + 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; @@ -137,99 +112,84 @@ namespace TJAPlayer3 private CCounter ctBGMフェードアウト用; private CCounter ctBGMフェードイン用; private CCounter ct再生待ちウェイト; - private long long再生位置; - private long long再生開始時のシステム時刻; + private long long再生位置; + private long long再生開始時のシステム時刻; private CSound sound; private string str現在のファイル名; - - private void tBGMフェードアウト開始() - { - if( this.ctBGMフェードイン用 != null ) - { + + private void tBGMフェードアウト開始() { + if (this.ctBGMフェードイン用 != null) { this.ctBGMフェードイン用.Stop(); } - this.ctBGMフェードアウト用 = new CCounter( 0, 100, 10, TJAPlayer3.Timer ); + this.ctBGMフェードアウト用 = new CCounter(0, 100, 10, TJAPlayer3.Timer); this.ctBGMフェードアウト用.CurrentValue = 100 - TJAPlayer3.Skin.bgm選曲画面.nAutomationLevel_現在のサウンド; } - private void tBGMフェードイン開始() - { - if( this.ctBGMフェードアウト用 != null ) - { + private void tBGMフェードイン開始() { + if (this.ctBGMフェードアウト用 != null) { this.ctBGMフェードアウト用.Stop(); } - this.ctBGMフェードイン用 = new CCounter( 0, 100, 20, TJAPlayer3.Timer ); + this.ctBGMフェードイン用 = new CCounter(0, 100, 20, TJAPlayer3.Timer); this.ctBGMフェードイン用.CurrentValue = TJAPlayer3.Skin.bgm選曲画面.nAutomationLevel_現在のサウンド; } - private void tプレビューサウンドの作成() - { + private void tプレビューサウンドの作成() { Cスコア cスコア = TJAPlayer3.stageSongSelect.r現在選択中のスコア; - var HiddenIndex = TJAPlayer3.Databases.DBSongUnlockables.tGetSongHiddenIndex(TJAPlayer3.stageSongSelect.rNowSelectedSong); - if ( ( cスコア != null ) - && !string.IsNullOrEmpty( cスコア.譜面情報.strBGMファイル名 ) - && TJAPlayer3.stageSongSelect.ePhaseID != CStage.EPhase.SongSelect_FadeOutToNowLoading + var HiddenIndex = TJAPlayer3.Databases.DBSongUnlockables.tGetSongHiddenIndex(TJAPlayer3.stageSongSelect.rNowSelectedSong); + if ((cスコア != null) + && !string.IsNullOrEmpty(cスコア.譜面情報.strBGMファイル名) + && TJAPlayer3.stageSongSelect.ePhaseID != CStage.EPhase.SongSelect_FadeOutToNowLoading && HiddenIndex != DBSongUnlockables.EHiddenIndex.GRAYED - ) - { + ) { string strPreviewFilename = cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.Presound; - try - { - strPreviewFilename = cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.strBGMファイル名; - if(TJAPlayer3.ConfigIni.bBGM音を発声する) - this.sound = TJAPlayer3.SoundManager.tCreateSound( strPreviewFilename, ESoundGroup.SongPreview ); + try { + strPreviewFilename = cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.strBGMファイル名; + if (TJAPlayer3.ConfigIni.bBGM音を発声する) + this.sound = TJAPlayer3.SoundManager.tCreateSound(strPreviewFilename, ESoundGroup.SongPreview); if (this.sound == null) return; - //this.sound.db再生速度 = ((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0; + //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); - TJAPlayer3.SongGainController.Set( cスコア.譜面情報.SongVol, loudnessMetadata, this.sound ); + // 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); + TJAPlayer3.SongGainController.Set(cスコア.譜面情報.SongVol, loudnessMetadata, this.sound); // Disable song if playing while playing the preview song CSongSelectSongManager.disable(); - this.sound.PlayStart( true ); + 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; + 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.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 ) - { + private void t進行処理_プレビューサウンド() { + if ((this.ct再生待ちウェイト != null) && !this.ct再生待ちウェイト.IsStoped) { this.ct再生待ちウェイト.Tick(); - if( !this.ct再生待ちウェイト.IsUnEnded ) - { + if (!this.ct再生待ちウェイト.IsUnEnded) { this.ct再生待ちウェイト.Stop(); - if( !TJAPlayer3.stageSongSelect.bCurrentlyScrolling ) - { - this.tプレビューサウンドの作成(); + if (!TJAPlayer3.stageSongSelect.bCurrentlyScrolling) { + this.tプレビューサウンドの作成(); } } } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectQuickConfig.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectQuickConfig.cs index b92e9901..549bf6b7 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectQuickConfig.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectQuickConfig.cs @@ -1,152 +1,133 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using System.Drawing; -using System.IO; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - internal class CActSelectQuickConfig : CActSelectPopupMenu - { +namespace TJAPlayer3 { + internal class CActSelectQuickConfig : CActSelectPopupMenu { // コンストラクタ - public CActSelectQuickConfig() - { + public CActSelectQuickConfig() { CActSelectQuickConfigMain(); } - 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 ); + 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 + base.Initialize(lci[nCurrentConfigSet][0], true, CLangManager.LangInstance.GetString("SONGSELECT_QUICKCONFIG"), 0); // ConfSet=0, nInst=Drums } - private List MakeListCItemBase( int nConfigSet, int nInst ) - { + 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, TJAPlayer3.ConfigIni.nScrollSpeed[TJAPlayer3.SaveFile], - "" ) ); + l.Add(new CItemInteger(CLangManager.LangInstance.GetString("MOD_SPEED"), 0, 1999, TJAPlayer3.ConfigIni.nScrollSpeed[TJAPlayer3.SaveFile], + "")); #endregion #region [ 共通 Dark/Risky/PlaySpeed ] - l.Add( new CItemInteger( CLangManager.LangInstance.GetString("MOD_SONGSPEED"), 5, 400, TJAPlayer3.ConfigIni.nSongSpeed, - "" ) ); + l.Add(new CItemInteger(CLangManager.LangInstance.GetString("MOD_SONGSPEED"), 5, 400, TJAPlayer3.ConfigIni.nSongSpeed, + "")); #endregion #region [ 個別 Sud/Hid ] - l.Add( new CItemList( CLangManager.LangInstance.GetString("MOD_RANDOM"), CItemBase.EPanelType.Normal, (int) TJAPlayer3.ConfigIni.eRandom[TJAPlayer3.SaveFile], + l.Add(new CItemList(CLangManager.LangInstance.GetString("MOD_RANDOM"), CItemBase.EPanelType.Normal, (int)TJAPlayer3.ConfigIni.eRandom[TJAPlayer3.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) TJAPlayer3.ConfigIni.eSTEALTH[TJAPlayer3.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)TJAPlayer3.ConfigIni.eSTEALTH[TJAPlayer3.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)TJAPlayer3.ConfigIni.eGameMode, - "", - new string[] { CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), "TYPE-A", "TYPE-B" }) ); + 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)TJAPlayer3.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, TJAPlayer3.ConfigIni.ShinuchiMode ? 1 : 0, "", "", new string[] { CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), CLangManager.LangInstance.GetString("MOD_SWITCH_ON") })); + l.Add(new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_SHINUCHI"), CItemBase.EPanelType.Normal, TJAPlayer3.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, TJAPlayer3.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[] { "", "" } ) ); + 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 ) - { + public override void tActivatePopupMenu(EInstrumentPad einst) { this.CActSelectQuickConfigMain(); - base.tActivatePopupMenu( einst ); + base.tActivatePopupMenu(einst); } //public void tDeativatePopupMenu() //{ // base.tDeativatePopupMenu(); //} - public override void t進行描画sub() - { + public override void t進行描画sub() { } - public override void tEnter押下Main( int nSortOrder ) - { - switch ( n現在の選択行 ) - { - case (int) EOrder.ScrollSpeed: - TJAPlayer3.ConfigIni.nScrollSpeed[ TJAPlayer3.SaveFile ] = (int) GetObj現在値( (int) EOrder.ScrollSpeed ); + public override void tEnter押下Main(int nSortOrder) { + switch (n現在の選択行) { + case (int)EOrder.ScrollSpeed: + TJAPlayer3.ConfigIni.nScrollSpeed[TJAPlayer3.SaveFile] = (int)GetObj現在値((int)EOrder.ScrollSpeed); break; - case (int) EOrder.PlaySpeed: - TJAPlayer3.ConfigIni.nSongSpeed = (int) GetObj現在値( (int) EOrder.PlaySpeed ); + case (int)EOrder.PlaySpeed: + TJAPlayer3.ConfigIni.nSongSpeed = (int)GetObj現在値((int)EOrder.PlaySpeed); break; - case (int) EOrder.Random: - TJAPlayer3.ConfigIni.eRandom[TJAPlayer3.SaveFile] = (ERandomMode)GetIndex( (int)EOrder.Random ); + case (int)EOrder.Random: + TJAPlayer3.ConfigIni.eRandom[TJAPlayer3.SaveFile] = (ERandomMode)GetIndex((int)EOrder.Random); break; - case (int) EOrder.Stealth: - TJAPlayer3.ConfigIni.eSTEALTH[TJAPlayer3.SaveFile] = (EStealthMode)GetIndex( (int)EOrder.Stealth ); + case (int)EOrder.Stealth: + TJAPlayer3.ConfigIni.eSTEALTH[TJAPlayer3.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.完走叩ききりまショー; break; - case 2: game = EGame.完走叩ききりまショー激辛; 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.完走叩ききりまショー; break; + case 2: game = EGame.完走叩ききりまショー激辛; break; + } TJAPlayer3.ConfigIni.eGameMode = game; break; - case (int)EOrder.ShinuchiMode: - TJAPlayer3.ConfigIni.ShinuchiMode = !TJAPlayer3.ConfigIni.ShinuchiMode; - break; - case (int)EOrder.PlayerCount: - TJAPlayer3.ConfigIni.nPlayerCount = (int)GetObj現在値((int) EOrder.PlayerCount ); + case (int)EOrder.ShinuchiMode: + TJAPlayer3.ConfigIni.ShinuchiMode = !TJAPlayer3.ConfigIni.ShinuchiMode; break; - case (int) EOrder.More: - SetAutoParameters(); // 簡易CONFIGメニュー脱出に伴い、簡易CONFIG内のAUTOの設定をConfigIniクラスに反映する + case (int)EOrder.PlayerCount: + TJAPlayer3.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クラスに反映する + case (int)EOrder.Return: + SetAutoParameters(); // 簡易CONFIGメニュー脱出に伴い、簡易CONFIG内のAUTOの設定をConfigIniクラスに反映する this.tDeativatePopupMenu(); - break; - default: - break; - } + break; + default: + break; + } } - public override void tCancel() - { + public override void tCancel() { SetAutoParameters(); // Autoの設定値保持のロジックを書くこと! // (Autoのパラメータ切り替え時は実際に値設定していないため、キャンセルまたはRetern, More...時に値設定する必要有り) @@ -156,25 +137,21 @@ namespace TJAPlayer3 /// /// ConfigIni.bAutoPlayに簡易CONFIGの状態を反映する /// - private void SetAutoParameters() - { + private void SetAutoParameters() { - } + } // CActivity 実装 - public override void Activate() - { + public override void Activate() { base.Activate(); this.bGotoDetailConfig = false; } - public override void DeActivate() - { + public override void DeActivate() { base.DeActivate(); } - public override void CreateManagedResource() - { - this.ft表示用フォント = new CCachedFontRenderer( "Arial", 26, CFontRenderer.FontStyle.Bold ); + 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パネル本体 ) ) //{ @@ -183,15 +160,13 @@ namespace TJAPlayer3 base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { - if ( this.ft表示用フォント != null ) - { + public override void ReleaseManagedResource() { + if (this.ft表示用フォント != null) { this.ft表示用フォント.Dispose(); - this.ft表示用フォント = null; + this.ft表示用フォント = null; } //CDTXMania.tテクスチャの解放( ref this.txパネル本体 ); - TJAPlayer3.tテクスチャの解放( ref this.tx文字列パネル ); + TJAPlayer3.tテクスチャの解放(ref this.tx文字列パネル); base.ReleaseManagedResource(); } @@ -199,18 +174,17 @@ namespace TJAPlayer3 //----------------- private int nCurrentTarget = 0; private int nCurrentConfigSet = 0; - private List>> lci; // DrGtBs, ConfSet, 選択肢一覧。都合、3次のListとなる。 - private enum EOrder : int - { + private List>> lci; // DrGtBs, ConfSet, 選択肢一覧。都合、3次のListとなる。 + private enum EOrder : int { ScrollSpeed = 0, PlaySpeed, Random, - Stealth, - GameMode, - ShinuchiMode, + Stealth, + GameMode, + ShinuchiMode, PlayerCount, More, - Return, + Return, END, Default = 99 }; @@ -218,7 +192,7 @@ namespace TJAPlayer3 private CCachedFontRenderer ft表示用フォント; //private CTexture txパネル本体; private CTexture tx文字列パネル; - private CTexture tx説明文1; + private CTexture tx説明文1; //----------------- #endregion } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectShowCurrentPosition.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectShowCurrentPosition.cs index a27c9b0d..eb8ad184 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectShowCurrentPosition.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectShowCurrentPosition.cs @@ -1,71 +1,53 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Diagnostics; -using System.IO; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - internal class CActSelectShowCurrentPosition : CActivity - { +namespace TJAPlayer3 { + internal class CActSelectShowCurrentPosition : CActivity { // メソッド - public CActSelectShowCurrentPosition() - { + public CActSelectShowCurrentPosition() { base.IsDeActivated = true; } // CActivity 実装 - public override void Activate() - { - if ( this.IsActivated ) + public override void Activate() { + if (this.IsActivated) return; base.Activate(); } - public override void DeActivate() - { + 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 = TJAPlayer3.tテクスチャの生成( pathScrollBar, false ); + 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 = TJAPlayer3.tテクスチャの生成(pathScrollBar, false); } - if ( File.Exists( pathScrollPosition ) ) - { - this.txScrollPosition = TJAPlayer3.tテクスチャの生成( pathScrollPosition, false ); + if (File.Exists(pathScrollPosition)) { + this.txScrollPosition = TJAPlayer3.tテクスチャの生成(pathScrollPosition, false); } base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { - TJAPlayer3.tDisposeSafely( ref this.txScrollBar ); - TJAPlayer3.tDisposeSafely( ref this.txScrollPosition ); + public override void ReleaseManagedResource() { + TJAPlayer3.tDisposeSafely(ref this.txScrollBar); + TJAPlayer3.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 ] + 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 = TJAPlayer3.stageSongSelect.nスクロールバー相対y座標; - if( py <= 336 && py >= 0 ) - { + 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 - } + #endregion + } return 0; } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectSongInfo.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectSongInfo.cs index 06d92056..0934fd93 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectSongInfo.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectSongInfo.cs @@ -1,108 +1,88 @@ -using FDK; -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Drawing; +using FDK; // Minimalist menu class to use for custom menus -namespace TJAPlayer3 -{ - class CActSelectSongInfo : CStage - { - public CActSelectSongInfo() - { - base.IsDeActivated = true; - } +namespace TJAPlayer3 { + class CActSelectSongInfo : CStage { + public CActSelectSongInfo() { + base.IsDeActivated = true; + } - public override void Activate() - { - // On activation + public override void Activate() { + // On activation - if (base.IsActivated) - return; + 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() - { - // Ressource allocation + public override void CreateManagedResource() { + // Ressource allocation - base.CreateManagedResource(); - } + base.CreateManagedResource(); + } - public override void ReleaseManagedResource() - { - // Ressource freeing + public override void ReleaseManagedResource() { + // Ressource freeing - base.ReleaseManagedResource(); - } + base.ReleaseManagedResource(); + } - public override int Draw() - { - if (TJAPlayer3.stageSongSelect.rNowSelectedSong != null && TJAPlayer3.stageSongSelect.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) - { - int[] bpms = new int[3] { - (int)TJAPlayer3.stageSongSelect.rNowSelectedSong.arスコア[TJAPlayer3.stageSongSelect.actSongList.tFetchDifficulty(TJAPlayer3.stageSongSelect.rNowSelectedSong)].譜面情報.BaseBpm, - (int)TJAPlayer3.stageSongSelect.rNowSelectedSong.arスコア[TJAPlayer3.stageSongSelect.actSongList.tFetchDifficulty(TJAPlayer3.stageSongSelect.rNowSelectedSong)].譜面情報.MinBpm, - (int)TJAPlayer3.stageSongSelect.rNowSelectedSong.arスコア[TJAPlayer3.stageSongSelect.actSongList.tFetchDifficulty(TJAPlayer3.stageSongSelect.rNowSelectedSong)].譜面情報.MaxBpm - }; - for (int i = 0; i < 3; i++) - { - tBPMNumberDraw(TJAPlayer3.Skin.SongSelect_Bpm_X[i], TJAPlayer3.Skin.SongSelect_Bpm_Y[i], bpms[i]); - } + public override int Draw() { + if (TJAPlayer3.stageSongSelect.rNowSelectedSong != null && TJAPlayer3.stageSongSelect.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) { + int[] bpms = new int[3] { + (int)TJAPlayer3.stageSongSelect.rNowSelectedSong.arスコア[TJAPlayer3.stageSongSelect.actSongList.tFetchDifficulty(TJAPlayer3.stageSongSelect.rNowSelectedSong)].譜面情報.BaseBpm, + (int)TJAPlayer3.stageSongSelect.rNowSelectedSong.arスコア[TJAPlayer3.stageSongSelect.actSongList.tFetchDifficulty(TJAPlayer3.stageSongSelect.rNowSelectedSong)].譜面情報.MinBpm, + (int)TJAPlayer3.stageSongSelect.rNowSelectedSong.arスコア[TJAPlayer3.stageSongSelect.actSongList.tFetchDifficulty(TJAPlayer3.stageSongSelect.rNowSelectedSong)].譜面情報.MaxBpm + }; + for (int i = 0; i < 3; i++) { + tBPMNumberDraw(TJAPlayer3.Skin.SongSelect_Bpm_X[i], TJAPlayer3.Skin.SongSelect_Bpm_Y[i], bpms[i]); + } - if (TJAPlayer3.stageSongSelect.actSongList.ttkSelectedSongMaker != null && TJAPlayer3.Skin.SongSelect_Maker_Show) - { - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(TJAPlayer3.stageSongSelect.actSongList.ttkSelectedSongMaker).t2D拡大率考慮描画(CTexture.RefPnt.Left, TJAPlayer3.Skin.SongSelect_Maker[0], TJAPlayer3.Skin.SongSelect_Maker[1]); - } - if (TJAPlayer3.stageSongSelect.actSongList.ttkSelectedSongBPM != null && TJAPlayer3.Skin.SongSelect_BPM_Text_Show) - { - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(TJAPlayer3.stageSongSelect.actSongList.ttkSelectedSongBPM).t2D拡大率考慮描画(CTexture.RefPnt.Left, TJAPlayer3.Skin.SongSelect_BPM_Text[0], TJAPlayer3.Skin.SongSelect_BPM_Text[1]); - } - if (TJAPlayer3.stageSongSelect.rNowSelectedSong.bExplicit) - TJAPlayer3.Tx.SongSelect_Explicit?.t2D描画(TJAPlayer3.Skin.SongSelect_Explicit[0], TJAPlayer3.Skin.SongSelect_Explicit[1]); - if (TJAPlayer3.stageSongSelect.rNowSelectedSong.bMovie) - TJAPlayer3.Tx.SongSelect_Movie?.t2D描画(TJAPlayer3.Skin.SongSelect_Movie[0], TJAPlayer3.Skin.SongSelect_Movie[1]); - } + if (TJAPlayer3.stageSongSelect.actSongList.ttkSelectedSongMaker != null && TJAPlayer3.Skin.SongSelect_Maker_Show) { + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(TJAPlayer3.stageSongSelect.actSongList.ttkSelectedSongMaker).t2D拡大率考慮描画(CTexture.RefPnt.Left, TJAPlayer3.Skin.SongSelect_Maker[0], TJAPlayer3.Skin.SongSelect_Maker[1]); + } + if (TJAPlayer3.stageSongSelect.actSongList.ttkSelectedSongBPM != null && TJAPlayer3.Skin.SongSelect_BPM_Text_Show) { + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(TJAPlayer3.stageSongSelect.actSongList.ttkSelectedSongBPM).t2D拡大率考慮描画(CTexture.RefPnt.Left, TJAPlayer3.Skin.SongSelect_BPM_Text[0], TJAPlayer3.Skin.SongSelect_BPM_Text[1]); + } + if (TJAPlayer3.stageSongSelect.rNowSelectedSong.bExplicit) + TJAPlayer3.Tx.SongSelect_Explicit?.t2D描画(TJAPlayer3.Skin.SongSelect_Explicit[0], TJAPlayer3.Skin.SongSelect_Explicit[1]); + if (TJAPlayer3.stageSongSelect.rNowSelectedSong.bMovie) + TJAPlayer3.Tx.SongSelect_Movie?.t2D描画(TJAPlayer3.Skin.SongSelect_Movie[0], TJAPlayer3.Skin.SongSelect_Movie[1]); + } - return 0; - } + return 0; + } - #region [Private] + #region [Private] - private void tBPMNumberDraw(float originx, float originy, int num) - { - int[] nums = CConversion.SeparateDigits(num); + private void tBPMNumberDraw(float originx, float originy, int num) { + int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) - { - if (TJAPlayer3.Skin.SongSelect_Bpm_Show && TJAPlayer3.Tx.SongSelect_Bpm_Number != null) - { - float offset = j; - float x = originx - (TJAPlayer3.Skin.SongSelect_Bpm_Interval[0] * offset); - float y = originy - (TJAPlayer3.Skin.SongSelect_Bpm_Interval[1] * offset); + for (int j = 0; j < nums.Length; j++) { + if (TJAPlayer3.Skin.SongSelect_Bpm_Show && TJAPlayer3.Tx.SongSelect_Bpm_Number != null) { + float offset = j; + float x = originx - (TJAPlayer3.Skin.SongSelect_Bpm_Interval[0] * offset); + float y = originy - (TJAPlayer3.Skin.SongSelect_Bpm_Interval[1] * offset); - float width = TJAPlayer3.Tx.SongSelect_Bpm_Number.sz画像サイズ.Width / 10.0f; - float height = TJAPlayer3.Tx.SongSelect_Bpm_Number.sz画像サイズ.Height; + float width = TJAPlayer3.Tx.SongSelect_Bpm_Number.sz画像サイズ.Width / 10.0f; + float height = TJAPlayer3.Tx.SongSelect_Bpm_Number.sz画像サイズ.Height; - TJAPlayer3.Tx.SongSelect_Bpm_Number.t2D描画(x, y, new RectangleF(width * nums[j], 0, width, height)); - } - } - } + TJAPlayer3.Tx.SongSelect_Bpm_Number.t2D描画(x, y, new RectangleF(width * nums[j], 0, width, height)); + } + } + } - #endregion - } + #endregion + } } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectTowerInfo.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectTowerInfo.cs index 4d7c537c..4fb2c8ac 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectTowerInfo.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectTowerInfo.cs @@ -1,85 +1,69 @@ -using FDK; -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Drawing; +using FDK; // Minimalist menu class to use for custom menus -namespace TJAPlayer3 -{ - class CActSelectTowerInfo : CStage - { - public CActSelectTowerInfo() - { - base.IsDeActivated = true; - } +namespace TJAPlayer3 { + class CActSelectTowerInfo : CStage { + public CActSelectTowerInfo() { + base.IsDeActivated = true; + } - public override void Activate() - { - // On activation + public override void Activate() { + // On activation - if (base.IsActivated) - return; + 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() - { - tFloorNumberDraw(TJAPlayer3.Skin.SongSelect_FloorNum_X, TJAPlayer3.Skin.SongSelect_FloorNum_Y, TJAPlayer3.stageSongSelect.rNowSelectedSong.nTotalFloor); + public override int Draw() { + tFloorNumberDraw(TJAPlayer3.Skin.SongSelect_FloorNum_X, TJAPlayer3.Skin.SongSelect_FloorNum_Y, TJAPlayer3.stageSongSelect.rNowSelectedSong.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 (TJAPlayer3.Skin.SongSelect_FloorNum_Show && TJAPlayer3.Tx.SongSelect_Floor_Number != null) - { - float offset = j; - float x = originx - (TJAPlayer3.Skin.SongSelect_FloorNum_Interval[0] * offset); - float y = originy - (TJAPlayer3.Skin.SongSelect_FloorNum_Interval[1] * offset); + for (int j = 0; j < nums.Length; j++) { + if (TJAPlayer3.Skin.SongSelect_FloorNum_Show && TJAPlayer3.Tx.SongSelect_Floor_Number != null) { + float offset = j; + float x = originx - (TJAPlayer3.Skin.SongSelect_FloorNum_Interval[0] * offset); + float y = originy - (TJAPlayer3.Skin.SongSelect_FloorNum_Interval[1] * offset); - float width = TJAPlayer3.Tx.SongSelect_Floor_Number.sz画像サイズ.Width / 10.0f; - float height = TJAPlayer3.Tx.SongSelect_Floor_Number.sz画像サイズ.Height; + float width = TJAPlayer3.Tx.SongSelect_Floor_Number.sz画像サイズ.Width / 10.0f; + float height = TJAPlayer3.Tx.SongSelect_Floor_Number.sz画像サイズ.Height; - TJAPlayer3.Tx.SongSelect_Floor_Number.t2D描画(x, y, new RectangleF(width * nums[j], 0, width, height)); - } - } - } + TJAPlayer3.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 4508f880..c45ccd3e 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectステータスパネル.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectステータスパネル.cs @@ -1,50 +1,35 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; -using System.Drawing; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - internal class CActSelectステータスパネル : CActivity - { +namespace TJAPlayer3 { + internal class CActSelectステータスパネル : CActivity { // メソッド - public CActSelectステータスパネル() - { + public CActSelectステータスパネル() { base.IsDeActivated = true; } - public void t選択曲が変更された() - { + public void t選択曲が変更された() { } // CActivity 実装 - public override void Activate() - { + public override void Activate() { base.Activate(); } - public override void DeActivate() - { + public override void DeActivate() { base.DeActivate(); } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { base.ReleaseManagedResource(); } - public override int Draw() - { - if( !base.IsDeActivated ) - { + public override int Draw() { + if (!base.IsDeActivated) { } return 0; diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelect曲リスト.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelect曲リスト.cs index cb875498..82664980 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelect曲リスト.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelect曲リスト.cs @@ -1,108 +1,75 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Diagnostics; using System.Globalization; using System.Runtime.InteropServices; -using System.Drawing; -using System.Drawing.Imaging; -using System.Diagnostics; -using System.Drawing.Text; -using System.Threading.Tasks; -using Silk.NET.Maths; using FDK; -using System.Linq; - -using Rectangle = System.Drawing.Rectangle; -using Point = System.Drawing.Point; +using Silk.NET.Maths; using Color = System.Drawing.Color; +using Rectangle = System.Drawing.Rectangle; using RectangleF = System.Drawing.RectangleF; -using SkiaSharp; -using Microsoft.EntityFrameworkCore.Metadata.Internal; -using System.Runtime.ExceptionServices; -namespace TJAPlayer3 -{ - internal class CActSelect曲リスト : CActivity - { +namespace TJAPlayer3 { + internal class CActSelect曲リスト : CActivity { // プロパティ - public bool bIsEnumeratingSongs - { + public bool bIsEnumeratingSongs { get; set; } - public bool bスクロール中 - { - get - { + public bool bスクロール中 { + get { return ctScrollCounter.CurrentValue != ctScrollCounter.EndValue; } } - public double fNowScrollAnime - { - get - { + public double fNowScrollAnime { + get { double value = ctScrollCounter.CurrentValue / 1000.0; return Math.Sin(value * Math.PI / 2.0); } - } - public int n現在のアンカ難易度レベル - { + } + public int n現在のアンカ難易度レベル { get; private set; } - public int n現在選択中の曲の現在の難易度レベル - { - get - { - return this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す( this.rCurrentlySelectedSong ); + public int n現在選択中の曲の現在の難易度レベル { + get { + return this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(this.rCurrentlySelectedSong); } } - public Cスコア r現在選択中のスコア - { - get - { - if( this.rCurrentlySelectedSong != null ) - { - return this.rCurrentlySelectedSong.arスコア[ this.n現在選択中の曲の現在の難易度レベル ]; + public Cスコア r現在選択中のスコア { + get { + if (this.rCurrentlySelectedSong != null) { + return this.rCurrentlySelectedSong.arスコア[this.n現在選択中の曲の現在の難易度レベル]; } return null; } } - public int nSelectSongIndex - { + public int nSelectSongIndex { get; private set; } - public CSongListNode rPrevSelectedSong - { + public CSongListNode rPrevSelectedSong { get; private set; } private CSongListNode _rNowSelectedSong; - public CSongListNode rCurrentlySelectedSong - { - get - { + public CSongListNode rCurrentlySelectedSong { + get { return _rNowSelectedSong; } - set - { + set { rPrevSelectedSong = rCurrentlySelectedSong; _rNowSelectedSong = value; } } - public TitleTextureKey? ttkNowUnlockConditionText = null; + public TitleTextureKey? ttkNowUnlockConditionText = null; - public void ResetSongIndex() - { + public void ResetSongIndex() { nSelectSongIndex = 0; this.rCurrentlySelectedSong = TJAPlayer3.Songs管理.list曲ルート[nSelectSongIndex]; } - public int nスクロールバー相対y座標 - { + public int nスクロールバー相対y座標 { get; private set; } @@ -110,11 +77,10 @@ namespace TJAPlayer3 // t選択曲が変更された()内で使う、直前の選曲の保持 // (前と同じ曲なら選択曲変更に掛かる再計算を省略して高速化するため) private CSongListNode song_last = null; - + // コンストラクタ - public CActSelect曲リスト() - { + public CActSelect曲リスト() { #region[ レベル数字 ] STレベル数字[] stレベル数字Ar = new STレベル数字[10]; STレベル数字 st数字0 = new STレベル数字(); @@ -174,107 +140,89 @@ namespace TJAPlayer3 // メソッド // Closest level - public int n現在のアンカ難易度レベルに最も近い難易度レベルを返す( CSongListNode song ) - { + public int n現在のアンカ難易度レベルに最も近い難易度レベルを返す(CSongListNode song) { // 事前チェック。 - if( song == null ) - return this.n現在のアンカ難易度レベル; // 曲がまったくないよ + if (song == null) + return this.n現在のアンカ難易度レベル; // 曲がまったくないよ - if( song.arスコア[ this.n現在のアンカ難易度レベル ] != 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 は関係無いよ + 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; // 曲があった。 + 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; // 曲がなかったので次の難易度レベルへGo。(5以上になったら0に戻る。) } // 見つかった曲がアンカより下のレベルだった場合…… // アンカから下向きに検索すれば、もっとアンカに近い曲があるんじゃね? - if( n最も近いレベル < this.n現在のアンカ難易度レベル ) - { + if (n最も近いレベル < this.n現在のアンカ難易度レベル) { // 現在のアンカレベルから、難易度下向きに検索開始。 n最も近いレベル = this.n現在のアンカ難易度レベル; - for( int i = 0; i < (int)Difficulty.Total; i++ ) - { - if( song.arスコア[ n最も近いレベル ] != null ) - break; // 曲があった。 + 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に戻る。) + 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[0]; } - public CSongListNode r指定された曲が存在するリストの末尾の曲( CSongListNode song ) - { - List songList = GetSongListWithinMe( song ); - return ( songList == null ) ? null : songList[ songList.Count - 1 ]; + 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階層のノートだったら + private List GetSongListWithinMe(CSongListNode song) { + if (song.rParentNode == null) // root階層のノートだったら { - return TJAPlayer3.Songs管理.list曲ルート; // rootのリストを返す - } - else - { - if ( ( song.rParentNode.list子リスト != null ) && ( song.rParentNode.list子リスト.Count > 0 ) ) - { + return TJAPlayer3.Songs管理.list曲ルート; // rootのリストを返す + } else { + if ((song.rParentNode.list子リスト != null) && (song.rParentNode.list子リスト.Count > 0)) { return song.rParentNode.list子リスト; - } - else - { + } else { return null; } } } - public delegate void DGSortFunc( List songList, EInstrumentPad eInst, int order, params object[] p); + 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 ) - { + 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 ); + } 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) - { + 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, TJAPlayer3.Songs管理.listStrBoxDefSkinSubfolderFullName); @@ -291,16 +239,14 @@ namespace TJAPlayer3 } } - public void tResetTitleKey() - { + public void tResetTitleKey() { this.ttk選択している曲の曲名 = null; this.ttk選択している曲のサブタイトル = null; this.ttkSelectedSongMaker = null; this.ttkSelectedSongBPM = null; } - public bool tBOXに入る() - { + public bool tBOXに入る() { //Trace.TraceInformation( "box enter" ); //Trace.TraceInformation( "Skin現在Current : " + CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ); //Trace.TraceInformation( "Skin現在System : " + CSkin.strSystemSkinSubfolderFullName ); @@ -311,8 +257,7 @@ namespace TJAPlayer3 //Trace.TraceInformation( "Skinpath: " + this.r現在選択中の曲.strSkinPath ); bool ret = false; if (CSkin.GetSkinName(TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName(false)) != CSkin.GetSkinName(this.rCurrentlySelectedSong.strSkinPath) - && CSkin.bUseBoxDefSkin) - { + && CSkin.bUseBoxDefSkin) { ret = true; // BOXに入るときは、スキン変更発生時のみboxdefスキン設定の更新を行う TJAPlayer3.Skin.SetCurrentSkinSubfolderFullName( @@ -328,18 +273,14 @@ namespace TJAPlayer3 // 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 (TJAPlayer3.ConfigIni.TJAP3FolderMode) - { + if (rCurrentlySelectedSong != null && + rCurrentlySelectedSong.list子リスト != null && + rCurrentlySelectedSong.list子リスト.Count != 1) { + if (TJAPlayer3.ConfigIni.TJAP3FolderMode) { this.rCurrentlySelectedSong = this.rCurrentlySelectedSong.list子リスト[0]; nSelectSongIndex = 0; tChangeSong(this.rCurrentlySelectedSong.rParentNode.Openindex); - } - else - { + } else { //実際には親フォルダを消さないように変更 this.rCurrentlySelectedSong.bIsOpenFolder = true; @@ -354,7 +295,7 @@ namespace TJAPlayer3 this.t現在選択中の曲を元に曲バーを再構成する(); this.t選択曲が変更された(false); - + TJAPlayer3.stageSongSelect.tNotifySelectedSongChange(); // #27648 項目数変更を反映させる this.b選択曲が変更された = true; // TJAPlayer3.Skin.bgm選曲画面.t停止する(); @@ -363,49 +304,42 @@ namespace TJAPlayer3 return ret; } - public void tReturnToRootBox() - { + public void tReturnToRootBox() { while (this.rCurrentlySelectedSong.rParentNode != null) tCloseBOX(); - } + } - public bool tCloseBOX() - { + public bool tCloseBOX() { bool ret = false; - if ( CSkin.GetSkinName( TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName( false ) ) != CSkin.GetSkinName( this.rCurrentlySelectedSong.strSkinPath ) - && CSkin.bUseBoxDefSkin ) - { + if (CSkin.GetSkinName(TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName(false)) != CSkin.GetSkinName(this.rCurrentlySelectedSong.strSkinPath) + && CSkin.bUseBoxDefSkin) { ret = true; } // スキン変更が発生しなくても、boxdef圏外に出る場合は、boxdefスキン設定の更新が必要 // (ユーザーがboxdefスキンをConfig指定している場合への対応のために必要) // tBoxに入る()とは処理が微妙に異なるので注意 TJAPlayer3.Skin.SetCurrentSkinSubfolderFullName( - ( this.rCurrentlySelectedSong.strSkinPath == "" ) ? "" : TJAPlayer3.Skin.GetSkinSubfolderFullNameFromSkinName( CSkin.GetSkinName( this.rCurrentlySelectedSong.strSkinPath ) ), false ); + (this.rCurrentlySelectedSong.strSkinPath == "") ? "" : TJAPlayer3.Skin.GetSkinSubfolderFullNameFromSkinName(CSkin.GetSkinName(this.rCurrentlySelectedSong.strSkinPath)), false); - tResetTitleTextureKey(); + tResetTitleTextureKey(); - if (TJAPlayer3.ConfigIni.TJAP3FolderMode) - { - if (this.rCurrentlySelectedSong.rParentNode != null) - { + if (TJAPlayer3.ConfigIni.TJAP3FolderMode) { + if (this.rCurrentlySelectedSong.rParentNode != null) { this.rCurrentlySelectedSong = this.rCurrentlySelectedSong.rParentNode; this.rCurrentlySelectedSong.Openindex = nSelectSongIndex; tChangeSong(TJAPlayer3.Songs管理.list曲ルート.IndexOf(this.rCurrentlySelectedSong) - nSelectSongIndex); } - } - else - { + } else { // Reindex the parent node List currentSongList = flattenList(TJAPlayer3.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.rParentNode.Openindex = currentSongList.IndexOf(this.rCurrentlySelectedSong) - currentSongList.IndexOf(this.rCurrentlySelectedSong.rParentNode.list子リスト[0]); + this.rCurrentlySelectedSong.rParentNode.bIsOpenFolder = false; + tChangeSong(-this.rCurrentlySelectedSong.rParentNode.Openindex); - } + } this.t現在選択中の曲を元に曲バーを再構成する(); this.t選択曲が変更された(false); // #27648 項目数変更を反映させる @@ -415,34 +349,28 @@ namespace TJAPlayer3 } - public List flattenList(List list, bool useOpenFlag = false) - { + 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++) - { + 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)) - { + if (e.eノード種別 == CSongListNode.ENodeType.BOX && + (!useOpenFlag || e.bIsOpenFolder)) { ret.AddRange(flattenList(e.list子リスト, useOpenFlag)); } - } + } return (ret); - } + } - public void t現在選択中の曲を元に曲バーを再構成する() - { + public void t現在選択中の曲を元に曲バーを再構成する() { this.tバーの初期化(); } - public void t次に移動() - { - if( this.rCurrentlySelectedSong != null ) - { + public void t次に移動() { + if (this.rCurrentlySelectedSong != null) { nNowChange = 1; ctScoreFrameAnime.Stop(); ctScoreFrameAnime.CurrentValue = 0; @@ -487,8 +415,7 @@ namespace TJAPlayer3 this.stバー情報[index].ar難易度 = song.nLevel; this.stバー情報[index].nLevelIcon = song.nLevelIcon; - for (int f = 0; f < (int)Difficulty.Total; f++) - { + for (int f = 0; f < (int)Difficulty.Total; f++) { if (song.arスコア[f] != null) this.stバー情報[index].b分岐 = song.arスコア[f].譜面情報.b譜面分岐; } @@ -500,17 +427,16 @@ namespace TJAPlayer3 if (stバー情報[index].nスコアランク == null) this.stバー情報[index].nスコアランク = new int[2][]; - for (int i = 0; i < 2; i++) - { + 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 = TJAPlayer3.GetActualPlayer(i); //var sr = song.arスコア[n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)]; - var TableEntry = TJAPlayer3.SaveFileInstances[ap].data.tGetSongSelectTableEntry(song.tGetUniqueId()); + var TableEntry = TJAPlayer3.SaveFileInstances[ap].data.tGetSongSelectTableEntry(song.tGetUniqueId()); - this.stバー情報[index].nクリア[i] = TableEntry.ClearStatuses; + this.stバー情報[index].nクリア[i] = TableEntry.ClearStatuses; this.stバー情報[index].nスコアランク[i] = TableEntry.ScoreRanks; } @@ -522,8 +448,7 @@ namespace TJAPlayer3 // stバー情報[] の内容を1行ずつずらす。 - for (int i = 0; i < TJAPlayer3.Skin.SongSelect_Bar_Count; i++) - { + for (int i = 0; i < TJAPlayer3.Skin.SongSelect_Bar_Count; i++) { CSongListNode song2 = this.rGetSideSong(i - barCenterNum); int n = (((this.n現在の選択行 - barCenterNum) + i) + TJAPlayer3.Skin.SongSelect_Bar_Count) % TJAPlayer3.Skin.SongSelect_Bar_Count; this.stバー情報[n].eバー種別 = this.e曲のバー種別を返す(song2); @@ -558,18 +483,16 @@ namespace TJAPlayer3 ctScoreFrameAnime.Start(0, 6000, 1, TJAPlayer3.Timer); } - //----------------- - #endregion + //----------------- + #endregion - tResetTitleTextureKey(); - } + tResetTitleTextureKey(); + } this.b選択曲が変更された = true; } - public void t前に移動() - { - if( this.rCurrentlySelectedSong != null ) - { + public void t前に移動() { + if (this.rCurrentlySelectedSong != null) { nNowChange = -1; ctScoreFrameAnime.Stop(); ctScoreFrameAnime.CurrentValue = 0; @@ -613,9 +536,8 @@ namespace TJAPlayer3 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++) - { + 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譜面分岐; } @@ -643,16 +565,15 @@ namespace TJAPlayer3 if (stバー情報[index].nスコアランク == null) this.stバー情報[index].nスコアランク = new int[2][]; - for (int i = 0; i < 2; i++) - { + 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 = TJAPlayer3.GetActualPlayer(i); - //var sr = song.arスコア[n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)]; - var TableEntry = TJAPlayer3.SaveFileInstances[ap].data.tGetSongSelectTableEntry(song.tGetUniqueId()); + //var sr = song.arスコア[n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)]; + var TableEntry = TJAPlayer3.SaveFileInstances[ap].data.tGetSongSelectTableEntry(song.tGetUniqueId()); - this.stバー情報[index].nクリア[i] = TableEntry.ClearStatuses; + this.stバー情報[index].nクリア[i] = TableEntry.ClearStatuses; this.stバー情報[index].nスコアランク[i] = TableEntry.ScoreRanks; } @@ -663,8 +584,7 @@ namespace TJAPlayer3 // stバー情報[] の内容を1行ずつずらす。 - for (int i = 0; i < TJAPlayer3.Skin.SongSelect_Bar_Count; i++) - { + for (int i = 0; i < TJAPlayer3.Skin.SongSelect_Bar_Count; i++) { int n = (((this.n現在の選択行 - barCenterNum) + i) + TJAPlayer3.Skin.SongSelect_Bar_Count) % TJAPlayer3.Skin.SongSelect_Bar_Count; var song2 = this.rGetSideSong(i - barCenterNum); this.stバー情報[n].eバー種別 = this.e曲のバー種別を返す(song2); @@ -690,39 +610,33 @@ namespace TJAPlayer3 TJAPlayer3.stageSongSelect.NowBgColor = this.rCurrentlySelectedSong.BgColor; TJAPlayer3.stageSongSelect.NowUseGenre = !this.rCurrentlySelectedSong.isChangedBgType; ctScoreFrameAnime.Start(0, 6000, 1, TJAPlayer3.Timer); - //----------------- - #endregion + //----------------- + #endregion - tResetTitleTextureKey(); - } + tResetTitleTextureKey(); + } this.b選択曲が変更された = true; } - public void tUpdateCurSong() - { - if ((this.rGetSideSong(0).eノード種別 == CSongListNode.ENodeType.SCORE) || this.rGetSideSong(0).eノード種別 == CSongListNode.ENodeType.BACKBOX) - { + public void tUpdateCurSong() { + if ((this.rGetSideSong(0).eノード種別 == CSongListNode.ENodeType.SCORE) || this.rGetSideSong(0).eノード種別 == CSongListNode.ENodeType.BACKBOX) { TJAPlayer3.stageSongSelect.bBGMIn再生した = false; CSongSelectSongManager.disable(); - } - else - { + } else { CSongSelectSongManager.enable(); CSongSelectSongManager.playSongIfPossible(); } TJAPlayer3.stageSongSelect.ctBackgroundFade.Start(0, 600, 1, TJAPlayer3.Timer); - if (this.ctBarOpen.CurrentValue >= 200 || TJAPlayer3.stageSongSelect.ctBackgroundFade.CurrentValue >= 600 - 255) - { + if (this.ctBarOpen.CurrentValue >= 200 || TJAPlayer3.stageSongSelect.ctBackgroundFade.CurrentValue >= 600 - 255) { TJAPlayer3.stageSongSelect.OldGenre = this.rCurrentlySelectedSong.strジャンル; TJAPlayer3.stageSongSelect.OldUseGenre = !this.rCurrentlySelectedSong.isChangedBgType; TJAPlayer3.stageSongSelect.OldBg = this.rCurrentlySelectedSong.BgType; TJAPlayer3.stageSongSelect.OldBgColor = this.rCurrentlySelectedSong.BgColor; } - if (this.rCurrentlySelectedSong != null) - { + if (this.rCurrentlySelectedSong != null) { ctScoreFrameAnime.Stop(); ctScoreFrameAnime.CurrentValue = 0; ctBarOpen.Stop(); @@ -730,34 +644,30 @@ namespace TJAPlayer3 } this.b選択曲が変更された = true; } - public void t難易度レベルをひとつ進める() - { - if( ( this.rCurrentlySelectedSong == null ) || ( this.rCurrentlySelectedSong.nスコア数 <= 1 ) ) - return; // 曲にスコアが0~1個しかないなら進める意味なし。 - + public void t難易度レベルをひとつ進める() { + if ((this.rCurrentlySelectedSong == null) || (this.rCurrentlySelectedSong.nスコア数 <= 1)) + return; // 曲にスコアが0~1個しかないなら進める意味なし。 + // 難易度レベルを+1し、現在選曲中のスコアを変更する。 - this.n現在のアンカ難易度レベル = this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す( this.rCurrentlySelectedSong ); + 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。 + 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曲全部。) + // 曲毎に表示しているスキル値を、新しい難易度レベルに合わせて取得し直す。(表示されている13曲全部。) - int _center = (TJAPlayer3.Skin.SongSelect_Bar_Count - 1) / 2; - for ( int i = this.n現在の選択行 - _center; i < ( ( this.n現在の選択行 - _center) + TJAPlayer3.Skin.SongSelect_Bar_Count); i++ ) - { + int _center = (TJAPlayer3.Skin.SongSelect_Bar_Count - 1) / 2; + for (int i = this.n現在の選択行 - _center; i < ((this.n現在の選択行 - _center) + TJAPlayer3.Skin.SongSelect_Bar_Count); i++) { var song = this.rGetSideSong(i); - int index = ( i + TJAPlayer3.Skin.SongSelect_Bar_Count) % TJAPlayer3.Skin.SongSelect_Bar_Count; - for( int m = 0; m < 3; m++ ) - { - this.stバー情報[ index ].nスキル値[ m ] = (int) song.arスコア[ this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す( song ) ].譜面情報.最大スキル[ m ]; + int index = (i + TJAPlayer3.Skin.SongSelect_Bar_Count) % TJAPlayer3.Skin.SongSelect_Bar_Count; + for (int m = 0; m < 3; m++) { + this.stバー情報[index].nスキル値[m] = (int)song.arスコア[this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)].譜面情報.最大スキル[m]; } } @@ -766,59 +676,51 @@ namespace TJAPlayer3 TJAPlayer3.stageSongSelect.tNotifySelectedSongChange(); } - /// - /// 不便だったから作った。 - /// - public void t難易度レベルをひとつ戻す() - { - if( ( this.rCurrentlySelectedSong == null ) || ( this.rCurrentlySelectedSong.nスコア数 <= 1 ) ) + /// + /// 不便だったから作った。 + /// + public void t難易度レベルをひとつ戻す() { + if ((this.rCurrentlySelectedSong == null) || (this.rCurrentlySelectedSong.nスコア数 <= 1)) return; // 曲にスコアが0~1個しかないなら進める意味なし。 - - // 難易度レベルを+1し、現在選曲中のスコアを変更する。 - this.n現在のアンカ難易度レベル = this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す( this.rCurrentlySelectedSong ); + // 難易度レベルを+1し、現在選曲中のスコアを変更する。 - this.n現在のアンカ難易度レベル--; - if( this.n現在のアンカ難易度レベル < 0 ) // 0より下になったら4に戻す。 - { - this.n現在のアンカ難易度レベル = 4; - } + this.n現在のアンカ難易度レベル = this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(this.rCurrentlySelectedSong); - //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 = (TJAPlayer3.Skin.SongSelect_Bar_Count - 1) / 2; - for ( int i = this.n現在の選択行 - _center; i < ( ( this.n現在の選択行 - _center ) + TJAPlayer3.Skin.SongSelect_Bar_Count); i++ ) + 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 = (TJAPlayer3.Skin.SongSelect_Bar_Count - 1) / 2; + for (int i = this.n現在の選択行 - _center; i < ((this.n現在の選択行 - _center) + TJAPlayer3.Skin.SongSelect_Bar_Count); i++) { CSongListNode song = this.rGetSideSong(i); - int index = ( i + TJAPlayer3.Skin.SongSelect_Bar_Count) % TJAPlayer3.Skin.SongSelect_Bar_Count; - for( int m = 0; m < 3; m++ ) - { - this.stバー情報[ index ].nスキル値[ m ] = (int) song.arスコア[ this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す( song ) ].譜面情報.最大スキル[ m ]; + int index = (i + TJAPlayer3.Skin.SongSelect_Bar_Count) % TJAPlayer3.Skin.SongSelect_Bar_Count; + for (int m = 0; m < 3; m++) { + this.stバー情報[index].nスキル値[m] = (int)song.arスコア[this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)].譜面情報.最大スキル[m]; } } @@ -833,26 +735,25 @@ namespace TJAPlayer3 /// 曲リストをリセットする /// /// - public void Refresh(CSongs管理 cs, bool bRemakeSongTitleBar ) // #26070 2012.2.28 yyagi + public void Refresh(CSongs管理 cs, bool bRemakeSongTitleBar) // #26070 2012.2.28 yyagi { -// this.On非活性化(); + // this.On非活性化(); - if ( cs != null && cs.list曲ルート.Count > 0 ) // 新しい曲リストを検索して、1曲以上あった + if (cs != null && cs.list曲ルート.Count > 0) // 新しい曲リストを検索して、1曲以上あった { TJAPlayer3.Songs管理 = cs; - if ( this.rCurrentlySelectedSong != null ) // r現在選択中の曲==null とは、「最初songlist.dbが無かった or 検索したが1曲もない」 + if (this.rCurrentlySelectedSong != null) // r現在選択中の曲==null とは、「最初songlist.dbが無かった or 検索したが1曲もない」 { - this.rCurrentlySelectedSong = searchCurrentBreadcrumbsPosition( TJAPlayer3.Songs管理.list曲ルート, this.rCurrentlySelectedSong.strBreadcrumbs ); - if ( bRemakeSongTitleBar ) // 選曲画面以外に居るときには再構成しない (非活性化しているときに実行すると例外となる) + this.rCurrentlySelectedSong = searchCurrentBreadcrumbsPosition(TJAPlayer3.Songs管理.list曲ルート, this.rCurrentlySelectedSong.strBreadcrumbs); + if (bRemakeSongTitleBar) // 選曲画面以外に居るときには再構成しない (非活性化しているときに実行すると例外となる) { this.t現在選択中の曲を元に曲バーを再構成する(); } return; } } - if (this.IsActivated) - { + if (this.IsActivated) { this.DeActivate(); this.rCurrentlySelectedSong = null; this.nSelectSongIndex = 0; @@ -868,18 +769,14 @@ namespace TJAPlayer3 /// 検索対象のList /// 検索するパンくずリスト(文字列) /// - private CSongListNode searchCurrentBreadcrumbsPosition( List ln, string bc ) - { - foreach (CSongListNode n in ln) - { - if ( n.strBreadcrumbs == bc ) - { + 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; + } else if (n.list子リスト != null && n.list子リスト.Count > 0) // 子リストが存在するなら、再帰で探す + { + CSongListNode r = searchCurrentBreadcrumbsPosition(n.list子リスト, bc); + if (r != null) return r; } } return null; @@ -888,35 +785,30 @@ namespace TJAPlayer3 /// /// BOXのアイテム数と、今何番目を選択しているかをセットする /// - public void t選択曲が変更された( bool bForce ) // #27648 + public void t選択曲が変更された(bool bForce) // #27648 { CSongListNode song = TJAPlayer3.stageSongSelect.rNowSelectedSong; - if ( song == null ) + if (song == null) return; - if ( song == song_last && bForce == false ) + if (song == song_last && bForce == false) return; - + song_last = song; - List list =TJAPlayer3.Songs管理.list曲ルート; - int index = list.IndexOf( song ) + 1; - if ( index <= 0 ) - { + List list = TJAPlayer3.Songs管理.list曲ルート; + int index = list.IndexOf(song) + 1; + if (index <= 0) { nCurrentPosition = nNumOfItems = 0; - } - else - { + } else { nCurrentPosition = index; nNumOfItems = list.Count; } - TJAPlayer3.stageSongSelect.act演奏履歴パネル.tSongChange(); + TJAPlayer3.stageSongSelect.act演奏履歴パネル.tSongChange(); } // CActivity 実装 - async public void tLoadPads() - { - while (bIsEnumeratingSongs) - { + async public void tLoadPads() { + while (bIsEnumeratingSongs) { await Task.Delay(100); } @@ -924,18 +816,16 @@ namespace TJAPlayer3 } - public override void Activate() - { - if( this.IsActivated ) + public override void Activate() { + if (this.IsActivated) return; - if (!bFirstCrownLoad) - { + if (!bFirstCrownLoad) { // tLoadPads(); - + // Calculate Pads asynchonously new Task(tLoadPads).Start(); - + bFirstCrownLoad = true; } @@ -944,24 +834,24 @@ namespace TJAPlayer3 TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect = false; - this.pfBoxName = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.SongSelect_BoxName_Scale); - this.pfMusicName = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.SongSelect_MusicName_Scale); - this.pfSubtitle = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.SongSelect_Subtitle_Scale); - this.pfMaker = HPrivateFastFont.tInstantiateBoxFont(TJAPlayer3.Skin.SongSelect_Maker_Size); - this.pfBoxText = HPrivateFastFont.tInstantiateBoxFont(TJAPlayer3.Skin.SongSelect_BoxText_Scale); - this.pfBPM = HPrivateFastFont.tInstantiateBoxFont(TJAPlayer3.Skin.SongSelect_BPM_Text_Size); + this.pfBoxName = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.SongSelect_BoxName_Scale); + this.pfMusicName = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.SongSelect_MusicName_Scale); + this.pfSubtitle = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.SongSelect_Subtitle_Scale); + this.pfMaker = HPrivateFastFont.tInstantiateBoxFont(TJAPlayer3.Skin.SongSelect_Maker_Size); + this.pfBoxText = HPrivateFastFont.tInstantiateBoxFont(TJAPlayer3.Skin.SongSelect_BoxText_Scale); + this.pfBPM = HPrivateFastFont.tInstantiateBoxFont(TJAPlayer3.Skin.SongSelect_BPM_Text_Size); - this.b登場アニメ全部完了 = false; + this.b登場アニメ全部完了 = false; this.ctScrollCounter = new CCounter(0, 1000, TJAPlayer3.Skin.SongSelect_Scroll_Interval, TJAPlayer3.Timer); // フォント作成。 // 曲リスト文字は2倍(面積4倍)でテクスチャに描画してから縮小表示するので、フォントサイズは2倍とする。 - + // 現在選択中の曲がない(=はじめての活性化)なら、現在選択中の曲をルートの先頭ノードに設定する。 - if( ( this.rCurrentlySelectedSong == null ) && ( TJAPlayer3.Songs管理.list曲ルート.Count > 0 ) ) - this.rCurrentlySelectedSong = TJAPlayer3.Songs管理.list曲ルート[ 0 ]; + if ((this.rCurrentlySelectedSong == null) && (TJAPlayer3.Songs管理.list曲ルート.Count > 0)) + this.rCurrentlySelectedSong = TJAPlayer3.Songs管理.list曲ルート[0]; this.tバーの初期化(); @@ -976,82 +866,71 @@ namespace TJAPlayer3 this.ctScoreFrameAnime = new CCounter(); // strboxText here - if (this.rCurrentlySelectedSong != null) - { - #region [Box text] + 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) => !TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(song)); - _append = " ({0}/{1})".SafeFormat(countUnlockedSongs, countTotalSongs); - } + string _append = ""; + if (HSongTraverse.IsRegularFolder(rCurrentlySelectedSong)) { + int countTotalSongs = HSongTraverse.GetSongsMatchingCondition(rCurrentlySelectedSong, (_) => true); + int countUnlockedSongs = HSongTraverse.GetSongsMatchingCondition(rCurrentlySelectedSong, (song) => !TJAPlayer3.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 - }; + 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] = TJAPlayer3.tテクスチャの生成(texture); - this.strBoxText = boxText[0] + boxText[1] + boxText[2]; - } - } - } + 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] = TJAPlayer3.tテクスチャの生成(texture); + this.strBoxText = boxText[0] + boxText[1] + boxText[2]; + } + } + } - #endregion - } - else - { + #endregion + } else { strBoxText = "null"; } - for( int i = 0; i < TJAPlayer3.Skin.SongSelect_Bar_Count; i++ ) - { - this.stバー情報[ i ].ttkタイトル = this.ttk曲名テクスチャを生成する( this.stバー情報[ i ].strタイトル文字列, this.stバー情報[i].ForeColor, this.stバー情報[i].BackColor, stバー情報[i].eバー種別 == Eバー種別.Box ? this.pfBoxName : this.pfMusicName); - } + for (int i = 0; i < TJAPlayer3.Skin.SongSelect_Bar_Count; i++) { + this.stバー情報[i].ttkタイトル = this.ttk曲名テクスチャを生成する(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 選曲画面に入った直後の 現在位置/全アイテム数 の表示を正しく行うため + this.t選択曲が変更された(true); // #27648 2012.3.31 yyagi 選曲画面に入った直後の 現在位置/全アイテム数 の表示を正しく行うため } - public override void DeActivate() - { - if( this.IsDeActivated ) + public override void DeActivate() { + if (this.IsDeActivated) return; - TJAPlayer3.tDisposeSafely(ref pfBoxName); - TJAPlayer3.tDisposeSafely(ref pfMusicName); - TJAPlayer3.tDisposeSafely(ref pfSubtitle); + TJAPlayer3.tDisposeSafely(ref pfBoxName); + TJAPlayer3.tDisposeSafely(ref pfMusicName); + TJAPlayer3.tDisposeSafely(ref pfSubtitle); TJAPlayer3.tDisposeSafely(ref pfMaker); - TJAPlayer3.tDisposeSafely(ref pfBPM); + TJAPlayer3.tDisposeSafely(ref pfBPM); tResetTitleKey(); - ClearTitleTextureCache(); + ClearTitleTextureCache(); this.ct三角矢印アニメ = null; base.DeActivate(); } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { this.ft曲リスト用フォント = HPrivateFastFont.tInstantiateMainFont(40); - int c = ( CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "ja" ) ? 0 : 1; + int c = (CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "ja") ? 0 : 1; #region [ Songs not found画像 ] - try - { + 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 ); // 半分のサイズで表示する。 + this.txSongNotFound.vcScaleRatio = new Vector3D(0.5f, 0.5f, 1f); // 半分のサイズで表示する。 /* using( Bitmap image = new Bitmap( 640, 128 ) ) @@ -1071,19 +950,16 @@ namespace TJAPlayer3 } */ - } - catch( CTextureCreateFailedException e ) - { - Trace.TraceError( e.ToString() ); - Trace.TraceError( "SoungNotFoundテクスチャの作成に失敗しました。" ); + } catch (CTextureCreateFailedException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("SoungNotFoundテクスチャの作成に失敗しました。"); this.txSongNotFound = null; } #endregion #region [ "曲データを検索しています"画像 ] - try - { + try { this.txEnumeratingSongs = new CTexture(ft曲リスト用フォント.DrawText("Now enumerating songs.\nPlease wait...", Color.White)); - this.txEnumeratingSongs.vcScaleRatio = new Vector3D( 0.5f, 0.5f, 1f ); // 半分のサイズで表示する。 + this.txEnumeratingSongs.vcScaleRatio = new Vector3D(0.5f, 0.5f, 1f); // 半分のサイズで表示する。 /* using ( Bitmap image = new Bitmap( 640, 96 ) ) @@ -1101,11 +977,9 @@ namespace TJAPlayer3 this.txEnumeratingSongs.vc拡大縮小倍率 = new Vector3D( 0.5f, 0.5f, 1f ); // 半分のサイズで表示する。 } */ - } - catch ( CTextureCreateFailedException e ) - { - Trace.TraceError( e.ToString() ); - Trace.TraceError( "txEnumeratingSongsテクスチャの作成に失敗しました。" ); + } catch (CTextureCreateFailedException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("txEnumeratingSongsテクスチャの作成に失敗しました。"); this.txEnumeratingSongs = null; } #endregion @@ -1115,30 +989,26 @@ namespace TJAPlayer3 base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { - TJAPlayer3.tDisposeSafely( ref this.ft曲リスト用フォント ); + public override void ReleaseManagedResource() { + TJAPlayer3.tDisposeSafely(ref this.ft曲リスト用フォント); - for( int i = 0; i < TJAPlayer3.Skin.SongSelect_Bar_Count; i++ ) - { - TJAPlayer3.tテクスチャの解放( ref this.stバー情報[ i ].txタイトル名 ); - this.stバー情報[ i ].ttkタイトル = null; - } + for (int i = 0; i < TJAPlayer3.Skin.SongSelect_Bar_Count; i++) { + TJAPlayer3.tテクスチャの解放(ref this.stバー情報[i].txタイトル名); + this.stバー情報[i].ttkタイトル = null; + } - TJAPlayer3.tテクスチャの解放( ref this.txEnumeratingSongs ); - TJAPlayer3.tテクスチャの解放( ref this.txSongNotFound ); + TJAPlayer3.tテクスチャの解放(ref this.txEnumeratingSongs); + TJAPlayer3.tテクスチャの解放(ref this.txSongNotFound); base.ReleaseManagedResource(); } - public override int Draw() - { + public override int Draw() { if (this.IsDeActivated) return 0; #region [ 初めての進行描画 ] //----------------- - if (this.IsFirstDraw) - { + if (this.IsFirstDraw) { TJAPlayer3.stageSongSelect.tNotifySelectedSongChange(); ctBarOpen.Start(0, 260, 2, TJAPlayer3.Timer); @@ -1162,26 +1032,20 @@ namespace TJAPlayer3 // まだ選択中の曲が決まってなければ、曲ツリールートの最初の曲にセットする。 - if ((this.rCurrentlySelectedSong == null) && (TJAPlayer3.Songs管理.list曲ルート.Count > 0)) - { + if ((this.rCurrentlySelectedSong == null) && (TJAPlayer3.Songs管理.list曲ルート.Count > 0)) { nSelectSongIndex = 0; this.rCurrentlySelectedSong = TJAPlayer3.Songs管理.list曲ルート[nSelectSongIndex]; } // 描画。 - if (this.rCurrentlySelectedSong == null) - { + if (this.rCurrentlySelectedSong == null) { #region [Songs not found / Enumerating song screens] //----------------- - if (bIsEnumeratingSongs) - { - if (this.txEnumeratingSongs != null) - { + if (bIsEnumeratingSongs) { + if (this.txEnumeratingSongs != null) { this.txEnumeratingSongs.t2D描画(320, 160); } - } - else - { + } else { if (this.txSongNotFound != null) this.txSongNotFound.t2D描画(320, 160); } @@ -1191,31 +1055,27 @@ namespace TJAPlayer3 return 0; } - // 本ステージは、(1)登場アニメフェーズ → (2)通常フェーズ と二段階にわけて進む。 + // 本ステージは、(1)登場アニメフェーズ → (2)通常フェーズ と二段階にわけて進む。 - #region [Box text] + #region [Box text] - string _append = ""; - if (HSongTraverse.IsRegularFolder(rCurrentlySelectedSong)) - { + string _append = ""; + if (HSongTraverse.IsRegularFolder(rCurrentlySelectedSong)) { int countTotalSongs = HSongTraverse.GetSongsMatchingCondition(rCurrentlySelectedSong, (_) => true); int countUnlockedSongs = HSongTraverse.GetSongsMatchingCondition(rCurrentlySelectedSong, (song) => !TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(song)); - _append = " ({0}/{1})".SafeFormat(countUnlockedSongs, countTotalSongs); - } + _append = " ({0}/{1})".SafeFormat(countUnlockedSongs, countTotalSongs); + } string[] boxText = new string[3] { - rCurrentlySelectedSong.strBoxText[0].GetString(""), - rCurrentlySelectedSong.strBoxText[1].GetString(""), - rCurrentlySelectedSong.strBoxText[2].GetString("") + _append - }; + 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)) - { + 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] = TJAPlayer3.tテクスチャの生成(texture); this.strBoxText = boxText[0] + boxText[1] + boxText[2]; } @@ -1236,8 +1096,7 @@ namespace TJAPlayer3 int barCenterNum = (TJAPlayer3.Skin.SongSelect_Bar_Count - 1) / 2; - if (this.ctScrollCounter.CurrentValue == this.ctScrollCounter.EndValue) - { + if (this.ctScrollCounter.CurrentValue == this.ctScrollCounter.EndValue) { nNowChange = 0; } @@ -1294,11 +1153,11 @@ namespace TJAPlayer3 */ #endregion - + // x set here - int xAnime = xZahyou + (int)((xNextZahyou - xZahyou) + int xAnime = xZahyou + (int)((xNextZahyou - xZahyou) * (1.0 - fNowScrollAnime)); - + int y = yZahyou + (int)((yNextZahyou - yZahyou) * (1.0 - fNowScrollAnime)); @@ -1307,43 +1166,39 @@ namespace TJAPlayer3 float Box = 0; float Box_X = 0; float Box_Y = 0; - int _center = (TJAPlayer3.Skin.SongSelect_Bar_Count - 1) / 2; + int _center = (TJAPlayer3.Skin.SongSelect_Bar_Count - 1) / 2; float[] _boxAim = new float[2] { - TJAPlayer3.Skin.SongSelect_Bar_Anim_X[i], - TJAPlayer3.Skin.SongSelect_Bar_Anim_Y[i] - }; + TJAPlayer3.Skin.SongSelect_Bar_Anim_X[i], + TJAPlayer3.Skin.SongSelect_Bar_Anim_Y[i] + }; int _movfs = i - 1; int _maxfs = _center - 1; int _gap = Math.Max(1, TJAPlayer3.Skin.SongSelect_Bar_Count - 3); - #region [ BoxOpenAnime ] + #region [ BoxOpenAnime ] - if (i != _center && i != 0 && i < TJAPlayer3.Skin.SongSelect_Bar_Count - 1) - { - if (ctBoxOpen.CurrentValue >= 1000 && ctBoxOpen.CurrentValue <= 1560) - { + if (i != _center && i != 0 && i < TJAPlayer3.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_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); + } + 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); + 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]; - } + 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] @@ -1476,16 +1331,15 @@ namespace TJAPlayer3 bar_genre.vcScaleRatio.X = 1.0f; if (bar_genre_overlap != null) - bar_genre_overlap.vcScaleRatio.X = 1.0f; + bar_genre_overlap.vcScaleRatio.X = 1.0f; - TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.vcScaleRatio.X = 1.0f; + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.vcScaleRatio.X = 1.0f; TJAPlayer3.Tx.SongSelect_Bar_Genre_Back.vcScaleRatio.X = 1.0f; TJAPlayer3.Tx.SongSelect_Bar_Genre_Random.vcScaleRatio.X = 1.0f; - if (ctScrollCounter.CurrentValue != ctScrollCounter.EndValue || n見た目の行番号 != barCenterNum) - { + if (ctScrollCounter.CurrentValue != ctScrollCounter.EndValue || n見た目の行番号 != barCenterNum) { int songType = 0; if (this.stバー情報[nパネル番号].ar難易度[(int)Difficulty.Dan] >= 0) songType = 1; @@ -1499,14 +1353,14 @@ namespace TJAPlayer3 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, + this.stバー情報[nパネル番号].strジャンル, + stバー情報[nパネル番号].eバー種別, + stバー情報[nパネル番号].nクリア, + stバー情報[nパネル番号].nスコアランク, + boxType, songType, stバー情報[nパネル番号].csu, - stバー情報[nパネル番号].reference); + stバー情報[nパネル番号].reference); } /* @@ -1531,208 +1385,187 @@ namespace TJAPlayer3 else if (n見た目の行番号 != barCenterNum) ResolveTitleTexture(this.stバー情報[nパネル番号].ttkタイトル, TJAPlayer3.Skin.SongSelect_VerticalText).t2D拡大率考慮中央基準描画( xAnime - Box_X + GetTitleOffsetX(this.stバー情報[nパネル番号].eバー種別), y - Box_Y + GetTitleOffsetY(this.stバー情報[nパネル番号].eバー種別)); - #endregion + #endregion - var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(stバー情報[nパネル番号].reference); - var HiddenIndex = TJAPlayer3.Databases.DBSongUnlockables.tGetSongHiddenIndex(stバー情報[nパネル番号].reference); + var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(stバー情報[nパネル番号].reference); + var HiddenIndex = TJAPlayer3.Databases.DBSongUnlockables.tGetSongHiddenIndex(stバー情報[nパネル番号].reference); - if (HiddenIndex == DBSongUnlockables.EHiddenIndex.GRAYED) - { - TJAPlayer3.Tx.SongSelect_Bar_Genre_Locked_Top?.t2D描画(xAnime - (int)Box_X, y - ((int)Box_Y)); - } - + if (HiddenIndex == DBSongUnlockables.EHiddenIndex.GRAYED) { + TJAPlayer3.Tx.SongSelect_Bar_Genre_Locked_Top?.t2D描画(xAnime - (int)Box_X, y - ((int)Box_Y)); + } - //----------------- - } + + //----------------- + } #endregion - + if (TJAPlayer3.Skin.SongSelect_Bar_Select_Skip_Fade || - this.ctScrollCounter.CurrentValue == this.ctScrollCounter.EndValue) - { - #region [ Bar_Select ] + this.ctScrollCounter.CurrentValue == this.ctScrollCounter.EndValue) { + #region [ Bar_Select ] - int barSelect_width = TJAPlayer3.Tx.SongSelect_Bar_Select.sz画像サイズ.Width; - int barSelect_height = TJAPlayer3.Tx.SongSelect_Bar_Select.sz画像サイズ.Height / 2; + int barSelect_width = TJAPlayer3.Tx.SongSelect_Bar_Select.sz画像サイズ.Width; + int barSelect_height = TJAPlayer3.Tx.SongSelect_Bar_Select.sz画像サイズ.Height / 2; - if (ctBarFlash.IsEnded && !TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) - { - TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(BarAnimeCount * 255.0f); - if (TJAPlayer3.Skin.SongSelect_Bar_Select_Skip_Fade) - TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = 255; + if (ctBarFlash.IsEnded && !TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) { + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(BarAnimeCount * 255.0f); + if (TJAPlayer3.Skin.SongSelect_Bar_Select_Skip_Fade) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = 255; - } - else - TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 700) * 2.55f); + } else + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 700) * 2.55f); - TJAPlayer3.Tx.SongSelect_Bar_Select.t2D描画(TJAPlayer3.Skin.SongSelect_Bar_Select[0], TJAPlayer3.Skin.SongSelect_Bar_Select[1], new Rectangle(0, 0, barSelect_width, barSelect_height)); + TJAPlayer3.Tx.SongSelect_Bar_Select.t2D描画(TJAPlayer3.Skin.SongSelect_Bar_Select[0], TJAPlayer3.Skin.SongSelect_Bar_Select[1], new Rectangle(0, 0, barSelect_width, barSelect_height)); - #region [ BarFlash ] + #region [ BarFlash ] - if (ctBarFlash.CurrentValue <= 100) - TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(ctBarFlash.CurrentValue * 2.55f); - else if (ctBarFlash.CurrentValue <= 200) - TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 100) * 2.55f); - else if (ctBarFlash.CurrentValue <= 300) - TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)((ctBarFlash.CurrentValue - 200) * 2.55f); - else if (ctBarFlash.CurrentValue <= 400) - TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 300) * 2.55f); - else if (ctBarFlash.CurrentValue <= 500) - TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)((ctBarFlash.CurrentValue - 400) * 2.55f); - else if (ctBarFlash.CurrentValue <= 600) - TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 500) * 2.55f); - else if (ctBarFlash.CurrentValue <= 700) - TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)((ctBarFlash.CurrentValue - 600) * 2.55f); - else if (ctBarFlash.CurrentValue <= 800) - TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 700) * 2.55f); - else - TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = 0; + if (ctBarFlash.CurrentValue <= 100) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(ctBarFlash.CurrentValue * 2.55f); + else if (ctBarFlash.CurrentValue <= 200) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 100) * 2.55f); + else if (ctBarFlash.CurrentValue <= 300) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)((ctBarFlash.CurrentValue - 200) * 2.55f); + else if (ctBarFlash.CurrentValue <= 400) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 300) * 2.55f); + else if (ctBarFlash.CurrentValue <= 500) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)((ctBarFlash.CurrentValue - 400) * 2.55f); + else if (ctBarFlash.CurrentValue <= 600) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 500) * 2.55f); + else if (ctBarFlash.CurrentValue <= 700) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)((ctBarFlash.CurrentValue - 600) * 2.55f); + else if (ctBarFlash.CurrentValue <= 800) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 700) * 2.55f); + else + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = 0; - TJAPlayer3.Tx.SongSelect_Bar_Select.t2D描画(TJAPlayer3.Skin.SongSelect_Bar_Select[0], TJAPlayer3.Skin.SongSelect_Bar_Select[1], new Rectangle(0, barSelect_height, barSelect_width, barSelect_height)); + TJAPlayer3.Tx.SongSelect_Bar_Select.t2D描画(TJAPlayer3.Skin.SongSelect_Bar_Select[0], TJAPlayer3.Skin.SongSelect_Bar_Select[1], new Rectangle(0, barSelect_height, barSelect_width, barSelect_height)); - #endregion + #endregion - #endregion - } + #endregion + } - if (this.ctScrollCounter.CurrentValue == this.ctScrollCounter.EndValue) - { - #region [ Draw BarCenter ] - - - - if (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) - { - #region [ Score ] - - var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(rCurrentlySelectedSong); - var HiddenIndex = TJAPlayer3.Databases.DBSongUnlockables.tGetSongHiddenIndex(rCurrentlySelectedSong); - - #region [ Bar ] - - if (HiddenIndex == DBSongUnlockables.EHiddenIndex.GRAYED) - { - DrawBarCenter(TJAPlayer3.Tx.SongSelect_Bar_Genre_Locked, TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum], TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, false, false); - } - else - { - var bar_genre = HGenreBar.tGetGenreBar(rCurrentlySelectedSong.BoxType, TJAPlayer3.Tx.SongSelect_Bar_Genre); - var bar_genre_overlap = HGenreBar.tGetGenreBar(rCurrentlySelectedSong.BoxType, TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlap); - - DrawBarCenter(bar_genre, TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum], TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, true, false, false); - DrawBarCenter(bar_genre_overlap, TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum], TJAPlayer3.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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (i >= 2) continue; - - int ap = TJAPlayer3.GetActualPlayer(i); - - var TableEntry = TJAPlayer3.SaveFileInstances[ap].data.tGetSongSelectTableEntry(rCurrentlySelectedSong.tGetUniqueId()); - - int[] clear = TableEntry.ClearStatuses; - - int currentRank = Math.Min(clear[(int)Difficulty.Dan], 8) - 3; - - int x = TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum] + TJAPlayer3.Skin.SongSelect_DanStatus_Offset_X[i]; - int y = TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum] + TJAPlayer3.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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (i >= 2) continue; - - int ap = TJAPlayer3.GetActualPlayer(i); - var TableEntry = TJAPlayer3.SaveFileInstances[ap].data.tGetSongSelectTableEntry(rCurrentlySelectedSong.tGetUniqueId()); - - int[] clear = TableEntry.ClearStatuses; - - int currentRank = Math.Min(clear[(int)Difficulty.Tower], 8) - 2; - - int x = TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum] + TJAPlayer3.Skin.SongSelect_TowerStatus_Offset_X[i]; - int y = TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum] + TJAPlayer3.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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (i >= 2) continue; - - int ap = TJAPlayer3.GetActualPlayer(i); - var TableEntry = TJAPlayer3.SaveFileInstances[ap].data.tGetSongSelectTableEntry(TJAPlayer3.stageSongSelect.rNowSelectedSong.tGetUniqueId()); - - int[] クリア = TableEntry.ClearStatuses; - - int[] スコアランク = TableEntry.ScoreRanks; - - int x = TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum] + TJAPlayer3.Skin.SongSelect_RegularCrowns_Offset_X[i]; - int y = TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum] + TJAPlayer3.Skin.SongSelect_RegularCrowns_Offset_Y[i]; - - displayRegularCrowns((int)(x - centerMoveX / 1.1f), (int)(y - centerMove / 1.1f), クリア, スコアランク, 0.8f + BarAnimeCount / 620f); - - } - } + if (this.ctScrollCounter.CurrentValue == this.ctScrollCounter.EndValue) { + #region [ Draw BarCenter ] - #endregion - #region [Favorite status and Locked icon] + if (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) { + #region [ Score ] - if (IsSongLocked) - { - displayVisibleLockStatus( - (int)(TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum] + TJAPlayer3.Skin.SongSelect_FavoriteStatus_Offset[0] - centerMoveX / 1.1f), - (int)(TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum] + TJAPlayer3.Skin.SongSelect_FavoriteStatus_Offset[1] - centerMove / 1.1f), 1f); - } - else - { - displayFavoriteStatus( - (int)(TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum] + TJAPlayer3.Skin.SongSelect_FavoriteStatus_Offset[0] - centerMoveX / 1.1f), - (int)(TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum] + TJAPlayer3.Skin.SongSelect_FavoriteStatus_Offset[1] - centerMove / 1.1f), this.rCurrentlySelectedSong.uniqueId, 1f + BarAnimeCount / 620f); - } - #endregion + var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(rCurrentlySelectedSong); + var HiddenIndex = TJAPlayer3.Databases.DBSongUnlockables.tGetSongHiddenIndex(rCurrentlySelectedSong); - #region [Level number big] + #region [ Bar ] - tPrintLevelNumberBig( - (int)(TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum] + TJAPlayer3.Skin.SongSelect_Level_Offset[0] - centerMoveX / 1.1f), - (int)(TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum] + TJAPlayer3.Skin.SongSelect_Level_Offset[1] - centerMove / 1.1f), - this.rCurrentlySelectedSong - ); + if (HiddenIndex == DBSongUnlockables.EHiddenIndex.GRAYED) { + DrawBarCenter(TJAPlayer3.Tx.SongSelect_Bar_Genre_Locked, TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum], TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, false, false); + } else { + var bar_genre = HGenreBar.tGetGenreBar(rCurrentlySelectedSong.BoxType, TJAPlayer3.Tx.SongSelect_Bar_Genre); + var bar_genre_overlap = HGenreBar.tGetGenreBar(rCurrentlySelectedSong.BoxType, TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlap); - #endregion - } + DrawBarCenter(bar_genre, TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum], TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, true, false, false); + DrawBarCenter(bar_genre_overlap, TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum], TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, true, true); - #endregion + #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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (i >= 2) continue; + + int ap = TJAPlayer3.GetActualPlayer(i); + + var TableEntry = TJAPlayer3.SaveFileInstances[ap].data.tGetSongSelectTableEntry(rCurrentlySelectedSong.tGetUniqueId()); + + int[] clear = TableEntry.ClearStatuses; + + int currentRank = Math.Min(clear[(int)Difficulty.Dan], 8) - 3; + + int x = TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum] + TJAPlayer3.Skin.SongSelect_DanStatus_Offset_X[i]; + int y = TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum] + TJAPlayer3.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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (i >= 2) continue; + + int ap = TJAPlayer3.GetActualPlayer(i); + var TableEntry = TJAPlayer3.SaveFileInstances[ap].data.tGetSongSelectTableEntry(rCurrentlySelectedSong.tGetUniqueId()); + + int[] clear = TableEntry.ClearStatuses; + + int currentRank = Math.Min(clear[(int)Difficulty.Tower], 8) - 2; + + int x = TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum] + TJAPlayer3.Skin.SongSelect_TowerStatus_Offset_X[i]; + int y = TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum] + TJAPlayer3.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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (i >= 2) continue; + + int ap = TJAPlayer3.GetActualPlayer(i); + var TableEntry = TJAPlayer3.SaveFileInstances[ap].data.tGetSongSelectTableEntry(TJAPlayer3.stageSongSelect.rNowSelectedSong.tGetUniqueId()); + + int[] クリア = TableEntry.ClearStatuses; + + int[] スコアランク = TableEntry.ScoreRanks; + + int x = TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum] + TJAPlayer3.Skin.SongSelect_RegularCrowns_Offset_X[i]; + int y = TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum] + TJAPlayer3.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)(TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum] + TJAPlayer3.Skin.SongSelect_FavoriteStatus_Offset[0] - centerMoveX / 1.1f), + (int)(TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum] + TJAPlayer3.Skin.SongSelect_FavoriteStatus_Offset[1] - centerMove / 1.1f), 1f); + } else { + displayFavoriteStatus( + (int)(TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum] + TJAPlayer3.Skin.SongSelect_FavoriteStatus_Offset[0] - centerMoveX / 1.1f), + (int)(TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum] + TJAPlayer3.Skin.SongSelect_FavoriteStatus_Offset[1] - centerMove / 1.1f), this.rCurrentlySelectedSong.uniqueId, 1f + BarAnimeCount / 620f); + } + #endregion + + #region [Level number big] + + tPrintLevelNumberBig( + (int)(TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum] + TJAPlayer3.Skin.SongSelect_Level_Offset[0] - centerMoveX / 1.1f), + (int)(TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum] + TJAPlayer3.Skin.SongSelect_Level_Offset[1] - centerMove / 1.1f), + this.rCurrentlySelectedSong + ); + + #endregion + } + + #endregion - #endregion - } - if (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX) - { + #endregion + } + if (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX) { #region [ Box ] //int boxType = nStrジャンルtoNum(r現在選択中の曲.strジャンル); @@ -1741,22 +1574,20 @@ namespace TJAPlayer3 //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, TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum], TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, true, false, false); - DrawBarCenter(bar_genre_overlap, TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum], TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, true, false); + DrawBarCenter(bar_genre, TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum], TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, true, false, false); + DrawBarCenter(bar_genre_overlap, TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum], TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, true, false); - #endregion - } - if (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BACKBOX) - { + #endregion + } + if (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BACKBOX) { #region [ BackBox ] DrawBarCenter(TJAPlayer3.Tx.SongSelect_Bar_Genre_Back, TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum], TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, false, false); - + #endregion } - if (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.RANDOM) - { + if (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.RANDOM) { #region [Random box] DrawBarCenter(TJAPlayer3.Tx.SongSelect_Bar_Genre_Random, TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum], TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, false, false); @@ -1764,35 +1595,29 @@ namespace TJAPlayer3 #endregion } - #endregion + #endregion - switch (rCurrentlySelectedSong.eノード種別) - { - case CSongListNode.ENodeType.SCORE: - { - var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(rCurrentlySelectedSong); - var HiddenIndex = TJAPlayer3.Databases.DBSongUnlockables.tGetSongHiddenIndex(rCurrentlySelectedSong); + switch (rCurrentlySelectedSong.eノード種別) { + case CSongListNode.ENodeType.SCORE: { + var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(rCurrentlySelectedSong); + var HiddenIndex = TJAPlayer3.Databases.DBSongUnlockables.tGetSongHiddenIndex(rCurrentlySelectedSong); - #region [Difficulty bars] + #region [Difficulty bars] - if (TJAPlayer3.Tx.SongSelect_Frame_Score != null && HiddenIndex != DBSongUnlockables.EHiddenIndex.GRAYED) - { + if (TJAPlayer3.Tx.SongSelect_Frame_Score != null && HiddenIndex != DBSongUnlockables.EHiddenIndex.GRAYED) { // 難易度がTower、Danではない - if (TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度 != (int)Difficulty.Tower && TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度 != (int)Difficulty.Dan) - { - #region [Display difficulty boxes] + if (TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度 != (int)Difficulty.Tower && TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度 != (int)Difficulty.Dan) { + #region [Display difficulty boxes] - bool uraExists = TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Edit] >= 0; + bool uraExists = TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Edit] >= 0; bool omoteExists = TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Oni] >= 0; - for (int i = 0; i < (int)Difficulty.Edit + 1; i++) - { - if (ctBarOpen.CurrentValue >= 100 || TJAPlayer3.Skin.SongSelect_Shorten_Frame_Fade) - { - #region [Skip conditions] + for (int i = 0; i < (int)Difficulty.Edit + 1; i++) { + if (ctBarOpen.CurrentValue >= 100 || TJAPlayer3.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) + // 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 @@ -1818,11 +1643,10 @@ namespace TJAPlayer3 int opacity = 0; - if (avaliable && BarAnimeCount == 1.0) - { + if (avaliable && BarAnimeCount == 1.0) { if (ctScoreFrameAnime.CurrentValue <= 3000) opacity = Math.Max(0, ctScoreFrameAnime.CurrentValue - 2745); - else + else opacity = Math.Min(255, 255 - (ctScoreFrameAnime.CurrentValue - 5745)); } @@ -1832,31 +1656,27 @@ namespace TJAPlayer3 bool _switchingUra = i == (int)Difficulty.Edit && omoteExists; - int difSelectOpacity = (_switchingUra) ? (BarAnimeCount < 1.0 ? 0 : opacity) : (int)(BarAnimeCount * 255.0f); + int difSelectOpacity = (_switchingUra) ? (BarAnimeCount < 1.0 ? 0 : opacity) : (int)(BarAnimeCount * 255.0f); - if (TJAPlayer3.Skin.SongSelect_Shorten_Frame_Fade && !_switchingUra) - { - difSelectOpacity = 255; - } + if (TJAPlayer3.Skin.SongSelect_Shorten_Frame_Fade && !_switchingUra) { + difSelectOpacity = 255; + } - if (!TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect || ctDifficultyIn.CurrentValue < 1000) - { + if (!TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect || ctDifficultyIn.CurrentValue < 1000) { TJAPlayer3.Tx.SongSelect_Frame_Score[0].Opacity = difSelectOpacity; TJAPlayer3.Tx.SongSelect_Level_Number.Opacity = difSelectOpacity; - TJAPlayer3.Tx.SongSelect_Level_Number_Icon?.tUpdateOpacity(difSelectOpacity); - TJAPlayer3.Tx.SongSelect_Level_Number_Colored?.tUpdateOpacity(difSelectOpacity); - if (TJAPlayer3.Tx.SongSelect_Level != null) TJAPlayer3.Tx.SongSelect_Level.Opacity = difSelectOpacity; - } - else if (ctDifficultyIn.CurrentValue >= 1000) - { + TJAPlayer3.Tx.SongSelect_Level_Number_Icon?.tUpdateOpacity(difSelectOpacity); + TJAPlayer3.Tx.SongSelect_Level_Number_Colored?.tUpdateOpacity(difSelectOpacity); + if (TJAPlayer3.Tx.SongSelect_Level != null) TJAPlayer3.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)); TJAPlayer3.Tx.SongSelect_Frame_Score[0].Opacity = difInOpacity; TJAPlayer3.Tx.SongSelect_Level_Number.Opacity = difInOpacity; - TJAPlayer3.Tx.SongSelect_Level_Number_Icon?.tUpdateOpacity(difInOpacity); - TJAPlayer3.Tx.SongSelect_Level_Number_Colored?.tUpdateOpacity(difInOpacity); - if (TJAPlayer3.Tx.SongSelect_Level != null) TJAPlayer3.Tx.SongSelect_Level.Opacity = difInOpacity; + TJAPlayer3.Tx.SongSelect_Level_Number_Icon?.tUpdateOpacity(difInOpacity); + TJAPlayer3.Tx.SongSelect_Level_Number_Colored?.tUpdateOpacity(difInOpacity); + if (TJAPlayer3.Tx.SongSelect_Level != null) TJAPlayer3.Tx.SongSelect_Level.Opacity = difInOpacity; } #endregion @@ -1871,21 +1691,18 @@ namespace TJAPlayer3 TJAPlayer3.Tx.SongSelect_Frame_Score[0].t2D描画(TJAPlayer3.Skin.SongSelect_Frame_Score_X[displayingDiff], TJAPlayer3.Skin.SongSelect_Frame_Score_Y[displayingDiff], new Rectangle(width * i, 0, width, height)); - if (avaliable) - { + if (avaliable) { t小文字表示(TJAPlayer3.Skin.SongSelect_Level_Number_X[displayingDiff], TJAPlayer3.Skin.SongSelect_Level_Number_Y[displayingDiff], TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i], i, - TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nLevelIcon[i] - ); + TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nLevelIcon[i] + ); - if (TJAPlayer3.Tx.SongSelect_Level != null) - { + if (TJAPlayer3.Tx.SongSelect_Level != null) { int level_width = TJAPlayer3.Tx.SongSelect_Level.szTextureSize.Width / 7; int level_height = TJAPlayer3.Tx.SongSelect_Level.szTextureSize.Height; - for (int i2 = 0; i2 < TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i]; i2++) - { + for (int i2 = 0; i2 < TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i]; i2++) { TJAPlayer3.Tx.SongSelect_Level.t2D描画( TJAPlayer3.Skin.SongSelect_Level_X[displayingDiff] + (TJAPlayer3.Skin.SongSelect_Level_Move[0] * i2), TJAPlayer3.Skin.SongSelect_Level_Y[displayingDiff] + (TJAPlayer3.Skin.SongSelect_Level_Move[1] * i2), @@ -1893,32 +1710,29 @@ namespace TJAPlayer3 } } - if (TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.b譜面分岐[i]) - { - TJAPlayer3.Tx.SongSelect_Branch?.tUpdateOpacity(TJAPlayer3.Tx.SongSelect_Frame_Score[0].Opacity); - TJAPlayer3.Tx.SongSelect_Branch?.t2D描画( - - TJAPlayer3.Skin.SongSelect_Frame_Score_X[displayingDiff] + TJAPlayer3.Skin.SongSelect_Branch_Offset[0], - TJAPlayer3.Skin.SongSelect_Frame_Score_Y[displayingDiff] + TJAPlayer3.Skin.SongSelect_Branch_Offset[1] - ); - } - - } + if (TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.b譜面分岐[i]) { + TJAPlayer3.Tx.SongSelect_Branch?.tUpdateOpacity(TJAPlayer3.Tx.SongSelect_Frame_Score[0].Opacity); + TJAPlayer3.Tx.SongSelect_Branch?.t2D描画( + + TJAPlayer3.Skin.SongSelect_Frame_Score_X[displayingDiff] + TJAPlayer3.Skin.SongSelect_Branch_Offset[0], + TJAPlayer3.Skin.SongSelect_Frame_Score_Y[displayingDiff] + TJAPlayer3.Skin.SongSelect_Branch_Offset[1] + ); + } + + } #endregion } } - #endregion + #endregion - } - else - { + } else { // diff : int (5 : Tower, 6 : Dan) - #region [Check if Dan or Tower] + #region [Check if Dan or Tower] - int diff = 5; + int diff = 5; if (TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度 == (int)Difficulty.Dan) diff = 6; @@ -1943,23 +1757,20 @@ namespace TJAPlayer3 if (TJAPlayer3.Skin.SongSelect_Shorten_Frame_Fade) difSelectOpacity = 255; - if (!TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect || ctDifficultyIn.CurrentValue < 1000) - { + if (!TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect || ctDifficultyIn.CurrentValue < 1000) { TJAPlayer3.Tx.SongSelect_Frame_Score[1].Opacity = difSelectOpacity; TJAPlayer3.Tx.SongSelect_Level_Number.Opacity = difSelectOpacity; - TJAPlayer3.Tx.SongSelect_Level_Number_Icon?.tUpdateOpacity(difSelectOpacity); - TJAPlayer3.Tx.SongSelect_Level_Number_Colored?.tUpdateOpacity(difSelectOpacity); - if (TJAPlayer3.Tx.SongSelect_Level != null) TJAPlayer3.Tx.SongSelect_Level.Opacity = difSelectOpacity; - } - else if (ctDifficultyIn.CurrentValue >= 1000) - { + TJAPlayer3.Tx.SongSelect_Level_Number_Icon?.tUpdateOpacity(difSelectOpacity); + TJAPlayer3.Tx.SongSelect_Level_Number_Colored?.tUpdateOpacity(difSelectOpacity); + if (TJAPlayer3.Tx.SongSelect_Level != null) TJAPlayer3.Tx.SongSelect_Level.Opacity = difSelectOpacity; + } else if (ctDifficultyIn.CurrentValue >= 1000) { int difInOpacity = (int)255.0f - (ctDifficultyIn.CurrentValue - 1000); TJAPlayer3.Tx.SongSelect_Frame_Score[1].Opacity = difInOpacity; TJAPlayer3.Tx.SongSelect_Level_Number.Opacity = difInOpacity; - TJAPlayer3.Tx.SongSelect_Level_Number_Icon?.tUpdateOpacity(difInOpacity); - TJAPlayer3.Tx.SongSelect_Level_Number_Colored?.tUpdateOpacity(difInOpacity); - if (TJAPlayer3.Tx.SongSelect_Level != null) TJAPlayer3.Tx.SongSelect_Level.Opacity = difInOpacity; + TJAPlayer3.Tx.SongSelect_Level_Number_Icon?.tUpdateOpacity(difInOpacity); + TJAPlayer3.Tx.SongSelect_Level_Number_Colored?.tUpdateOpacity(difInOpacity); + if (TJAPlayer3.Tx.SongSelect_Level != null) TJAPlayer3.Tx.SongSelect_Level.Opacity = difInOpacity; } #endregion @@ -1975,36 +1786,31 @@ namespace TJAPlayer3 var _level_number = (diff == 5) ? TJAPlayer3.Skin.SongSelect_Level_Number_Tower : TJAPlayer3.Skin.SongSelect_Level_Number_Tower; - if (avaliable) - { + if (avaliable) { t小文字表示(TJAPlayer3.Skin.SongSelect_Level_Number_X[displayingDiff], TJAPlayer3.Skin.SongSelect_Level_Number_Y[displayingDiff], TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[diff], diff, - TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nLevelIcon[diff] - ); + TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nLevelIcon[diff] + ); - if (diff == 5) - { + if (diff == 5) { var _sidet = TJAPlayer3.Tx.SongSelect_Tower_Side; - if (_sidet != null) - { - var _side = (TJAPlayer3.stageSongSelect.rNowSelectedSong.nSide == CDTX.ESide.eNormal) ? 0 : 1; + if (_sidet != null) { + var _side = (TJAPlayer3.stageSongSelect.rNowSelectedSong.nSide == CDTX.ESide.eNormal) ? 0 : 1; var _sc = _sidet.sz画像サイズ.Width / 2; - _sidet.t2D描画( + _sidet.t2D描画( TJAPlayer3.Skin.SongSelect_Tower_Side[0], - TJAPlayer3.Skin.SongSelect_Tower_Side[1], - new Rectangle(_side * _sc, 0, _sc, _sidet.sz画像サイズ.Height)); - } + TJAPlayer3.Skin.SongSelect_Tower_Side[1], + new Rectangle(_side * _sc, 0, _sc, _sidet.sz画像サイズ.Height)); + } - } + } - if (TJAPlayer3.Tx.SongSelect_Level != null) - { + if (TJAPlayer3.Tx.SongSelect_Level != null) { int level_width = TJAPlayer3.Tx.SongSelect_Level.szTextureSize.Width / 7; int level_height = TJAPlayer3.Tx.SongSelect_Level.szTextureSize.Height; - for (int i2 = 0; i2 < TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[diff]; i2++) - { + for (int i2 = 0; i2 < TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[diff]; i2++) { TJAPlayer3.Tx.SongSelect_Level?.t2D描画( TJAPlayer3.Skin.SongSelect_Level_X[displayingDiff] + (TJAPlayer3.Skin.SongSelect_Level_Move[0] * i2), TJAPlayer3.Skin.SongSelect_Level_Y[displayingDiff] + (TJAPlayer3.Skin.SongSelect_Level_Move[1] * i2), @@ -2020,23 +1826,19 @@ namespace TJAPlayer3 } - #endregion - } - break; + #endregion + } + break; - case CSongListNode.ENodeType.BOX: - { - #region [Box explanation] + case CSongListNode.ENodeType.BOX: { + #region [Box explanation] - for (int j = 0; j < 3; j++) - { - if (!ctBoxOpen.IsEnded && ctBoxOpen.CurrentValue != 0) - { + 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 + } else if (txBoxText[j] != null) this.txBoxText[j].Opacity = (int)(BarAnimeCount * 255.0f); @@ -2046,19 +1848,18 @@ namespace TJAPlayer3 this.txBoxText[j].t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.SongSelect_BoxExplanation_X, TJAPlayer3.Skin.SongSelect_BoxExplanation_Y + j * TJAPlayer3.Skin.SongSelect_BoxExplanation_Interval); } - #endregion + #endregion - #region [Box chara] + #region [Box chara] - var box_chara = HGenreBar.tGetGenreBar(rCurrentlySelectedSong.BoxChara, TJAPlayer3.Tx.SongSelect_Box_Chara); + var box_chara = HGenreBar.tGetGenreBar(rCurrentlySelectedSong.BoxChara, TJAPlayer3.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 - { + else { if (!TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) box_chara.Opacity = (int)(BarAnimeCount * 255.0f); else if (ctDifficultyIn.CurrentValue >= 1000) @@ -2095,15 +1896,12 @@ namespace TJAPlayer3 */ } - if (ctBoxOpen.CurrentValue >= 1620) - { - if (bBoxOpen) - { + if (ctBoxOpen.CurrentValue >= 1620) { + if (bBoxOpen) { this.tBOXに入る(); bBoxOpen = false; } - if (bBoxClose) - { + if (bBoxClose) { this.tCloseBOX(); TJAPlayer3.stageSongSelect.bBGM再生済み = false; /* @@ -2116,8 +1914,7 @@ namespace TJAPlayer3 } } - if(ctDifficultyIn.CurrentValue >= ctDifficultyIn.EndValue) - { + if (ctDifficultyIn.CurrentValue >= ctDifficultyIn.EndValue) { ctDifficultyIn.Stop(); } @@ -2137,9 +1934,8 @@ namespace TJAPlayer3 int y = TJAPlayer3.Skin.SongSelect_Bar_Y[n見た目の行番号] + ((int)((TJAPlayer3.Skin.SongSelect_Bar_Y[n次のパネル番号] - TJAPlayer3.Skin.SongSelect_Bar_Y[n見た目の行番号]) * fNowScrollAnime)); - - if ((i == barCenterNum) && ctScrollCounter.CurrentValue == ctScrollCounter.EndValue) - { + + if ((i == barCenterNum) && ctScrollCounter.CurrentValue == ctScrollCounter.EndValue) { CTexture tx選択している曲のサブタイトル = null; // (A) スクロールが停止しているときの選択曲バーの描画。 @@ -2164,13 +1960,11 @@ namespace TJAPlayer3 //サブタイトルがあったら700 - if (ttk選択している曲の曲名 != null) - { + if (ttk選択している曲の曲名 != null) { if (!ctBoxOpen.IsEnded) ResolveTitleTexture(this.ttk選択している曲の曲名, TJAPlayer3.Skin.SongSelect_VerticalText).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 - { + else { if (!TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) ResolveTitleTexture(this.ttk選択している曲の曲名, TJAPlayer3.Skin.SongSelect_VerticalText).Opacity = 255; else if (ctDifficultyIn.CurrentValue >= 1000) @@ -2178,57 +1972,50 @@ namespace TJAPlayer3 } } - if (this.ttk選択している曲のサブタイトル != null) - { + if (this.ttk選択している曲のサブタイトル != null) { if (!ctBoxOpen.IsEnded) tx選択している曲のサブタイトル.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 - { + else { if (!TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) tx選択している曲のサブタイトル.Opacity = (int)(BarAnimeCount * 255.0f); - else if (ctDifficultyIn.CurrentValue >= 1000) - tx選択している曲のサブタイトル.Opacity = (int)255.0f - (ctDifficultyIn.CurrentValue - 1000); - } + else if (ctDifficultyIn.CurrentValue >= 1000) + tx選択している曲のサブタイトル.Opacity = (int)255.0f - (ctDifficultyIn.CurrentValue - 1000); + } tx選択している曲のサブタイトル.t2D拡大率考慮中央基準描画( - xAnime + TJAPlayer3.Skin.SongSelect_Bar_SubTitle_Offset[0] + (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMoveX : centerMoveX / 1.1f), + xAnime + TJAPlayer3.Skin.SongSelect_Bar_SubTitle_Offset[0] + (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMoveX : centerMoveX / 1.1f), y + TJAPlayer3.Skin.SongSelect_Bar_SubTitle_Offset[1] - (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMove : centerMove / 1.1f)); - - if (this.ttk選択している曲の曲名 != null) - { + + if (this.ttk選択している曲の曲名 != null) { ResolveTitleTexture(this.ttk選択している曲の曲名, TJAPlayer3.Skin.SongSelect_VerticalText).t2D拡大率考慮中央基準描画( xAnime + GetTitleOffsetX(rCurrentlySelectedSong.eノード種別) + (rCurrentlySelectedSong.eノード種別 != CSongListNode.ENodeType.BACKBOX ? (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMoveX : centerMoveX / 1.1f) : 0), - y + GetTitleOffsetY(rCurrentlySelectedSong.eノード種別) - + y + GetTitleOffsetY(rCurrentlySelectedSong.eノード種別) - (rCurrentlySelectedSong.eノード種別 != CSongListNode.ENodeType.BACKBOX ? (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMove : centerMove / 1.1f) : 0)); } - } - else - { - if (this.ttk選択している曲の曲名 != null) - { + } else { + if (this.ttk選択している曲の曲名 != null) { ResolveTitleTexture(this.ttk選択している曲の曲名, TJAPlayer3.Skin.SongSelect_VerticalText).t2D拡大率考慮中央基準描画( xAnime + GetTitleOffsetX(this.stバー情報[nパネル番号].eバー種別) + - (rCurrentlySelectedSong.eノード種別 != CSongListNode.ENodeType.BACKBOX ? (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMoveX : centerMoveX / 1.1f) : 0), + (rCurrentlySelectedSong.eノード種別 != CSongListNode.ENodeType.BACKBOX ? (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMoveX : centerMoveX / 1.1f) : 0), - y + GetTitleOffsetY(this.stバー情報[nパネル番号].eバー種別) - + y + GetTitleOffsetY(this.stバー情報[nパネル番号].eバー種別) - (rCurrentlySelectedSong.eノード種別 != CSongListNode.ENodeType.BACKBOX ? (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMove : centerMove / 1.1f) : 0)); } } - //----------------- - #endregion + //----------------- + #endregion - var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(rCurrentlySelectedSong); - var HiddenIndex = TJAPlayer3.Databases.DBSongUnlockables.tGetSongHiddenIndex(rCurrentlySelectedSong); + var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(rCurrentlySelectedSong); + var HiddenIndex = TJAPlayer3.Databases.DBSongUnlockables.tGetSongHiddenIndex(rCurrentlySelectedSong); - if (HiddenIndex == DBSongUnlockables.EHiddenIndex.GRAYED) - { - DrawBarCenter(TJAPlayer3.Tx.SongSelect_Bar_Genre_Locked_Top, TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum], TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, false, false); - //TJAPlayer3.Tx.SongSelect_Bar_Genre_Locked_Top?.t2D描画(); + if (HiddenIndex == DBSongUnlockables.EHiddenIndex.GRAYED) { + DrawBarCenter(TJAPlayer3.Tx.SongSelect_Bar_Genre_Locked_Top, TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum], TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, false, false); + //TJAPlayer3.Tx.SongSelect_Bar_Genre_Locked_Top?.t2D描画(); } - } + } } //----------------- @@ -2237,19 +2024,16 @@ namespace TJAPlayer3 return 0; } - public void tMenuContextView(eMenuContext emc) - { + 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) - { + if (emc == eMenuContext.SearchByDifficulty) { TJAPlayer3.Tx.SongSelect_Search_Window?.t2D描画(0, 0); int tileSize = 0; - if (TJAPlayer3.Tx.Dani_Difficulty_Cymbol != null) - { + if (TJAPlayer3.Tx.Dani_Difficulty_Cymbol != null) { tileSize = TJAPlayer3.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; TJAPlayer3.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画(TJAPlayer3.Skin.SongSelect_Search_Bar_X[0], TJAPlayer3.Skin.SongSelect_Search_Bar_Y[0], new Rectangle(tileSize * _contextVars[0], @@ -2257,19 +2041,15 @@ namespace TJAPlayer3 (_contextVars[0] == (int)Difficulty.Oni ? 2 : 1) * tileSize, tileSize)); } - - if (_contextVars[2] == 0) - { + + if (_contextVars[2] == 0) { TJAPlayer3.Tx.SongSelect_Search_Arrow_Glow?.t2D中心基準描画(TJAPlayer3.Skin.SongSelect_Search_Bar_X[0], TJAPlayer3.Skin.SongSelect_Search_Bar_Y[0]); - } - else if (_contextVars[2] == 1) - { + } else if (_contextVars[2] == 1) { TJAPlayer3.Tx.SongSelect_Search_Arrow?.t2D中心基準描画(TJAPlayer3.Skin.SongSelect_Search_Bar_X[0], TJAPlayer3.Skin.SongSelect_Search_Bar_Y[0]); TJAPlayer3.Tx.SongSelect_Search_Arrow_Glow?.t2D中心基準描画(TJAPlayer3.Skin.SongSelect_Search_Bar_X[1], TJAPlayer3.Skin.SongSelect_Search_Bar_Y[1]); - if (TJAPlayer3.Tx.SongSelect_Level_Icons != null) - { + if (TJAPlayer3.Tx.SongSelect_Level_Icons != null) { tileSize = TJAPlayer3.Tx.SongSelect_Level_Icons.szTextureSize.Height; TJAPlayer3.Tx.SongSelect_Level_Icons.t2D中心基準描画(TJAPlayer3.Skin.SongSelect_Search_Bar_X[1], TJAPlayer3.Skin.SongSelect_Search_Bar_Y[1], new Rectangle(tileSize * _contextVars[1], @@ -2277,21 +2057,18 @@ namespace TJAPlayer3 tileSize, tileSize)); } - + } - } + } // Context vars : // 0~4 - Selected difficulty (1~5P) // 5 - Current menu (0~4 for each player) - else if (emc == eMenuContext.Random) - { + else if (emc == eMenuContext.Random) { // To change with a new texture TJAPlayer3.Tx.SongSelect_Search_Window?.t2D描画(0, 0); - for (int i = 0; i <= _contextVars[5]; i++) - { - if (TJAPlayer3.Tx.Dani_Difficulty_Cymbol != null) - { + for (int i = 0; i <= _contextVars[5]; i++) { + if (TJAPlayer3.Tx.Dani_Difficulty_Cymbol != null) { var tileSize = TJAPlayer3.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; TJAPlayer3.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画(TJAPlayer3.Skin.SongSelect_Search_Bar_X[i], TJAPlayer3.Skin.SongSelect_Search_Bar_Y[i], new Rectangle(tileSize * _contextVars[i], @@ -2306,11 +2083,10 @@ namespace TJAPlayer3 else if (i == _contextVars[5]) TJAPlayer3.Tx.SongSelect_Search_Arrow_Glow?.t2D中心基準描画(TJAPlayer3.Skin.SongSelect_Search_Bar_X[i], TJAPlayer3.Skin.SongSelect_Search_Bar_Y[i]); } - } - } + } + } - public bool tMenuContextController(eMenuContext emc) - { + public bool tMenuContextController(eMenuContext emc) { tMenuContextView(emc); #region [Inputs] @@ -2318,23 +2094,17 @@ namespace TJAPlayer3 #region [Decide] if ((TJAPlayer3.Pad.bPressedDGB(EPad.Decide)) || - ((TJAPlayer3.ConfigIni.bEnterがキー割り当てのどこにも使用されていない && TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)))) - { - if (emc == eMenuContext.SearchByDifficulty) - { + ((TJAPlayer3.ConfigIni.bEnterがキー割り当てのどこにも使用されていない && TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)))) { + if (emc == eMenuContext.SearchByDifficulty) { TJAPlayer3.Skin.soundDecideSFX.tPlay(); _contextVars[2]++; - if (_contextVars[2] >= 2) - { + if (_contextVars[2] >= 2) { //tMenuContextDisable(); return true; - } - else if (_contextVars[2] == 1) - { + } else if (_contextVars[2] == 1) { // Set default level for each difficulty - switch (_contextVars[0]) - { + switch (_contextVars[0]) { case (int)Difficulty.Easy: _contextVars[1] = 1; break; @@ -2350,42 +2120,35 @@ namespace TJAPlayer3 } } - } - else if (emc == eMenuContext.Random) - { + } else if (emc == eMenuContext.Random) { TJAPlayer3.Skin.soundDecideSFX.tPlay(); _contextVars[5]++; if (_contextVars[5] >= TJAPlayer3.ConfigIni.nPlayerCount) return true; - if (_contextVars[5] >= 1 && TJAPlayer3.ConfigIni.bAIBattleMode) - { + if (_contextVars[5] >= 1 && TJAPlayer3.ConfigIni.bAIBattleMode) { _contextVars[1] = _contextVars[0]; - return true; + return true; } _contextVars[_contextVars[5]] = Math.Min((int)Difficulty.Oni, TJAPlayer3.ConfigIni.nDefaultCourse); - } + } } - #endregion + #endregion - #region [Left] + #region [Left] - else if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange) - || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) - { - if (emc == eMenuContext.SearchByDifficulty) - { + else if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange) + || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) { + if (emc == eMenuContext.SearchByDifficulty) { TJAPlayer3.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) - { + } else if (emc == eMenuContext.Random) { TJAPlayer3.Skin.soundChangeSFX.tPlay(); _contextVars[_contextVars[5]]--; @@ -2399,19 +2162,15 @@ namespace TJAPlayer3 #region [Right] else if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange) - || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) - { - if (emc == eMenuContext.SearchByDifficulty) - { + || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) { + if (emc == eMenuContext.SearchByDifficulty) { TJAPlayer3.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) - { + } else if (emc == eMenuContext.Random) { TJAPlayer3.Skin.soundChangeSFX.tPlay(); _contextVars[_contextVars[5]]++; @@ -2427,58 +2186,50 @@ namespace TJAPlayer3 return false; } - public void tMenuContextTrigger(eMenuContext emc) - { + public void tMenuContextTrigger(eMenuContext emc) { _contextVars = new int[10]; isContextBoxOpened = true; latestContext = emc; - } + } - public void tMenuContextDisable() - { + public void tMenuContextDisable() { isContextBoxOpened = false; latestContext = eMenuContext.NONE; - } + } - public int tMenuContextGetVar(int i) - { + 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 } + #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 class CScorePad { public int[] ScoreRankCount = new int[7]; public int[] CrownCount = new int[4]; - } + } - private struct STバー - { + private struct STバー { public CTexture Score; public CTexture Box; public CTexture Other; - public CTexture this[ int index ] - { - get - { - switch( index ) - { + public CTexture this[int index] { + get { + switch (index) { case 0: return this.Score; @@ -2490,10 +2241,8 @@ namespace TJAPlayer3 } throw new IndexOutOfRangeException(); } - set - { - switch( index ) - { + set { + switch (index) { case 0: this.Score = value; return; @@ -2511,15 +2260,14 @@ namespace TJAPlayer3 } } - private struct STバー情報 - { + 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 ForeColor; + public Color BackColor; public Color BoxColor; public Color BgColor; @@ -2533,17 +2281,17 @@ namespace TJAPlayer3 public int[] ar難易度; public CDTX.ELevelIcon[] nLevelIcon; - public bool[] b分岐; - public string strジャンル; - public string strサブタイトル; - public TitleTextureKey ttkタイトル; + 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; @@ -2559,18 +2307,18 @@ namespace TJAPlayer3 public bool b選択曲が変更された = true; private bool b登場アニメ全部完了; - private CCounter[] ct登場アニメ用 = new CCounter[ 13 ]; - private CCounter ct三角矢印アニメ; - private CCachedFontRenderer pfMusicName; - private CCachedFontRenderer pfSubtitle; + 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 CCachedFontRenderer pfBPM; + private CCachedFontRenderer pfBoxName; private string strBoxText; private CCachedFontRenderer pfBoxText; private CTexture[] txBoxText = new CTexture[3]; - + @@ -2593,25 +2341,23 @@ namespace TJAPlayer3 new Point(358, 485), new Point(386, 574), new Point(411, 665), new Point(436, 756) }; */ - private STバー情報[] stバー情報 = new STバー情報[TJAPlayer3.Skin.SongSelect_Bar_Count]; + private STバー情報[] stバー情報 = new STバー情報[TJAPlayer3.Skin.SongSelect_Bar_Count]; private CTexture txSongNotFound, txEnumeratingSongs; - private TitleTextureKey ttk選択している曲の曲名; - private TitleTextureKey ttk選択している曲のサブタイトル; + private TitleTextureKey ttk選択している曲の曲名; + private TitleTextureKey ttk選択している曲のサブタイトル; public TitleTextureKey ttkSelectedSongBPM; public TitleTextureKey ttkSelectedSongMaker; - private CTexture[] tx曲バー_難易度 = new CTexture[ 5 ]; + private CTexture[] tx曲バー_難易度 = new CTexture[5]; private int nCurrentPosition = 0; private int nNumOfItems = 0; private int nNowChange; - private int GetTitleOffsetX(Eバー種別 bar) - { - switch (bar) - { + private int GetTitleOffsetX(Eバー種別 bar) { + switch (bar) { case Eバー種別.Score: return TJAPlayer3.Skin.SongSelect_Bar_Title_Offset[0]; case Eバー種別.Box: @@ -2625,10 +2371,8 @@ namespace TJAPlayer3 } } - private int GetTitleOffsetX(CSongListNode.ENodeType node) - { - switch (node) - { + private int GetTitleOffsetX(CSongListNode.ENodeType node) { + switch (node) { case CSongListNode.ENodeType.SCORE: return TJAPlayer3.Skin.SongSelect_Bar_Title_Offset[0]; case CSongListNode.ENodeType.BOX: @@ -2642,10 +2386,8 @@ namespace TJAPlayer3 } } - private int GetTitleOffsetY(Eバー種別 bar) - { - switch (bar) - { + private int GetTitleOffsetY(Eバー種別 bar) { + switch (bar) { case Eバー種別.Score: return TJAPlayer3.Skin.SongSelect_Bar_Title_Offset[1]; case Eバー種別.Box: @@ -2659,10 +2401,8 @@ namespace TJAPlayer3 } } - private int GetTitleOffsetY(CSongListNode.ENodeType node) - { - switch (node) - { + private int GetTitleOffsetY(CSongListNode.ENodeType node) { + switch (node) { case CSongListNode.ENodeType.SCORE: return TJAPlayer3.Skin.SongSelect_Bar_Title_Offset[1]; case CSongListNode.ENodeType.BOX: @@ -2676,76 +2416,70 @@ namespace TJAPlayer3 } } - private void DrawBarCenter(CTexture texture, int x, int y, int moveX, int move, bool changeColor, bool drawOverlay, bool fullScaleOverlay) - { - CTexture overlay = TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay; + private void DrawBarCenter(CTexture texture, int x, int y, int moveX, int move, bool changeColor, bool drawOverlay, bool fullScaleOverlay) { + CTexture overlay = TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay; - float openAnime = 1; + float openAnime = 1; - if (ctBoxOpen.CurrentValue >= 1300 && ctBoxOpen.CurrentValue <= 1940) - { - openAnime -= (float)Math.Sin(((ctBoxOpen.CurrentValue - 1300) * 0.28125f) * (Math.PI / 180)) * 1.0f; - } + 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 = (TJAPlayer3.Skin.SongSelect_Bar_Center_Move_X * (1.0f - openAnime)); + float overlay_xoffset = ((overlay.szTextureSize.Width / 3) * (1.0f - openAnime)); + float moveX_xoffset = (TJAPlayer3.Skin.SongSelect_Bar_Center_Move_X * (1.0f - openAnime)); - int width = overlay.sz画像サイズ.Width / 3; - int height = overlay.sz画像サイズ.Height / 3; + int width = overlay.sz画像サイズ.Width / 3; + int height = overlay.sz画像サイズ.Height / 3; - if (texture != null) - { - if (changeColor) - { - texture.color4 = CConversion.ColorToColor4(rCurrentlySelectedSong.BoxColor); - } + if (texture != null) { + if (changeColor) { + texture.color4 = CConversion.ColorToColor4(rCurrentlySelectedSong.BoxColor); + } - float texture_xoffset = ((texture.szTextureSize.Width / 3) * (1.0f - openAnime)); + 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; + 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 + ((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 * 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; + 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 + ((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 + ((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; + 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 + ((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)); + 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) - { + 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)); @@ -2753,9 +2487,7 @@ namespace TJAPlayer3 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 - { + } 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)); @@ -2769,8 +2501,7 @@ namespace TJAPlayer3 overlay.t2D描画(x + (overlay_xoffset * 1.5f) + moveX_xoffset - moveX, y + (height * 2) + move, new Rectangle(0, height * 2, width, height)); - if (fullScaleOverlay) - { + 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)); @@ -2778,9 +2509,7 @@ namespace TJAPlayer3 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 - { + } 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)); @@ -2794,8 +2523,7 @@ namespace TJAPlayer3 overlay.t2D描画(x + (overlay_xoffset / 2) + moveX_xoffset - moveX + width, y + (height * 2) + move, new Rectangle(width, height * 2, width, height)); - if (fullScaleOverlay) - { + 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)); @@ -2803,9 +2531,7 @@ namespace TJAPlayer3 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 - { + } 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)); @@ -2822,12 +2548,9 @@ namespace TJAPlayer3 } - private Eバー種別 e曲のバー種別を返す( CSongListNode song ) - { - if( song != null ) - { - switch( song.eノード種別 ) - { + private Eバー種別 e曲のバー種別を返す(CSongListNode song) { + if (song != null) { + switch (song.eノード種別) { case CSongListNode.ENodeType.SCORE: case CSongListNode.ENodeType.SCORE_MIDI: return Eバー種別.Score; @@ -2844,40 +2567,34 @@ namespace TJAPlayer3 } return Eバー種別.Other; } - private void tChangeSong(int change) - { + private void tChangeSong(int change) { List list = (TJAPlayer3.ConfigIni.TJAP3FolderMode && rCurrentlySelectedSong.rParentNode != null) ? rCurrentlySelectedSong.rParentNode.list子リスト : flattenList(TJAPlayer3.Songs管理.list曲ルート, true); int index = nSelectSongIndex + change; - while (index >= list.Count) - { + while (index >= list.Count) { index -= list.Count; } - while (index < 0) - { + while (index < 0) { index += list.Count; } nSelectSongIndex = index; rCurrentlySelectedSong = list[index]; - var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(rCurrentlySelectedSong); - if (IsSongLocked) - { + var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(rCurrentlySelectedSong); + if (IsSongLocked) { var SongUnlockable = TJAPlayer3.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; + 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 = (TJAPlayer3.ConfigIni.TJAP3FolderMode && rCurrentlySelectedSong.rParentNode != null) ? rCurrentlySelectedSong.rParentNode.list子リスト : flattenList(TJAPlayer3.Songs管理.list曲ルート, true); @@ -2885,38 +2602,34 @@ namespace TJAPlayer3 int index = nSelectSongIndex + change; - while (index >= list.Count) - { + while (index >= list.Count) { index -= list.Count; } - while (index < 0) - { + while (index < 0) { index += list.Count; } var _sideNode = list[index]; - return _sideNode; + return _sideNode; } - public void tバーの初期化() - { - stバー情報 = new STバー情報[TJAPlayer3.Skin.SongSelect_Bar_Count]; + public void tバーの初期化() { + stバー情報 = new STバー情報[TJAPlayer3.Skin.SongSelect_Bar_Count]; - int barCenterNum = (TJAPlayer3.Skin.SongSelect_Bar_Count - 1) / 2; - for ( int i = 0; i < TJAPlayer3.Skin.SongSelect_Bar_Count; i++ ) - { + int barCenterNum = (TJAPlayer3.Skin.SongSelect_Bar_Count - 1) / 2; + for (int i = 0; i < TJAPlayer3.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].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; @@ -2926,16 +2639,15 @@ namespace TJAPlayer3 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; + 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譜面分岐; - } + 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] @@ -2944,19 +2656,17 @@ namespace TJAPlayer3 if (stバー情報[i].nスコアランク == null) this.stバー情報[i].nスコアランク = new int[2][]; - for (int d = 0; d < 2; d++) - { + 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) - { + if (this.stバー情報[i].eバー種別 == Eバー種別.Score) { int ap = TJAPlayer3.GetActualPlayer(d); //var sr = song.arスコア[n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)]; - var TableEntry = TJAPlayer3.SaveFileInstances[ap].data.tGetSongSelectTableEntry(song.tGetUniqueId()); + var TableEntry = TJAPlayer3.SaveFileInstances[ap].data.tGetSongSelectTableEntry(song.tGetUniqueId()); - this.stバー情報[i].nクリア[d] = TableEntry.ClearStatuses; + this.stバー情報[i].nクリア[d] = TableEntry.ClearStatuses; this.stバー情報[i].nスコアランク[d] = TableEntry.ScoreRanks; } } @@ -2964,34 +2674,33 @@ namespace TJAPlayer3 this.stバー情報[i].csu = song.uniqueId; this.stバー情報[i].reference = song; - #endregion + #endregion - for ( int j = 0; j < 3; j++ ) - this.stバー情報[ i ].nスキル値[ j ] = (int) song.arスコア[ this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す( song ) ].譜面情報.最大スキル[ j ]; + for (int j = 0; j < 3; j++) + this.stバー情報[i].nスキル値[j] = (int)song.arスコア[this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)].譜面情報.最大スキル[j]; - this.stバー情報[ i ].ttkタイトル = this.ttk曲名テクスチャを生成する( this.stバー情報[ i ].strタイトル文字列, this.stバー情報[i].ForeColor, this.stバー情報[i].BackColor, stバー情報[i].eバー種別 == Eバー種別.Box ? this.pfBoxName : this.pfMusicName); + this.stバー情報[i].ttkタイトル = this.ttk曲名テクスチャを生成する(this.stバー情報[i].strタイトル文字列, this.stバー情報[i].ForeColor, this.stバー情報[i].BackColor, stバー情報[i].eバー種別 == Eバー種別.Box ? this.pfBoxName : this.pfMusicName); } - int _center = (TJAPlayer3.Skin.SongSelect_Bar_Count - 1) / 2; - this.n現在の選択行 = _center; + int _center = (TJAPlayer3.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, + int x, + int y, + string strジャンル, + Eバー種別 eバー種別, + int[][] クリア, + int[][] スコアランク, + string boxType, + int _songType = 0, CSongUniqueID csu = null, - CSongListNode reference = null - ) - { + CSongListNode reference = null + ) { if (x >= SampleFramework.GameWindowSize.Width || y >= SampleFramework.GameWindowSize.Height) return; @@ -2999,7 +2708,7 @@ namespace TJAPlayer3 var HiddenIndex = TJAPlayer3.Databases.DBSongUnlockables.tGetSongHiddenIndex(reference); - var rc = new Rectangle(0, 48, 128, 48); + var rc = new Rectangle(0, 48, 128, 48); int opct = 255; @@ -3009,125 +2718,98 @@ namespace TJAPlayer3 TJAPlayer3.Tx.SongSelect_Crown.Opacity = opct; TJAPlayer3.Tx.SongSelect_ScoreRank.Opacity = opct; - foreach(var tex in TJAPlayer3.Tx.SongSelect_Bar_Genre) - { - tex.Value.Opacity = opct; + foreach (var tex in TJAPlayer3.Tx.SongSelect_Bar_Genre) { + tex.Value.Opacity = opct; } - foreach(var tex in TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlap) - { - tex.Value.Opacity = opct; + foreach (var tex in TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlap) { + tex.Value.Opacity = opct; } - + TJAPlayer3.Tx.SongSelect_Bar_Genre_Back?.tUpdateOpacity(opct); - TJAPlayer3.Tx.SongSelect_Bar_Genre_Random?.tUpdateOpacity(opct); - TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay?.tUpdateOpacity(opct); - TJAPlayer3.Tx.SongSelect_Favorite?.tUpdateOpacity(opct); - TJAPlayer3.Tx.TowerResult_ScoreRankEffect?.tUpdateOpacity(opct); - TJAPlayer3.Tx.DanResult_Rank?.tUpdateOpacity(opct); - TJAPlayer3.Tx.SongSelect_Level_Number_Big?.tUpdateOpacity(opct); - TJAPlayer3.Tx.SongSelect_Level_Number_Big_Colored?.tUpdateOpacity(opct); - TJAPlayer3.Tx.SongSelect_Level_Number_Big_Icon?.tUpdateOpacity(opct); + TJAPlayer3.Tx.SongSelect_Bar_Genre_Random?.tUpdateOpacity(opct); + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay?.tUpdateOpacity(opct); + TJAPlayer3.Tx.SongSelect_Favorite?.tUpdateOpacity(opct); + TJAPlayer3.Tx.TowerResult_ScoreRankEffect?.tUpdateOpacity(opct); + TJAPlayer3.Tx.DanResult_Rank?.tUpdateOpacity(opct); + TJAPlayer3.Tx.SongSelect_Level_Number_Big?.tUpdateOpacity(opct); + TJAPlayer3.Tx.SongSelect_Level_Number_Big_Colored?.tUpdateOpacity(opct); + TJAPlayer3.Tx.SongSelect_Level_Number_Big_Icon?.tUpdateOpacity(opct); TJAPlayer3.Tx.SongSelect_Lock?.tUpdateOpacity(opct); TJAPlayer3.Tx.SongSelect_Bar_Genre_Locked?.tUpdateOpacity(opct); TJAPlayer3.Tx.SongSelect_Bar_Genre_Locked_Top?.tUpdateOpacity(opct); - for (int i = 0; i < TJAPlayer3.Tx.SongSelect_Song_Panel.Length; i++) - { + for (int i = 0; i < TJAPlayer3.Tx.SongSelect_Song_Panel.Length; i++) { TJAPlayer3.Tx.SongSelect_Song_Panel[i]?.tUpdateOpacity(opct); } TJAPlayer3.Tx.SongSelect_Bpm_Number?.tUpdateOpacity(opct); - if (ttkSelectedSongMaker != null && TJAPlayer3.Skin.SongSelect_Maker_Show) - { + if (ttkSelectedSongMaker != null && TJAPlayer3.Skin.SongSelect_Maker_Show) { ResolveTitleTexture(ttkSelectedSongMaker)?.tUpdateOpacity(opct); } - if (ttkSelectedSongBPM != null && TJAPlayer3.Skin.SongSelect_BPM_Text_Show) - { - ResolveTitleTexture(ttkSelectedSongBPM)?.tUpdateOpacity(opct); - } + if (ttkSelectedSongBPM != null && TJAPlayer3.Skin.SongSelect_BPM_Text_Show) { + ResolveTitleTexture(ttkSelectedSongBPM)?.tUpdateOpacity(opct); + } TJAPlayer3.Tx.SongSelect_Explicit?.tUpdateOpacity(opct); TJAPlayer3.Tx.SongSelect_Movie?.tUpdateOpacity(opct); - if (eバー種別 == Eバー種別.Random) - { + if (eバー種別 == Eバー種別.Random) { TJAPlayer3.Tx.SongSelect_Bar_Genre_Random?.t2D描画(x, y); - } - else if (eバー種別 != Eバー種別.BackBox) - { - if (HiddenIndex == DBSongUnlockables.EHiddenIndex.GRAYED) - { - TJAPlayer3.Tx.SongSelect_Bar_Genre_Locked?.t2D描画(x, y); + } else if (eバー種別 != Eバー種別.BackBox) { + if (HiddenIndex == DBSongUnlockables.EHiddenIndex.GRAYED) { + TJAPlayer3.Tx.SongSelect_Bar_Genre_Locked?.t2D描画(x, y); return; - } - else - { - HGenreBar.tGetGenreBar(boxType, TJAPlayer3.Tx.SongSelect_Bar_Genre)?.t2D描画(x, y); - HGenreBar.tGetGenreBar(boxType, TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlap)?.t2D描画(x, y); - TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay?.t2D描画(x, y); - } - } - else - { + } else { + HGenreBar.tGetGenreBar(boxType, TJAPlayer3.Tx.SongSelect_Bar_Genre)?.t2D描画(x, y); + HGenreBar.tGetGenreBar(boxType, TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlap)?.t2D描画(x, y); + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay?.t2D描画(x, y); + } + } else { TJAPlayer3.Tx.SongSelect_Bar_Genre_Back?.t2D描画(x, y); } - if (eバー種別 == Eバー種別.Score) - { - if (_songType == 1) - { + 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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { if (i >= 2) continue; displayDanStatus(x + TJAPlayer3.Skin.SongSelect_DanStatus_Offset_X[i], y + TJAPlayer3.Skin.SongSelect_DanStatus_Offset_Y[i], Math.Min(クリア[i][0], 6) - 1, 0.2f); } - } - else if (_songType == 2) - { + } else if (_songType == 2) { // displayTowerStatus(x + 30, y + 30, Math.Min(クリア[0][0], 6) - 1, 0.2f); - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { if (i >= 2) continue; displayTowerStatus(x + TJAPlayer3.Skin.SongSelect_TowerStatus_Offset_X[i], y + TJAPlayer3.Skin.SongSelect_TowerStatus_Offset_Y[i], Math.Min(クリア[i][0], 7) - 1, 0.3f); } - } - else - { + } else { // var sr = this.r現在選択中の曲.arスコア[n現在のアンカ難易度レベルに最も近い難易度レベルを返す(this.r現在選択中の曲)]; - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { if (i >= 2) continue; displayRegularCrowns(x + TJAPlayer3.Skin.SongSelect_RegularCrowns_Offset_X[i], y + TJAPlayer3.Skin.SongSelect_RegularCrowns_Offset_Y[i], クリア[i], スコアランク[i], 0.8f); } } - if (IsSongLocked) - { + if (IsSongLocked) { displayVisibleLockStatus(x + TJAPlayer3.Skin.SongSelect_FavoriteStatus_Offset[0], y + TJAPlayer3.Skin.SongSelect_FavoriteStatus_Offset[1], 1f); + } else { + displayFavoriteStatus(x + TJAPlayer3.Skin.SongSelect_FavoriteStatus_Offset[0], y + TJAPlayer3.Skin.SongSelect_FavoriteStatus_Offset[1], csu, 1f); } - else - { - displayFavoriteStatus(x + TJAPlayer3.Skin.SongSelect_FavoriteStatus_Offset[0], y + TJAPlayer3.Skin.SongSelect_FavoriteStatus_Offset[1], csu, 1f); - } - tPrintLevelNumberBig( - x + TJAPlayer3.Skin.SongSelect_Level_Offset[0], - y + TJAPlayer3.Skin.SongSelect_Level_Offset[1], - reference - ); - } + tPrintLevelNumberBig( + x + TJAPlayer3.Skin.SongSelect_Level_Offset[0], + y + TJAPlayer3.Skin.SongSelect_Level_Offset[1], + reference + ); + } } - public void displayTowerStatus(int x, int y, int grade, float _resize) - { - if (grade >= 0 && TJAPlayer3.Tx.TowerResult_ScoreRankEffect != null) - { + public void displayTowerStatus(int x, int y, int grade, float _resize) { + if (grade >= 0 && TJAPlayer3.Tx.TowerResult_ScoreRankEffect != null) { int scoreRankEffect_width = TJAPlayer3.Tx.TowerResult_ScoreRankEffect.szTextureSize.Width / 7; int scoreRankEffect_height = TJAPlayer3.Tx.TowerResult_ScoreRankEffect.szTextureSize.Height; @@ -3140,10 +2822,8 @@ namespace TJAPlayer3 } } - public void displayDanStatus(int x, int y, int grade, float _resize) - { - if (grade >= 0 && TJAPlayer3.Tx.DanResult_Rank != null) - { + public void displayDanStatus(int x, int y, int grade, float _resize) { + if (grade >= 0 && TJAPlayer3.Tx.DanResult_Rank != null) { int danResult_rank_width = TJAPlayer3.Tx.DanResult_Rank.szTextureSize.Width / 7; int danResult_rank_height = TJAPlayer3.Tx.DanResult_Rank.szTextureSize.Height; @@ -3156,8 +2836,7 @@ namespace TJAPlayer3 } } - public void displayRegularCrowns(int x, int y, int[] クリア, int[] スコアランク, float _resize) - { + 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 (TJAPlayer3.Tx.SongSelect_Crown == null || TJAPlayer3.Tx.SongSelect_ScoreRank == null) return; @@ -3172,32 +2851,28 @@ namespace TJAPlayer3 int bestCrown = -1; int bestScoreRank = -1; - for (int i = 0; i <= (int)Difficulty.Edit; i++) - { + for (int i = 0; i <= (int)Difficulty.Edit; i++) { if (クリア[i] > 0) bestCrown = i; if (スコアランク[i] > 0) bestScoreRank = i; - } + } - if (bestCrown >= 0) - { + if (bestCrown >= 0) { float width = TJAPlayer3.Tx.SongSelect_Crown.szTextureSize.Width / 4.0f; int height = TJAPlayer3.Tx.SongSelect_Crown.szTextureSize.Height; - TJAPlayer3.Tx.SongSelect_Crown?.t2D拡大率考慮中央基準描画(x + TJAPlayer3.Skin.SongSelect_RegularCrowns_ScoreRank_Offset_X[0], y + TJAPlayer3.Skin.SongSelect_RegularCrowns_ScoreRank_Offset_Y[0], + TJAPlayer3.Tx.SongSelect_Crown?.t2D拡大率考慮中央基準描画(x + TJAPlayer3.Skin.SongSelect_RegularCrowns_ScoreRank_Offset_X[0], y + TJAPlayer3.Skin.SongSelect_RegularCrowns_ScoreRank_Offset_Y[0], new RectangleF((クリア[bestCrown] - 1) * width, 0, width, height)); } - if (bestScoreRank >= 0) - { + if (bestScoreRank >= 0) { int width = TJAPlayer3.Tx.SongSelect_ScoreRank.szTextureSize.Width; float height = TJAPlayer3.Tx.SongSelect_ScoreRank.szTextureSize.Height / 7.0f; TJAPlayer3.Tx.SongSelect_ScoreRank?.t2D拡大率考慮中央基準描画(x + TJAPlayer3.Skin.SongSelect_RegularCrowns_ScoreRank_Offset_X[1], y + TJAPlayer3.Skin.SongSelect_RegularCrowns_ScoreRank_Offset_Y[1], new RectangleF(0, (スコアランク[bestScoreRank] - 1) * height, width, height)); } - if (TJAPlayer3.Tx.Dani_Difficulty_Cymbol != null) - { + if (TJAPlayer3.Tx.Dani_Difficulty_Cymbol != null) { int dani_difficulty_cymbol_width = TJAPlayer3.Tx.Dani_Difficulty_Cymbol.szTextureSize.Width / 5; int dani_difficulty_cymbol_height = TJAPlayer3.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; @@ -3205,16 +2880,14 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.X = 0.5f; TJAPlayer3.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.Y = 0.5f; - if (bestCrown >= 0) - { + if (bestCrown >= 0) { TJAPlayer3.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画( x + TJAPlayer3.Skin.SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_X[0], y + TJAPlayer3.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) - { + if (bestScoreRank >= 0) { TJAPlayer3.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画( x + TJAPlayer3.Skin.SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_X[1], y + TJAPlayer3.Skin.SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_Y[1], @@ -3229,37 +2902,30 @@ namespace TJAPlayer3 } - public void displayFavoriteStatus(int x, int y, CSongUniqueID csu, float _resize) - { + public void displayFavoriteStatus(int x, int y, CSongUniqueID csu, float _resize) { if (csu != null && TJAPlayer3.Tx.SongSelect_Favorite != null - && TJAPlayer3.Favorites.tIsFavorite(csu.data.id)) - { + && TJAPlayer3.Favorites.tIsFavorite(csu.data.id)) { TJAPlayer3.Tx.SongSelect_Favorite.vcScaleRatio.X = _resize; TJAPlayer3.Tx.SongSelect_Favorite.vcScaleRatio.Y = _resize; TJAPlayer3.Tx.SongSelect_Favorite.t2D拡大率考慮中央基準描画(x, y); } - } - - public void displayVisibleLockStatus(int x, int y, float _resize) - { - if (TJAPlayer3.Tx.SongSelect_Lock != null) - { - TJAPlayer3.Tx.SongSelect_Lock.vcScaleRatio.X = _resize; - TJAPlayer3.Tx.SongSelect_Lock.vcScaleRatio.Y = _resize; - TJAPlayer3.Tx.SongSelect_Lock.t2D拡大率考慮中央基準描画(x, y); - } } - public int nStrジャンルtoNum(string strジャンル) - { + public void displayVisibleLockStatus(int x, int y, float _resize) { + if (TJAPlayer3.Tx.SongSelect_Lock != null) { + TJAPlayer3.Tx.SongSelect_Lock.vcScaleRatio.X = _resize; + TJAPlayer3.Tx.SongSelect_Lock.vcScaleRatio.Y = _resize; + TJAPlayer3.Tx.SongSelect_Lock.t2D拡大率考慮中央基準描画(x, y); + } + } + + public int nStrジャンルtoNum(string strジャンル) { return this.nStrジャンルtoNumBox(strジャンル); } - - public int nStrジャンルtoNumBox(string strジャンル) - { - switch (strジャンル) - { + + public int nStrジャンルtoNumBox(string strジャンル) { + switch (strジャンル) { case "ポップス": case "J-POP": case "POPS": @@ -3289,49 +2955,43 @@ namespace TJAPlayer3 } } - private TitleTextureKey ttk曲名テクスチャを生成する( string str文字, Color forecolor, Color backcolor, CCachedFontRenderer pf) - { - return new TitleTextureKey(str文字, pf, forecolor, backcolor, TJAPlayer3.Skin.SongSelect_Title_MaxSize); - } - - private TitleTextureKey ttkサブタイトルテクスチャを生成する( string str文字, Color forecolor, Color backcolor) - { - return new TitleTextureKey(str文字, pfSubtitle, forecolor, backcolor, TJAPlayer3.Skin.SongSelect_SubTitle_MaxSize); + private TitleTextureKey ttk曲名テクスチャを生成する(string str文字, Color forecolor, Color backcolor, CCachedFontRenderer pf) { + return new TitleTextureKey(str文字, pf, forecolor, backcolor, TJAPlayer3.Skin.SongSelect_Title_MaxSize); } - private TitleTextureKey ttkGenerateMakerTexture(string str文字, Color forecolor, Color backcolor) - { + private TitleTextureKey ttkサブタイトルテクスチャを生成する(string str文字, Color forecolor, Color backcolor) { + return new TitleTextureKey(str文字, pfSubtitle, forecolor, backcolor, TJAPlayer3.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, TJAPlayer3.Skin.SongSelect_Maker_MaxSize); } - private TitleTextureKey ttkGenerateBPMTexture(CSongListNode node, Color forecolor, Color backcolor) - { + private TitleTextureKey ttkGenerateBPMTexture(CSongListNode node, Color forecolor, Color backcolor) { var _score = node.arスコア[tFetchDifficulty(node)].譜面情報; var _speed = TJAPlayer3.ConfigIni.SongPlaybackSpeed; - double[] bpms = new double[3] { + 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; + var _color = forecolor; if (_speed > 1) _color = Color.Red; else if (_speed < 1) _color = Color.LightBlue; - return new TitleTextureKey(bpm_str, pfBPM, _color, backcolor, TJAPlayer3.Skin.SongSelect_BPM_Text_MaxSize); - } + return new TitleTextureKey(bpm_str, pfBPM, _color, backcolor, TJAPlayer3.Skin.SongSelect_BPM_Text_MaxSize); + } - public CTexture ResolveTitleTexture(TitleTextureKey titleTextureKey) - { - if (!_titledictionary.TryGetValue(titleTextureKey, out var texture)) - { + public CTexture ResolveTitleTexture(TitleTextureKey titleTextureKey) { + if (!_titledictionary.TryGetValue(titleTextureKey, out var texture)) { texture = GenerateTitleTexture(titleTextureKey); _titledictionary.Add(titleTextureKey, texture); } @@ -3339,10 +2999,8 @@ namespace TJAPlayer3 return texture; } - public CTexture ResolveTitleTexture(TitleTextureKey titleTextureKey, bool bVertical, bool keepCenter = false) - { - if (!_titledictionary.TryGetValue(titleTextureKey, out var texture)) - { + public CTexture ResolveTitleTexture(TitleTextureKey titleTextureKey, bool bVertical, bool keepCenter = false) { + if (!_titledictionary.TryGetValue(titleTextureKey, out var texture)) { if (bVertical) texture = GenerateTitleTextureTate(titleTextureKey, keepCenter); else @@ -3353,10 +3011,8 @@ namespace TJAPlayer3 return texture; } - public CTexture ResolveTitleTextureTate(TitleTextureKey titleTextureKey) - { - if (!_titledictionary.TryGetValue(titleTextureKey, out var texture)) - { + public CTexture ResolveTitleTextureTate(TitleTextureKey titleTextureKey) { + if (!_titledictionary.TryGetValue(titleTextureKey, out var texture)) { texture = GenerateTitleTextureTate(titleTextureKey); _titledictionary.Add(titleTextureKey, texture); } @@ -3364,14 +3020,11 @@ namespace TJAPlayer3 return texture; } - private static CTexture GenerateTitleTextureTate(TitleTextureKey titleTextureKey, bool keepCenter = false) - { + private static CTexture GenerateTitleTextureTate(TitleTextureKey titleTextureKey, bool keepCenter = false) { using (var bmp = titleTextureKey.cPrivateFastFont.DrawText_V( - titleTextureKey.str文字, titleTextureKey.forecolor, titleTextureKey.backcolor, titleTextureKey.secondEdge, 30, keepCenter)) - { + titleTextureKey.str文字, titleTextureKey.forecolor, titleTextureKey.backcolor, titleTextureKey.secondEdge, 30, keepCenter)) { CTexture tx文字テクスチャ = TJAPlayer3.tテクスチャの生成(bmp, false); - if (tx文字テクスチャ.szTextureSize.Height > titleTextureKey.maxWidth) - { + 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); @@ -3382,120 +3035,101 @@ namespace TJAPlayer3 } - private static CTexture GenerateTitleTexture(TitleTextureKey titleTextureKey, bool keepCenter = false) - { + private static CTexture GenerateTitleTexture(TitleTextureKey titleTextureKey, bool keepCenter = false) { using (var bmp = titleTextureKey.cPrivateFastFont.DrawText( - titleTextureKey.str文字, titleTextureKey.forecolor, titleTextureKey.backcolor, titleTextureKey.secondEdge, 30, keepCenter)) - { - CTexture tx文字テクスチャ = TJAPlayer3.tテクスチャの生成(bmp, false); - if (tx文字テクスチャ.szTextureSize.Width > titleTextureKey.maxWidth) - { - tx文字テクスチャ.vcScaleRatio.X = (float) (((double) titleTextureKey.maxWidth) / tx文字テクスチャ.szTextureSize.Width); + titleTextureKey.str文字, titleTextureKey.forecolor, titleTextureKey.backcolor, titleTextureKey.secondEdge, 30, keepCenter)) { + CTexture tx文字テクスチャ = TJAPlayer3.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文字テクスチャ; - } - } + return tx文字テクスチャ; + } + } - private void ClearTitleTextureCache() - { - foreach (var titleTexture in _titledictionary.Values) - { + private void ClearTitleTextureCache() { + foreach (var titleTexture in _titledictionary.Values) { titleTexture.Dispose(); - } + } _titledictionary.Clear(); } - public sealed class TitleTextureKey - { - public readonly string str文字; - public readonly CCachedFontRenderer cPrivateFastFont; - public readonly Color forecolor; - public readonly Color backcolor; - public readonly int maxWidth; + public sealed class TitleTextureKey { + 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; + 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) && + 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; - } + 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 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; + 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; - } - } + 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); + } - public static bool operator !=(TitleTextureKey left, TitleTextureKey right) - { - return !Equals(left, right); - } - } + public static bool operator !=(TitleTextureKey left, TitleTextureKey right) { + return !Equals(left, right); + } + } - private void tアイテム数の描画() - { + private void tアイテム数の描画() { string s = nCurrentPosition.ToString() + "/" + nNumOfItems.ToString(); int x = 639 - 8 - 12; int y = 362; - for ( int p = s.Length - 1; p >= 0; p-- ) - { - tアイテム数の描画_1桁描画( x, y, s[ p ] ); + for (int p = s.Length - 1; p >= 0; p--) { + tアイテム数の描画_1桁描画(x, y, s[p]); x -= 8; } } - private void tアイテム数の描画_1桁描画( int x, int y, char s数値 ) - { + private void tアイテム数の描画_1桁描画(int x, int y, char s数値) { int dx, dy; - if ( s数値 == '/' ) - { + if (s数値 == '/') { dx = 48; dy = 0; - } - else - { - int n = (int) s数値 - (int) '0'; - dx = ( n % 6 ) * 8; - dy = ( n / 6 ) * 12; + } else { + int n = (int)s数値 - (int)'0'; + dx = (n % 6) * 8; + dy = (n / 6) * 12; } //if ( this.txアイテム数数字 != null ) //{ @@ -3504,63 +3138,53 @@ namespace TJAPlayer3 } - //数字フォント - private CTexture txレベル数字フォント; - [StructLayout( LayoutKind.Sequential )] - private struct STレベル数字 - { - public char ch; - public int ptX; - } - private STレベル数字[] st小文字位置 = new STレベル数字[ 10 ]; + //数字フォント + private CTexture txレベル数字フォント; + [StructLayout(LayoutKind.Sequential)] + private struct STレベル数字 { + public char ch; + public int ptX; + } + private STレベル数字[] st小文字位置 = new STレベル数字[10]; - private void tResetTitleTextureKey() - { - if (this.ttk選択している曲の曲名 != null) - { - this.ttk選択している曲の曲名 = null; - this.b選択曲が変更された = false; - } - if (this.ttk選択している曲のサブタイトル != null) - { - this.ttk選択している曲のサブタイトル = null; - this.b選択曲が変更された = false; - } - if (this.ttkSelectedSongMaker != null) - { - this.ttkSelectedSongMaker = null; - this.b選択曲が変更された = false; - } - if (this.ttkSelectedSongBPM != null) - { - this.ttkSelectedSongBPM = null; - this.b選択曲が変更された = false; - } - } + private void tResetTitleTextureKey() { + if (this.ttk選択している曲の曲名 != null) { + this.ttk選択している曲の曲名 = null; + this.b選択曲が変更された = false; + } + if (this.ttk選択している曲のサブタイトル != null) { + this.ttk選択している曲のサブタイトル = 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) - { + public void tDisplayLevelIcon(int x, int y, CDTX.ELevelIcon icon, CTexture iconTex = null) { var _tex = (iconTex != null) ? iconTex : TJAPlayer3.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) - ); - } - } + if (icon != CDTX.ELevelIcon.eNone && + _tex != null) { + var __width = _tex.sz画像サイズ.Width / 3; + var __height = _tex.sz画像サイズ.Height; + _tex.t2D_DisplayImage_AnchorUpRight( - private void t小文字表示(int x, int y, int num, int diff, CDTX.ELevelIcon icon) - { + 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[] 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 - (TJAPlayer3.Skin.SongSelect_Level_Number_Interval[0] * offset); float _y = y - (TJAPlayer3.Skin.SongSelect_Level_Number_Interval[1] * offset); @@ -3568,95 +3192,87 @@ namespace TJAPlayer3 float width = TJAPlayer3.Tx.SongSelect_Level_Number.sz画像サイズ.Width / 10.0f; float height = TJAPlayer3.Tx.SongSelect_Level_Number.sz画像サイズ.Height; - var _expand_ratio = 1.0f / (1.0f + (0.25f * (nums.Length - 1))); - TJAPlayer3.Tx.SongSelect_Level_Number.vcScaleRatio.X = _expand_ratio; + var _expand_ratio = 1.0f / (1.0f + (0.25f * (nums.Length - 1))); + TJAPlayer3.Tx.SongSelect_Level_Number.vcScaleRatio.X = _expand_ratio; - icon_coords[0] = Math.Max(icon_coords[0], _x + width * _expand_ratio); - icon_coords[1] = _y; + icon_coords[0] = Math.Max(icon_coords[0], _x + width * _expand_ratio); + icon_coords[1] = _y; - TJAPlayer3.Tx.SongSelect_Level_Number.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); + TJAPlayer3.Tx.SongSelect_Level_Number.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - if (TJAPlayer3.Tx.SongSelect_Level_Number_Colored != null) - { - TJAPlayer3.Tx.SongSelect_Level_Number_Colored.vcScaleRatio.X = _expand_ratio; - TJAPlayer3.Tx.SongSelect_Level_Number_Colored.color4 = CConversion.ColorToColor4(TJAPlayer3.Skin.SongSelect_Difficulty_Colors[diff]); - TJAPlayer3.Tx.SongSelect_Level_Number_Colored.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - } - } + if (TJAPlayer3.Tx.SongSelect_Level_Number_Colored != null) { + TJAPlayer3.Tx.SongSelect_Level_Number_Colored.vcScaleRatio.X = _expand_ratio; + TJAPlayer3.Tx.SongSelect_Level_Number_Colored.color4 = CConversion.ColorToColor4(TJAPlayer3.Skin.SongSelect_Difficulty_Colors[diff]); + TJAPlayer3.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, TJAPlayer3.Tx.SongSelect_Level_Number_Icon); - } + } - public void tPrintLevelNumberBig(int x, int y, CSongListNode song) - { + 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 (TJAPlayer3.Tx.SongSelect_Level_Number_Big == null || num < 0) return; - int[] nums = CConversion.SeparateDigits(num); + int[] nums = CConversion.SeparateDigits(num); float _ratio = 1f; float[] icon_coords = new float[2] { -999, -999 }; - if (TJAPlayer3.Tx.SongSelect_Level_Number != null) - { + if (TJAPlayer3.Tx.SongSelect_Level_Number != null) { _ratio = TJAPlayer3.Tx.SongSelect_Level_Number_Big.szTextureSize.Width / TJAPlayer3.Tx.SongSelect_Level_Number.szTextureSize.Width; - } - for (int j = 0; j < nums.Length; j++) - { - float offset = j - (nums.Length / 2.0f); - float _x = x - (TJAPlayer3.Skin.SongSelect_Level_Number_Interval[0] * offset * _ratio); - float _y = y - (TJAPlayer3.Skin.SongSelect_Level_Number_Interval[1] * offset); + } + for (int j = 0; j < nums.Length; j++) { + float offset = j - (nums.Length / 2.0f); + float _x = x - (TJAPlayer3.Skin.SongSelect_Level_Number_Interval[0] * offset * _ratio); + float _y = y - (TJAPlayer3.Skin.SongSelect_Level_Number_Interval[1] * offset); - float width = TJAPlayer3.Tx.SongSelect_Level_Number_Big.sz画像サイズ.Width / 10.0f; - float height = TJAPlayer3.Tx.SongSelect_Level_Number_Big.sz画像サイズ.Height; + float width = TJAPlayer3.Tx.SongSelect_Level_Number_Big.sz画像サイズ.Width / 10.0f; + float height = TJAPlayer3.Tx.SongSelect_Level_Number_Big.sz画像サイズ.Height; var _expand_ratio = 1.0f / (1.0f + (0.25f * (nums.Length - 1))); TJAPlayer3.Tx.SongSelect_Level_Number_Big.vcScaleRatio.X = _expand_ratio; - TJAPlayer3.Tx.SongSelect_Level_Number_Big.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); + TJAPlayer3.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; + icon_coords[0] = Math.Max(icon_coords[0], _x + width * _expand_ratio); + icon_coords[1] = _y; - if (TJAPlayer3.Tx.SongSelect_Level_Number_Big_Colored != null) - { - TJAPlayer3.Tx.SongSelect_Level_Number_Big_Colored.vcScaleRatio.X = _expand_ratio; - TJAPlayer3.Tx.SongSelect_Level_Number_Big_Colored.color4 = CConversion.ColorToColor4(TJAPlayer3.Skin.SongSelect_Difficulty_Colors[difficulty]); - TJAPlayer3.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); + if (TJAPlayer3.Tx.SongSelect_Level_Number_Big_Colored != null) { + TJAPlayer3.Tx.SongSelect_Level_Number_Big_Colored.vcScaleRatio.X = _expand_ratio; + TJAPlayer3.Tx.SongSelect_Level_Number_Big_Colored.color4 = CConversion.ColorToColor4(TJAPlayer3.Skin.SongSelect_Difficulty_Colors[difficulty]); + TJAPlayer3.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, TJAPlayer3.ConfigIni.nDefaultCourse)); + } + + public int tFetchDifficulty(CSongListNode song) { + var closest = this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song); + int defaultTable = Math.Max(0, Math.Min((int)Difficulty.Edit + 1, TJAPlayer3.ConfigIni.nDefaultCourse)); if (song.arスコア[defaultTable] == null) return closest; return defaultTable; - } + } - //----------------- - #endregion - } + //----------------- + #endregion + } - public enum eMenuContext - { + public enum eMenuContext { NONE, SearchByDifficulty, Random, - } + } - public enum eLayoutType - { + 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 5c7dfdc3..dc2b9628 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelect演奏履歴パネル.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelect演奏履歴パネル.cs @@ -1,96 +1,81 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; -using System.Drawing; +using System.Diagnostics; using System.Runtime.InteropServices; -using Silk.NET.Maths; using FDK; +using Silk.NET.Maths; using SkiaSharp; - -using Rectangle = System.Drawing.Rectangle; -using Point = System.Drawing.Point; using Color = System.Drawing.Color; +using Point = System.Drawing.Point; +using Rectangle = System.Drawing.Rectangle; -namespace TJAPlayer3 -{ - internal class CActSelect演奏履歴パネル : CActivity - { +namespace TJAPlayer3 { + internal class CActSelect演奏履歴パネル : CActivity { // メソッド - public CActSelect演奏履歴パネル() - { - ST文字位置[] st文字位置Array = new ST文字位置[10]; + public CActSelect演奏履歴パネル() { + ST文字位置[] st文字位置Array = new ST文字位置[10]; - 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; + 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; base.IsDeActivated = true; } - public void t選択曲が変更された() - { + public void t選択曲が変更された() { Cスコア cスコア = TJAPlayer3.stageSongSelect.r現在選択中のスコア; - if( ( cスコア != null ) && !TJAPlayer3.stageSongSelect.bCurrentlyScrolling ) - { - try - { - foreach (var item in tx文字列パネル) - { + if ((cスコア != null) && !TJAPlayer3.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 ); + 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( "演奏履歴文字列テクスチャの作成に失敗しました。" ); + } catch (CTextureCreateFailedException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("演奏履歴文字列テクスチャの作成に失敗しました。"); this.tx文字列パネル = null; } } @@ -99,121 +84,104 @@ namespace TJAPlayer3 // CActivity 実装 - public override void Activate() - { + public override void Activate() { this.n本体X = 810; this.n本体Y = 558; base.Activate(); } - public override void DeActivate() - { + public override void DeActivate() { this.ct登場アニメ用 = null; base.DeActivate(); } - public override void CreateManagedResource() - { - this.ft表示用フォント = new CCachedFontRenderer( "Arial", 30, CFontRenderer.FontStyle.Bold); + 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.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 ) - { + 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文字 ); + //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, TJAPlayer3.Timer ); + public override int Draw() { + if (!base.IsDeActivated) { + if (base.IsFirstDraw) { + this.ct登場アニメ用 = new CCounter(0, 3000, 1, TJAPlayer3.Timer); base.IsFirstDraw = false; } this.ct登場アニメ用.Tick(); - int x = 980; - int y = 350; - if (TJAPlayer3.stageSongSelect.r現在選択中のスコア != null && this.ct登場アニメ用.CurrentValue >= 2000 && TJAPlayer3.stageSongSelect.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) - { - //CDTXMania.Tx.SongSelect_ScoreWindow_Text.n透明度 = ct登場アニメ用.n現在の値 - 1745; - if (TJAPlayer3.Tx.SongSelect_ScoreWindow[TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度] != null) - { - //CDTXMania.Tx.SongSelect_ScoreWindow[CDTXMania.stage選曲.n現在選択中の曲の難易度].n透明度 = ct登場アニメ用.n現在の値 - 1745; - TJAPlayer3.Tx.SongSelect_ScoreWindow[TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度].t2D描画(x, y); - this.t小文字表示(x + 56, y + 160, string.Format("{0,7:######0}", TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nハイスコア[TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度].ToString())); - TJAPlayer3.Tx.SongSelect_ScoreWindow_Text.t2D描画(x + 236, y + 166, new Rectangle(0, 36, 32, 30)); - } - } + int x = 980; + int y = 350; + if (TJAPlayer3.stageSongSelect.r現在選択中のスコア != null && this.ct登場アニメ用.CurrentValue >= 2000 && TJAPlayer3.stageSongSelect.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) { + //CDTXMania.Tx.SongSelect_ScoreWindow_Text.n透明度 = ct登場アニメ用.n現在の値 - 1745; + if (TJAPlayer3.Tx.SongSelect_ScoreWindow[TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度] != null) { + //CDTXMania.Tx.SongSelect_ScoreWindow[CDTXMania.stage選曲.n現在選択中の曲の難易度].n透明度 = ct登場アニメ用.n現在の値 - 1745; + TJAPlayer3.Tx.SongSelect_ScoreWindow[TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度].t2D描画(x, y); + this.t小文字表示(x + 56, y + 160, string.Format("{0,7:######0}", TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nハイスコア[TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度].ToString())); + TJAPlayer3.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 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文字; + // 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 (TJAPlayer3.Tx.SongSelect_ScoreWindow_Text != null) - { - TJAPlayer3.Tx.SongSelect_ScoreWindow_Text.t2D描画(x, y, rectangle); - } - break; - } - } - x += 26; - } - } + [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 (TJAPlayer3.Tx.SongSelect_ScoreWindow_Text != null) { + TJAPlayer3.Tx.SongSelect_ScoreWindow_Text.t2D描画(x, y, rectangle); + } + break; + } + } + x += 26; + } + } - public void tSongChange() - { - this.ct登場アニメ用 = new CCounter( 0, 3000, 1, TJAPlayer3.Timer ); - } + public void tSongChange() { + this.ct登場アニメ用 = new CCounter(0, 3000, 1, TJAPlayer3.Timer); + } #endregion diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelect難易度選択画面.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelect難易度選択画面.cs index 7b0cc0d1..6907d883 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelect難易度選択画面.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelect難易度選択画面.cs @@ -1,535 +1,449 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Globalization; -using System.Runtime.InteropServices; -using System.Drawing; -using System.Drawing.Imaging; -using System.Diagnostics; -using System.Drawing.Text; - +using System.Runtime.InteropServices; using FDK; - +using Color = System.Drawing.Color; using Rectangle = System.Drawing.Rectangle; using RectangleF = System.Drawing.RectangleF; -using Color = System.Drawing.Color; -namespace TJAPlayer3 -{ - /// - /// 難易度選択画面。 - /// この難易度選択画面はAC7~AC14のような方式であり、WiiまたはAC15移行の方式とは異なる。 - /// - internal class CActSelect難易度選択画面 : CActivity - { +namespace TJAPlayer3 { + /// + /// 難易度選択画面。 + /// この難易度選択画面はAC7~AC14のような方式であり、WiiまたはAC15移行の方式とは異なる。 + /// + internal class CActSelect難易度選択画面 : CActivity { // プロパティ - public bool bIsDifficltSelect; + 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; + 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, TJAPlayer3.Timer); - if (!b裏譜面) - { - n現在の選択行[player]++; - } - else - { - if (n現在の選択行[player] == 4) - { - n現在の選択行[player] += 2; - } - else - { - n現在の選択行[player]++; - } - } - } - else if (n現在の選択行[player] >= 5) - { - if (TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[4] < 0 || TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[3] < 0) - return; + public void t次に移動(int player) { + if (n現在の選択行[player] < 5) { + ctBarAnime[player].Start(0, 180, 1, TJAPlayer3.Timer); + if (!b裏譜面) { + n現在の選択行[player]++; + } else { + if (n現在の選択行[player] == 4) { + n現在の選択行[player] += 2; + } else { + n現在の選択行[player]++; + } + } + } else if (n現在の選択行[player] >= 5) { + if (TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[4] < 0 || TJAPlayer3.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 - TJAPlayer3.stageSongSelect.actExExtraTransAnime.BeginAnime(true); - n現在の選択行[i] = 6; - } - else if (n現在の選択行[i] == 6) - { - //Extra to Extreme - TJAPlayer3.stageSongSelect.actExExtraTransAnime.BeginAnime(false); - n現在の選択行[i] = 5; - } - } - } + 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 + TJAPlayer3.stageSongSelect.actExExtraTransAnime.BeginAnime(true); + n現在の選択行[i] = 6; + } else if (n現在の選択行[i] == 6) { + //Extra to Extreme + TJAPlayer3.stageSongSelect.actExExtraTransAnime.BeginAnime(false); + n現在の選択行[i] = 5; + } + } + } - b裏譜面 = !b裏譜面; - nスイッチカウント = 0; - } - } - } - - public void t前に移動(int player) - { - if(n現在の選択行[player] - 1 >= 0) - { - ctBarAnime[player].Start(0, 180, 1, TJAPlayer3.Timer); - nスイッチカウント = 0; - if(n現在の選択行[player] == 6) - n現在の選択行[player] -= 2; - else - n現在の選択行[player]--; - } + b裏譜面 = !b裏譜面; + nスイッチカウント = 0; + } + } } - public void t選択画面初期化() - { - this.txTitle = TJAPlayer3.tテクスチャの生成(pfTitle.DrawText(TJAPlayer3.stageSongSelect.rNowSelectedSong.ldTitle.GetString(""), Color.White, Color.Black, null, 30 )); - this.txSubTitle = TJAPlayer3.tテクスチャの生成(pfSubTitle.DrawText(TJAPlayer3.stageSongSelect.rNowSelectedSong.ldSubtitle.GetString(""), Color.White, Color.Black, null, 30)); - - 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前に移動(int player) { + if (n現在の選択行[player] - 1 >= 0) { + ctBarAnime[player].Start(0, 180, 1, TJAPlayer3.Timer); + nスイッチカウント = 0; + if (n現在の選択行[player] == 6) + n現在の選択行[player] -= 2; + else + n現在の選択行[player]--; + } + } - this.b裏譜面 = (TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Edit] >= 0 && TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Oni] < 0); + public void t選択画面初期化() { + this.txTitle = TJAPlayer3.tテクスチャの生成(pfTitle.DrawText(TJAPlayer3.stageSongSelect.rNowSelectedSong.ldTitle.GetString(""), Color.White, Color.Black, null, 30)); + this.txSubTitle = TJAPlayer3.tテクスチャの生成(pfSubTitle.DrawText(TJAPlayer3.stageSongSelect.rNowSelectedSong.ldSubtitle.GetString(""), Color.White, Color.Black, null, 30)); - this.IsFirstDraw = true; + 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.b裏譜面 = (TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Edit] >= 0 && TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Oni] < 0); + + this.IsFirstDraw = true; } // CActivity 実装 - public override void Activate() - { - if( this.IsActivated ) + 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(); + 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(); + base.Activate(); } - public override void DeActivate() - { - if( this.IsDeActivated ) + public override void DeActivate() { + if (this.IsDeActivated) return; - ctBarAnime = null; + ctBarAnime = null; - base.DeActivate(); + base.DeActivate(); } - public override void CreateManagedResource() - { - this.pfTitle = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.SongSelect_MusicName_Scale); - this.pfSubTitle = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.SongSelect_Subtitle_Scale); + public override void CreateManagedResource() { + this.pfTitle = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.SongSelect_MusicName_Scale); + this.pfSubTitle = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.SongSelect_Subtitle_Scale); - // this.soundSelectAnnounce = TJAPlayer3.Sound管理.tサウンドを生成する( CSkin.Path( @"Sounds{Path.DirectorySeparatorChar}DiffSelect.ogg" ), ESoundGroup.SoundEffect ); + // this.soundSelectAnnounce = TJAPlayer3.Sound管理.tサウンドを生成する( CSkin.Path( @"Sounds{Path.DirectorySeparatorChar}DiffSelect.ogg" ), ESoundGroup.SoundEffect ); base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { pfTitle.Dispose(); pfSubTitle.Dispose(); - // TJAPlayer3.t安全にDisposeする( ref this.soundSelectAnnounce ); + // TJAPlayer3.t安全にDisposeする( ref this.soundSelectAnnounce ); base.ReleaseManagedResource(); } - public override int Draw() - { - if (this.IsDeActivated) - return 0; + public override int Draw() { + if (this.IsDeActivated) + return 0; - #region [ 初めての進行描画 ] - //----------------- - if (this.IsFirstDraw) - { - ctBarAnimeIn = new CCounter(0, 170, 4, TJAPlayer3.Timer); - // this.soundSelectAnnounce?.tサウンドを再生する(); - //TJAPlayer3.Skin.soundSelectAnnounce.t再生する(); - TJAPlayer3.Skin.voiceMenuDiffSelect[TJAPlayer3.SaveFile]?.tPlay(); - base.IsFirstDraw = false; - } - //----------------- - #endregion + #region [ 初めての進行描画 ] + //----------------- + if (this.IsFirstDraw) { + ctBarAnimeIn = new CCounter(0, 170, 4, TJAPlayer3.Timer); + // this.soundSelectAnnounce?.tサウンドを再生する(); + //TJAPlayer3.Skin.soundSelectAnnounce.t再生する(); + TJAPlayer3.Skin.voiceMenuDiffSelect[TJAPlayer3.SaveFile]?.tPlay(); + base.IsFirstDraw = false; + } + //----------------- + #endregion - ctBarAnimeIn.Tick(); - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - ctBarAnime[i].Tick(); - } + ctBarAnimeIn.Tick(); + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + ctBarAnime[i].Tick(); + } - bool uraExists = TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Edit] >= 0; - bool omoteExists = TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Oni] >= 0; + bool uraExists = TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Edit] >= 0; + bool omoteExists = TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Oni] >= 0; - #region [ キー入力 ] + #region [ キー入力 ] - if (this.ctBarAnimeIn.IsEnded && exextraAnimation == 0) // Prevent player actions if animation is active - { - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (!bSelect[i] && !isOnOption()) - { - bool right = false; - bool left = false; - bool decide = false; + if (this.ctBarAnimeIn.IsEnded && exextraAnimation == 0) // Prevent player actions if animation is active + { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (!bSelect[i] && !isOnOption()) { + bool right = false; + bool left = false; + bool decide = false; - bool cancel = false; + bool cancel = false; - switch (i) - { - case 0: - right = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)); - left = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)); - decide = (TJAPlayer3.Pad.bPressedDGB(EPad.Decide) || - (TJAPlayer3.ConfigIni.bEnterがキー割り当てのどこにも使用されていない && TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))); - cancel = (TJAPlayer3.Pad.bPressedDGB(EPad.Cancel) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)); - break; - case 1: - if (!TJAPlayer3.ConfigIni.bAIBattleMode) - { - right = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue2P)); - left = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue2P)); - decide = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed2P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed2P)); - } - break; - case 2: - right = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue3P)); - left = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue3P)); - decide = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed3P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed3P)); - break; - case 3: - right = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue4P)); - left = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue4P)); - decide = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed4P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed4P)); - break; - case 4: - right = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue5P)); - left = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue5P)); - decide = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed5P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed5P)); - break; - } + switch (i) { + case 0: + right = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)); + left = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)); + decide = (TJAPlayer3.Pad.bPressedDGB(EPad.Decide) || + (TJAPlayer3.ConfigIni.bEnterがキー割り当てのどこにも使用されていない && TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))); + cancel = (TJAPlayer3.Pad.bPressedDGB(EPad.Cancel) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)); + break; + case 1: + if (!TJAPlayer3.ConfigIni.bAIBattleMode) { + right = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue2P)); + left = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue2P)); + decide = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed2P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed2P)); + } + break; + case 2: + right = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue3P)); + left = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue3P)); + decide = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed3P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed3P)); + break; + case 3: + right = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue4P)); + left = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue4P)); + decide = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed4P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed4P)); + break; + case 4: + right = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue5P)); + left = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue5P)); + decide = (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed5P) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed5P)); + break; + } - if (right) - { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - this.t次に移動(i); - } - else if (left) - { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - this.t前に移動(i); - } - if (decide) - { - if (n現在の選択行[i] == 0) - { - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - TJAPlayer3.stageSongSelect.actSongList.ctBarOpen.Start(100, 260, 2, TJAPlayer3.Timer); - this.bIsDifficltSelect = false; - } - else if (n現在の選択行[i] == 1) - { - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - bOption[i] = true; - } - else - { - if (TJAPlayer3.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 < TJAPlayer3.ConfigIni.nPlayerCount; i2++) - { - if (TJAPlayer3.ConfigIni.bAIBattleMode && i2 == 1) break; - - if (!bSelect[i2]) - { - allPlayerSelected = false; - break; - } - } - - if (allPlayerSelected) - { - if (TJAPlayer3.Skin.soundSongDecide_AI.bLoadedSuccessfuly && TJAPlayer3.ConfigIni.bAIBattleMode) - { - TJAPlayer3.Skin.soundSongDecide_AI.tPlay(); - } - else if (TJAPlayer3.Skin.sound曲決定音.bLoadedSuccessfuly) - { - TJAPlayer3.Skin.sound曲決定音.tPlay(); - } - else - { - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - } - - for (int i2 = 0; i2 < TJAPlayer3.ConfigIni.nPlayerCount; i2++) - { - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - TJAPlayer3.Skin.voiceMenuSongDecide_AI[TJAPlayer3.GetActualPlayer(i2)]?.tPlay(); - } - else - { - TJAPlayer3.Skin.voiceMenuSongDecide[TJAPlayer3.GetActualPlayer(i2)]?.tPlay(); - } - CMenuCharacter.tMenuResetTimer(i2, CMenuCharacter.ECharacterAnimation.START); - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - TJAPlayer3.stageSongSelect.t曲を選択する(n現在の選択行[0] - 2, i2); - } - else - { - TJAPlayer3.stageSongSelect.t曲を選択する(n現在の選択行[i2] - 2, i2); - } - } - } - else - { - CMenuCharacter.tMenuResetTimer(i, CMenuCharacter.ECharacterAnimation.WAIT); - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - } - } - } - } - if (cancel) - { - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - TJAPlayer3.stageSongSelect.actSongList.ctBarOpen.Start(100, 260, 2, TJAPlayer3.Timer); - this.bIsDifficltSelect = false; - } - } - } - } - - #endregion - - bool consideMultiPlay = TJAPlayer3.ConfigIni.nPlayerCount >= 2 && !TJAPlayer3.ConfigIni.bAIBattleMode; - - #region [ 画像描画 ] + if (right) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + this.t次に移動(i); + } else if (left) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + this.t前に移動(i); + } + if (decide) { + if (n現在の選択行[i] == 0) { + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + TJAPlayer3.stageSongSelect.actSongList.ctBarOpen.Start(100, 260, 2, TJAPlayer3.Timer); + this.bIsDifficltSelect = false; + } else if (n現在の選択行[i] == 1) { + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + bOption[i] = true; + } else { + if (TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[n現在の選択行[i] - 2] > 0) { + //TJAPlayer3.stage選曲.ctChara_Jump[0].t開始(0, SongSelect_Chara_Jump.Length - 1, 1000 / 45, TJAPlayer3.Timer); - // int boxType = nStrジャンルtoNum(TJAPlayer3.stage選曲.r現在選択中の曲.strジャンル); + this.bSelect[i] = true; + + bool allPlayerSelected = true; + + for (int i2 = 0; i2 < TJAPlayer3.ConfigIni.nPlayerCount; i2++) { + if (TJAPlayer3.ConfigIni.bAIBattleMode && i2 == 1) break; + + if (!bSelect[i2]) { + allPlayerSelected = false; + break; + } + } + + if (allPlayerSelected) { + if (TJAPlayer3.Skin.soundSongDecide_AI.bLoadedSuccessfuly && TJAPlayer3.ConfigIni.bAIBattleMode) { + TJAPlayer3.Skin.soundSongDecide_AI.tPlay(); + } else if (TJAPlayer3.Skin.sound曲決定音.bLoadedSuccessfuly) { + TJAPlayer3.Skin.sound曲決定音.tPlay(); + } else { + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + } + + for (int i2 = 0; i2 < TJAPlayer3.ConfigIni.nPlayerCount; i2++) { + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + TJAPlayer3.Skin.voiceMenuSongDecide_AI[TJAPlayer3.GetActualPlayer(i2)]?.tPlay(); + } else { + TJAPlayer3.Skin.voiceMenuSongDecide[TJAPlayer3.GetActualPlayer(i2)]?.tPlay(); + } + CMenuCharacter.tMenuResetTimer(i2, CMenuCharacter.ECharacterAnimation.START); + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + TJAPlayer3.stageSongSelect.t曲を選択する(n現在の選択行[0] - 2, i2); + } else { + TJAPlayer3.stageSongSelect.t曲を選択する(n現在の選択行[i2] - 2, i2); + } + } + } else { + CMenuCharacter.tMenuResetTimer(i, CMenuCharacter.ECharacterAnimation.WAIT); + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + } + } + } + } + if (cancel) { + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + TJAPlayer3.stageSongSelect.actSongList.ctBarOpen.Start(100, 260, 2, TJAPlayer3.Timer); + this.bIsDifficltSelect = false; + } + } + } + } + + #endregion + + bool consideMultiPlay = TJAPlayer3.ConfigIni.nPlayerCount >= 2 && !TJAPlayer3.ConfigIni.bAIBattleMode; + + #region [ 画像描画 ] + + + // int boxType = nStrジャンルtoNum(TJAPlayer3.stage選曲.r現在選択中の曲.strジャンル); var difficulty_back = HGenreBar.tGetGenreBar(TJAPlayer3.stageSongSelect.rNowSelectedSong.BoxType, TJAPlayer3.Tx.Difficulty_Back); - difficulty_back.Opacity = - (TJAPlayer3.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); - TJAPlayer3.Tx.Difficulty_Bar.Opacity = (TJAPlayer3.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); - TJAPlayer3.Tx.Difficulty_Number.Opacity = (TJAPlayer3.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); - TJAPlayer3.Tx.Difficulty_Crown.Opacity = (TJAPlayer3.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); - TJAPlayer3.Tx.SongSelect_ScoreRank.vcScaleRatio.X = 0.65f; - TJAPlayer3.Tx.SongSelect_ScoreRank.vcScaleRatio.Y = 0.65f; - TJAPlayer3.Tx.SongSelect_ScoreRank.Opacity = (TJAPlayer3.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); - TJAPlayer3.Tx.Difficulty_Star.Opacity = (TJAPlayer3.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); + difficulty_back.Opacity = + (TJAPlayer3.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); + TJAPlayer3.Tx.Difficulty_Bar.Opacity = (TJAPlayer3.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); + TJAPlayer3.Tx.Difficulty_Number.Opacity = (TJAPlayer3.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); + TJAPlayer3.Tx.Difficulty_Crown.Opacity = (TJAPlayer3.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); + TJAPlayer3.Tx.SongSelect_ScoreRank.vcScaleRatio.X = 0.65f; + TJAPlayer3.Tx.SongSelect_ScoreRank.vcScaleRatio.Y = 0.65f; + TJAPlayer3.Tx.SongSelect_ScoreRank.Opacity = (TJAPlayer3.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); + TJAPlayer3.Tx.Difficulty_Star.Opacity = (TJAPlayer3.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); - difficulty_back.color4 = CConversion.ColorToColor4(TJAPlayer3.stageSongSelect.rNowSelectedSong.BoxColor); + difficulty_back.color4 = CConversion.ColorToColor4(TJAPlayer3.stageSongSelect.rNowSelectedSong.BoxColor); - difficulty_back.t2D中心基準描画(TJAPlayer3.Skin.SongSelect_Difficulty_Back[0], TJAPlayer3.Skin.SongSelect_Difficulty_Back[1]); + difficulty_back.t2D中心基準描画(TJAPlayer3.Skin.SongSelect_Difficulty_Back[0], TJAPlayer3.Skin.SongSelect_Difficulty_Back[1]); - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) break; - - /* + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.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))); */ - TJAPlayer3.Tx.Difficulty_Select_Bar[i].Opacity = (int)(ctBarAnimeIn.CurrentValue >= 80 ? (ctBarAnimeIn.CurrentValue - 80) * 2.84f : 0); + TJAPlayer3.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; - TJAPlayer3.Tx.Difficulty_Select_Bar[i].t2D描画( - TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Back_X[n現在の選択行[i]], - TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Back_Y[n現在の選択行[i]], - new RectangleF(TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Rect[backType][0], TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Rect[backType][1], - TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Rect[backType][2], TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Rect[backType][3])); - } + TJAPlayer3.Tx.Difficulty_Select_Bar[i].t2D描画( + TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Back_X[n現在の選択行[i]], + TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Back_Y[n現在の選択行[i]], + new RectangleF(TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Rect[backType][0], TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Rect[backType][1], + TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Rect[backType][2], TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Rect[backType][3])); + } - TJAPlayer3.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++) - { - TJAPlayer3.Tx.Difficulty_Bar.t2D描画(TJAPlayer3.Skin.SongSelect_Difficulty_Bar_X[i], TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Y[i], - new RectangleF(TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Rect[i][0], - TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Rect[i][1], - TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Rect[i][2], - TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Rect[i][3])); //閉じる - } + TJAPlayer3.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++) { + TJAPlayer3.Tx.Difficulty_Bar.t2D描画(TJAPlayer3.Skin.SongSelect_Difficulty_Bar_X[i], TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Y[i], + new RectangleF(TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Rect[i][0], + TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Rect[i][1], + TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Rect[i][2], + TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Rect[i][3])); //閉じる + } - exextraAnimation = TJAPlayer3.stageSongSelect.actExExtraTransAnime.Draw(); + exextraAnimation = TJAPlayer3.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 = TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i]; - bool avaliable = TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i] >= 0; + int screenPos = Math.Min((int)Difficulty.Oni, i); + int level = TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i]; + bool avaliable = TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i] >= 0; - if (avaliable) - TJAPlayer3.Tx.Difficulty_Bar.color4 = new Color4(1.0f, 1.0f, 1.0f, 1.0f); - else - TJAPlayer3.Tx.Difficulty_Bar.color4 = new Color4(0.5f, 0.5f, 0.5f, 1.0f); + if (avaliable) + TJAPlayer3.Tx.Difficulty_Bar.color4 = new Color4(1.0f, 1.0f, 1.0f, 1.0f); + else + TJAPlayer3.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 - { - TJAPlayer3.Tx.Difficulty_Bar.t2D描画(TJAPlayer3.Skin.SongSelect_Difficulty_Bar_X[i + 2], TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Y[i + 2], - new RectangleF(TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Rect[i + 2][0], - TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Rect[i + 2][1], - TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Rect[i + 2][2], - TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Rect[i + 2][3])); - } + if (!(i >= (int)Difficulty.Oni && exextraAnimation > 0)) // Hide Oni/Ura during transition + { + TJAPlayer3.Tx.Difficulty_Bar.t2D描画(TJAPlayer3.Skin.SongSelect_Difficulty_Bar_X[i + 2], TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Y[i + 2], + new RectangleF(TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Rect[i + 2][0], + TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Rect[i + 2][1], + TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Rect[i + 2][2], + TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Rect[i + 2][3])); + } - if (!avaliable) - continue; + if (!avaliable) + continue; - for (int j = 0; j < TJAPlayer3.ConfigIni.nPlayerCount; j++) - { - if (j >= 2) continue; + for (int j = 0; j < TJAPlayer3.ConfigIni.nPlayerCount; j++) { + if (j >= 2) continue; - if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) break; + if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) break; - int p = TJAPlayer3.GetActualPlayer(j); + int p = TJAPlayer3.GetActualPlayer(j); - Cスコア.ST譜面情報 idx = TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報; + Cスコア.ST譜面情報 idx = TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報; - //var GPInfo = TJAPlayer3.stageSongSelect.r現在選択中のスコア.GPInfo[p]; + //var GPInfo = TJAPlayer3.stageSongSelect.r現在選択中のスコア.GPInfo[p]; - var TableEntry = TJAPlayer3.SaveFileInstances[p].data.tGetSongSelectTableEntry(TJAPlayer3.stageSongSelect.rNowSelectedSong.tGetUniqueId()); + var TableEntry = TJAPlayer3.SaveFileInstances[p].data.tGetSongSelectTableEntry(TJAPlayer3.stageSongSelect.rNowSelectedSong.tGetUniqueId()); - //Difficulty_Crown.t2D描画(445 + screenPos * 144, 284, new RectangleF(idx.nクリア[i] * 24.5f, 0, 24.5f, 26)); + //Difficulty_Crown.t2D描画(445 + screenPos * 144, 284, new RectangleF(idx.nクリア[i] * 24.5f, 0, 24.5f, 26)); - int crown_width = TJAPlayer3.Tx.Difficulty_Crown.szTextureSize.Width / 5; - int crown_height = TJAPlayer3.Tx.Difficulty_Crown.szTextureSize.Height; - TJAPlayer3.Tx.Difficulty_Crown.t2D描画( - TJAPlayer3.Skin.SongSelect_Difficulty_Crown_X[j][i], - TJAPlayer3.Skin.SongSelect_Difficulty_Crown_Y[j][i], - new RectangleF(TableEntry.ClearStatuses[i] * crown_width, 0, crown_width, crown_height)); + int crown_width = TJAPlayer3.Tx.Difficulty_Crown.szTextureSize.Width / 5; + int crown_height = TJAPlayer3.Tx.Difficulty_Crown.szTextureSize.Height; + TJAPlayer3.Tx.Difficulty_Crown.t2D描画( + TJAPlayer3.Skin.SongSelect_Difficulty_Crown_X[j][i], + TJAPlayer3.Skin.SongSelect_Difficulty_Crown_Y[j][i], + new RectangleF(TableEntry.ClearStatuses[i] * crown_width, 0, crown_width, crown_height)); - int scoreRank_width = TJAPlayer3.Tx.SongSelect_ScoreRank.szTextureSize.Width; - int scoreRank_height = TJAPlayer3.Tx.SongSelect_ScoreRank.szTextureSize.Height / 7; + int scoreRank_width = TJAPlayer3.Tx.SongSelect_ScoreRank.szTextureSize.Width; + int scoreRank_height = TJAPlayer3.Tx.SongSelect_ScoreRank.szTextureSize.Height / 7; - if (TableEntry.ScoreRanks[i] != 0) - TJAPlayer3.Tx.SongSelect_ScoreRank.t2D描画( - TJAPlayer3.Skin.SongSelect_Difficulty_ScoreRank_X[j][i], - TJAPlayer3.Skin.SongSelect_Difficulty_ScoreRank_Y[j][i], - new RectangleF(0, (TableEntry.ScoreRanks[i] - 1) * scoreRank_height, scoreRank_width, scoreRank_height)); + if (TableEntry.ScoreRanks[i] != 0) + TJAPlayer3.Tx.SongSelect_ScoreRank.t2D描画( + TJAPlayer3.Skin.SongSelect_Difficulty_ScoreRank_X[j][i], + TJAPlayer3.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小文字表示(TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i], - TJAPlayer3.Skin.SongSelect_Difficulty_Number_X[i], - TJAPlayer3.Skin.SongSelect_Difficulty_Number_Y[i], - i, - TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nLevelIcon[i] - ); + } - if (!(i >= (int)Difficulty.Oni && exextraAnimation > 0)) - { - for (int g = 0; g < 10; g++) - { - if (level > g + 10) - { - TJAPlayer3.Tx.Difficulty_Star.color4 = new Color4(1f, 0.2f, 0.2f, 1.0f); - TJAPlayer3.Tx.Difficulty_Star?.t2D描画(TJAPlayer3.Skin.SongSelect_Difficulty_Star_X[i] + g * TJAPlayer3.Skin.SongSelect_Difficulty_Star_Interval[0], TJAPlayer3.Skin.SongSelect_Difficulty_Star_Y[i] + g * TJAPlayer3.Skin.SongSelect_Difficulty_Star_Interval[1]); - } - else if (level > g) - { - TJAPlayer3.Tx.Difficulty_Star.color4 = new Color4(1f, 1f, 1f, 1.0f); - TJAPlayer3.Tx.Difficulty_Star?.t2D描画(TJAPlayer3.Skin.SongSelect_Difficulty_Star_X[i] + g * TJAPlayer3.Skin.SongSelect_Difficulty_Star_Interval[0], TJAPlayer3.Skin.SongSelect_Difficulty_Star_Y[i] + g * TJAPlayer3.Skin.SongSelect_Difficulty_Star_Interval[1]); - } + if (level >= 0 && (!(i >= (int)Difficulty.Oni && exextraAnimation > 0))) + t小文字表示(TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i], + TJAPlayer3.Skin.SongSelect_Difficulty_Number_X[i], + TJAPlayer3.Skin.SongSelect_Difficulty_Number_Y[i], + i, + TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.nLevelIcon[i] + ); - } - } + if (!(i >= (int)Difficulty.Oni && exextraAnimation > 0)) { + for (int g = 0; g < 10; g++) { + if (level > g + 10) { + TJAPlayer3.Tx.Difficulty_Star.color4 = new Color4(1f, 0.2f, 0.2f, 1.0f); + TJAPlayer3.Tx.Difficulty_Star?.t2D描画(TJAPlayer3.Skin.SongSelect_Difficulty_Star_X[i] + g * TJAPlayer3.Skin.SongSelect_Difficulty_Star_Interval[0], TJAPlayer3.Skin.SongSelect_Difficulty_Star_Y[i] + g * TJAPlayer3.Skin.SongSelect_Difficulty_Star_Interval[1]); + } else if (level > g) { + TJAPlayer3.Tx.Difficulty_Star.color4 = new Color4(1f, 1f, 1f, 1.0f); + TJAPlayer3.Tx.Difficulty_Star?.t2D描画(TJAPlayer3.Skin.SongSelect_Difficulty_Star_X[i] + g * TJAPlayer3.Skin.SongSelect_Difficulty_Star_Interval[0], TJAPlayer3.Skin.SongSelect_Difficulty_Star_Y[i] + g * TJAPlayer3.Skin.SongSelect_Difficulty_Star_Interval[1]); + } - if (TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.b譜面分岐[i]) - TJAPlayer3.Tx.SongSelect_Branch_Text?.t2D描画( - - TJAPlayer3.Skin.SongSelect_Difficulty_Bar_X[i + 2] + TJAPlayer3.Skin.SongSelect_Branch_Text_Offset[0], - TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Y[i + 2] + TJAPlayer3.Skin.SongSelect_Branch_Text_Offset[1] - ); - } + } + } - this.txTitle.t2D中心基準描画(TJAPlayer3.Skin.SongSelect_Difficulty_Select_Title[0], TJAPlayer3.Skin.SongSelect_Difficulty_Select_Title[1]); - this.txSubTitle.t2D中心基準描画(TJAPlayer3.Skin.SongSelect_Difficulty_Select_SubTitle[0], TJAPlayer3.Skin.SongSelect_Difficulty_Select_SubTitle[1]); + if (TJAPlayer3.stageSongSelect.r現在選択中のスコア.譜面情報.b譜面分岐[i]) + TJAPlayer3.Tx.SongSelect_Branch_Text?.t2D描画( - #region [ バーの描画 ] + TJAPlayer3.Skin.SongSelect_Difficulty_Bar_X[i + 2] + TJAPlayer3.Skin.SongSelect_Branch_Text_Offset[0], + TJAPlayer3.Skin.SongSelect_Difficulty_Bar_Y[i + 2] + TJAPlayer3.Skin.SongSelect_Branch_Text_Offset[1] + ); + } - for(int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) break; + this.txTitle.t2D中心基準描画(TJAPlayer3.Skin.SongSelect_Difficulty_Select_Title[0], TJAPlayer3.Skin.SongSelect_Difficulty_Select_Title[1]); + this.txSubTitle.t2D中心基準描画(TJAPlayer3.Skin.SongSelect_Difficulty_Select_SubTitle[0], TJAPlayer3.Skin.SongSelect_Difficulty_Select_SubTitle[1]); - /* + #region [ バーの描画 ] + + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.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; + //bool overlap = n現在の選択行[0] == n現在の選択行[1] && consideMultiPlay; - int overlapCount = 0; - int nowOverlapIndex = 0; + int overlapCount = 0; + int nowOverlapIndex = 0; - for (int j = 0; j < TJAPlayer3.ConfigIni.nPlayerCount; j++) - { - if (n現在の選択行[i] == n現在の選択行[j] && j != i) overlapCount++; - if (j == i) - { - nowOverlapIndex = overlapCount; - } - } + for (int j = 0; j < TJAPlayer3.ConfigIni.nPlayerCount; j++) { + if (n現在の選択行[i] == n現在の選択行[j] && j != i) overlapCount++; + if (j == i) { + nowOverlapIndex = overlapCount; + } + } - /*float moveX = overlap ? (i == 0 ? -TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Move[0] : TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Move[0]) : 0; + /*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])); @@ -538,109 +452,102 @@ namespace TJAPlayer3 (((float)Math.Cos((float)ctBarAnimeIn.n現在の値 * (Math.PI / 170)) + 1.0f) * TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Anime[1])); */ - float moveX = TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Move[0] * (nowOverlapIndex - (overlapCount / 2.0f)) * (2.0f / Math.Max(overlapCount, 1)); - float moveY = TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Move[1] * (nowOverlapIndex - (overlapCount / 2.0f)) * (2.0f / Math.Max(overlapCount, 1)); + float moveX = TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Move[0] * (nowOverlapIndex - (overlapCount / 2.0f)) * (2.0f / Math.Max(overlapCount, 1)); + float moveY = TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Move[1] * (nowOverlapIndex - (overlapCount / 2.0f)) * (2.0f / Math.Max(overlapCount, 1)); - if (!consideMultiPlay) - { - moveX = 0; - moveY = 0; - } + if (!consideMultiPlay) { + moveX = 0; + moveY = 0; + } - moveX += (((float)Math.Sin((float)ctBarAnime[i].CurrentValue * (Math.PI / 180)) * TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Anime[0]) - - (((float)Math.Cos((float)ctBarAnimeIn.CurrentValue * (Math.PI / 170)) + 1.0f) * TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_AnimeIn[0])); - moveY += (((float)Math.Sin((float)ctBarAnime[i].CurrentValue * (Math.PI / 180)) * TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Anime[1]) - - (((float)Math.Cos((float)ctBarAnimeIn.CurrentValue * (Math.PI / 170)) + 1.0f) * TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Anime[1])); + moveX += (((float)Math.Sin((float)ctBarAnime[i].CurrentValue * (Math.PI / 180)) * TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Anime[0]) - + (((float)Math.Cos((float)ctBarAnimeIn.CurrentValue * (Math.PI / 170)) + 1.0f) * TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_AnimeIn[0])); + moveY += (((float)Math.Sin((float)ctBarAnime[i].CurrentValue * (Math.PI / 180)) * TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Anime[1]) - + (((float)Math.Cos((float)ctBarAnimeIn.CurrentValue * (Math.PI / 170)) + 1.0f) * TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Anime[1])); - TJAPlayer3.Tx.Difficulty_Select_Bar[i].t2D描画( - TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_X[n現在の選択行[i]] + moveX, - TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Y[n現在の選択行[i]] + moveY, - new RectangleF(TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Rect[0][0], TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Rect[0][1], - TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Rect[0][2], TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Rect[0][3])); - } + TJAPlayer3.Tx.Difficulty_Select_Bar[i].t2D描画( + TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_X[n現在の選択行[i]] + moveX, + TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Y[n現在の選択行[i]] + moveY, + new RectangleF(TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Rect[0][0], TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Rect[0][1], + TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Rect[0][2], TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Rect[0][3])); + } - #endregion + #endregion - #endregion + #endregion - return 0; - } + return 0; + } - // その他 + // その他 - #region [ private ] - //----------------- + #region [ private ] + //----------------- - public bool[] bSelect = new bool[5]; - public bool[] bOption = new bool[5]; + 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 CCachedFontRenderer pfTitle; + private CCachedFontRenderer pfSubTitle; + private CTexture txTitle; + private CTexture txSubTitle; - private CCounter ctBarAnimeIn; - private CCounter[] ctBarAnime = new CCounter[2]; + private CCounter ctBarAnimeIn; + private CCounter[] ctBarAnime = new CCounter[2]; - private int exextraAnimation; + private int exextraAnimation; - //0 閉じる 1 演奏オプション 2~ 難易度 - public int[] n現在の選択行; - private int nスイッチカウント; + //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 bool b裏譜面; + //176 + private int[] BarX = new int[] { 163, 251, 367, 510, 653, 797, 797 }; - private CSound soundSelectAnnounce; + private CSound soundSelectAnnounce; - [StructLayout(LayoutKind.Sequential)] - private struct STレベル数字 - { - public char ch; - public int ptX; - } - private STレベル数字[] st小文字位置 = new STレベル数字[10]; + [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 - (TJAPlayer3.Skin.SongSelect_Difficulty_Number_Interval[0] * offset); - float _y = y - (TJAPlayer3.Skin.SongSelect_Difficulty_Number_Interval[1] * offset); + 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 - (TJAPlayer3.Skin.SongSelect_Difficulty_Number_Interval[0] * offset); + float _y = y - (TJAPlayer3.Skin.SongSelect_Difficulty_Number_Interval[1] * offset); - int width = TJAPlayer3.Tx.Difficulty_Number.sz画像サイズ.Width / 10; - int height = TJAPlayer3.Tx.Difficulty_Number.sz画像サイズ.Height; + int width = TJAPlayer3.Tx.Difficulty_Number.sz画像サイズ.Width / 10; + int height = TJAPlayer3.Tx.Difficulty_Number.sz画像サイズ.Height; - icon_coords[0] = Math.Max(icon_coords[0], _x + width); - icon_coords[1] = _y; + icon_coords[0] = Math.Max(icon_coords[0], _x + width); + icon_coords[1] = _y; - TJAPlayer3.Tx.Difficulty_Number.t2D描画(_x, _y, new Rectangle(width * nums[j], 0, width, height)); + TJAPlayer3.Tx.Difficulty_Number.t2D描画(_x, _y, new Rectangle(width * nums[j], 0, width, height)); - if (TJAPlayer3.Tx.Difficulty_Number_Colored != null) - { - TJAPlayer3.Tx.Difficulty_Number_Colored.color4 = CConversion.ColorToColor4(TJAPlayer3.Skin.SongSelect_Difficulty_Colors[diff]); - TJAPlayer3.Tx.Difficulty_Number_Colored.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - } - } - TJAPlayer3.stageSongSelect.actSongList.tDisplayLevelIcon((int)icon_coords[0], (int)icon_coords[1], icon, TJAPlayer3.Tx.Difficulty_Number_Icon); - } + if (TJAPlayer3.Tx.Difficulty_Number_Colored != null) { + TJAPlayer3.Tx.Difficulty_Number_Colored.color4 = CConversion.ColorToColor4(TJAPlayer3.Skin.SongSelect_Difficulty_Colors[diff]); + TJAPlayer3.Tx.Difficulty_Number_Colored.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); + } + } + TJAPlayer3.stageSongSelect.actSongList.tDisplayLevelIcon((int)icon_coords[0], (int)icon_coords[1], icon, TJAPlayer3.Tx.Difficulty_Number_Icon); + } - private bool isOnOption() - { - return bOption[0] || bOption[1] || bOption[2] || bOption[3] || bOption[4]; - } + private bool isOnOption() { + return bOption[0] || bOption[1] || bOption[2] || bOption[3] || bOption[4]; + } - public int nStrジャンルtoNum(string strジャンル) - { - return TJAPlayer3.stageSongSelect.actSongList.nStrジャンルtoNumBox(strジャンル); - } - //----------------- - #endregion - } + public int nStrジャンルtoNum(string strジャンル) { + return TJAPlayer3.stageSongSelect.actSongList.nStrジャンルtoNumBox(strジャンル); + } + //----------------- + #endregion + } } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSortSongs.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSortSongs.cs index 7eae5fb7..b9ea18ca 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSortSongs.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSortSongs.cs @@ -1,38 +1,32 @@ -using System.Collections.Generic; - -namespace TJAPlayer3 -{ - internal class CActSortSongs : CActSelectPopupMenu - { +namespace TJAPlayer3 { + internal class CActSortSongs : CActSelectPopupMenu { // コンストラクタ - public CActSortSongs() - { + 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,..." } ) ); - //lci.Add( new CItemList( "Best Rank", CItemBase.Eパネル種別.通常, 0, "", "", new string[] { "E,D,C,...", "SS,S,A,..." } ) ); - //lci.Add( new CItemList( "PlayCount", CItemBase.Eパネル種別.通常, 0, "", "", new string[] { "10,9,8,...", "1,2,3,..." } ) ); - - //lci.Add( new CItemList( "SkillPoint", CItemBase.Eパネル種別.通常, 0, "", "", new string[] { "100,99,98,...", "1,2,3,..." } ) ); + 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,..." })); + //lci.Add( new CItemList( "Best Rank", CItemBase.Eパネル種別.通常, 0, "", "", new string[] { "E,D,C,...", "SS,S,A,..." } ) ); + //lci.Add( new CItemList( "PlayCount", CItemBase.Eパネル種別.通常, 0, "", "", new string[] { "10,9,8,...", "1,2,3,..." } ) ); + + //lci.Add( new CItemList( "SkillPoint", CItemBase.Eパネル種別.通常, 0, "", "", new string[] { "100,99,98,...", "1,2,3,..." } ) ); #if TEST_SORTBGM lci.Add( new CItemList( "BPM", CItemBase.Eパネル種別.通常, 0, "", "", new string[] { "300,200,...", "70,80,90,..." } ) ); #endif //lci.Add( new CItemList( "ジャンル", CItemBase.Eパネル種別.通常, 0, "", "", new string[] { "AC15", "AC8-14" } ) ); - 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 void tDeativatePopupMenu() //{ @@ -40,36 +34,34 @@ namespace TJAPlayer3 //} - public override void tEnter押下Main( int nSortOrder ) - { - nSortOrder *= 2; // 0,1 => -1, 1 + public override void tEnter押下Main(int nSortOrder) { + nSortOrder *= 2; // 0,1 => -1, 1 nSortOrder -= 1; - switch ( (EOrder)n現在の選択行 ) - { + switch ((EOrder)n現在の選択行) { case EOrder.Path: this.act曲リスト.t曲リストのソート( - CSongs管理.t曲リストのソート1_絶対パス順, eInst, nSortOrder + CSongs管理.t曲リストのソート1_絶対パス順, eInst, nSortOrder ); this.act曲リスト.t選択曲が変更された(true); break; case EOrder.Title: this.act曲リスト.t曲リストのソート( - CSongs管理.t曲リストのソート2_タイトル順, eInst, nSortOrder + 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; - 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曲リストのソート( @@ -79,34 +71,29 @@ namespace TJAPlayer3 this.act曲リスト.t選択曲が変更された(true); break; #endif - case EOrder.Return: + case EOrder.Return: this.tDeativatePopupMenu(); break; default: break; } } - + // CActivity 実装 - public override void Activate() - { - //this.e現在のソート = EOrder.Title; + public override void Activate() { + //this.e現在のソート = EOrder.Title; base.Activate(); } - public override void DeActivate() - { - if( !base.IsDeActivated ) - { + public override void DeActivate() { + if (!base.IsDeActivated) { base.DeActivate(); } } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { base.ReleaseManagedResource(); } @@ -115,13 +102,12 @@ namespace TJAPlayer3 private CActSelect曲リスト act曲リスト; - private enum EOrder : int - { - Path = 0, + private enum EOrder : int { + Path = 0, Title = 1, Subtitle = 2, Level = 3, - Return = 4 + Return = 4 } //----------------- diff --git a/OpenTaiko/src/Stages/05.SongSelect/CStage選曲.cs b/OpenTaiko/src/Stages/05.SongSelect/CStage選曲.cs index 92f49040..74194338 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CStage選曲.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CStage選曲.cs @@ -1,1250 +1,1052 @@ -using FDK; -using System; -using System.Collections.Generic; -using System.Diagnostics; +using System.Diagnostics; using System.Drawing; -using System.IO; using System.Runtime.InteropServices; using System.Text; using DiscordRPC; -using static System.Runtime.InteropServices.JavaScript.JSType; +using FDK; using static TJAPlayer3.CActSelect曲リスト; -namespace TJAPlayer3 -{ - /* +namespace TJAPlayer3 { + /* ** 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] + #region [Generic static class for handling the menu song] - static internal class CSongSelectSongManager - { - public static CSkin.CSystemSound bgmIn - { - get - { - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - return TJAPlayer3.Skin.bgmSongSelect_AI_In; - } - else - { - return TJAPlayer3.Skin.bgm選曲画面イン; - } - } - } - public static CSkin.CSystemSound bgmLoop - { - get - { - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - return TJAPlayer3.Skin.bgmSongSelect_AI; - } - else - { - return TJAPlayer3.Skin.bgm選曲画面; - } - } - } + static internal class CSongSelectSongManager { + public static CSkin.CSystemSound bgmIn { + get { + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + return TJAPlayer3.Skin.bgmSongSelect_AI_In; + } else { + return TJAPlayer3.Skin.bgm選曲画面イン; + } + } + } + public static CSkin.CSystemSound bgmLoop { + get { + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + return TJAPlayer3.Skin.bgmSongSelect_AI; + } else { + return TJAPlayer3.Skin.bgm選曲画面; + } + } + } - public static void playSongIfPossible() - { - if (CSongSelectSongManager.isSongDisabled) - return; + public static void playSongIfPossible() { + if (CSongSelectSongManager.isSongDisabled) + return; - if (TJAPlayer3.ConfigIni.bBGM音を発声する && !bgmIn.bIsPlaying && !bgmLoop.bIsPlaying) - { - if (inSongPlayed == false) - { - bgmIn.tPlay(); - CSongSelectSongManager.inSongPlayed = true; - } - else - { - bgmLoop.tPlay(); - } - } - - } + if (TJAPlayer3.ConfigIni.bBGM音を発声する && !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 stopSong() { + bgmIn.tStop(); + bgmLoop.tStop(); + CSongSelectSongManager.inSongPlayed = false; + } - public static void disable() - { - CSongSelectSongManager.stopSong(); - CSongSelectSongManager.isSongDisabled = true; - } + 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; - } + private static bool inSongPlayed = false; + private static bool isSongDisabled = false; + } - #endregion + #endregion - internal class CStage選曲 : CStage - { - // プロパティ - 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]; + internal class CStage選曲 : CStage { + // プロパティ + 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 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()); + // コンストラクタ + 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++) { + 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); - } + 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 - } + this.CommandHistory = new CCommandHistory(); // #24063 2011.1.16 yyagi + } - // メソッド + // メソッド - public void tNotifySelectedSongChange() - { - int scroll = this.ct背景スクロール用タイマー.CurrentValue; + public void tNotifySelectedSongChange() { + int scroll = this.ct背景スクロール用タイマー.CurrentValue; - if (rPrevSelectedSong != null) - { - bool bchangedBGPath = rNowSelectedSong != null && rNowSelectedSong.strSelectBGPath != rPrevSelectedSong.strSelectBGPath; + if (rPrevSelectedSong != null) { + bool bchangedBGPath = rNowSelectedSong != null && rNowSelectedSong.strSelectBGPath != rPrevSelectedSong.strSelectBGPath; - if (bchangedBGPath) - TJAPlayer3.tテクスチャの解放(ref txCustomPrevSelectBG); + if (bchangedBGPath) + TJAPlayer3.tテクスチャの解放(ref txCustomPrevSelectBG); - txCustomPrevSelectBG = txCustomSelectBG; + txCustomPrevSelectBG = txCustomSelectBG; - if (bchangedBGPath) - { - if (rNowSelectedSong.strSelectBGPath != null && rNowSelectedSong.strSelectBGPath != "") - { - txCustomSelectBG = TJAPlayer3.tテクスチャの生成(rNowSelectedSong.strSelectBGPath); - } - else - { - txCustomSelectBG = null; - } - } - } + if (bchangedBGPath) { + if (rNowSelectedSong.strSelectBGPath != null && rNowSelectedSong.strSelectBGPath != "") { + txCustomSelectBG = TJAPlayer3.tテクスチャの生成(rNowSelectedSong.strSelectBGPath); + } else { + txCustomSelectBG = null; + } + } + } - float scale = TJAPlayer3.Skin.Resolution[1] / (float)txGenreBack.szTextureSize.Height; - this.ct背景スクロール用タイマー = new CCounter(0, (int)(txGenreBack.szTextureSize.Width * scale), 30, TJAPlayer3.Timer); - this.ct背景スクロール用タイマー.CurrentValue = Math.Min(scroll, (int)(txGenreBack.szTextureSize.Width * scale)); + float scale = TJAPlayer3.Skin.Resolution[1] / (float)txGenreBack.szTextureSize.Height; + this.ct背景スクロール用タイマー = new CCounter(0, (int)(txGenreBack.szTextureSize.Width * scale), 30, TJAPlayer3.Timer); + this.ct背景スクロール用タイマー.CurrentValue = Math.Min(scroll, (int)(txGenreBack.szTextureSize.Width * scale)); - float oldScale = TJAPlayer3.Skin.Resolution[1] / (float)txOldGenreBack.szTextureSize.Height; - this.ctOldBGScroll = new CCounter(0, (int)(txOldGenreBack.szTextureSize.Width * oldScale), 30, TJAPlayer3.Timer); - this.ctOldBGScroll.CurrentValue = Math.Min(scroll, (int)(txOldGenreBack.szTextureSize.Width * oldScale)); + float oldScale = TJAPlayer3.Skin.Resolution[1] / (float)txOldGenreBack.szTextureSize.Height; + this.ctOldBGScroll = new CCounter(0, (int)(txOldGenreBack.szTextureSize.Width * oldScale), 30, TJAPlayer3.Timer); + this.ctOldBGScroll.CurrentValue = Math.Min(scroll, (int)(txOldGenreBack.szTextureSize.Width * oldScale)); - this.actPreimageパネル.t選択曲が変更された(); - this.actPresound.t選択曲が変更された(); - this.act演奏履歴パネル.t選択曲が変更された(); - this.actステータスパネル.t選択曲が変更された(); - this.actArtistComment.t選択曲が変更された(); - actDanInfo.UpdateSong(); + this.actPreimageパネル.t選択曲が変更された(); + this.actPresound.t選択曲が変更された(); + this.act演奏履歴パネル.t選択曲が変更された(); + this.actステータスパネル.t選択曲が変更された(); + this.actArtistComment.t選択曲が変更された(); + actDanInfo.UpdateSong(); - #region [ プラグインにも通知する(BOX, RANDOM, BACK なら通知しない)] - //--------------------- - if (TJAPlayer3.app != null) - { - var c曲リストノード = TJAPlayer3.stageSongSelect.rNowSelectedSong; - var cスコア = TJAPlayer3.stageSongSelect.r現在選択中のスコア; + #region [ プラグインにも通知する(BOX, RANDOM, BACK なら通知しない)] + //--------------------- + if (TJAPlayer3.app != null) { + var c曲リストノード = TJAPlayer3.stageSongSelect.rNowSelectedSong; + var cスコア = TJAPlayer3.stageSongSelect.r現在選択中のスコア; - if (c曲リストノード != null && cスコア != null && c曲リストノード.eノード種別 == CSongListNode.ENodeType.SCORE) - { - string str選択曲ファイル名 = cスコア.ファイル情報.ファイルの絶対パス; - int n曲番号inブロック = TJAPlayer3.stageSongSelect.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(c曲リストノード); + if (c曲リストノード != null && cスコア != null && c曲リストノード.eノード種別 == CSongListNode.ENodeType.SCORE) { + string str選択曲ファイル名 = cスコア.ファイル情報.ファイルの絶対パス; + int n曲番号inブロック = TJAPlayer3.stageSongSelect.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(c曲リストノード); - foreach (TJAPlayer3.STPlugin stPlugin in TJAPlayer3.app.PluginList) - { - Directory.SetCurrentDirectory(stPlugin.pluginDirectory); - stPlugin.plugin.On選択曲変更(str選択曲ファイル名, n曲番号inブロック); - Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); - } - } - } - //--------------------- - #endregion - } + foreach (TJAPlayer3.STPlugin stPlugin in TJAPlayer3.app.PluginList) { + Directory.SetCurrentDirectory(stPlugin.pluginDirectory); + stPlugin.plugin.On選択曲変更(str選択曲ファイル名, n曲番号inブロック); + Directory.SetCurrentDirectory(TJAPlayer3.strEXEのあるフォルダ); + } + } + } + //--------------------- + #endregion + } - // CStage 実装 + // CStage 実装 - /// - /// 曲リストをリセットする - /// - /// - public void Refresh(CSongs管理 cs, bool bRemakeSongTitleBar) - { - this.actSongList.Refresh(cs, bRemakeSongTitleBar); - } + /// + /// 曲リストをリセットする + /// + /// + 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戻り値.継続; + public override void Activate() { + Trace.TraceInformation("選曲ステージを活性化します。"); + Trace.Indent(); + try { + nChoosenSongDifficulty = new int[5]; + this.eフェードアウト完了時の戻り値 = E戻り値.継続; - // BGM played - this.bBGM再生済み = false; + // BGM played + this.bBGM再生済み = false; - this.ct背景スクロール用タイマー = new CCounter(0, txGenreBack.szTextureSize.Width, 30, TJAPlayer3.Timer); - this.ctOldBGScroll = new CCounter(0, txOldGenreBack.szTextureSize.Width, 30, TJAPlayer3.Timer); + this.ct背景スクロール用タイマー = new CCounter(0, txGenreBack.szTextureSize.Width, 30, TJAPlayer3.Timer); + this.ctOldBGScroll = new CCounter(0, txOldGenreBack.szTextureSize.Width, 30, TJAPlayer3.Timer); - TJAPlayer3.Skin.voiceMenuSongSelect[TJAPlayer3.SaveFile]?.tPlay(); - - for (int i = 0; i < 2; i++) - this.ctキー反復用[i] = new CCounter(0, 0, 0, TJAPlayer3.Timer); + TJAPlayer3.Skin.voiceMenuSongSelect[TJAPlayer3.SaveFile]?.tPlay(); - //ctChara_Normal = new CCounter(0, TJAPlayer3.Tx.SongSelect_Chara_Normal.Length - 1, 1000 / 45, TJAPlayer3.Timer); - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.NORMAL); + for (int i = 0; i < 2; i++) + this.ctキー反復用[i] = new CCounter(0, 0, 0, TJAPlayer3.Timer); - //ctChara_Select = new CCounter(); - //ctChara_Jump[0] = new CCounter(); - //ctChara_Jump[1] = new CCounter(); + //ctChara_Normal = new CCounter(0, TJAPlayer3.Tx.SongSelect_Chara_Normal.Length - 1, 1000 / 45, TJAPlayer3.Timer); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.NORMAL); - CMenuCharacter.tDisableCounter(CMenuCharacter.ECharacterAnimation.SELECT); - CMenuCharacter.tDisableCounter(CMenuCharacter.ECharacterAnimation.START); + //ctChara_Select = new CCounter(); + //ctChara_Jump[0] = new CCounter(); + //ctChara_Jump[1] = new CCounter(); - ctBackgroundFade = new CCounter(); - ctCreditAnime = new CCounter(0, 4500, 1, TJAPlayer3.Timer); - ctTimer = new CCounter(0, 100, 1000, TJAPlayer3.Timer); + CMenuCharacter.tDisableCounter(CMenuCharacter.ECharacterAnimation.SELECT); + CMenuCharacter.tDisableCounter(CMenuCharacter.ECharacterAnimation.START); - this.PuchiChara.IdleAnimation(); + ctBackgroundFade = new CCounter(); + ctCreditAnime = new CCounter(0, 4500, 1, TJAPlayer3.Timer); + ctTimer = new CCounter(0, 100, 1000, TJAPlayer3.Timer); - ctBackgroundFade.CurrentValue = 600; + 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(); + for (int i = 0; i < 3; i++) + r[i] = new Random(); - //this.act難易度選択画面.bIsDifficltSelect = true; - base.Activate(); + //this.act難易度選択画面.bIsDifficltSelect = true; + base.Activate(); - this.actステータスパネル.t選択曲が変更された(); // 最大ランクを更新 - // Discord Presenceの更新 - TJAPlayer3.DiscordClient?.SetPresence(new RichPresence() - { + this.actステータスパネル.t選択曲が変更された(); // 最大ランクを更新 + // Discord Presenceの更新 + TJAPlayer3.DiscordClient?.SetPresence(new RichPresence() { Details = "", State = "SongSelect", Timestamps = new Timestamps(TJAPlayer3.StartupTime), - Assets = new Assets() - { + Assets = new Assets() { LargeImageKey = TJAPlayer3.LargeImageKey, LargeImageText = TJAPlayer3.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; - } - - TJAPlayer3.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; - } - - 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, TJAPlayer3.Timer); - if (TJAPlayer3.r直前のステージ == TJAPlayer3.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 - - - ctTimer.Tick(); - ctCreditAnime.TickLoop(); - ctBackgroundFade.Tick(); - - //ctChara_Select.t進行(); - //ctChara_Jump[0].t進行(); - //ctChara_Jump[1].t進行(); - //ctChara_Normal.t進行Loop(); - - this.ct登場時アニメ用共通.Tick(); - - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - AI_Background?.Update(); - AI_Background?.Draw(); - } - else - { - if (TJAPlayer3.Tx.SongSelect_Background != null) - TJAPlayer3.Tx.SongSelect_Background.t2D描画(0, 0); - } - - if (this.rNowSelectedSong != null) - { - - #region [Background] - - nGenreBack = this.NowBg; - nOldGenreBack = this.OldBg; - - if (!TJAPlayer3.ConfigIni.bAIBattleMode) - { - if (txGenreBack != null) - { - float scale = TJAPlayer3.Skin.Resolution[1] / (float)txGenreBack.szTextureSize.Height; - for (int i = 0; i < (TJAPlayer3.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 = TJAPlayer3.Skin.Resolution[1] / (float)txOldGenreBack.szTextureSize.Height; - for (int i = 0; i < (TJAPlayer3.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); - } - } - } - } - - #endregion - - #region [Song Panel] - - if (this.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.BOX) - { - TJAPlayer3.Tx.SongSelect_Song_Panel[0]?.t2D描画(0, 0); - } - else if (this.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) - { - var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); - var HiddenIndex = TJAPlayer3.Databases.DBSongUnlockables.tGetSongHiddenIndex(this.rNowSelectedSong); - - if (HiddenIndex == DBSongUnlockables.EHiddenIndex.GRAYED) - { - TJAPlayer3.Tx.SongSelect_Song_Panel[4]?.t2D描画(0, 0); - } - else - { - if (TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度 == (int)Difficulty.Dan) - TJAPlayer3.Tx.SongSelect_Song_Panel[2]?.t2D描画(0, 0); - else if (TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度 == (int)Difficulty.Tower) - TJAPlayer3.Tx.SongSelect_Song_Panel[3]?.t2D描画(0, 0); - else - TJAPlayer3.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)(TJAPlayer3.Tx.SongSelect_Header.sz画像サイズ.Height * dbY表示割合)) - TJAPlayer3.Tx.SongSelect_Header.sz画像サイズ.Height; - } - - TJAPlayer3.Tx.SongSelect_Header?.t2D描画(0, 0); - TJAPlayer3.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 = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); - var HiddenIndex = TJAPlayer3.Databases.DBSongUnlockables.tGetSongHiddenIndex(this.rNowSelectedSong); - - if (HiddenIndex != DBSongUnlockables.EHiddenIndex.GRAYED) - { - actSongInfo.Draw(); - if (TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度 == (int)Difficulty.Dan) - { - actDanInfo.Draw(); - } - else if (TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度 == (int)Difficulty.Tower) - { - actTowerInfo.Draw(); - } - else - { - } - } - } - } - - #endregion - - tSongNumberDraw(TJAPlayer3.Skin.SongSelect_SongNumber_X[0], TJAPlayer3.Skin.SongSelect_SongNumber_Y[0], NowSong); - tSongNumberDraw(TJAPlayer3.Skin.SongSelect_SongNumber_X[1], TJAPlayer3.Skin.SongSelect_SongNumber_Y[1], MaxSong); - - this.actInformation.Draw(); - - #region[Modicons] - - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - ModIcons.tDisplayModsMenu(TJAPlayer3.Skin.SongSelect_ModIcons_X[i], TJAPlayer3.Skin.SongSelect_ModIcons_Y[i], i); - } - - if (TJAPlayer3.ConfigIni.bTokkunMode) - TJAPlayer3.actTextConsole.tPrint(0, 0, CTextConsole.EFontType.White, "GAME: TRAINING MODE"); - if (TJAPlayer3.ConfigIni.eGameMode == EGame.完走叩ききりまショー) - TJAPlayer3.actTextConsole.tPrint(0, 16, CTextConsole.EFontType.White, "GAME: SURVIVAL"); - if (TJAPlayer3.ConfigIni.eGameMode == EGame.完走叩ききりまショー激辛) - TJAPlayer3.actTextConsole.tPrint(0, 16, CTextConsole.EFontType.White, "GAME: SURVIVAL HARD"); - if (TJAPlayer3.ConfigIni.bSuperHard) - TJAPlayer3.actTextConsole.tPrint(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 = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); - var HiddenIndex = TJAPlayer3.Databases.DBSongUnlockables.tGetSongHiddenIndex(this.rNowSelectedSong); - - if (this.actDifficultySelectionScreen.bIsDifficltSelect == false || this.actSongList.ctDifficultyIn.CurrentValue < 1000) - this.actPreimageパネル.Draw(); - - if (HiddenIndex == DBSongUnlockables.EHiddenIndex.GRAYED) - TJAPlayer3.Tx.SongSelect_Song_Panel[5]?.t2D描画(0, 0); - - if (IsSongLocked) - { - TJAPlayer3.Tx.SongSelect_Unlock_Conditions?.t2D描画(0, 0); - - if (actSongList.ttkNowUnlockConditionText is not null) - { - actSongList.ResolveTitleTexture(actSongList.ttkNowUnlockConditionText)?.t2D描画(TJAPlayer3.Skin.SongSelect_Unlock_Conditions_Text[0], TJAPlayer3.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(); + 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; + } + + TJAPlayer3.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; + } + + 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, TJAPlayer3.Timer); + if (TJAPlayer3.r直前のステージ == TJAPlayer3.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 + + + ctTimer.Tick(); + ctCreditAnime.TickLoop(); + ctBackgroundFade.Tick(); + + //ctChara_Select.t進行(); + //ctChara_Jump[0].t進行(); + //ctChara_Jump[1].t進行(); + //ctChara_Normal.t進行Loop(); + + this.ct登場時アニメ用共通.Tick(); + + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + AI_Background?.Update(); + AI_Background?.Draw(); + } else { + if (TJAPlayer3.Tx.SongSelect_Background != null) + TJAPlayer3.Tx.SongSelect_Background.t2D描画(0, 0); + } + + if (this.rNowSelectedSong != null) { + + #region [Background] + + nGenreBack = this.NowBg; + nOldGenreBack = this.OldBg; + + if (!TJAPlayer3.ConfigIni.bAIBattleMode) { + if (txGenreBack != null) { + float scale = TJAPlayer3.Skin.Resolution[1] / (float)txGenreBack.szTextureSize.Height; + for (int i = 0; i < (TJAPlayer3.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 = TJAPlayer3.Skin.Resolution[1] / (float)txOldGenreBack.szTextureSize.Height; + for (int i = 0; i < (TJAPlayer3.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); + } + } + } + } + + #endregion + + #region [Song Panel] + + if (this.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.BOX) { + TJAPlayer3.Tx.SongSelect_Song_Panel[0]?.t2D描画(0, 0); + } else if (this.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) { + var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); + var HiddenIndex = TJAPlayer3.Databases.DBSongUnlockables.tGetSongHiddenIndex(this.rNowSelectedSong); + + if (HiddenIndex == DBSongUnlockables.EHiddenIndex.GRAYED) { + TJAPlayer3.Tx.SongSelect_Song_Panel[4]?.t2D描画(0, 0); + } else { + if (TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度 == (int)Difficulty.Dan) + TJAPlayer3.Tx.SongSelect_Song_Panel[2]?.t2D描画(0, 0); + else if (TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度 == (int)Difficulty.Tower) + TJAPlayer3.Tx.SongSelect_Song_Panel[3]?.t2D描画(0, 0); + else + TJAPlayer3.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)(TJAPlayer3.Tx.SongSelect_Header.sz画像サイズ.Height * dbY表示割合)) - TJAPlayer3.Tx.SongSelect_Header.sz画像サイズ.Height; + } + + TJAPlayer3.Tx.SongSelect_Header?.t2D描画(0, 0); + TJAPlayer3.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 = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); + var HiddenIndex = TJAPlayer3.Databases.DBSongUnlockables.tGetSongHiddenIndex(this.rNowSelectedSong); - #region [Character & PuchiChara] + if (HiddenIndex != DBSongUnlockables.EHiddenIndex.GRAYED) { + actSongInfo.Draw(); + if (TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度 == (int)Difficulty.Dan) { + actDanInfo.Draw(); + } else if (TJAPlayer3.stageSongSelect.n現在選択中の曲の難易度 == (int)Difficulty.Tower) { + actTowerInfo.Draw(); + } else { + } + } + } + } + #endregion - //if (this.ctChara_Select.b終了値に達してない) + tSongNumberDraw(TJAPlayer3.Skin.SongSelect_SongNumber_X[0], TJAPlayer3.Skin.SongSelect_SongNumber_Y[0], NowSong); + tSongNumberDraw(TJAPlayer3.Skin.SongSelect_SongNumber_X[1], TJAPlayer3.Skin.SongSelect_SongNumber_Y[1], MaxSong); - for (int player = 0; player < TJAPlayer3.ConfigIni.nPlayerCount; player++) - { - CCounter ___cc = CMenuCharacter._getReferenceCounter(CMenuCharacter.ECharacterAnimation.SELECT)[player]; + this.actInformation.Draw(); - int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character; + #region[Modicons] - //int chara_x = TJAPlayer3.Skin.Characters_Menu_X[_charaId][player]; - //int chara_y = TJAPlayer3.Skin.Characters_Menu_Y[_charaId][player]; + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + ModIcons.tDisplayModsMenu(TJAPlayer3.Skin.SongSelect_ModIcons_X[i], TJAPlayer3.Skin.SongSelect_ModIcons_Y[i], i); + } - int chara_x = TJAPlayer3.Skin.SongSelect_NamePlate_X[player] + TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2; - int chara_y = TJAPlayer3.Skin.SongSelect_NamePlate_Y[player]; + if (TJAPlayer3.ConfigIni.bTokkunMode) + TJAPlayer3.actTextConsole.tPrint(0, 0, CTextConsole.EFontType.White, "GAME: TRAINING MODE"); + if (TJAPlayer3.ConfigIni.eGameMode == EGame.完走叩ききりまショー) + TJAPlayer3.actTextConsole.tPrint(0, 16, CTextConsole.EFontType.White, "GAME: SURVIVAL"); + if (TJAPlayer3.ConfigIni.eGameMode == EGame.完走叩ききりまショー激辛) + TJAPlayer3.actTextConsole.tPrint(0, 16, CTextConsole.EFontType.White, "GAME: SURVIVAL HARD"); + if (TJAPlayer3.ConfigIni.bSuperHard) + TJAPlayer3.actTextConsole.tPrint(0, 32, CTextConsole.EFontType.Cyan, "SUPER HARD MODE : ON"); - //int puchi_x = player == 0 ? 0 + 100 : 981 + 250; - //int puchi_y = player == 0 ? 330 + 230 : 330 + 230; + #endregion - int puchi_x = chara_x + TJAPlayer3.Skin.Adjustments_MenuPuchichara_X[player % 2]; - int puchi_y = chara_y + TJAPlayer3.Skin.Adjustments_MenuPuchichara_Y[player % 2]; + #region [Preimage, upper lock layer and unlock conditions] - if (___cc != null && ___cc.IsUnEnded) - { - CMenuCharacter.tMenuDisplayCharacter(player, chara_x, chara_y, CMenuCharacter.ECharacterAnimation.SELECT); + if (this.rNowSelectedSong != null + && this.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) { + var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); + var HiddenIndex = TJAPlayer3.Databases.DBSongUnlockables.tGetSongHiddenIndex(this.rNowSelectedSong); - this.PuchiChara.On進行描画(puchi_x, puchi_y, false, 255, false, player); - } - else - { - CCounter ___cj = CMenuCharacter._getReferenceCounter(CMenuCharacter.ECharacterAnimation.START)[player]; + if (this.actDifficultySelectionScreen.bIsDifficltSelect == false || this.actSongList.ctDifficultyIn.CurrentValue < 1000) + this.actPreimageパネル.Draw(); + if (HiddenIndex == DBSongUnlockables.EHiddenIndex.GRAYED) + TJAPlayer3.Tx.SongSelect_Song_Panel[5]?.t2D描画(0, 0); - if (___cj != null && ___cj.EndValue > 0) - { - CMenuCharacter.tMenuDisplayCharacter(player, chara_x, chara_y, CMenuCharacter.ECharacterAnimation.START); + if (IsSongLocked) { + TJAPlayer3.Tx.SongSelect_Unlock_Conditions?.t2D描画(0, 0); - 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); + if (actSongList.ttkNowUnlockConditionText is not null) { + actSongList.ResolveTitleTexture(actSongList.ttkNowUnlockConditionText)?.t2D描画(TJAPlayer3.Skin.SongSelect_Unlock_Conditions_Text[0], TJAPlayer3.Skin.SongSelect_Unlock_Conditions_Text[1]); + } + } + } - this.PuchiChara.On進行描画(puchi_x, puchi_y, false, 255, false, player); - } - else - { - CMenuCharacter.tMenuDisplayCharacter(player, chara_x, chara_y, CMenuCharacter.ECharacterAnimation.NORMAL); + #endregion - this.PuchiChara.On進行描画(puchi_x, puchi_y, false, 255, false, player); - } - } - } + this.actPresound.Draw(); + this.act演奏履歴パネル.Draw(); - #endregion + this.actShowCurrentPosition.Draw(); // #27648 2011.3.28 yyagi - #region [ Nameplate ] - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - TJAPlayer3.NamePlate.tNamePlateDraw(TJAPlayer3.Skin.SongSelect_NamePlate_X[i], TJAPlayer3.Skin.SongSelect_NamePlate_Y[i], i); - } - #endregion + // Select screen song + if (base.ePhaseID == CStage.EPhase.Common_NORMAL) { + CSongSelectSongManager.playSongIfPossible(); + } - #region [Pad displayables] + if (this.ctDiffSelect移動待ち != null) + this.ctDiffSelect移動待ち.Tick(); - int defaultTable = Math.Max(0, Math.Min((int)Difficulty.Edit + 1, TJAPlayer3.ConfigIni.nDefaultCourse)); - int[] currentPads = new int[5] { - defaultTable, - defaultTable, - defaultTable, - defaultTable, - defaultTable }; + #region [Character & PuchiChara] - //int currentPad = (int)Difficulty.Edit + 1; - if (TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) - { - if (TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[0] >= 2) - currentPads[0] = TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[0] - 2; - if (TJAPlayer3.ConfigIni.nPlayerCount > 1 && TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[1] >= 2) - currentPads[1] = TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[1] - 2; - if (TJAPlayer3.ConfigIni.nPlayerCount > 1 && TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[2] >= 2) - currentPads[2] = TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[2] - 2; - if (TJAPlayer3.ConfigIni.nPlayerCount > 1 && TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[3] >= 2) - currentPads[3] = TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[3] - 2; - if (TJAPlayer3.ConfigIni.nPlayerCount > 1 && TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[4] >= 2) - currentPads[4] = TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[4] - 2; - } + //if (this.ctChara_Select.b終了値に達してない) + for (int player = 0; player < TJAPlayer3.ConfigIni.nPlayerCount; player++) { + CCounter ___cc = CMenuCharacter._getReferenceCounter(CMenuCharacter.ECharacterAnimation.SELECT)[player]; - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) break; + int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character; - int p = TJAPlayer3.GetActualPlayer(i); - - TJAPlayer3.Tx.SongSelect_Table[currentPads[i]]?.t2D描画(TJAPlayer3.Skin.SongSelect_Table_X[i], TJAPlayer3.Skin.SongSelect_Table_Y[i]); + //int chara_x = TJAPlayer3.Skin.Characters_Menu_X[_charaId][player]; + //int chara_y = TJAPlayer3.Skin.Characters_Menu_Y[_charaId][player]; - CActSelect曲リスト.CScorePad[] SPArrRef = CSongDict.ScorePads[p]; - - // Current board - for (int j = 0; j < 11; j++) - { - tBoardNumberDraw(TJAPlayer3.Skin.SongSelect_BoardNumber_X[i][j], TJAPlayer3.Skin.SongSelect_BoardNumber_Y[i][j], j < 7 ? - SPArrRef[currentPads[i]].ScoreRankCount[j] - : SPArrRef[currentPads[i]].CrownCount[j - 7]); - } - - } - - if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) - { - TJAPlayer3.Tx.SongSelect_Coin_Slot[0]?.t2D描画(0, 0, - new Rectangle(0, 0, (TJAPlayer3.Tx.SongSelect_Coin_Slot[0].sz画像サイズ.Width / 2) + ((TJAPlayer3.ConfigIni.nPlayerCount > 1 && !TJAPlayer3.ConfigIni.bAIBattleMode) ? (TJAPlayer3.Tx.SongSelect_Coin_Slot[0].sz画像サイズ.Width / 2) : 0), TJAPlayer3.Tx.SongSelect_Coin_Slot[0].sz画像サイズ.Height)); - } - else - { - TJAPlayer3.Tx.SongSelect_Coin_Slot[TJAPlayer3.ConfigIni.nPlayerCount - 2]?.t2D描画(0, 0); - } - - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) break; - - int p = TJAPlayer3.GetActualPlayer(i); - - if (TJAPlayer3.SaveFileInstances[p].data.Medals >= 0) - tBoardNumberDraw(TJAPlayer3.Skin.SongSelect_BoardNumber_X[i][11], TJAPlayer3.Skin.SongSelect_BoardNumber_Y[i][11], (int)TJAPlayer3.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; - - TJAPlayer3.Tx.SongSelect_High_Score?.t2D中心基準描画(TJAPlayer3.Skin.SongSelect_High_Score_X[i], TJAPlayer3.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 = TJAPlayer3.SaveFileInstances[p].data.tGetSongSelectTableEntry(TJAPlayer3.stageSongSelect.rNowSelectedSong.tGetUniqueId()); - displayedScore = TableEntry.HighScore[table]; - - if (this.n現在選択中の曲の難易度 <= (int)Difficulty.Edit) - { - CTexture __tex = (TJAPlayer3.Tx.SongSelect_Difficulty_Cymbol == null) ? TJAPlayer3.Tx.Dani_Difficulty_Cymbol : TJAPlayer3.Tx.SongSelect_Difficulty_Cymbol; - int width = __tex.sz画像サイズ.Width / 5; - int height = __tex.sz画像サイズ.Height; - - __tex.t2D中心基準描画( - TJAPlayer3.Skin.SongSelect_High_Score_Difficulty_Cymbol_X[i], - TJAPlayer3.Skin.SongSelect_High_Score_Difficulty_Cymbol_Y[i], - new Rectangle(table * width, 0, width, height)); - } - - tBoardNumberDraw(TJAPlayer3.Skin.SongSelect_BoardNumber_X[i][12], TJAPlayer3.Skin.SongSelect_BoardNumber_Y[i][12], displayedScore); - } - - } - - #endregion - } - - #endregion - - - #region [ Inputs ] - - // キー入力 - if (base.ePhaseID == CStage.EPhase.Common_NORMAL - && TJAPlayer3.act現在入力を占有中のプラグイン == null) - { - #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; - TJAPlayer3.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(); - - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - this.actSongList.ctBarFlash.Start(0, 2700, 1, TJAPlayer3.Timer); - this.actSongList.ctBoxOpen.Start(200, 2700, 1.3f, TJAPlayer3.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 - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - this.actDifficultySelectionScreen.bIsDifficltSelect = true; - this.actDifficultySelectionScreen.t選択画面初期化(); - this.actSongList.ctBarFlash.Start(0, 2700, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval, TJAPlayer3.Timer); - this.actSongList.ctDifficultyIn.Start(0, 3200, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval, TJAPlayer3.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 ((TJAPlayer3.Pad.bPressedDGB(EPad.Cancel) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) && (this.actSongList.rCurrentlySelectedSong != null))// && ( ) ) ) - if (this.actSongList.rCurrentlySelectedSong.rParentNode == null) - { // [ESC] - this.actPresound.tStopSound(); - CSongSelectSongManager.enable(); - - TJAPlayer3.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(); - - TJAPlayer3.Skin.soundCancelSFX.tPlay(); - this.actSongList.ctBarFlash.Start(0, 2700, 1, TJAPlayer3.Timer); - this.actSongList.ctBoxOpen.Start(200, 2700, 1.3f, TJAPlayer3.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 ((TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightShift) || TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftShift)) && - TJAPlayer3.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; - TJAPlayer3.Skin.soundCancelSFX.tPlay(); - return 0; - } - #endregion - #region [ F2 Quick Config ] - if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.QuickConfig)) - { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - this.actQuickConfig.tActivatePopupMenu(EInstrumentPad.DRUMS); - } - #endregion - #region [ F3 1P AUTO ] - if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.ToggleAutoP1)) - { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - CUtility.ToggleBoolian(ref TJAPlayer3.ConfigIni.bAutoPlay[0]); - } - #endregion - #region [ F4 2P AUTO ] - if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.ToggleAutoP2)) - { - if (TJAPlayer3.ConfigIni.nPlayerCount > 1) - { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - CUtility.ToggleBoolian(ref TJAPlayer3.ConfigIni.bAutoPlay[1]); - } - } - #endregion - #region [ F5 Super Hard Mode (DEPRECATED / UNUSED) ] - if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F5)) - { - // Deprecated, to delete - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - CUtility.ToggleBoolian(ref TJAPlayer3.ConfigIni.bSuperHard); - } - #endregion - #region [ F7 TokkunMode ] - if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.ToggleTrainingMode)) - { - if (TJAPlayer3.ConfigIni.nPlayerCount < 2) - { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - CUtility.ToggleBoolian(ref TJAPlayer3.ConfigIni.bTokkunMode); - } - } - #endregion - #region [ F9 New Heya ] - if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.NewHeya)) - { - actNewHeya.Open(); - } - #endregion - - if (this.actSongList.rCurrentlySelectedSong != null) - { - - if (this.actSongList.ctBoxOpen.IsEnded || this.actSongList.ctBoxOpen.CurrentValue == 0) - { - if (!this.bCurrentlyScrolling) - { - #region [ Decide ] - if ((TJAPlayer3.Pad.bPressedDGB(EPad.Decide) || - ((TJAPlayer3.ConfigIni.bEnterがキー割り当てのどこにも使用されていない && TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))))) - { - - if (this.actSongList.rCurrentlySelectedSong != null) - { - switch (this.actSongList.rCurrentlySelectedSong.eノード種別) - { - case CSongListNode.ENodeType.SCORE: - { - var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); - - if (IsSongLocked) - { - var SongToUnlock = TJAPlayer3.Databases.DBSongUnlockables.tGetUnlockableByUniqueId(this.rNowSelectedSong); - - if (SongToUnlock != null) - { - (bool, string?) response = SongToUnlock.unlockConditions.tConditionMetWrapper(TJAPlayer3.SaveFile, DBUnlockables.CUnlockConditions.EScreen.SongSelect); - - 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) - { - TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.UnlockedSongs.Add(this.rNowSelectedSong?.tGetUniqueId() ?? ""); - DBSaves.RegisterStringUnlockedAsset( - TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.SaveId, - "unlocked_songs", - this.rNowSelectedSong?.tGetUniqueId() ?? "" // Can't be null in this context - ); - TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].tSpendCoins(SongToUnlock.unlockConditions.Values[0]); - // Play modal animation here ? - } - else - TJAPlayer3.Skin.soundError.tPlay(); - } - else - { - TJAPlayer3.Skin.soundError.tPlay(); - } - } - else - { - if (this.n現在選択中の曲の難易度 >= (int)Difficulty.Tower) - { - if (TJAPlayer3.ConfigIni.nPlayerCount == 1 && !TJAPlayer3.ConfigIni.bTokkunMode) - { - // Init tower variables - if (this.n現在選択中の曲の難易度 == (int)Difficulty.Tower) - CFloorManagement.reinitialize(this.rNowSelectedSong.arスコア[(int)Difficulty.Tower].譜面情報.nLife); - - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - TJAPlayer3.Skin.voiceMenuSongDecide[TJAPlayer3.SaveFile]?.tPlay(); - - this.t曲を選択する(); - } - else - { - TJAPlayer3.Skin.soundError.tPlay(); - } - } - else - { - // Called here - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - this.actDifficultySelectionScreen.bIsDifficltSelect = true; - this.actDifficultySelectionScreen.t選択画面初期化(); - this.actSongList.ctBarFlash.Start(0, 2700, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval, TJAPlayer3.Timer); - this.actSongList.ctDifficultyIn.Start(0, 3200, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval, TJAPlayer3.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); - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - goto Decided; - //this.act曲リスト.r現在選択中の曲.list子リスト = CSongDict.tFetchSongsByDifficulty(this.act曲リスト.r現在選択中の曲, (int)Difficulty.Oni, 8); - } - - #endregion - - CSongSelectSongManager.disable(); - - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - this.actSongList.ctBarFlash.Start(0, 2700, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval, TJAPlayer3.Timer); - this.actSongList.ctBoxOpen.Start(200, 2700, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval * 1.3f, TJAPlayer3.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.soundCancelSFX.tPlay(); - this.actSongList.ctBarFlash.Start(0, 2700, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval, TJAPlayer3.Timer); - this.actSongList.ctBoxOpen.Start(200, 2700, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval * 1.3f, TJAPlayer3.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(); - - // Called here - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - this.actDifficultySelectionScreen.bIsDifficltSelect = true; - this.actDifficultySelectionScreen.t選択画面初期化(); - this.actSongList.ctBarFlash.Start(0, 2700, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval, TJAPlayer3.Timer); - this.actSongList.ctDifficultyIn.Start(0, 3200, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval, TJAPlayer3.Timer); - - //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); - - /* + int chara_x = TJAPlayer3.Skin.SongSelect_NamePlate_X[player] + TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2; + int chara_y = TJAPlayer3.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 = chara_x + TJAPlayer3.Skin.Adjustments_MenuPuchichara_X[player % 2]; + int puchi_y = chara_y + TJAPlayer3.Skin.Adjustments_MenuPuchichara_Y[player % 2]; + + 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 { + CMenuCharacter.tMenuDisplayCharacter(player, chara_x, chara_y, CMenuCharacter.ECharacterAnimation.NORMAL); + + this.PuchiChara.On進行描画(puchi_x, puchi_y, false, 255, false, player); + } + } + } + + + #endregion + + #region [ Nameplate ] + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + TJAPlayer3.NamePlate.tNamePlateDraw(TJAPlayer3.Skin.SongSelect_NamePlate_X[i], TJAPlayer3.Skin.SongSelect_NamePlate_Y[i], i); + } + #endregion + + #region [Pad displayables] + + int defaultTable = Math.Max(0, Math.Min((int)Difficulty.Edit + 1, TJAPlayer3.ConfigIni.nDefaultCourse)); + + int[] currentPads = new int[5] { + defaultTable, + defaultTable, + defaultTable, + defaultTable, + defaultTable }; + + //int currentPad = (int)Difficulty.Edit + 1; + if (TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) { + if (TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[0] >= 2) + currentPads[0] = TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[0] - 2; + if (TJAPlayer3.ConfigIni.nPlayerCount > 1 && TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[1] >= 2) + currentPads[1] = TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[1] - 2; + if (TJAPlayer3.ConfigIni.nPlayerCount > 1 && TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[2] >= 2) + currentPads[2] = TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[2] - 2; + if (TJAPlayer3.ConfigIni.nPlayerCount > 1 && TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[3] >= 2) + currentPads[3] = TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[3] - 2; + if (TJAPlayer3.ConfigIni.nPlayerCount > 1 && TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[4] >= 2) + currentPads[4] = TJAPlayer3.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[4] - 2; + } + + + + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) break; + + int p = TJAPlayer3.GetActualPlayer(i); + + TJAPlayer3.Tx.SongSelect_Table[currentPads[i]]?.t2D描画(TJAPlayer3.Skin.SongSelect_Table_X[i], TJAPlayer3.Skin.SongSelect_Table_Y[i]); + + CActSelect曲リスト.CScorePad[] SPArrRef = CSongDict.ScorePads[p]; + + // Current board + for (int j = 0; j < 11; j++) { + tBoardNumberDraw(TJAPlayer3.Skin.SongSelect_BoardNumber_X[i][j], TJAPlayer3.Skin.SongSelect_BoardNumber_Y[i][j], j < 7 ? + SPArrRef[currentPads[i]].ScoreRankCount[j] + : SPArrRef[currentPads[i]].CrownCount[j - 7]); + } + + } + + if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) { + TJAPlayer3.Tx.SongSelect_Coin_Slot[0]?.t2D描画(0, 0, + new Rectangle(0, 0, (TJAPlayer3.Tx.SongSelect_Coin_Slot[0].sz画像サイズ.Width / 2) + ((TJAPlayer3.ConfigIni.nPlayerCount > 1 && !TJAPlayer3.ConfigIni.bAIBattleMode) ? (TJAPlayer3.Tx.SongSelect_Coin_Slot[0].sz画像サイズ.Width / 2) : 0), TJAPlayer3.Tx.SongSelect_Coin_Slot[0].sz画像サイズ.Height)); + } else { + TJAPlayer3.Tx.SongSelect_Coin_Slot[TJAPlayer3.ConfigIni.nPlayerCount - 2]?.t2D描画(0, 0); + } + + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) break; + + int p = TJAPlayer3.GetActualPlayer(i); + + if (TJAPlayer3.SaveFileInstances[p].data.Medals >= 0) + tBoardNumberDraw(TJAPlayer3.Skin.SongSelect_BoardNumber_X[i][11], TJAPlayer3.Skin.SongSelect_BoardNumber_Y[i][11], (int)TJAPlayer3.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; + + TJAPlayer3.Tx.SongSelect_High_Score?.t2D中心基準描画(TJAPlayer3.Skin.SongSelect_High_Score_X[i], TJAPlayer3.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 = TJAPlayer3.SaveFileInstances[p].data.tGetSongSelectTableEntry(TJAPlayer3.stageSongSelect.rNowSelectedSong.tGetUniqueId()); + displayedScore = TableEntry.HighScore[table]; + + if (this.n現在選択中の曲の難易度 <= (int)Difficulty.Edit) { + CTexture __tex = (TJAPlayer3.Tx.SongSelect_Difficulty_Cymbol == null) ? TJAPlayer3.Tx.Dani_Difficulty_Cymbol : TJAPlayer3.Tx.SongSelect_Difficulty_Cymbol; + int width = __tex.sz画像サイズ.Width / 5; + int height = __tex.sz画像サイズ.Height; + + __tex.t2D中心基準描画( + TJAPlayer3.Skin.SongSelect_High_Score_Difficulty_Cymbol_X[i], + TJAPlayer3.Skin.SongSelect_High_Score_Difficulty_Cymbol_Y[i], + new Rectangle(table * width, 0, width, height)); + } + + tBoardNumberDraw(TJAPlayer3.Skin.SongSelect_BoardNumber_X[i][12], TJAPlayer3.Skin.SongSelect_BoardNumber_Y[i][12], displayedScore); + } + + } + + #endregion + } + + #endregion + + + #region [ Inputs ] + + // キー入力 + if (base.ePhaseID == CStage.EPhase.Common_NORMAL + && TJAPlayer3.act現在入力を占有中のプラグイン == null) { + #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; + TJAPlayer3.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(); + + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + this.actSongList.ctBarFlash.Start(0, 2700, 1, TJAPlayer3.Timer); + this.actSongList.ctBoxOpen.Start(200, 2700, 1.3f, TJAPlayer3.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 + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + this.actDifficultySelectionScreen.bIsDifficltSelect = true; + this.actDifficultySelectionScreen.t選択画面初期化(); + this.actSongList.ctBarFlash.Start(0, 2700, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval, TJAPlayer3.Timer); + this.actSongList.ctDifficultyIn.Start(0, 3200, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval, TJAPlayer3.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 ((TJAPlayer3.Pad.bPressedDGB(EPad.Cancel) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) && (this.actSongList.rCurrentlySelectedSong != null))// && ( ) ) ) + if (this.actSongList.rCurrentlySelectedSong.rParentNode == null) { // [ESC] + this.actPresound.tStopSound(); + CSongSelectSongManager.enable(); + + TJAPlayer3.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(); + + TJAPlayer3.Skin.soundCancelSFX.tPlay(); + this.actSongList.ctBarFlash.Start(0, 2700, 1, TJAPlayer3.Timer); + this.actSongList.ctBoxOpen.Start(200, 2700, 1.3f, TJAPlayer3.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 ((TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightShift) || TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftShift)) && + TJAPlayer3.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; + TJAPlayer3.Skin.soundCancelSFX.tPlay(); + return 0; + } + #endregion + #region [ F2 Quick Config ] + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.QuickConfig)) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + this.actQuickConfig.tActivatePopupMenu(EInstrumentPad.DRUMS); + } + #endregion + #region [ F3 1P AUTO ] + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.ToggleAutoP1)) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + CUtility.ToggleBoolian(ref TJAPlayer3.ConfigIni.bAutoPlay[0]); + } + #endregion + #region [ F4 2P AUTO ] + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.ToggleAutoP2)) { + if (TJAPlayer3.ConfigIni.nPlayerCount > 1) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + CUtility.ToggleBoolian(ref TJAPlayer3.ConfigIni.bAutoPlay[1]); + } + } + #endregion + #region [ F5 Super Hard Mode (DEPRECATED / UNUSED) ] + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F5)) { + // Deprecated, to delete + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + CUtility.ToggleBoolian(ref TJAPlayer3.ConfigIni.bSuperHard); + } + #endregion + #region [ F7 TokkunMode ] + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.ToggleTrainingMode)) { + if (TJAPlayer3.ConfigIni.nPlayerCount < 2) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + CUtility.ToggleBoolian(ref TJAPlayer3.ConfigIni.bTokkunMode); + } + } + #endregion + #region [ F9 New Heya ] + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.NewHeya)) { + actNewHeya.Open(); + } + #endregion + + if (this.actSongList.rCurrentlySelectedSong != null) { + + if (this.actSongList.ctBoxOpen.IsEnded || this.actSongList.ctBoxOpen.CurrentValue == 0) { + if (!this.bCurrentlyScrolling) { + #region [ Decide ] + if ((TJAPlayer3.Pad.bPressedDGB(EPad.Decide) || + ((TJAPlayer3.ConfigIni.bEnterがキー割り当てのどこにも使用されていない && TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))))) { + + if (this.actSongList.rCurrentlySelectedSong != null) { + switch (this.actSongList.rCurrentlySelectedSong.eノード種別) { + case CSongListNode.ENodeType.SCORE: { + var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); + + if (IsSongLocked) { + var SongToUnlock = TJAPlayer3.Databases.DBSongUnlockables.tGetUnlockableByUniqueId(this.rNowSelectedSong); + + if (SongToUnlock != null) { + (bool, string?) response = SongToUnlock.unlockConditions.tConditionMetWrapper(TJAPlayer3.SaveFile, DBUnlockables.CUnlockConditions.EScreen.SongSelect); + + 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) { + TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.UnlockedSongs.Add(this.rNowSelectedSong?.tGetUniqueId() ?? ""); + DBSaves.RegisterStringUnlockedAsset( + TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.SaveId, + "unlocked_songs", + this.rNowSelectedSong?.tGetUniqueId() ?? "" // Can't be null in this context + ); + TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].tSpendCoins(SongToUnlock.unlockConditions.Values[0]); + // Play modal animation here ? + } else + TJAPlayer3.Skin.soundError.tPlay(); + } else { + TJAPlayer3.Skin.soundError.tPlay(); + } + } else { + if (this.n現在選択中の曲の難易度 >= (int)Difficulty.Tower) { + if (TJAPlayer3.ConfigIni.nPlayerCount == 1 && !TJAPlayer3.ConfigIni.bTokkunMode) { + // Init tower variables + if (this.n現在選択中の曲の難易度 == (int)Difficulty.Tower) + CFloorManagement.reinitialize(this.rNowSelectedSong.arスコア[(int)Difficulty.Tower].譜面情報.nLife); + + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + TJAPlayer3.Skin.voiceMenuSongDecide[TJAPlayer3.SaveFile]?.tPlay(); + + this.t曲を選択する(); + } else { + TJAPlayer3.Skin.soundError.tPlay(); + } + } else { + // Called here + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + this.actDifficultySelectionScreen.bIsDifficltSelect = true; + this.actDifficultySelectionScreen.t選択画面初期化(); + this.actSongList.ctBarFlash.Start(0, 2700, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval, TJAPlayer3.Timer); + this.actSongList.ctDifficultyIn.Start(0, 3200, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval, TJAPlayer3.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); + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + goto Decided; + //this.act曲リスト.r現在選択中の曲.list子リスト = CSongDict.tFetchSongsByDifficulty(this.act曲リスト.r現在選択中の曲, (int)Difficulty.Oni, 8); + } + + #endregion + + CSongSelectSongManager.disable(); + + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + this.actSongList.ctBarFlash.Start(0, 2700, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval, TJAPlayer3.Timer); + this.actSongList.ctBoxOpen.Start(200, 2700, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval * 1.3f, TJAPlayer3.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.soundCancelSFX.tPlay(); + this.actSongList.ctBarFlash.Start(0, 2700, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval, TJAPlayer3.Timer); + this.actSongList.ctBoxOpen.Start(200, 2700, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval * 1.3f, TJAPlayer3.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(); + + // Called here + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + this.actDifficultySelectionScreen.bIsDifficltSelect = true; + this.actDifficultySelectionScreen.t選択画面初期化(); + this.actSongList.ctBarFlash.Start(0, 2700, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval, TJAPlayer3.Timer); + this.actSongList.ctDifficultyIn.Start(0, 3200, TJAPlayer3.Skin.SongSelect_Box_Opening_Interval, TJAPlayer3.Timer); + + //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); + + /* TJAPlayer3.Skin.sound決定音.t再生する(); 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; - } + } + break; + } - goto Decided; + goto Decided; - } - } - #endregion + } + } + #endregion - } + } - #region [ Favorite ] + #region [ Favorite ] - if (!this.bCurrentlyScrolling) - { - var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); + if (!this.bCurrentlyScrolling) { + var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); - if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftControl) && !IsSongLocked) - { - CSongUniqueID csu = this.rNowSelectedSong.uniqueId; + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftControl) && !IsSongLocked) { + CSongUniqueID csu = this.rNowSelectedSong.uniqueId; - if (csu != null) - { - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - TJAPlayer3.Favorites.tToggleFavorite(csu.data.id); - } - } - } + if (csu != null) { + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + TJAPlayer3.Favorites.tToggleFavorite(csu.data.id); + } + } + } - #endregion + #endregion - #region [ Up ] - if (!this.bCurrentlyScrolling) - { - this.ctキー反復用.Up.KeyIntervalFunc(TJAPlayer3.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 (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange)) - { - this.tカーソルを上へ移動する(); - } - } - else - { - if (TJAPlayer3.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 [ Up ] + if (!this.bCurrentlyScrolling) { + this.ctキー反復用.Up.KeyIntervalFunc(TJAPlayer3.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 (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange)) { + this.tカーソルを上へ移動する(); + } + } else { + if (TJAPlayer3.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 + for (int i = 0; i < 7; i++) tカーソルスキップ(true); + } + } + #endregion - #region [ Down ] - if (!this.bCurrentlyScrolling) - { - this.ctキー反復用.Down.KeyIntervalFunc(TJAPlayer3.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 (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange)) - { - this.tカーソルを下へ移動する(); - } - } - else - { - if (TJAPlayer3.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 [ Down ] + if (!this.bCurrentlyScrolling) { + this.ctキー反復用.Down.KeyIntervalFunc(TJAPlayer3.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カーソルを下へ移動する ) ); - for (int i = 0; i < 7; i++) tカーソルスキップ(false); - } - } - #endregion + if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange)) { + this.tカーソルを下へ移動する(); + } + } else { + if (TJAPlayer3.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); - Decided:; + for (int i = 0; i < 7; i++) tカーソルスキップ(false); + } + } + #endregion - } - #region [ Upstairs ] - /* + 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(); @@ -1253,708 +1055,616 @@ namespace TJAPlayer3 this.tNotifySelectedSongChange(); } */ - #endregion - #region [ BDx2: 簡易CONFIG ] - if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.SortSongs)) - { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - this.actSortSongs.tActivatePopupMenu(EInstrumentPad.DRUMS, ref this.actSongList); - } - #endregion - #region [ HHx2: 難易度変更 ] - if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.HH) || TJAPlayer3.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難易度レベルをひとつ進める(); - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - } - } - #endregion - } - } + #endregion + #region [ BDx2: 簡易CONFIG ] + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.SortSongs)) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + this.actSortSongs.tActivatePopupMenu(EInstrumentPad.DRUMS, ref this.actSongList); + } + #endregion + #region [ HHx2: 難易度変更 ] + if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.HH) || TJAPlayer3.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難易度レベルをひとつ進める(); + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + } + } + #endregion + } + } - #region [ Minus & Equals Sound Group Level ] - KeyboardSoundGroupLevelControlHandler.Handle( - TJAPlayer3.InputManager.Keyboard, TJAPlayer3.SoundGroupLevelController, TJAPlayer3.Skin, true); - #endregion + #region [ Minus & Equals Sound Group Level ] + KeyboardSoundGroupLevelControlHandler.Handle( + TJAPlayer3.InputManager.Keyboard, TJAPlayer3.SoundGroupLevelController, TJAPlayer3.Skin, true); + #endregion - this.actSortSongs.t進行描画(); - this.actQuickConfig.t進行描画(); - } + this.actSortSongs.t進行描画(); + this.actQuickConfig.t進行描画(); + } - #endregion + #endregion - //------------------------------ - if (this.actDifficultySelectionScreen.bIsDifficltSelect) - { - if (this.actSongList.ctDifficultyIn.CurrentValue >= 1255) - { - this.actDifficultySelectionScreen.Draw(); - } - } - //------------------------------ + //------------------------------ + if (this.actDifficultySelectionScreen.bIsDifficltSelect) { + if (this.actSongList.ctDifficultyIn.CurrentValue >= 1255) { + this.actDifficultySelectionScreen.Draw(); + } + } + //------------------------------ - if (TJAPlayer3.ConfigIni.nPlayerCount == 1) - { - var opacity = 0; + if (TJAPlayer3.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); + if (ctCreditAnime.CurrentValue <= 510) + opacity = ctCreditAnime.CurrentValue / 2; + else if (ctCreditAnime.CurrentValue <= 4500 - 510) + opacity = 255; + else + opacity = 255 - ((ctCreditAnime.CurrentValue - (4500 - 510)) / 2); - TJAPlayer3.Tx.SongSelect_Credit.Opacity = opacity; + TJAPlayer3.Tx.SongSelect_Credit.Opacity = opacity; - TJAPlayer3.Tx.SongSelect_Credit.t2D描画(0, 0); - } + TJAPlayer3.Tx.SongSelect_Credit.t2D描画(0, 0); + } - for (int i = 0; i < 5; i++) - { - CCounter ___cs = CMenuCharacter._getReferenceCounter(CMenuCharacter.ECharacterAnimation.START)[i]; + 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.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 (!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 (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(); + 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; + 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.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_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 - { - 継続, - タイトルに戻る, - 選曲した, - オプション呼び出し, - コンフィグ呼び出し, - スキン変更 - } + 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; + #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: + 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; - private 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; + 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; + private 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; + public CActSortSongs actSortSongs; + private CActSelectQuickConfig actQuickConfig; - private ScriptBG AI_Background; + private ScriptBG AI_Background; - private const int MaxSong = 3; - public int NowSong = 1; + private const int MaxSong = 3; + public int NowSong = 1; - //private CCounter ctChara_Normal; - //private CCounter ctChara_Select; - //public CCounter[] ctChara_Jump = new CCounter[2]; + //private CCounter ctChara_Normal; + //private CCounter ctChara_Select; + //public CCounter[] ctChara_Jump = new CCounter[2]; - public PuchiChara PuchiChara; + 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 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]; + 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; // コマンド入力時刻 - } + 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, TJAPlayer3.Tx.SongSelect_GenreBack); - } - else - { - return txCustomSelectBG; - } - } - } - private CTexture txOldGenreBack - { - get - { - if (txCustomPrevSelectBG == null) - { - return HGenreBar.tGetGenreBar(nOldGenreBack, TJAPlayer3.Tx.SongSelect_GenreBack); - } - else - { - return txCustomPrevSelectBG; - } - } - } + private CTexture txCustomSelectBG; + private CTexture txCustomPrevSelectBG; + private CTexture txGenreBack { + get { + if (txCustomSelectBG == null) { + return HGenreBar.tGetGenreBar(nGenreBack, TJAPlayer3.Tx.SongSelect_GenreBack); + } else { + return txCustomSelectBG; + } + } + } + private CTexture txOldGenreBack { + get { + if (txCustomPrevSelectBG == null) { + return HGenreBar.tGetGenreBar(nOldGenreBack, TJAPlayer3.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 - (TJAPlayer3.Skin.SongSelect_BoardNumber_Interval[0] * offset); - float _y = y - (TJAPlayer3.Skin.SongSelect_BoardNumber_Interval[1] * offset); + 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 - (TJAPlayer3.Skin.SongSelect_BoardNumber_Interval[0] * offset); + float _y = y - (TJAPlayer3.Skin.SongSelect_BoardNumber_Interval[1] * offset); - float width = TJAPlayer3.Tx.SongSelect_BoardNumber.sz画像サイズ.Width / 10.0f; - float height = TJAPlayer3.Tx.SongSelect_BoardNumber.sz画像サイズ.Height; + float width = TJAPlayer3.Tx.SongSelect_BoardNumber.sz画像サイズ.Width / 10.0f; + float height = TJAPlayer3.Tx.SongSelect_BoardNumber.sz画像サイズ.Height; - TJAPlayer3.Tx.SongSelect_BoardNumber.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - } - } + TJAPlayer3.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 - (TJAPlayer3.Skin.SongSelect_SongNumber_Interval[0] * offset); - float _y = y - (TJAPlayer3.Skin.SongSelect_SongNumber_Interval[1] * offset); + 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 - (TJAPlayer3.Skin.SongSelect_SongNumber_Interval[0] * offset); + float _y = y - (TJAPlayer3.Skin.SongSelect_SongNumber_Interval[1] * offset); - float width = TJAPlayer3.Tx.SongSelect_Song_Number.sz画像サイズ.Width / 10.0f; - float height = TJAPlayer3.Tx.SongSelect_Song_Number.sz画像サイズ.Height; + float width = TJAPlayer3.Tx.SongSelect_Song_Number.sz画像サイズ.Width / 10.0f; + float height = TJAPlayer3.Tx.SongSelect_Song_Number.sz画像サイズ.Height; - TJAPlayer3.Tx.SongSelect_Song_Number.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - } - } + TJAPlayer3.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; + private void tTimerDraw(int num) { + //int x = 1171, y = 57; - int[] nums = CConversion.SeparateDigits(num); + int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) - { - if (TJAPlayer3.ConfigIni.bEnableCountdownTimer) - { - float offset = j - (nums.Length / 2.0f); - float x = TJAPlayer3.Skin.SongSelect_Timer[0] - (int)(TJAPlayer3.Skin.SongSelect_Timer_Interval[0] * offset); - float y = TJAPlayer3.Skin.SongSelect_Timer[1] - (int)(TJAPlayer3.Skin.SongSelect_Timer_Interval[1] * offset); + for (int j = 0; j < nums.Length; j++) { + if (TJAPlayer3.ConfigIni.bEnableCountdownTimer) { + float offset = j - (nums.Length / 2.0f); + float x = TJAPlayer3.Skin.SongSelect_Timer[0] - (int)(TJAPlayer3.Skin.SongSelect_Timer_Interval[0] * offset); + float y = TJAPlayer3.Skin.SongSelect_Timer[1] - (int)(TJAPlayer3.Skin.SongSelect_Timer_Interval[1] * offset); - float width = TJAPlayer3.Tx.SongSelect_Timer.sz画像サイズ.Width / 10.0f; - float height = TJAPlayer3.Tx.SongSelect_Timer.sz画像サイズ.Height / 2.0f; + float width = TJAPlayer3.Tx.SongSelect_Timer.sz画像サイズ.Width / 10.0f; + float height = TJAPlayer3.Tx.SongSelect_Timer.sz画像サイズ.Height / 2.0f; - TJAPlayer3.Tx.SongSelect_Timer.t2D描画(x, y, new RectangleF(width * nums[j], 0, width, height)); - } - } - } + TJAPlayer3.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; + private class CCommandHistory // #24063 2011.1.16 yyagi コマンド入力履歴を保持_確認するクラス + { + readonly int buffersize = 16; + private List stct; - public CCommandHistory() // コンストラクタ - { - stct = new List(buffersize); - } + public CCommandHistory() // コンストラクタ + { + stct = new List(buffersize); + } - /// - /// コマンド入力履歴へのコマンド追加 - /// - /// 楽器の種類 - /// 入力コマンド(同時押しはOR演算で列挙すること) - public void Add(EInstrumentPad _eInst, EPadFlag _ePad) - { - STCommandTime _stct = new STCommandTime - { - eInst = _eInst, - ePad = _ePad, - time = TJAPlayer3.Timer.NowTime - }; + /// + /// コマンド入力履歴へのコマンド追加 + /// + /// 楽器の種類 + /// 入力コマンド(同時押しはOR演算で列挙すること) + public void Add(EInstrumentPad _eInst, EPadFlag _ePad) { + STCommandTime _stct = new STCommandTime { + eInst = _eInst, + ePad = _ePad, + time = TJAPlayer3.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); - } + 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; - } + /// + /// コマンド入力に成功しているか調べる + /// + /// 入力が成功したか調べたいコマンド + /// 対象楽器 + /// コマンド入力成功時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 = TJAPlayer3.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; - } + long curTime = TJAPlayer3.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 + //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; + 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) - { - TJAPlayer3.stageSongSelect.bBGMIn再生した = false; + private void tカーソルを下へ移動する() { + if ((this.actSongList.rGetSideSong(1).eノード種別 == CSongListNode.ENodeType.SCORE) || this.actSongList.rGetSideSong(1).eノード種別 == CSongListNode.ENodeType.BACKBOX) { + TJAPlayer3.stageSongSelect.bBGMIn再生した = false; - CSongSelectSongManager.disable(); - } - else - { - CSongSelectSongManager.enable(); - CSongSelectSongManager.playSongIfPossible(); - } - this.ctBackgroundFade.Start(0, 600, 1, TJAPlayer3.Timer); - if (this.actSongList.ctBarOpen.CurrentValue >= 200 || this.ctBackgroundFade.CurrentValue >= 600 - 255) - { - TJAPlayer3.stageSongSelect.OldGenre = this.rNowSelectedSong.strジャンル; - TJAPlayer3.stageSongSelect.OldUseGenre = !this.rNowSelectedSong.isChangedBgType; - TJAPlayer3.stageSongSelect.OldBg = this.rNowSelectedSong.BgType; - TJAPlayer3.stageSongSelect.OldBgColor = this.rNowSelectedSong.BgColor; - } - - this.actSongList.t次に移動(); - TJAPlayer3.Skin.soundカーソル移動音.tPlay(); - } - private void tカーソルを上へ移動する() - { - if ((this.actSongList.rGetSideSong(-1).eノード種別 == CSongListNode.ENodeType.SCORE) || this.actSongList.rGetSideSong(-1).eノード種別 == CSongListNode.ENodeType.BACKBOX) - { - TJAPlayer3.stageSongSelect.bBGMIn再生した = false; + CSongSelectSongManager.disable(); + } else { + CSongSelectSongManager.enable(); + CSongSelectSongManager.playSongIfPossible(); + } + this.ctBackgroundFade.Start(0, 600, 1, TJAPlayer3.Timer); + if (this.actSongList.ctBarOpen.CurrentValue >= 200 || this.ctBackgroundFade.CurrentValue >= 600 - 255) { + TJAPlayer3.stageSongSelect.OldGenre = this.rNowSelectedSong.strジャンル; + TJAPlayer3.stageSongSelect.OldUseGenre = !this.rNowSelectedSong.isChangedBgType; + TJAPlayer3.stageSongSelect.OldBg = this.rNowSelectedSong.BgType; + TJAPlayer3.stageSongSelect.OldBgColor = this.rNowSelectedSong.BgColor; + } - CSongSelectSongManager.disable(); - } - else - { - CSongSelectSongManager.enable(); - CSongSelectSongManager.playSongIfPossible(); - } + this.actSongList.t次に移動(); + TJAPlayer3.Skin.soundカーソル移動音.tPlay(); + } + private void tカーソルを上へ移動する() { + if ((this.actSongList.rGetSideSong(-1).eノード種別 == CSongListNode.ENodeType.SCORE) || this.actSongList.rGetSideSong(-1).eノード種別 == CSongListNode.ENodeType.BACKBOX) { + TJAPlayer3.stageSongSelect.bBGMIn再生した = false; - this.ctBackgroundFade.Start(0, 600, 1, TJAPlayer3.Timer); - if (this.actSongList.ctBarOpen.CurrentValue >= 200 || this.ctBackgroundFade.CurrentValue >= 600 - 255) - { - TJAPlayer3.stageSongSelect.OldGenre = this.rNowSelectedSong.strジャンル; - TJAPlayer3.stageSongSelect.OldUseGenre = !this.rNowSelectedSong.isChangedBgType; - TJAPlayer3.stageSongSelect.OldBg = this.rNowSelectedSong.BgType; - TJAPlayer3.stageSongSelect.OldBgColor = this.rNowSelectedSong.BgColor; - } - - this.actSongList.t前に移動(); - TJAPlayer3.Skin.soundカーソル移動音.tPlay(); - } - private void tカーソルスキップ(bool Up) - { - this.ctBackgroundFade.Start(0, 600, 1, TJAPlayer3.Timer); - if (this.actSongList.ctBarOpen.CurrentValue >= 200 || this.ctBackgroundFade.CurrentValue >= 600 - 255) - { - TJAPlayer3.stageSongSelect.OldGenre = this.rNowSelectedSong.strジャンル; - TJAPlayer3.stageSongSelect.OldUseGenre = !this.rNowSelectedSong.isChangedBgType; - TJAPlayer3.stageSongSelect.OldBg = this.rNowSelectedSong.BgType; - TJAPlayer3.stageSongSelect.OldBgColor = this.rNowSelectedSong.BgColor; - } + CSongSelectSongManager.disable(); + } else { + CSongSelectSongManager.enable(); + CSongSelectSongManager.playSongIfPossible(); + } - if (Up) this.actSongList.t前に移動(); - else this.actSongList.t次に移動(); + this.ctBackgroundFade.Start(0, 600, 1, TJAPlayer3.Timer); + if (this.actSongList.ctBarOpen.CurrentValue >= 200 || this.ctBackgroundFade.CurrentValue >= 600 - 255) { + TJAPlayer3.stageSongSelect.OldGenre = this.rNowSelectedSong.strジャンル; + TJAPlayer3.stageSongSelect.OldUseGenre = !this.rNowSelectedSong.isChangedBgType; + TJAPlayer3.stageSongSelect.OldBg = this.rNowSelectedSong.BgType; + TJAPlayer3.stageSongSelect.OldBgColor = this.rNowSelectedSong.BgColor; + } - TJAPlayer3.Skin.soundSkip.tPlay(); - } + this.actSongList.t前に移動(); + TJAPlayer3.Skin.soundカーソル移動音.tPlay(); + } + private void tカーソルスキップ(bool Up) { + this.ctBackgroundFade.Start(0, 600, 1, TJAPlayer3.Timer); + if (this.actSongList.ctBarOpen.CurrentValue >= 200 || this.ctBackgroundFade.CurrentValue >= 600 - 255) { + TJAPlayer3.stageSongSelect.OldGenre = this.rNowSelectedSong.strジャンル; + TJAPlayer3.stageSongSelect.OldUseGenre = !this.rNowSelectedSong.isChangedBgType; + TJAPlayer3.stageSongSelect.OldBg = this.rNowSelectedSong.BgType; + TJAPlayer3.stageSongSelect.OldBgColor = this.rNowSelectedSong.BgColor; + } - private int tGetRandomSongDifficulty(int contextDiff) - { - var song = this.rChoosenSong; + if (Up) this.actSongList.t前に移動(); + else this.actSongList.t次に移動(); - int baseDiff = this.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(this.rChoosenSong); + TJAPlayer3.Skin.soundSkip.tPlay(); + } - 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; - } - } + private int tGetRandomSongDifficulty(int contextDiff) { + var song = this.rChoosenSong; - return baseDiff; - } + int baseDiff = this.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(this.rChoosenSong); - private void tSetSongRandomly() - { - var usedDiffs = new int[] { -1, -1, -1, -1, -1 }; - var mandatoryDiffs = new List(); + 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; + } + } - #region [Fetch context informations] + return baseDiff; + } - if (this.actSongList.latestContext == eMenuContext.Random) - { - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - var diff = this.actSongList.tMenuContextGetVar(i); - usedDiffs[i] = diff; - if (!mandatoryDiffs.Contains(diff)) - mandatoryDiffs.Add(diff); - } - } + private void tSetSongRandomly() { + var usedDiffs = new int[] { -1, -1, -1, -1, -1 }; + var mandatoryDiffs = new List(); - #endregion + #region [Fetch context informations] - CSongListNode song = this.actSongList.rCurrentlySelectedSong; + if (this.actSongList.latestContext == eMenuContext.Random) { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + var diff = this.actSongList.tMenuContextGetVar(i); + usedDiffs[i] = diff; + if (!mandatoryDiffs.Contains(diff)) + mandatoryDiffs.Add(diff); + } + } - song.listランダム用ノードリスト = this.t指定された曲が存在する場所の曲を列挙する_子リスト含む(song, ref mandatoryDiffs); - int selectableSongCount = song.listランダム用ノードリスト.Count; + #endregion - if (selectableSongCount == 0) - { - return; - } + CSongListNode song = this.actSongList.rCurrentlySelectedSong; - int randomSongIndex = TJAPlayer3.Random.Next(selectableSongCount); + song.listランダム用ノードリスト = this.t指定された曲が存在する場所の曲を列挙する_子リスト含む(song, ref mandatoryDiffs); + int selectableSongCount = song.listランダム用ノードリスト.Count; - if (TJAPlayer3.ConfigIni.bLogDTX詳細ログ出力) - { - 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 (selectableSongCount == 0) { + return; + } - // Third assignment - this.rNowSelectedSong = song.listランダム用ノードリスト[randomSongIndex]; + int randomSongIndex = TJAPlayer3.Random.Next(selectableSongCount); - 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現在選択中のスコア; + if (TJAPlayer3.ConfigIni.bLogDTX詳細ログ出力) { + 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()); + } - this.nChoosenSongDifficulty[0] = this.actSongList.n現在選択中の曲の現在の難易度レベル; - this.str確定された曲のジャンル = this.rChoosenSong.strジャンル; + // Third assignment + this.rNowSelectedSong = song.listランダム用ノードリスト[randomSongIndex]; - 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現在選択中のスコア; + 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[player] = nCurrentLevel; - this.str確定された曲のジャンル = this.rChoosenSong.strジャンル; + 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; - } + 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現在選択中のスコア; - // TJAPlayer3.Skin.bgm選曲画面.t停止する(); - CSongSelectSongManager.stopSong(); - } + this.nChoosenSongDifficulty[player] = nCurrentLevel; + this.str確定された曲のジャンル = this.rChoosenSong.strジャンル; - // Foreach randomly selectable songs - private List t指定された曲が存在する場所の曲を列挙する_子リスト含む(CSongListNode song, ref List mandatory) - { - List list = new List(); - song = song.rParentNode; - if ((song == null) && (TJAPlayer3.Songs管理.list曲ルート.Count > 0)) - { - foreach (CSongListNode c曲リストノード in TJAPlayer3.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; - } - } + if ((this.rChoosenSong != null) && (this.r確定されたスコア != null)) { + this.eフェードアウト完了時の戻り値 = E戻り値.選曲した; + this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略 + base.ePhaseID = CStage.EPhase.SongSelect_FadeOutToNowLoading; + } - var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(c曲リストノード); - if (requiredDiffsExist == true && IsSongLocked == false) - { - list.Add(c曲リストノード); - } - - } - - } - if ((c曲リストノード.list子リスト != null) && TJAPlayer3.ConfigIni.bIncludeSubfoldersOnRandomSelect) - { - this.t指定された曲の子リストの曲を列挙する_孫リスト含む(c曲リストノード, ref list, ref mandatory); - } - } - return list; - } - this.t指定された曲の子リストの曲を列挙する_孫リスト含む(song, ref list, ref mandatory); - return list; - } + // TJAPlayer3.Skin.bgm選曲画面.t停止する(); + CSongSelectSongManager.stopSong(); + } - 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曲リストノード); + // Foreach randomly selectable songs + private List t指定された曲が存在する場所の曲を列挙する_子リスト含む(CSongListNode song, ref List mandatory) { + List list = new List(); + song = song.rParentNode; + if ((song == null) && (TJAPlayer3.Songs管理.list曲ルート.Count > 0)) { + foreach (CSongListNode c曲リストノード in TJAPlayer3.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; + } + } - 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 = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(c曲リストノード); + if (requiredDiffsExist == true && IsSongLocked == false) { + list.Add(c曲リストノード); + } - var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(c曲リストノード); - if (requiredDiffsExist == true && IsSongLocked == false) - { - list.Add(c曲リストノード); - } + } - } - } - if ((c曲リストノード.list子リスト != null) && TJAPlayer3.ConfigIni.bIncludeSubfoldersOnRandomSelect) - { - this.t指定された曲の子リストの曲を列挙する_孫リスト含む(c曲リストノード, ref list, ref mandatory, dan, difficulty); - } - } - } - } + } + if ((c曲リストノード.list子リスト != null) && TJAPlayer3.ConfigIni.bIncludeSubfoldersOnRandomSelect) { + this.t指定された曲の子リストの曲を列挙する_孫リスト含む(c曲リストノード, ref list, ref mandatory); + } + } + return list; + } + this.t指定された曲の子リストの曲を列挙する_孫リスト含む(song, ref list, ref mandatory); + return list; + } - public int nStrジャンルtoNum(string strジャンル) - { - return this.actSongList.nStrジャンルtoNumBox(strジャンル); - } - //----------------- - #endregion - } -} \ No newline at end of file + 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; + } + } + + var IsSongLocked = TJAPlayer3.Databases.DBSongUnlockables.tIsSongLocked(c曲リストノード); + if (requiredDiffsExist == true && IsSongLocked == false) { + list.Add(c曲リストノード); + } + + } + } + if ((c曲リストノード.list子リスト != null) && TJAPlayer3.ConfigIni.bIncludeSubfoldersOnRandomSelect) { + this.t指定された曲の子リストの曲を列挙する_孫リスト含む(c曲リストノード, ref list, ref mandatory, dan, difficulty); + } + } + } + } + + public int nStrジャンルtoNum(string strジャンル) { + return this.actSongList.nStrジャンルtoNumBox(strジャンル); + } + //----------------- + #endregion + } +} diff --git a/OpenTaiko/src/Stages/06.SongLoading/CStage曲読み込み.cs b/OpenTaiko/src/Stages/06.SongLoading/CStage曲読み込み.cs index cb2451e7..31a0ae61 100644 --- a/OpenTaiko/src/Stages/06.SongLoading/CStage曲読み込み.cs +++ b/OpenTaiko/src/Stages/06.SongLoading/CStage曲読み込み.cs @@ -1,24 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; -using System.Drawing; -using System.IO; -using System.Drawing.Text; -using Silk.NET.Maths; +using System.Diagnostics; using FDK; -using RectangleF = System.Drawing.RectangleF; -using Color = System.Drawing.Color; - -namespace TJAPlayer3 -{ - internal class CStage曲読み込み : CStage - { +namespace TJAPlayer3 { + internal class CStage曲読み込み : CStage { // コンストラクタ - public CStage曲読み込み() - { + public CStage曲読み込み() { base.eStageID = CStage.EStage.SongLoading; base.ePhaseID = CStage.EPhase.Common_NORMAL; base.IsDeActivated = true; @@ -29,76 +16,66 @@ namespace TJAPlayer3 // CStage 実装 - public override void Activate() - { - Trace.TraceInformation( "曲読み込みステージを活性化します。" ); + public override void Activate() { + Trace.TraceInformation("曲読み込みステージを活性化します。"); Trace.Indent(); - try - { + try { this.str曲タイトル = ""; this.strSTAGEFILE = ""; this.nBGM再生開始時刻 = -1; this.nBGMの総再生時間ms = 0; - if( this.sd読み込み音 != null ) - { - TJAPlayer3.SoundManager.tDisposeSound( this.sd読み込み音 ); + if (this.sd読み込み音 != null) { + TJAPlayer3.SoundManager.tDisposeSound(this.sd読み込み音); this.sd読み込み音 = null; } - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] >= 5 || TJAPlayer3.ConfigIni.nPlayerCount != 1) - { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] >= 5 || TJAPlayer3.ConfigIni.nPlayerCount != 1) { TJAPlayer3.ConfigIni.bTokkunMode = false; } - if (TJAPlayer3.bコンパクトモード) - { - string strDTXファイルパス = TJAPlayer3.strコンパクトモードファイル; - - CDTX cdtx = new CDTX( strDTXファイルパス, true, 1.0, 0, 0 ); + if (TJAPlayer3.bコンパクトモード) { + string strDTXファイルパス = TJAPlayer3.strコンパクトモードファイル; - if( File.Exists( cdtx.strフォルダ名 + @"set.def" ) ) - cdtx = new CDTX( strDTXファイルパス, true, 1.0, 0, 1 ); + CDTX cdtx = new CDTX(strDTXファイルパス, true, 1.0, 0, 0); - this.str曲タイトル = cdtx.TITLE.GetString(""); - this.strサブタイトル = cdtx.SUBTITLE.GetString(""); + if (File.Exists(cdtx.strフォルダ名 + @"set.def")) + cdtx = new CDTX(strDTXファイルパス, true, 1.0, 0, 1); - cdtx.DeActivate(); - } - else - { - string strDTXファイルパス = TJAPlayer3.stageSongSelect.r確定されたスコア.ファイル情報.ファイルの絶対パス; + this.str曲タイトル = cdtx.TITLE.GetString(""); + this.strサブタイトル = cdtx.SUBTITLE.GetString(""); - var strフォルダ名 = Path.GetDirectoryName(strDTXファイルパス) + Path.DirectorySeparatorChar; + cdtx.DeActivate(); + } else { + string strDTXファイルパス = TJAPlayer3.stageSongSelect.r確定されたスコア.ファイル情報.ファイルの絶対パス; - if (File.Exists(strフォルダ名 + @"set.def")) - { - var cdtx = new CDTX(strDTXファイルパス, true, 1.0, 0, 1); + var strフォルダ名 = Path.GetDirectoryName(strDTXファイルパス) + Path.DirectorySeparatorChar; - this.str曲タイトル = cdtx.TITLE.GetString(""); - this.strサブタイトル = cdtx.SUBTITLE.GetString(""); + if (File.Exists(strフォルダ名 + @"set.def")) { + var cdtx = new CDTX(strDTXファイルパス, true, 1.0, 0, 1); - cdtx.DeActivate(); - } - else - { - var 譜面情報 = TJAPlayer3.stageSongSelect.r確定されたスコア.譜面情報; - this.str曲タイトル = 譜面情報.タイトル; - this.strサブタイトル = 譜面情報.strサブタイトル; - } - } + this.str曲タイトル = cdtx.TITLE.GetString(""); + this.strサブタイトル = cdtx.SUBTITLE.GetString(""); - // For the moment, detect that we are performing - // calibration via there being an actual single - // player and the special song title and subtitle - // of the .tja used to perform input calibration - TJAPlayer3.IsPerformingCalibration = - !TJAPlayer3.ConfigIni.bAutoPlay[0] && - TJAPlayer3.ConfigIni.nPlayerCount == 1 && - str曲タイトル == "Input Calibration" && - strサブタイトル == "TJAPlayer3 Developers"; + cdtx.DeActivate(); + } else { + var 譜面情報 = TJAPlayer3.stageSongSelect.r確定されたスコア.譜面情報; + this.str曲タイトル = 譜面情報.タイトル; + this.strサブタイトル = 譜面情報.strサブタイトル; + } + } + + // For the moment, detect that we are performing + // calibration via there being an actual single + // player and the special song title and subtitle + // of the .tja used to perform input calibration + TJAPlayer3.IsPerformingCalibration = + !TJAPlayer3.ConfigIni.bAutoPlay[0] && + TJAPlayer3.ConfigIni.nPlayerCount == 1 && + str曲タイトル == "Input Calibration" && + strサブタイトル == "TJAPlayer3 Developers"; this.strSTAGEFILE = CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}4_SongLoading{Path.DirectorySeparatorChar}Background.png"); - + float wait = 600f; if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) @@ -106,10 +83,9 @@ namespace TJAPlayer3 else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) wait = 1200f; - this.ct待機 = new CCounter( 0, wait, 5, TJAPlayer3.Timer ); - this.ct曲名表示 = new CCounter( 1, 30, 30, TJAPlayer3.Timer ); - try - { + this.ct待機 = new CCounter(0, wait, 5, TJAPlayer3.Timer); + this.ct曲名表示 = new CCounter(1, 30, 30, TJAPlayer3.Timer); + try { // When performing calibration, inform the player that // calibration is about to begin, rather than // displaying the song title and subtitle as usual. @@ -122,114 +98,90 @@ namespace TJAPlayer3 ? "Please play as accurately as possible." : this.strサブタイトル; - if( !string.IsNullOrEmpty(タイトル) ) - { + 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( タイトル, TJAPlayer3.Skin.SongLoading_Title_ForeColor, TJAPlayer3.Skin.SongLoading_Title_BackColor, null, 30 )) - - { - this.txタイトル = new CTexture( bmpSongTitle ); - txタイトル.vcScaleRatio.X = TJAPlayer3.GetSongNameXScaling(ref txタイトル, TJAPlayer3.Skin.SongLoading_Title_MaxSize); + using (var bmpSongTitle = this.pfTITLE.DrawText(タイトル, TJAPlayer3.Skin.SongLoading_Title_ForeColor, TJAPlayer3.Skin.SongLoading_Title_BackColor, null, 30)) { + this.txタイトル = new CTexture(bmpSongTitle); + txタイトル.vcScaleRatio.X = TJAPlayer3.GetSongNameXScaling(ref txタイトル, TJAPlayer3.Skin.SongLoading_Title_MaxSize); } - using (var bmpSongSubTitle = this.pfSUBTITLE.DrawText( サブタイトル, TJAPlayer3.Skin.SongLoading_SubTitle_ForeColor, TJAPlayer3.Skin.SongLoading_SubTitle_BackColor, null, 30 )) - - - { - this.txサブタイトル = new CTexture( bmpSongSubTitle ); - txサブタイトル.vcScaleRatio.X = TJAPlayer3.GetSongNameXScaling(ref txサブタイトル, TJAPlayer3.Skin.SongLoading_SubTitle_MaxSize); + using (var bmpSongSubTitle = this.pfSUBTITLE.DrawText(サブタイトル, TJAPlayer3.Skin.SongLoading_SubTitle_ForeColor, TJAPlayer3.Skin.SongLoading_SubTitle_BackColor, null, 30)) { + this.txサブタイトル = new CTexture(bmpSongSubTitle); + txサブタイトル.vcScaleRatio.X = TJAPlayer3.GetSongNameXScaling(ref txサブタイトル, TJAPlayer3.Skin.SongLoading_SubTitle_MaxSize); } - } - else - { + } else { this.txタイトル = null; this.txサブタイトル = null; } - } - catch ( CTextureCreateFailedException e ) - { - Trace.TraceError( e.ToString() ); - Trace.TraceError( "テクスチャの生成に失敗しました。({0})", new object[] { this.strSTAGEFILE } ); + } catch (CTextureCreateFailedException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("テクスチャの生成に失敗しました。({0})", new object[] { this.strSTAGEFILE }); this.txタイトル = null; this.txサブタイトル = null; this.tx背景 = null; } base.Activate(); - } - finally - { - Trace.TraceInformation( "曲読み込みステージの活性化を完了しました。" ); + } finally { + Trace.TraceInformation("曲読み込みステージの活性化を完了しました。"); Trace.Unindent(); } } - public override void DeActivate() - { - Trace.TraceInformation( "曲読み込みステージを非活性化します。" ); + public override void DeActivate() { + Trace.TraceInformation("曲読み込みステージを非活性化します。"); Trace.Indent(); - try - { - TJAPlayer3.tテクスチャの解放( ref this.txタイトル ); + try { + TJAPlayer3.tテクスチャの解放(ref this.txタイトル); //CDTXMania.tテクスチャの解放( ref this.txSongnamePlate ); - TJAPlayer3.tテクスチャの解放( ref this.txサブタイトル ); - base.DeActivate(); - } - finally - { - Trace.TraceInformation( "曲読み込みステージの非活性化を完了しました。" ); + TJAPlayer3.tテクスチャの解放(ref this.txサブタイトル); + base.DeActivate(); + } finally { + Trace.TraceInformation("曲読み込みステージの非活性化を完了しました。"); Trace.Unindent(); } } - public override void CreateManagedResource() - { - this.pfTITLE = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.SongLoading_Title_FontSize ); + public override void CreateManagedResource() { + this.pfTITLE = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.SongLoading_Title_FontSize); this.pfSUBTITLE = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.SongLoading_SubTitle_FontSize); pfDanTitle = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Game_DanC_Title_Size); pfDanSubTitle = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Game_DanC_SubTitle_Size); - this.tx背景 = TJAPlayer3.tテクスチャの生成( this.strSTAGEFILE, false ); + this.tx背景 = TJAPlayer3.tテクスチャの生成(this.strSTAGEFILE, false); //this.txSongnamePlate = CDTXMania.tテクスチャの生成( CSkin.Path( @$"Graphics{Path.DirectorySeparatorChar}6_SongnamePlate.png" ) ); base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { - TJAPlayer3.tDisposeSafely(ref this.pfTITLE); - TJAPlayer3.tDisposeSafely(ref this.pfSUBTITLE); + public override void ReleaseManagedResource() { + TJAPlayer3.tDisposeSafely(ref this.pfTITLE); + TJAPlayer3.tDisposeSafely(ref this.pfSUBTITLE); - pfDanTitle?.Dispose(); - pfDanSubTitle?.Dispose(); + pfDanTitle?.Dispose(); + pfDanSubTitle?.Dispose(); - TJAPlayer3.tテクスチャの解放( ref this.tx背景 ); + TJAPlayer3.tテクスチャの解放(ref this.tx背景); base.ReleaseManagedResource(); } - public override int Draw() - { + public override int Draw() { string str; - if( base.IsDeActivated ) + if (base.IsDeActivated) return 0; #region [ 初めての進行描画 ] //----------------------------- - if( base.IsFirstDraw ) - { + if (base.IsFirstDraw) { Cスコア cスコア1 = TJAPlayer3.stageSongSelect.r確定されたスコア; - if( this.sd読み込み音 != null ) - { - if( TJAPlayer3.Skin.sound曲読込開始音.bExclusive && ( CSkin.CSystemSound.r最後に再生した排他システムサウンド != null ) ) - { + if (this.sd読み込み音 != null) { + if (TJAPlayer3.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 - { + } else { TJAPlayer3.Skin.sound曲読込開始音.tPlay(); this.nBGM再生開始時刻 = SoundManager.PlayTimer.NowTime; this.nBGMの総再生時間ms = TJAPlayer3.Skin.sound曲読込開始音.n長さ_現在のサウンド; @@ -242,38 +194,28 @@ namespace TJAPlayer3 } //----------------------------- #endregion - this.ct待機.Tick(); + this.ct待機.Tick(); #region [ Cancel loading with esc ] - if ( tキー入力() ) - { - if ( this.sd読み込み音 != null ) - { + if (tキー入力()) { + if (this.sd読み込み音 != null) { this.sd読み込み音.tStopSound(); this.sd読み込み音.tDispose(); } - return (int) E曲読込画面の戻り値.読込中止; + return (int)E曲読込画面の戻り値.読込中止; } #endregion - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) - { - void drawPlate() - { - if (TJAPlayer3.Tx.SongLoading_Plate != null) - { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { + void drawPlate() { + if (TJAPlayer3.Tx.SongLoading_Plate != null) { TJAPlayer3.Tx.SongLoading_Plate.bスクリーン合成 = TJAPlayer3.Skin.SongLoading_Plate_ScreenBlend; //あまりにも出番が無い TJAPlayer3.Tx.SongLoading_Plate.Opacity = 255; - if (TJAPlayer3.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Left) - { + if (TJAPlayer3.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Left) { TJAPlayer3.Tx.SongLoading_Plate.t2D描画(TJAPlayer3.Skin.SongLoading_Plate_X, TJAPlayer3.Skin.SongLoading_Plate_Y - (TJAPlayer3.Tx.SongLoading_Plate.sz画像サイズ.Height / 2)); - } - else if (TJAPlayer3.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Right) - { + } else if (TJAPlayer3.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Right) { TJAPlayer3.Tx.SongLoading_Plate.t2D描画(TJAPlayer3.Skin.SongLoading_Plate_X - TJAPlayer3.Tx.SongLoading_Plate.sz画像サイズ.Width, TJAPlayer3.Skin.SongLoading_Plate_Y - (TJAPlayer3.Tx.SongLoading_Plate.sz画像サイズ.Height / 2)); - } - else - { + } else { TJAPlayer3.Tx.SongLoading_Plate.t2D描画(TJAPlayer3.Skin.SongLoading_Plate_X - (TJAPlayer3.Tx.SongLoading_Plate.sz画像サイズ.Width / 2), TJAPlayer3.Skin.SongLoading_Plate_Y - (TJAPlayer3.Tx.SongLoading_Plate.sz画像サイズ.Height / 2)); } } @@ -281,58 +223,39 @@ namespace TJAPlayer3 int y = 720 - 45; - if (this.txタイトル != null) - { + if (this.txタイトル != null) { int nサブタイトル補正 = string.IsNullOrEmpty(TJAPlayer3.stageSongSelect.r確定されたスコア.譜面情報.strサブタイトル) ? 15 : 0; this.txタイトル.Opacity = 255; - if (TJAPlayer3.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Left) - { + if (TJAPlayer3.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Left) { this.txタイトル.t2D描画(TJAPlayer3.Skin.SongLoading_Title_X, TJAPlayer3.Skin.SongLoading_Title_Y - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); - } - else if (TJAPlayer3.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) - { + } else if (TJAPlayer3.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) { this.txタイトル.t2D描画(TJAPlayer3.Skin.SongLoading_Title_X - (this.txタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X), TJAPlayer3.Skin.SongLoading_Title_Y - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); - } - else - { + } else { this.txタイトル.t2D描画((TJAPlayer3.Skin.SongLoading_Title_X - ((this.txタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X) / 2)), TJAPlayer3.Skin.SongLoading_Title_Y - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); } } - if (this.txサブタイトル != null) - { + if (this.txサブタイトル != null) { this.txサブタイトル.Opacity = 255; - if (TJAPlayer3.Skin.SongLoading_SubTitle_ReferencePoint == CSkin.ReferencePoint.Left) - { + if (TJAPlayer3.Skin.SongLoading_SubTitle_ReferencePoint == CSkin.ReferencePoint.Left) { this.txサブタイトル.t2D描画(TJAPlayer3.Skin.SongLoading_SubTitle_X, TJAPlayer3.Skin.SongLoading_SubTitle_Y - (this.txサブタイトル.sz画像サイズ.Height / 2)); - } - else if (TJAPlayer3.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) - { + } else if (TJAPlayer3.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) { this.txサブタイトル.t2D描画(TJAPlayer3.Skin.SongLoading_SubTitle_X - (this.txサブタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X), TJAPlayer3.Skin.SongLoading_SubTitle_Y - (this.txサブタイトル.sz画像サイズ.Height / 2)); - } - else - { + } else { this.txサブタイトル.t2D描画((TJAPlayer3.Skin.SongLoading_SubTitle_X - ((this.txサブタイトル.sz画像サイズ.Width * txサブタイトル.vcScaleRatio.X) / 2)), TJAPlayer3.Skin.SongLoading_SubTitle_Y - (this.txサブタイトル.sz画像サイズ.Height / 2)); } } } - void drawPlate_AI() - { - if (TJAPlayer3.Tx.SongLoading_Plate_AI != null) - { + void drawPlate_AI() { + if (TJAPlayer3.Tx.SongLoading_Plate_AI != null) { TJAPlayer3.Tx.SongLoading_Plate_AI.bスクリーン合成 = TJAPlayer3.Skin.SongLoading_Plate_ScreenBlend; //あまりにも出番が無い TJAPlayer3.Tx.SongLoading_Plate_AI.Opacity = 255; - if (TJAPlayer3.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Left) - { + if (TJAPlayer3.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Left) { TJAPlayer3.Tx.SongLoading_Plate_AI.t2D描画(TJAPlayer3.Skin.SongLoading_Plate_X_AI, TJAPlayer3.Skin.SongLoading_Plate_Y_AI - (TJAPlayer3.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); - } - else if (TJAPlayer3.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Right) - { + } else if (TJAPlayer3.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Right) { TJAPlayer3.Tx.SongLoading_Plate_AI.t2D描画(TJAPlayer3.Skin.SongLoading_Plate_X_AI - TJAPlayer3.Tx.SongLoading_Plate_AI.sz画像サイズ.Width, TJAPlayer3.Skin.SongLoading_Plate_Y_AI - (TJAPlayer3.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); - } - else - { + } else { TJAPlayer3.Tx.SongLoading_Plate_AI.t2D描画(TJAPlayer3.Skin.SongLoading_Plate_X_AI - (TJAPlayer3.Tx.SongLoading_Plate_AI.sz画像サイズ.Width / 2), TJAPlayer3.Skin.SongLoading_Plate_Y_AI - (TJAPlayer3.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); } } @@ -340,37 +263,25 @@ namespace TJAPlayer3 int y = 720 - 45; - if (this.txタイトル != null) - { + if (this.txタイトル != null) { int nサブタイトル補正 = string.IsNullOrEmpty(TJAPlayer3.stageSongSelect.r確定されたスコア.譜面情報.strサブタイトル) ? 15 : 0; this.txタイトル.Opacity = 255; - if (TJAPlayer3.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Left) - { + if (TJAPlayer3.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Left) { this.txタイトル.t2D描画(TJAPlayer3.Skin.SongLoading_Title_X_AI, TJAPlayer3.Skin.SongLoading_Title_Y_AI - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); - } - else if (TJAPlayer3.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) - { + } else if (TJAPlayer3.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) { this.txタイトル.t2D描画(TJAPlayer3.Skin.SongLoading_Title_X_AI - (this.txタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X), TJAPlayer3.Skin.SongLoading_Title_Y_AI - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); - } - else - { + } else { this.txタイトル.t2D描画((TJAPlayer3.Skin.SongLoading_Title_X_AI - ((this.txタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X) / 2)), TJAPlayer3.Skin.SongLoading_Title_Y_AI - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); } } - if (this.txサブタイトル != null) - { + if (this.txサブタイトル != null) { this.txサブタイトル.Opacity = 255; - if (TJAPlayer3.Skin.SongLoading_SubTitle_ReferencePoint == CSkin.ReferencePoint.Left) - { + if (TJAPlayer3.Skin.SongLoading_SubTitle_ReferencePoint == CSkin.ReferencePoint.Left) { this.txサブタイトル.t2D描画(TJAPlayer3.Skin.SongLoading_SubTitle_X_AI, TJAPlayer3.Skin.SongLoading_SubTitle_Y_AI - (this.txサブタイトル.sz画像サイズ.Height / 2)); - } - else if (TJAPlayer3.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) - { + } else if (TJAPlayer3.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) { this.txサブタイトル.t2D描画(TJAPlayer3.Skin.SongLoading_SubTitle_X_AI - (this.txサブタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X), TJAPlayer3.Skin.SongLoading_SubTitle_Y_AI - (this.txサブタイトル.sz画像サイズ.Height / 2)); - } - else - { + } else { this.txサブタイトル.t2D描画((TJAPlayer3.Skin.SongLoading_SubTitle_X_AI - ((this.txサブタイトル.sz画像サイズ.Width * txサブタイトル.vcScaleRatio.X) / 2)), TJAPlayer3.Skin.SongLoading_SubTitle_Y_AI - (this.txサブタイトル.sz画像サイズ.Height / 2)); } } @@ -380,12 +291,10 @@ namespace TJAPlayer3 //----------------------------- this.ct曲名表示.Tick(); - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { #region [Tower loading screen] - if (TJAPlayer3.Skin.Game_Tower_Ptn_Result > 0) - { + if (TJAPlayer3.Skin.Game_Tower_Ptn_Result > 0) { int xFactor = 0; float yFactor = 1f; @@ -394,8 +303,7 @@ namespace TJAPlayer3 if (currentTowerType < 0 || currentTowerType >= TJAPlayer3.Skin.Game_Tower_Ptn) currentTowerType = 0; - if (TJAPlayer3.Tx.TowerResult_Background != null && currentTowerType < TJAPlayer3.Tx.TowerResult_Tower.Length && TJAPlayer3.Tx.TowerResult_Tower[currentTowerType] != null) - { + if (TJAPlayer3.Tx.TowerResult_Background != null && currentTowerType < TJAPlayer3.Tx.TowerResult_Tower.Length && TJAPlayer3.Tx.TowerResult_Tower[currentTowerType] != null) { xFactor = (TJAPlayer3.Tx.TowerResult_Background.szTextureSize.Width - TJAPlayer3.Tx.TowerResult_Tower[currentTowerType].szTextureSize.Width) / 2; yFactor = TJAPlayer3.Tx.TowerResult_Tower[currentTowerType].szTextureSize.Height / (float)TJAPlayer3.Tx.TowerResult_Background.szTextureSize.Height; } @@ -404,22 +312,18 @@ namespace TJAPlayer3 ((ct待機.CurrentValue <= 1200 ? ct待機.CurrentValue / 10f : 120) / 120f * (TJAPlayer3.Tx.TowerResult_Background.szTextureSize.Height - TJAPlayer3.Skin.Resolution[1])); TJAPlayer3.Tx.TowerResult_Background?.t2D描画(0, -1 * pos); - + if (currentTowerType < TJAPlayer3.Tx.TowerResult_Tower.Length) TJAPlayer3.Tx.TowerResult_Tower[currentTowerType]?.t2D描画(xFactor, -1 * yFactor * pos); } #endregion drawPlate(); - } - else if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - TJAPlayer3.ConfigIni.tInitializeAILevel(); - TJAPlayer3.Tx.SongLoading_Bg_AI_Wait.t2D描画(0, 0); + } else if (TJAPlayer3.ConfigIni.bAIBattleMode) { + TJAPlayer3.ConfigIni.tInitializeAILevel(); + TJAPlayer3.Tx.SongLoading_Bg_AI_Wait.t2D描画(0, 0); drawPlate_AI(); - } - else - { + } else { #region [Ensou loading screen] if (TJAPlayer3.Tx.SongLoading_BgWait != null) TJAPlayer3.Tx.SongLoading_BgWait.t2D描画(0, 0); @@ -434,9 +338,7 @@ namespace TJAPlayer3 //----------------------------- #endregion - } - else - { + } else { #region [ Dan Loading screen ] TJAPlayer3.Tx.SongLoading_Bg_Dan.t2D描画(0, 0 - (ct待機.CurrentValue <= 600 ? ct待機.CurrentValue / 10f : 60)); @@ -446,12 +348,11 @@ namespace TJAPlayer3 : null; CActSelect段位リスト.tDisplayDanPlate(dp, - null, + null, TJAPlayer3.Skin.SongLoading_DanPlate[0], TJAPlayer3.Skin.SongLoading_DanPlate[1]); - if (TJAPlayer3.Tx.Tile_Black != null) - { + if (TJAPlayer3.Tx.Tile_Black != null) { TJAPlayer3.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 / TJAPlayer3.Tx.Tile_Black.szTextureSize.Width); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size { @@ -465,32 +366,30 @@ namespace TJAPlayer3 #endregion } - switch ( base.ePhaseID ) - { + 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) E曲読込画面の戻り値.継続; + // 必ず一度「CStaeg.Eフェーズ.共通_フェードイン」フェーズを経由させること。 + // さもないと、曲読み込みが完了するまで、曲読み込み画面が描画されない。 + base.ePhaseID = CStage.EPhase.SongLoading_LoadDTXFile; + return (int)E曲読込画面の戻り値.継続; - case CStage.EPhase.SongLoading_LoadDTXFile: - { + case CStage.EPhase.SongLoading_LoadDTXFile: { timeBeginLoad = DateTime.Now; TimeSpan span; str = null; - if( !TJAPlayer3.bコンパクトモード ) + if (!TJAPlayer3.bコンパクトモード) str = TJAPlayer3.stageSongSelect.r確定されたスコア.ファイル情報.ファイルの絶対パス; else str = TJAPlayer3.strコンパクトモードファイル; - if( ( TJAPlayer3.DTX != null ) && TJAPlayer3.DTX.IsActivated ) + if ((TJAPlayer3.DTX != null) && TJAPlayer3.DTX.IsActivated) TJAPlayer3.DTX.DeActivate(); - //if( CDTXMania.DTX == null ) - { + //if( CDTXMania.DTX == null ) + { TJAPlayer3.DTX = new CDTX(str, false, 1.0, 0, 0, 0, true, TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]); - if ( TJAPlayer3.ConfigIni.nPlayerCount >= 2 ) + if (TJAPlayer3.ConfigIni.nPlayerCount >= 2) TJAPlayer3.DTX_2P = new CDTX(str, false, 1.0, 0, 0, 1, true, TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[1]); if (TJAPlayer3.ConfigIni.nPlayerCount >= 3) TJAPlayer3.DTX_3P = new CDTX(str, false, 1.0, 0, 0, 2, true, TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[2]); @@ -499,99 +398,84 @@ namespace TJAPlayer3 if (TJAPlayer3.ConfigIni.nPlayerCount >= 5) TJAPlayer3.DTX_5P = new CDTX(str, false, 1.0, 0, 0, 4, true, TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[4]); - if (TJAPlayer3.DTX.listErrors.Count != 0) - { + if (TJAPlayer3.DTX.listErrors.Count != 0) { string message = ""; - foreach (var text in TJAPlayer3.DTX.listErrors) - { + foreach (var text in TJAPlayer3.DTX.listErrors) { TJAPlayer3.VisualLogManager.PushCard(CVisualLogManager.ELogCardType.LogError, text); //System.Windows.Forms.MessageBox.Show(text, "譜面にエラーが見つかりました"); } } - Trace.TraceInformation( "---- Song information -----------------" ); - Trace.TraceInformation( "TITLE: {0}", TJAPlayer3.DTX.TITLE.GetString("") ); - Trace.TraceInformation( "FILE: {0}", TJAPlayer3.DTX.strファイル名の絶対パス ); - Trace.TraceInformation( "---------------------------" ); + Trace.TraceInformation("---- Song information -----------------"); + Trace.TraceInformation("TITLE: {0}", TJAPlayer3.DTX.TITLE.GetString("")); + Trace.TraceInformation("FILE: {0}", TJAPlayer3.DTX.strファイル名の絶対パス); + Trace.TraceInformation("---------------------------"); - span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); - Trace.TraceInformation( "Chart loading time: {0}", span.ToString() ); + span = (TimeSpan)(DateTime.Now - timeBeginLoad); + Trace.TraceInformation("Chart loading time: {0}", span.ToString()); // 段位認定モード用。 #region [dan setup] - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan && TJAPlayer3.DTX.List_DanSongs != null) - { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan && TJAPlayer3.DTX.List_DanSongs != null) { - var titleForeColor = TJAPlayer3.Skin.Game_DanC_Title_ForeColor; - var titleBackColor = TJAPlayer3.Skin.Game_DanC_Title_BackColor; - var subtitleForeColor = TJAPlayer3.Skin.Game_DanC_SubTitle_ForeColor; - var subtitleBackColor = TJAPlayer3.Skin.Game_DanC_SubTitle_BackColor; + var titleForeColor = TJAPlayer3.Skin.Game_DanC_Title_ForeColor; + var titleBackColor = TJAPlayer3.Skin.Game_DanC_Title_BackColor; + var subtitleForeColor = TJAPlayer3.Skin.Game_DanC_SubTitle_ForeColor; + var subtitleBackColor = TJAPlayer3.Skin.Game_DanC_SubTitle_BackColor; - for (int i = 0; i < TJAPlayer3.DTX.List_DanSongs.Count; i++) - { - if (!string.IsNullOrEmpty(TJAPlayer3.DTX.List_DanSongs[i].Title)) - { - using (var bmpSongTitle = pfDanTitle.DrawText(TJAPlayer3.DTX.List_DanSongs[i].Title, titleForeColor, titleBackColor, null, 30)) - { - TJAPlayer3.DTX.List_DanSongs[i].TitleTex = TJAPlayer3.tテクスチャの生成(bmpSongTitle, false); - TJAPlayer3.DTX.List_DanSongs[i].TitleTex.vcScaleRatio.X = TJAPlayer3.GetSongNameXScaling(ref TJAPlayer3.DTX.List_DanSongs[i].TitleTex, TJAPlayer3.Skin.Game_DanC_Title_MaxWidth); - } - } + for (int i = 0; i < TJAPlayer3.DTX.List_DanSongs.Count; i++) { + if (!string.IsNullOrEmpty(TJAPlayer3.DTX.List_DanSongs[i].Title)) { + using (var bmpSongTitle = pfDanTitle.DrawText(TJAPlayer3.DTX.List_DanSongs[i].Title, titleForeColor, titleBackColor, null, 30)) { + TJAPlayer3.DTX.List_DanSongs[i].TitleTex = TJAPlayer3.tテクスチャの生成(bmpSongTitle, false); + TJAPlayer3.DTX.List_DanSongs[i].TitleTex.vcScaleRatio.X = TJAPlayer3.GetSongNameXScaling(ref TJAPlayer3.DTX.List_DanSongs[i].TitleTex, TJAPlayer3.Skin.Game_DanC_Title_MaxWidth); + } + } - if (!string.IsNullOrEmpty(TJAPlayer3.DTX.List_DanSongs[i].SubTitle)) - { - using (var bmpSongSubTitle = pfDanSubTitle.DrawText(TJAPlayer3.DTX.List_DanSongs[i].SubTitle, subtitleForeColor, subtitleBackColor, null, 30)) - { - TJAPlayer3.DTX.List_DanSongs[i].SubTitleTex = TJAPlayer3.tテクスチャの生成(bmpSongSubTitle, false); - TJAPlayer3.DTX.List_DanSongs[i].SubTitleTex.vcScaleRatio.X = TJAPlayer3.GetSongNameXScaling(ref TJAPlayer3.DTX.List_DanSongs[i].SubTitleTex, TJAPlayer3.Skin.Game_DanC_SubTitle_MaxWidth); - } - } + if (!string.IsNullOrEmpty(TJAPlayer3.DTX.List_DanSongs[i].SubTitle)) { + using (var bmpSongSubTitle = pfDanSubTitle.DrawText(TJAPlayer3.DTX.List_DanSongs[i].SubTitle, subtitleForeColor, subtitleBackColor, null, 30)) { + TJAPlayer3.DTX.List_DanSongs[i].SubTitleTex = TJAPlayer3.tテクスチャの生成(bmpSongSubTitle, false); + TJAPlayer3.DTX.List_DanSongs[i].SubTitleTex.vcScaleRatio.X = TJAPlayer3.GetSongNameXScaling(ref TJAPlayer3.DTX.List_DanSongs[i].SubTitleTex, TJAPlayer3.Skin.Game_DanC_SubTitle_MaxWidth); + } + } - } - } + } + } #endregion } - base.ePhaseID = CStage.EPhase.SongLoading_WaitToLoadWAVFile; + base.ePhaseID = CStage.EPhase.SongLoading_WaitToLoadWAVFile; timeBeginLoadWAV = DateTime.Now; - return (int) E曲読込画面の戻り値.継続; + return (int)E曲読込画面の戻り値.継続; } - case CStage.EPhase.SongLoading_WaitToLoadWAVFile: - { - if( this.ct待機.CurrentValue > 260 ) - { - base.ePhaseID = CStage.EPhase.SongLoading_LoadWAVFile; - } - return (int) E曲読込画面の戻り値.継続; - } + case CStage.EPhase.SongLoading_WaitToLoadWAVFile: { + if (this.ct待機.CurrentValue > 260) { + base.ePhaseID = CStage.EPhase.SongLoading_LoadWAVFile; + } + return (int)E曲読込画面の戻り値.継続; + } - case CStage.EPhase.SongLoading_LoadWAVFile: - { - int looptime = (TJAPlayer3.ConfigIni.bEnableVSync)? 3 : 1; // VSyncWait=ON時は1frame(1/60s)あたり3つ読むようにする - for ( int i = 0; i < looptime && nWAVcount <= TJAPlayer3.DTX.listWAV.Count; i++ ) - { - if ( TJAPlayer3.DTX.listWAV[ nWAVcount ].listこのWAVを使用するチャンネル番号の集合.Count > 0 ) // #28674 2012.5.8 yyagi + case CStage.EPhase.SongLoading_LoadWAVFile: { + int looptime = (TJAPlayer3.ConfigIni.bEnableVSync) ? 3 : 1; // VSyncWait=ON時は1frame(1/60s)あたり3つ読むようにする + for (int i = 0; i < looptime && nWAVcount <= TJAPlayer3.DTX.listWAV.Count; i++) { + if (TJAPlayer3.DTX.listWAV[nWAVcount].listこのWAVを使用するチャンネル番号の集合.Count > 0) // #28674 2012.5.8 yyagi { - TJAPlayer3.DTX.tWAVの読み込み( TJAPlayer3.DTX.listWAV[ nWAVcount ] ); + TJAPlayer3.DTX.tWAVの読み込み(TJAPlayer3.DTX.listWAV[nWAVcount]); } nWAVcount++; } - if ( nWAVcount > TJAPlayer3.DTX.listWAV.Count ) - { - TimeSpan span = ( TimeSpan ) ( DateTime.Now - timeBeginLoadWAV ); - Trace.TraceInformation("Song loading time({0,4}): {1}", TJAPlayer3.DTX.listWAV.Count, span.ToString() ); + if (nWAVcount > TJAPlayer3.DTX.listWAV.Count) { + TimeSpan span = (TimeSpan)(DateTime.Now - timeBeginLoadWAV); + Trace.TraceInformation("Song loading time({0,4}): {1}", TJAPlayer3.DTX.listWAV.Count, span.ToString()); timeBeginLoadWAV = DateTime.Now; - if ( TJAPlayer3.ConfigIni.bDynamicBassMixerManagement ) - { + if (TJAPlayer3.ConfigIni.bDynamicBassMixerManagement) { TJAPlayer3.DTX.PlanToAddMixerChannel(); } - var _dtx = new CDTX[5]{ TJAPlayer3.DTX, TJAPlayer3.DTX_2P, TJAPlayer3.DTX_3P, TJAPlayer3.DTX_4P, TJAPlayer3.DTX_5P }; - - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { + var _dtx = new CDTX[5] { TJAPlayer3.DTX, TJAPlayer3.DTX_2P, TJAPlayer3.DTX_3P, TJAPlayer3.DTX_4P, TJAPlayer3.DTX_5P }; + + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { _dtx[i]?.tRandomizeTaikoChips(i); _dtx[i]?.tApplyFunMods(i); TJAPlayer3.ReplayInstances[i] = new CSongReplay(_dtx[i].strファイル名の絶対パス, i); @@ -600,74 +484,69 @@ namespace TJAPlayer3 TJAPlayer3.stage演奏ドラム画面.Activate(); - span = (TimeSpan) ( DateTime.Now - timeBeginLoadWAV ); + span = (TimeSpan)(DateTime.Now - timeBeginLoadWAV); base.ePhaseID = CStage.EPhase.SongLoading_LoadBMPFile; } - return (int) E曲読込画面の戻り値.継続; + return (int)E曲読込画面の戻り値.継続; } - case CStage.EPhase.SongLoading_LoadBMPFile: - { + case CStage.EPhase.SongLoading_LoadBMPFile: { TimeSpan span; DateTime timeBeginLoadBMPAVI = DateTime.Now; - if ( TJAPlayer3.ConfigIni.bEnableAVI ) + if (TJAPlayer3.ConfigIni.bEnableAVI) TJAPlayer3.DTX.tAVIの読み込み(); - span = ( TimeSpan ) ( DateTime.Now - timeBeginLoadBMPAVI ); + span = (TimeSpan)(DateTime.Now - timeBeginLoadBMPAVI); - span = ( TimeSpan ) ( DateTime.Now - timeBeginLoad ); - Trace.TraceInformation( "総読込時間: {0}", span.ToString() ); + span = (TimeSpan)(DateTime.Now - timeBeginLoad); + Trace.TraceInformation("総読込時間: {0}", span.ToString()); - if(TJAPlayer3.ConfigIni.FastRender) - { - var fastRender = new FastRender(); - fastRender.Render(); - fastRender = null; - } + if (TJAPlayer3.ConfigIni.FastRender) { + var fastRender = new FastRender(); + fastRender.Render(); + fastRender = null; + } TJAPlayer3.Timer.Update(); - //CSound管理.rc演奏用タイマ.t更新(); + //CSound管理.rc演奏用タイマ.t更新(); base.ePhaseID = CStage.EPhase.SongLoading_WaitForSoundSystemBGM; - return (int) E曲読込画面の戻り値.継続; + return (int)E曲読込画面の戻り値.継続; } - case CStage.EPhase.SongLoading_WaitForSoundSystemBGM: - { + case CStage.EPhase.SongLoading_WaitForSoundSystemBGM: { long nCurrentTime = TJAPlayer3.Timer.NowTime; - if( nCurrentTime < this.nBGM再生開始時刻 ) + 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 == フェードイン分の時間 + // 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) E曲読込画面の戻り値.継続; + return (int)E曲読込画面の戻り値.継続; } case CStage.EPhase.Common_FADEOUT: - if ( this.ct待機.IsUnEnded ) // DTXVモード時は、フェードアウト省略 + if (this.ct待機.IsUnEnded) // DTXVモード時は、フェードアウト省略 return (int)E曲読込画面の戻り値.継続; - if ( this.sd読み込み音 != null ) - { + if (this.sd読み込み音 != null) { this.sd読み込み音.tDispose(); } - return (int) E曲読込画面の戻り値.読込完了; + return (int)E曲読込画面の戻り値.読込完了; } - return (int) E曲読込画面の戻り値.継続; + return (int)E曲読込画面の戻り値.継続; } /// /// ESC押下時、trueを返す /// /// - protected bool tキー入力() - { + protected bool tキー入力() { IInputDevice keyboard = TJAPlayer3.InputManager.Keyboard; - if ( keyboard.KeyPressed( (int)SlimDXKeys.Key.Escape ) ) // escape (exit) + if (keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) // escape (exit) { return true; } @@ -685,22 +564,22 @@ namespace TJAPlayer3 private CSound sd読み込み音; private string strSTAGEFILE; private string str曲タイトル; - private string strサブタイトル; + private string strサブタイトル; private CTexture txタイトル; - private CTexture txサブタイトル; + private CTexture txサブタイトル; private CTexture tx背景; - //private CTexture txSongnamePlate; + //private CTexture txSongnamePlate; private DateTime timeBeginLoad; private DateTime timeBeginLoadWAV; private int nWAVcount; - private CCounter ct待機; - private CCounter ct曲名表示; + private CCounter ct待機; + private CCounter ct曲名表示; - private CCachedFontRenderer pfTITLE; - private CCachedFontRenderer pfSUBTITLE; + private CCachedFontRenderer pfTITLE; + private CCachedFontRenderer pfSUBTITLE; - private CCachedFontRenderer pfDanTitle = null; - private CCachedFontRenderer pfDanSubTitle = null; + 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 4b0bd001..eb5c884f 100644 --- a/OpenTaiko/src/Stages/06.SongLoading/FastRender.cs +++ b/OpenTaiko/src/Stages/06.SongLoading/FastRender.cs @@ -1,21 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - class FastRender - { - public FastRender() - { - - } +namespace TJAPlayer3 { + 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++) { @@ -23,18 +15,17 @@ namespace TJAPlayer3 } }*/ - NullCheckAndRender(ref TJAPlayer3.Tx.Effects_GoGoSplash); + NullCheckAndRender(ref TJAPlayer3.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 4115110e..03b8d23a 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏AVI.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏AVI.cs @@ -1,72 +1,53 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using Silk.NET.Maths; -using FDK; +using FDK; -using Rectangle = System.Drawing.Rectangle; -using Point = System.Drawing.Point; -using Color = System.Drawing.Color; - -namespace TJAPlayer3 -{ - internal class CAct演奏AVI : CActivity - { +namespace TJAPlayer3 { + internal class CAct演奏AVI : CActivity { // コンストラクタ - public CAct演奏AVI() - { + public CAct演奏AVI() { base.IsDeActivated = true; } // メソッド - public void Start( int nチャンネル番号, CVideoDecoder rVD ) - { - if ( nチャンネル番号 == 0x54 && TJAPlayer3.ConfigIni.bEnableAVI ) - { + public void Start(int nチャンネル番号, CVideoDecoder rVD) { + if (nチャンネル番号 == 0x54 && TJAPlayer3.ConfigIni.bEnableAVI) { this.rVD = rVD; - if (this.rVD != null) - { + 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 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) - { + 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 (TJAPlayer3.ConfigIni.eClipDispType.HasFlag(EClipDispType.背景のみ)) - { + if (TJAPlayer3.ConfigIni.eClipDispType.HasFlag(EClipDispType.背景のみ)) { 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 || !TJAPlayer3.ConfigIni.eClipDispType.HasFlag(EClipDispType.ウィンドウのみ)) + public void t窓表示() { + if (this.rVD == null || this.tx描画用 == null || !TJAPlayer3.ConfigIni.eClipDispType.HasFlag(EClipDispType.ウィンドウのみ)) return; - + float[] fRatio = new float[] { 640.0f - 4.0f, 360.0f - 4.0f }; //中央下表示 float ratio = Math.Min((float)(fRatio[0] / this.rVD.FrameSize.Width), (float)(fRatio[1] / this.rVD.FrameSize.Height)); @@ -78,30 +59,24 @@ namespace TJAPlayer3 // CActivity 実装 - public override void Activate() - { + public override void Activate() { base.Activate(); } - public override void DeActivate() - { - if ( this.tx描画用 != null ) - { + public override void DeActivate() { + if (this.tx描画用 != null) { this.tx描画用.Dispose(); this.tx描画用 = null; } base.DeActivate(); } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { base.ReleaseManagedResource(); } - public override int Draw() - { - throw new InvalidOperationException( "t進行描画(int,int)のほうを使用してください。" ); + public override int Draw() { + throw new InvalidOperationException("t進行描画(int,int)のほうを使用してください。"); } diff --git a/OpenTaiko/src/Stages/07.Game/CAct演奏Combo共通.cs b/OpenTaiko/src/Stages/07.Game/CAct演奏Combo共通.cs index 968fe305..e7821af6 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏Combo共通.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏Combo共通.cs @@ -1,27 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; -using System.Drawing; +using System.Drawing; using FDK; -namespace TJAPlayer3 -{ - internal class CAct演奏Combo共通 : CActivity - { - // プロパティ - +namespace TJAPlayer3 { + internal class CAct演奏Combo共通 : CActivity { + // プロパティ + public STCOMBO n現在のコンボ数; - public struct STCOMBO - { + public struct STCOMBO { public CAct演奏Combo共通 act; - public int this[int index] - { - get - { - switch (index) - { + public int this[int index] { + get { + switch (index) { case 0: return this.P1; @@ -39,10 +29,8 @@ namespace TJAPlayer3 } throw new IndexOutOfRangeException(); } - set - { - switch (index) - { + set { + switch (index) { case 0: this.P1 = value; return; @@ -66,85 +54,65 @@ namespace TJAPlayer3 throw new IndexOutOfRangeException(); } } - public int P1 - { - get - { + public int P1 { + get { return this.p1; } - set - { + set { this.p1 = value; - if (this.p1 > this.最高値[0]) - { + 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 - { + public int P2 { + get { return this.p2; } - set - { + set { this.p2 = value; - if (this.p2 > this.最高値[1]) - { + 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 - { + public int P3 { + get { return this.p3; } - set - { + set { this.p3 = value; - if (this.p3 > this.最高値[2]) - { + 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 - { + public int P4 { + get { return this.p4; } - set - { + set { this.p4 = value; - if (this.p4 > this.最高値[3]) - { + 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 - { + public int P5 { + get { return this.p5; } - set - { + set { this.p5 = value; - if (this.p5 > this.最高値[4]) - { + if (this.p5 > this.最高値[4]) { this.最高値[4] = this.p5; } this.act.status.P5.nCOMBO値 = this.p5; @@ -168,10 +136,10 @@ namespace TJAPlayer3 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コンボラメ; + protected CSTATUS status; + //protected CTexture txCOMBO太鼓; + //protected CTexture txCOMBO太鼓_でかいやつ; + //protected CTexture txコンボラメ; public CCounter[] ctコンボ加算; public CCounter ctコンボラメ; @@ -241,22 +209,18 @@ namespace TJAPlayer3 { 0.032f, 0}, { 0.011f, 0}, { 0.000f, 0}, - }; - // 内部クラス - - protected class CSTATUS - { + }; + // 内部クラス + + 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) - { + public CSTAT this[int index] { + get { + switch (index) { case 0: return this.P1; @@ -274,10 +238,8 @@ namespace TJAPlayer3 } throw new IndexOutOfRangeException(); } - set - { - switch (index) - { + set { + switch (index) { case 0: this.P1 = value; return; @@ -302,8 +264,7 @@ namespace TJAPlayer3 } } - public class CSTAT - { + public class CSTAT { public CAct演奏Combo共通.EMode e現在のモード; public int nCOMBO値; public long nコンボが切れた時刻; @@ -313,81 +274,75 @@ namespace TJAPlayer3 public int n残像表示中のCOMBO値; public long n前回の時刻_ジャンプ用; } - } - - - // メソッド - - - private void showComboEffect(int cat, int i, int rightX, int y, int nPlayer) - { - if (TJAPlayer3.Tx.Taiko_Combo_Effect != null) - { + } + + + // メソッド + + + private void showComboEffect(int cat, int i, int rightX, int y, int nPlayer) { + if (TJAPlayer3.Tx.Taiko_Combo_Effect != null) { int a = rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[cat] * i; float b = (TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0] / 4) * TJAPlayer3.Skin.Game_Taiko_Combo_Scale[cat]; float c = (TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[1] / 4) * TJAPlayer3.Skin.Game_Taiko_Combo_Scale[cat]; float d = y; - if (ctコンボラメ.CurrentValue < 13) // First - { - // まんなか + if (ctコンボラメ.CurrentValue < 13) // First + { + // まんなか TJAPlayer3.Tx.Taiko_Combo_Effect.t2D拡大率考慮下中心基準描画(a, d - c - (int)(1.05 * this.ctコンボラメ.CurrentValue) - 13); } - if (ctコンボラメ.CurrentValue >= 8 && ctコンボラメ.CurrentValue < 23) - { - // みぎ + if (ctコンボラメ.CurrentValue >= 8 && ctコンボラメ.CurrentValue < 23) { + // みぎ TJAPlayer3.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) - { - // ひだり + if (this.ctコンボラメ.CurrentValue >= 17 && this.ctコンボラメ.CurrentValue < 32) { + // ひだり TJAPlayer3.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; + protected virtual void tコンボ表示_太鼓(int nCombo値, int nジャンプインデックス, int nPlayer) { + // Combo display here + + //テスト用コンボ数 + //nCombo値 = 72; #region [ 事前チェック。] - //----------------- - //if( CDTXMania.ConfigIni.bドラムコンボ表示 == false ) - // return; // 表示OFF。 - + //----------------- + //if( CDTXMania.ConfigIni.bドラムコンボ表示 == false ) + // return; // 表示OFF。 + if (nCombo値 == 0) - return; // コンボゼロは表示しない。 - //----------------- + return; // コンボゼロは表示しない。 + //----------------- #endregion - - int[] n位の数 = new int[10]; // 表示は10桁もあれば足りるだろう - + + int[] n位の数 = new int[10]; // 表示は10桁もあれば足りるだろう + this.ctコンボラメ.TickLoop(); - this.ctコンボ加算[nPlayer].Tick(); - + 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 ) + 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座標を求めていく? - + //----------------- + const int n1桁ごとのジャンプの遅れ = 30; // 1桁につき 50 インデックス遅れる + + + //X右座標を元にして、右座標 - ( コンボの幅 * 桁数 ) でX座標を求めていく? + int combo_text_x; int combo_text_y; int combo_x; @@ -396,8 +351,7 @@ namespace TJAPlayer3 int combo_ex_y; int combo_ex4_x; int combo_ex4_y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { combo_text_x = TJAPlayer3.Skin.Game_Taiko_Combo_Text_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * nPlayer); combo_text_y = TJAPlayer3.Skin.Game_Taiko_Combo_Text_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * nPlayer); @@ -407,9 +361,7 @@ namespace TJAPlayer3 combo_ex_y = TJAPlayer3.Skin.Game_Taiko_Combo_Ex_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * nPlayer); combo_ex4_x = TJAPlayer3.Skin.Game_Taiko_Combo_Ex4_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * nPlayer); combo_ex4_y = TJAPlayer3.Skin.Game_Taiko_Combo_Ex4_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * nPlayer); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { combo_text_x = TJAPlayer3.Skin.Game_Taiko_Combo_Text_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * nPlayer); combo_text_y = TJAPlayer3.Skin.Game_Taiko_Combo_Text_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * nPlayer); @@ -419,9 +371,7 @@ namespace TJAPlayer3 combo_ex_y = TJAPlayer3.Skin.Game_Taiko_Combo_Ex_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * nPlayer); combo_ex4_x = TJAPlayer3.Skin.Game_Taiko_Combo_Ex4_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * nPlayer); combo_ex4_y = TJAPlayer3.Skin.Game_Taiko_Combo_Ex4_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * nPlayer); - } - else - { + } else { combo_text_x = TJAPlayer3.Skin.Game_Taiko_Combo_Text_X[nPlayer]; combo_text_y = TJAPlayer3.Skin.Game_Taiko_Combo_Text_Y[nPlayer]; @@ -435,132 +385,106 @@ namespace TJAPlayer3 int nY上辺位置px = TJAPlayer3.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 ]; - + int x = 245 + (n数字とCOMBOを合わせた画像の全長px / 2); + //int y = 212; + //int y = CDTXMania.Skin.nComboNumberY[ nPlayer ]; + #region[ Combo text & Combo guides ] - - if (!TJAPlayer3.ConfigIni.SimpleMode) - { - TJAPlayer3.Tx.Taiko_Combo_Text?.t2D拡大率考慮下中心基準描画(combo_text_x, combo_text_y); - int guide = 2; - var ccf = TJAPlayer3.stage演奏ドラム画面.CChartScore[nPlayer]; + if (!TJAPlayer3.ConfigIni.SimpleMode) { + TJAPlayer3.Tx.Taiko_Combo_Text?.t2D拡大率考慮下中心基準描画(combo_text_x, combo_text_y); - if (ccf.nGood > 0) - guide = 1; - if (ccf.nMiss > 0 || ccf.nMine > 0) - guide = 0; + int guide = 2; + var ccf = TJAPlayer3.stage演奏ドラム画面.CChartScore[nPlayer]; + + if (ccf.nGood > 0) + guide = 1; + if (ccf.nMiss > 0 || ccf.nMine > 0) + guide = 0; + + TJAPlayer3.Tx.Taiko_Combo_Guide[guide]?.t2D拡大率考慮下中心基準描画(combo_text_x, combo_text_y); + } - TJAPlayer3.Tx.Taiko_Combo_Guide[guide]?.t2D拡大率考慮下中心基準描画(combo_text_x, combo_text_y); - } - #endregion - - int rightX = 0; + + int rightX = 0; #region 一番右の数字の座標の決定 - if (n桁数 == 1) - { - // 一桁ならそのままSkinConfigの座標を使用する。 + if (n桁数 == 1) { + // 一桁ならそのままSkinConfigの座標を使用する。 rightX = combo_x; - } - else if (n桁数 == 2) - { - // 二桁ならSkinConfigの座標+パディング/2を使用する + } else if (n桁数 == 2) { + // 二桁ならSkinConfigの座標+パディング/2を使用する rightX = combo_x + TJAPlayer3.Skin.Game_Taiko_Combo_Padding[0] / 2; - } - else if (n桁数 == 3) - { - // 三桁ならSkinConfigの座標+パディングを使用する + } else if (n桁数 == 3) { + // 三桁ならSkinConfigの座標+パディングを使用する rightX = combo_ex_x + TJAPlayer3.Skin.Game_Taiko_Combo_Padding[1]; - } - else if (n桁数 == 4) - { - // 四桁ならSkinconfigの座標+パディング/2 + パディングを使用する + } else if (n桁数 == 4) { + // 四桁ならSkinconfigの座標+パディング/2 + パディングを使用する rightX = combo_ex4_x + TJAPlayer3.Skin.Game_Taiko_Combo_Padding[2] / 2 + TJAPlayer3.Skin.Game_Taiko_Combo_Padding[2]; - } - else - { - // 五桁以上の場合 + } else { + // 五桁以上の場合 int rightDigit = 0; - switch (n桁数 % 2) - { - case 0: - // 2で割り切れる - // パディング/2を足す必要がある - // 右に表示される桁数を求め、-1する + switch (n桁数 % 2) { + case 0: + // 2で割り切れる + // パディング/2を足す必要がある + // 右に表示される桁数を求め、-1する rightDigit = n桁数 / 2 - 1; rightX = combo_ex4_x + TJAPlayer3.Skin.Game_Taiko_Combo_Padding[2] / 2 + TJAPlayer3.Skin.Game_Taiko_Combo_Padding[2] * rightDigit; break; - case 1: - // 2で割るとあまりが出る - // そのままパディングを足していく - // 右に表示される桁数を求める(中央除く -1) + case 1: + // 2で割るとあまりが出る + // そのままパディングを足していく + // 右に表示される桁数を求める(中央除く -1) rightDigit = (n桁数 - 1) / 2; rightX = combo_ex4_x + TJAPlayer3.Skin.Game_Taiko_Combo_Padding[2] * rightDigit; break; default: break; } - } + } #endregion - - - for (int i = 0; i < n桁数; i++) - { + + + for (int i = 0; i < n桁数; i++) { TJAPlayer3.Tx.Taiko_Combo[0].Opacity = 255; TJAPlayer3.Tx.Taiko_Combo[1].Opacity = 255; - if (n桁数 <= 1) - { - if (TJAPlayer3.Tx.Taiko_Combo[0] != null) - { + if (n桁数 <= 1) { + if (TJAPlayer3.Tx.Taiko_Combo[0] != null) { var yScalling = TJAPlayer3.ConfigIni.SimpleMode ? 0 : ComboScale[this.ctコンボ加算[nPlayer].CurrentValue]; TJAPlayer3.Tx.Taiko_Combo[0].vcScaleRatio.Y = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[0] + yScalling; TJAPlayer3.Tx.Taiko_Combo[0].vcScaleRatio.X = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[0]; TJAPlayer3.Tx.Taiko_Combo[0].t2D拡大率考慮下中心基準描画(rightX, combo_y, new Rectangle(n位の数[i] * TJAPlayer3.Skin.Game_Taiko_Combo_Size[0], 0, TJAPlayer3.Skin.Game_Taiko_Combo_Size[0], TJAPlayer3.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 (TJAPlayer3.Tx.Taiko_Combo[0] != null) - { + } 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 (TJAPlayer3.Tx.Taiko_Combo[0] != null) { var yScalling = TJAPlayer3.ConfigIni.SimpleMode ? 0 : ComboScale[this.ctコンボ加算[nPlayer].CurrentValue]; TJAPlayer3.Tx.Taiko_Combo[0].vcScaleRatio.Y = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[0] + yScalling; TJAPlayer3.Tx.Taiko_Combo[0].vcScaleRatio.X = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[0]; TJAPlayer3.Tx.Taiko_Combo[0].t2D拡大率考慮下中心基準描画(rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[0] * i, combo_y, new Rectangle(n位の数[i] * TJAPlayer3.Skin.Game_Taiko_Combo_Size[0], 0, TJAPlayer3.Skin.Game_Taiko_Combo_Size[0], TJAPlayer3.Skin.Game_Taiko_Combo_Size[1])); } - } - else - { - if (TJAPlayer3.Tx.Taiko_Combo[2] != null) - { + } else { + if (TJAPlayer3.Tx.Taiko_Combo[2] != null) { var yScalling = TJAPlayer3.ConfigIni.SimpleMode ? 0 : ComboScale[this.ctコンボ加算[nPlayer].CurrentValue]; TJAPlayer3.Tx.Taiko_Combo[2].vcScaleRatio.Y = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[0] + yScalling; TJAPlayer3.Tx.Taiko_Combo[2].vcScaleRatio.X = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[0]; TJAPlayer3.Tx.Taiko_Combo[2].t2D拡大率考慮下中心基準描画(rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[0] * i, combo_y, new Rectangle(n位の数[i] * TJAPlayer3.Skin.Game_Taiko_Combo_Size[0], 0, TJAPlayer3.Skin.Game_Taiko_Combo_Size[0], TJAPlayer3.Skin.Game_Taiko_Combo_Size[1])); } - if (!TJAPlayer3.ConfigIni.SimpleMode) showComboEffect(0, i, rightX, combo_ex_y, nPlayer); + if (!TJAPlayer3.ConfigIni.SimpleMode) showComboEffect(0, i, rightX, combo_ex_y, nPlayer); } - } - else if (n桁数 == 3) - { - if (nCombo値 >= 300 && TJAPlayer3.Tx.Taiko_Combo[3] != null) - { + } else if (n桁数 == 3) { + if (nCombo値 >= 300 && TJAPlayer3.Tx.Taiko_Combo[3] != null) { var yScalling = TJAPlayer3.ConfigIni.SimpleMode ? 0 : ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 0]; TJAPlayer3.Tx.Taiko_Combo[3].vcScaleRatio.Y = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[1] + yScalling; TJAPlayer3.Tx.Taiko_Combo[3].vcScaleRatio.X = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[1]; var yJumping = TJAPlayer3.Skin.Game_Taiko_Combo_Ex_IsJumping ? (int)ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 1] : 0; TJAPlayer3.Tx.Taiko_Combo[3].t2D拡大率考慮下中心基準描画(rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[1] * i, combo_ex_y + yJumping, new Rectangle(n位の数[i] * TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0], 0, TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0], TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[1])); - } - else if (TJAPlayer3.Tx.Taiko_Combo[1] != null) - { + } else if (TJAPlayer3.Tx.Taiko_Combo[1] != null) { var yScalling = TJAPlayer3.ConfigIni.SimpleMode ? 0 : ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 0]; TJAPlayer3.Tx.Taiko_Combo[1].vcScaleRatio.Y = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[1] + yScalling; TJAPlayer3.Tx.Taiko_Combo[1].vcScaleRatio.X = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[1]; @@ -568,20 +492,15 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Taiko_Combo[1].t2D拡大率考慮下中心基準描画(rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[1] * i, combo_ex_y + yJumping, new Rectangle(n位の数[i] * TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0], 0, TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0], TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[1])); } - if (!TJAPlayer3.ConfigIni.SimpleMode) showComboEffect(1, i, rightX, combo_ex_y, nPlayer); - } - else - { - if (nCombo値 >= 300 && TJAPlayer3.Tx.Taiko_Combo[3] != null) - { + if (!TJAPlayer3.ConfigIni.SimpleMode) showComboEffect(1, i, rightX, combo_ex_y, nPlayer); + } else { + if (nCombo値 >= 300 && TJAPlayer3.Tx.Taiko_Combo[3] != null) { var yScalling = TJAPlayer3.ConfigIni.SimpleMode ? 0 : ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 0]; TJAPlayer3.Tx.Taiko_Combo[3].vcScaleRatio.Y = 1.0f + yScalling; TJAPlayer3.Tx.Taiko_Combo[3].vcScaleRatio.X = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[2]; var yJumping = TJAPlayer3.Skin.Game_Taiko_Combo_Ex_IsJumping ? (int)ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 1] : 0; TJAPlayer3.Tx.Taiko_Combo[3].t2D拡大率考慮下中心基準描画(rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[2] * i, combo_ex_y + yJumping, new Rectangle(n位の数[i] * TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0], 0, TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0], TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[1])); - } - else if (TJAPlayer3.Tx.Taiko_Combo[1] != null) - { + } else if (TJAPlayer3.Tx.Taiko_Combo[1] != null) { var yScalling = TJAPlayer3.ConfigIni.SimpleMode ? 0 : ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 0]; TJAPlayer3.Tx.Taiko_Combo[1].vcScaleRatio.Y = 1.0f + yScalling; TJAPlayer3.Tx.Taiko_Combo[1].vcScaleRatio.X = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[2]; @@ -589,25 +508,23 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Taiko_Combo[1].t2D拡大率考慮下中心基準描画(rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[2] * i, combo_ex_y + yJumping, new Rectangle(n位の数[i] * TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0], 0, TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0], TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[1])); } - if (!TJAPlayer3.ConfigIni.SimpleMode) showComboEffect(2, i, rightX, combo_ex_y, nPlayer); + if (!TJAPlayer3.ConfigIni.SimpleMode) showComboEffect(2, i, rightX, combo_ex_y, nPlayer); } - } - - //----------------- + } + + //----------------- #endregion - } - - // CActivity 実装 - - public override void Activate() - { + } + + // 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++) - { + for (int i = 0; i < 5; i++) { this.status[i].e現在のモード = EMode.非表示中; this.status[i].nCOMBO値 = 0; this.status[i].n最高COMBO値 = 0; @@ -621,81 +538,65 @@ namespace TJAPlayer3 this.ctコンボラメ = new CCounter(0, 35, 16, TJAPlayer3.Timer); base.Activate(); } - public override void DeActivate() - { + public override void DeActivate() { if (this.status != null) this.status = null; base.DeActivate(); } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { base.ReleaseManagedResource(); } - public override int Draw() - { + public override int Draw() { if (this.IsDeActivated) return 0; - for (int i = 0; i < 5; i++) - { - EEvent e今回の状態遷移イベント; - + for (int i = 0; i < 5; i++) { + EEvent e今回の状態遷移イベント; + #region [ 前回と今回の COMBO 値から、e今回の状態遷移イベントを決定する。] - //----------------- - if (this.status[i].n現在表示中のCOMBO値 == this.status[i].nCOMBO値) - { + //----------------- + if (this.status[i].n現在表示中のCOMBO値 == this.status[i].nCOMBO値) { e今回の状態遷移イベント = EEvent.同一数値; - } - else if (this.status[i].n現在表示中のCOMBO値 > this.status[i].nCOMBO値) - { + } else if (this.status[i].n現在表示中のCOMBO値 > this.status[i].nCOMBO値) { e今回の状態遷移イベント = EEvent.ミス通知; - } - else if ((this.status[i].n現在表示中のCOMBO値 < TJAPlayer3.ConfigIni.n表示可能な最小コンボ数.Drums) && (this.status[i].nCOMBO値 < TJAPlayer3.ConfigIni.n表示可能な最小コンボ数.Drums)) - { + } else if ((this.status[i].n現在表示中のCOMBO値 < TJAPlayer3.ConfigIni.n表示可能な最小コンボ数.Drums) && (this.status[i].nCOMBO値 < TJAPlayer3.ConfigIni.n表示可能な最小コンボ数.Drums)) { e今回の状態遷移イベント = EEvent.非表示; - } - else - { + } else { e今回の状態遷移イベント = EEvent.数値更新; - } - //----------------- + } + //----------------- #endregion - + #region [ nジャンプインデックス値 の進行。] - //----------------- - if (this.status[i].nジャンプインデックス値 < 360) - { + //----------------- + if (this.status[i].nジャンプインデックス値 < 360) { if ((this.status[i].n前回の時刻_ジャンプ用 == -1) || (TJAPlayer3.Timer.NowTime < this.status[i].n前回の時刻_ジャンプ用)) this.status[i].n前回の時刻_ジャンプ用 = TJAPlayer3.Timer.NowTime; const long INTERVAL = 2; - while ((TJAPlayer3.Timer.NowTime - this.status[i].n前回の時刻_ジャンプ用) >= INTERVAL) - { + while ((TJAPlayer3.Timer.NowTime - this.status[i].n前回の時刻_ジャンプ用) >= INTERVAL) { if (this.status[i].nジャンプインデックス値 < 2000) this.status[i].nジャンプインデックス値 += 3; this.status[i].n前回の時刻_ジャンプ用 += INTERVAL; } - } - //----------------- + } + //----------------- #endregion - - Retry: // モードが変化した場合はここからリトライする。 - - switch (this.status[i].e現在のモード) - { - case EMode.非表示中: + + Retry: // モードが変化した場合はここからリトライする。 + + switch (this.status[i].e現在のモード) { + case EMode.非表示中: #region [ *** ] - //----------------- - - if (e今回の状態遷移イベント == EEvent.数値更新) - { - // モード変更 + //----------------- + + if (e今回の状態遷移イベント == EEvent.数値更新) { + // モード変更 this.status[i].e現在のモード = EMode.進行表示中; this.status[i].nジャンプインデックス値 = 0; this.status[i].n前回の時刻_ジャンプ用 = TJAPlayer3.Timer.NowTime; @@ -703,32 +604,29 @@ namespace TJAPlayer3 } this.status[i].n現在表示中のCOMBO値 = this.status[i].nCOMBO値; - break; - //----------------- + break; + //----------------- #endregion - - case EMode.進行表示中: + + case EMode.進行表示中: #region [ *** ] - //----------------- - - if ((e今回の状態遷移イベント == EEvent.非表示) || (e今回の状態遷移イベント == EEvent.ミス通知)) - { - // モード変更 + //----------------- + + if ((e今回の状態遷移イベント == EEvent.非表示) || (e今回の状態遷移イベント == EEvent.ミス通知)) { + // モード変更 this.status[i].e現在のモード = EMode.残像表示中; this.status[i].n残像表示中のCOMBO値 = this.status[i].n現在表示中のCOMBO値; this.status[i].nコンボが切れた時刻 = TJAPlayer3.Timer.NowTime; goto Retry; } - if (e今回の状態遷移イベント == EEvent.数値更新) - { + if (e今回の状態遷移イベント == EEvent.数値更新) { this.status[i].nジャンプインデックス値 = 0; this.status[i].n前回の時刻_ジャンプ用 = TJAPlayer3.Timer.NowTime; } this.status[i].n現在表示中のCOMBO値 = this.status[i].nCOMBO値; - switch (i) - { + switch (i) { case 0: this.tコンボ表示_太鼓(this.status[i].nCOMBO値, this.status[i].nジャンプインデックス値, 0); break; @@ -749,28 +647,26 @@ namespace TJAPlayer3 this.tコンボ表示_太鼓(this.status[i].nCOMBO値, this.status[i].nジャンプインデックス値, 4); break; } - break; - //----------------- + break; + //----------------- #endregion - - case EMode.残像表示中: + + case EMode.残像表示中: #region [ *** ] - //----------------- - if (e今回の状態遷移イベント == EEvent.数値更新) - { - // モード変更1 + //----------------- + if (e今回の状態遷移イベント == EEvent.数値更新) { + // モード変更1 this.status[i].e現在のモード = EMode.進行表示中; goto Retry; } - if ((TJAPlayer3.Timer.NowTime - this.status[i].nコンボが切れた時刻) > 1000) - { - // モード変更2 + if ((TJAPlayer3.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; - //----------------- + break; + //----------------- #endregion } } @@ -778,4 +674,4 @@ namespace TJAPlayer3 return 0; } } -} \ No newline at end of file +} diff --git a/OpenTaiko/src/Stages/07.Game/CAct演奏Combo音声.cs b/OpenTaiko/src/Stages/07.Game/CAct演奏Combo音声.cs index 5380056a..66679bb2 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏Combo音声.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏Combo音声.cs @@ -1,95 +1,74 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Runtime.InteropServices; -using System.Drawing; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - internal class CAct演奏Combo音声 : CActivity - { +namespace TJAPlayer3 { + internal class CAct演奏Combo音声 : CActivity { // コンストラクタ - public CAct演奏Combo音声() - { + public CAct演奏Combo音声() { base.IsDeActivated = true; } - + // メソッド - 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 t再生(int nCombo, int player) { + if (VoiceIndex[player] < ListCombo[player].Count) { - public void tPlayFloorSound() - { - if (FloorIndex[0] < ListFloor[0].Count) - { + var index = ListCombo[player][VoiceIndex[player]]; + if (nCombo == index.nCombo) { + index.soundComboVoice.PlayStart(); + VoiceIndex[player]++; + } - var index = ListFloor[0][FloorIndex[0]]; - if (CFloorManagement.LastRegisteredFloor == index.nCombo) - { - index.soundComboVoice.PlayStart(); - FloorIndex[0]++; - } - } - } + } + } - /// - /// カーソルを戻す。 - /// コンボが切れた時に使う。 - /// - public void tReset(int nPlayer) - { - VoiceIndex[nPlayer] = 0; - } + 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 }; + 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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - #region [Combo voices] - int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(i)].data.Character; + // フォルダ内を走査してコンボボイスをListに入れていく + // 1P、2P コンボボイス + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + #region [Combo voices] - var currentDir = ($@"{TJAPlayer3.strEXEのあるフォルダ}Global{Path.DirectorySeparatorChar}Characters{Path.DirectorySeparatorChar}{TJAPlayer3.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 = TJAPlayer3.SoundManager.tCreateSound(item, ESoundGroup.Voice); - /* + int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(i)].data.Character; + + var currentDir = ($@"{TJAPlayer3.strEXEのあるフォルダ}Global{Path.DirectorySeparatorChar}Characters{Path.DirectorySeparatorChar}{TJAPlayer3.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 = TJAPlayer3.SoundManager.tCreateSound(item, ESoundGroup.Voice); + /* if (TJAPlayer3.ConfigIni.nPlayerCount >= 2) //2020.05.06 Mr-Ojii 左右に出したかったから追加。 { if (i == 0) @@ -98,111 +77,97 @@ namespace TJAPlayer3 comboVoice.soundComboVoice.n位置 = 100; } */ - comboVoice.soundComboVoice.SoundPosition = TJAPlayer3.ConfigIni.nPanning[TJAPlayer3.ConfigIni.nPlayerCount - 1][i]; - comboVoice.nCombo = int.Parse(Path.GetFileNameWithoutExtension(item)); - ListCombo[i].Add(comboVoice); - } - if(ListCombo[i].Count > 0) - { - ListCombo[i].Sort(); - } - } + comboVoice.soundComboVoice.SoundPosition = TJAPlayer3.ConfigIni.nPanning[TJAPlayer3.ConfigIni.nPlayerCount - 1][i]; + comboVoice.nCombo = int.Parse(Path.GetFileNameWithoutExtension(item)); + ListCombo[i].Add(comboVoice); + } + if (ListCombo[i].Count > 0) { + ListCombo[i].Sort(); + } + } - #endregion + #endregion - #region [Floor voices] + #region [Floor voices] - currentDir = ($@"{TJAPlayer3.strEXEのあるフォルダ}Global\Characters\{TJAPlayer3.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 = TJAPlayer3.SoundManager.tCreateSound(item, ESoundGroup.Voice); - comboVoice.nCombo = int.Parse(Path.GetFileNameWithoutExtension(item)); - ListFloor[i].Add(comboVoice); - } - if (ListFloor[i].Count > 0) - { - ListFloor[i].Sort(); - } - } + currentDir = ($@"{TJAPlayer3.strEXEのあるフォルダ}Global\Characters\{TJAPlayer3.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 = TJAPlayer3.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 + #endregion - } + } - base.Activate(); + base.Activate(); } - public override void DeActivate() - { - if( !base.IsDeActivated ) - { - for (int i = 0; i < 5; i++) - { - foreach (var item in ListCombo[i]) - { - TJAPlayer3.SoundManager.tDisposeSound(item.soundComboVoice); - } - ListCombo[i].Clear(); + public override void DeActivate() { + if (!base.IsDeActivated) { + for (int i = 0; i < 5; i++) { + foreach (var item in ListCombo[i]) { + TJAPlayer3.SoundManager.tDisposeSound(item.soundComboVoice); + } + ListCombo[i].Clear(); - foreach (var item in ListFloor[i]) - { - TJAPlayer3.SoundManager.tDisposeSound(item.soundComboVoice); - } - ListFloor[i].Clear(); - } + foreach (var item in ListFloor[i]) { + TJAPlayer3.SoundManager.tDisposeSound(item.soundComboVoice); + } + ListFloor[i].Clear(); + } base.DeActivate(); } } - public override void CreateManagedResource() - { - base.CreateManagedResource(); + public override void CreateManagedResource() { + base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { base.ReleaseManagedResource(); } #region [ private ] //----------------- - int[] VoiceIndex; - int[] FloorIndex; + int[] VoiceIndex; + int[] FloorIndex; - readonly List[] ListCombo = new List[5]; - readonly List[] ListFloor = new List[5]; - //----------------- - #endregion - } + 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 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 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; + public int CompareTo(CComboVoice other) { + if (this.nCombo > other.nCombo) return 1; + else if (this.nCombo < other.nCombo) return -1; - return 0; - } - } + return 0; + } + } } diff --git a/OpenTaiko/src/Stages/07.Game/CAct演奏PauseMenu.cs b/OpenTaiko/src/Stages/07.Game/CAct演奏PauseMenu.cs index 84c1eb7e..e9126ea5 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏PauseMenu.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏PauseMenu.cs @@ -1,104 +1,83 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using System.Drawing; -using System.IO; +using System.Diagnostics; using FDK; -namespace TJAPlayer3 -{ - internal class CAct演奏PauseMenu : CActSelectPopupMenu - { +namespace TJAPlayer3 { + internal class CAct演奏PauseMenu : CActSelectPopupMenu { // コンストラクタ - public CAct演奏PauseMenu() - { - CAct演奏PauseMenuMain(); + public CAct演奏PauseMenu() { + CAct演奏PauseMenuMain(); } - private void CAct演奏PauseMenuMain() - { - this.bEsc有効 = false; - lci = new List>>(); // この画面に来る度に、メニューを作り直す。 - for ( int nConfSet = 0; nConfSet < (TJAPlayer3.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 ); + private void CAct演奏PauseMenuMain() { + this.bEsc有効 = false; + lci = new List>>(); // この画面に来る度に、メニューを作り直す。 + for (int nConfSet = 0; nConfSet < (TJAPlayer3.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 + base.Initialize(lci[nCurrentConfigSet][0], true, CLangManager.LangInstance.GetString("PAUSE_TITLE"), 0); // ConfSet=0, nInst=Drums } - private List MakeListCItemBase( int nConfigSet, int nInst ) - { + 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 (TJAPlayer3.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[] { "", "" })); + #region [ 共通 SET切り替え/More/Return ] + l.Add(new CSwitchItemList(CLangManager.LangInstance.GetString("PAUSE_RESUME"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "" })); + if (TJAPlayer3.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(); + public override void tActivatePopupMenu(EInstrumentPad einst) { + this.CAct演奏PauseMenuMain(); CActSelectPopupMenu.b選択した = false; this.bやり直しを選択した = false; - base.tActivatePopupMenu( einst ); + 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 ) - { - TJAPlayer3.stage演奏ドラム画面.bPAUSE = false; - TJAPlayer3.stage演奏ドラム画面.t演奏やりなおし(); + public override void t進行描画sub() { + if (this.bやり直しを選択した) { + if (!sw.IsRunning) + this.sw = Stopwatch.StartNew(); + if (sw.ElapsedMilliseconds > 1500) { + TJAPlayer3.stage演奏ドラム画面.bPAUSE = false; + TJAPlayer3.stage演奏ドラム画面.t演奏やりなおし(); - this.tDeativatePopupMenu(); - this.sw.Reset(); - } - } + this.tDeativatePopupMenu(); + this.sw.Reset(); + } + } } - public override void tEnter押下Main( int nSortOrder ) - { - switch ( n現在の選択行 ) - { - case (int) EOrder.Continue: - TJAPlayer3.stage演奏ドラム画面.bPAUSE = false; + public override void tEnter押下Main(int nSortOrder) { + switch (n現在の選択行) { + case (int)EOrder.Continue: + TJAPlayer3.stage演奏ドラム画面.bPAUSE = false; - SoundManager.PlayTimer.Resume(); + SoundManager.PlayTimer.Resume(); TJAPlayer3.Timer.Resume(); TJAPlayer3.DTX.t全チップの再生再開(); - TJAPlayer3.stage演奏ドラム画面.actAVI.tPauseControl(); + TJAPlayer3.stage演奏ドラム画面.actAVI.tPauseControl(); CActSelectPopupMenu.b選択した = true; this.tDeativatePopupMenu(); break; - case (int) EOrder.Redoing: - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) - { + case (int)EOrder.Redoing: + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { this.bやり直しを選択した = true; CActSelectPopupMenu.b選択した = true; - } - else - { + } else { SoundManager.PlayTimer.Resume(); TJAPlayer3.Timer.Resume(); TJAPlayer3.stage演奏ドラム画面.t演奏中止(); @@ -107,48 +86,42 @@ namespace TJAPlayer3 } break; - case (int) EOrder.Return: - SoundManager.PlayTimer.Resume(); + case (int)EOrder.Return: + SoundManager.PlayTimer.Resume(); TJAPlayer3.Timer.Resume(); - TJAPlayer3.stage演奏ドラム画面.t演奏中止(); + TJAPlayer3.stage演奏ドラム画面.t演奏中止(); CActSelectPopupMenu.b選択した = true; this.tDeativatePopupMenu(); - break; - default: - break; - } + break; + default: + break; + } } - public override void tCancel() - { + public override void tCancel() { } // CActivity 実装 - public override void Activate() - { + public override void Activate() { base.Activate(); this.bGotoDetailConfig = false; - this.sw = new Stopwatch(); + this.sw = new Stopwatch(); } - public override void DeActivate() - { + 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パネル本体 = TJAPlayer3.tテクスチャの生成( pathパネル本体, true ); + public override void CreateManagedResource() { + string pathパネル本体 = CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}ScreenSelect popup auto settings.png"); + if (File.Exists(pathパネル本体)) { + this.txパネル本体 = TJAPlayer3.tテクスチャの生成(pathパネル本体, true); } base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { - TJAPlayer3.tテクスチャの解放( ref this.txパネル本体 ); - TJAPlayer3.tテクスチャの解放( ref this.tx文字列パネル ); + public override void ReleaseManagedResource() { + TJAPlayer3.tテクスチャの解放(ref this.txパネル本体); + TJAPlayer3.tテクスチャの解放(ref this.tx文字列パネル); base.ReleaseManagedResource(); } @@ -157,8 +130,7 @@ namespace TJAPlayer3 private int nCurrentTarget = 0; private int nCurrentConfigSet = 0; private List>> lci; - private enum EOrder : int - { + private enum EOrder : int { Continue, Redoing, Return, END, @@ -168,8 +140,8 @@ namespace TJAPlayer3 private bool b選択した; private CTexture txパネル本体; private CTexture tx文字列パネル; - private Stopwatch sw; - private bool bやり直しを選択した; + 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 673d7c3c..7234e826 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏ゲージ共通.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏ゲージ共通.cs @@ -1,378 +1,337 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; -using System.Drawing; -using System.Diagnostics; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - /// - /// CAct演奏Drumsゲージ と CAct演奏Gutiarゲージ のbaseクラス。ダメージ計算やDanger/Failed判断もこのクラスで行う。 - /// - /// 課題 - /// _STAGE FAILED OFF時にゲージ回復を止める - /// _黒→閉店までの差を大きくする。 - /// - internal class CAct演奏ゲージ共通 : CActivity - { - // プロパティ - public CActLVLNFont actLVLNFont { get; protected set; } +namespace TJAPlayer3 { + /// + /// CAct演奏Drumsゲージ と CAct演奏Gutiarゲージ のbaseクラス。ダメージ計算やDanger/Failed判断もこのクラスで行う。 + /// + /// 課題 + /// _STAGE FAILED OFF時にゲージ回復を止める + /// _黒→閉店までの差を大きくする。 + /// + internal class CAct演奏ゲージ共通 : CActivity { + // プロパティ + public CActLVLNFont actLVLNFont { get; protected set; } - // コンストラクタ - public CAct演奏ゲージ共通() - { - //actLVLNFont = new CActLVLNFont(); // On活性化()に移動 - //actLVLNFont.On活性化(); - } + // コンストラクタ + public CAct演奏ゲージ共通() { + //actLVLNFont = new CActLVLNFont(); // On活性化()に移動 + //actLVLNFont.On活性化(); + } - // CActivity 実装 + // 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] = TJAPlayer3.DTX; - this.DTX[1] = TJAPlayer3.DTX_2P; - this.DTX[2] = TJAPlayer3.DTX_3P; - this.DTX[3] = TJAPlayer3.DTX_4P; - this.DTX[4] = TJAPlayer3.DTX_5P; - actLVLNFont = new CActLVLNFont(); - actLVLNFont.Activate(); - base.Activate(); - } - public override void DeActivate() - { - actLVLNFont.DeActivate(); - actLVLNFont = null; - base.DeActivate(); - } + 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] = TJAPlayer3.DTX; + this.DTX[1] = TJAPlayer3.DTX_2P; + this.DTX[2] = TJAPlayer3.DTX_3P; + this.DTX[3] = TJAPlayer3.DTX_4P; + this.DTX[4] = TJAPlayer3.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; + 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); - } + 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 = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.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]; - + /// + /// ゲージの初期化 + /// + /// Riskyの初期値(0でRisky未使用) + public void Init(int nRiskyTimes_InitialVal, int nPlayer) // ゲージ初期化 + { + //ダメージ値の計算 + { + var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.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; + } + } - if (nRiskyTimes_InitialVal > 0) - { - this.bRisky = true; - this.nRiskyTimes = TJAPlayer3.ConfigIni.nRisky; - this.nRiskyTimes_Initial = TJAPlayer3.ConfigIni.nRisky; - } - - float gaugeRate = 0f; - float dbDamageRate = 2.0f; - - int nanidou = TJAPlayer3.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; + //ゲージのMAXまでの最低コンボ数を計算 + float dbGaugeMaxComboValue = 0; + float[] dbGaugeMaxComboValue_branch = new float[3]; - case 8: - gaugeRate = this.fGaugeMaxRate[1]; - dbDamageRate = 0.625f; - break; + if (nRiskyTimes_InitialVal > 0) { + this.bRisky = true; + this.nRiskyTimes = TJAPlayer3.ConfigIni.nRisky; + this.nRiskyTimes_Initial = TJAPlayer3.ConfigIni.nRisky; + } - case 9: - case 10: - default: - gaugeRate = this.fGaugeMaxRate[2]; - dbDamageRate = 2.0f; - break; - } + float gaugeRate = 0f; + float dbDamageRate = 2.0f; - #region [(Unbloated) Gauge max combo values] + int nanidou = TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[nPlayer]; - 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); - } + 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; - #endregion - float multiplicationFactor = 1f; - if (nanidou == (int)Difficulty.Tower) - multiplicationFactor = 0f; + case 8: + gaugeRate = this.fGaugeMaxRate[1]; + dbDamageRate = 0.625f; + break; - double nGaugeRankValue = 0D; - double[] nGaugeRankValue_branch = new double[] { 0D, 0D, 0D }; + case 9: + case 10: + default: + gaugeRate = this.fGaugeMaxRate[2]; + dbDamageRate = 2.0f; + break; + } - nGaugeRankValue = (10000.0f / dbGaugeMaxComboValue) * multiplicationFactor; - for (int i = 0; i < 3; i++) - { - nGaugeRankValue_branch[i] = (10000.0f / dbGaugeMaxComboValue_branch[i]) * multiplicationFactor; - } + #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); + } - 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; + #endregion - 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; - } + float multiplicationFactor = 1f; + if (nanidou == (int)Difficulty.Tower) + multiplicationFactor = 0f; - //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 ]; + double nGaugeRankValue = 0D; + double[] nGaugeRankValue_branch = new double[] { 0D, 0D, 0D }; - //2015.03.26 kairera0467 計算を初期化時にするよう修正。 + nGaugeRankValue = (10000.0f / dbGaugeMaxComboValue) * multiplicationFactor; + for (int i = 0; i < 3; i++) { + nGaugeRankValue_branch[i] = (10000.0f / dbGaugeMaxComboValue_branch[i]) * multiplicationFactor; + } - #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 + 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; - #region [Rounding process] + 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; + } - 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; - } + //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 ]; - for (int i = 0; i < 3; i++) - { - var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.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 = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.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 - } + //2015.03.26 kairera0467 計算を初期化時にするよう修正。 - #region [ DAMAGE ] + #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 = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.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 = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.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 + #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 - }; + { 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ゲージ増加量 = new float[3][]; - //譜面レベル, 判定 - public float[,][] dbゲージ増加量_Branch = new float[3, 3][]; + //譜面レベル, 判定 + public float[,][] dbゲージ増加量_Branch = new float[3, 3][]; - public float[] fGaugeMaxRate = - { - 70.7f, // 1~7 + public float[] fGaugeMaxRate = + { + 70.7f, // 1~7 70f, // 8 75.0f, // 9~10 78.5f, // 11 @@ -380,131 +339,111 @@ namespace TJAPlayer3 82f, // 13+ };//おおよその値。 - // ---------------------------------- - #endregion + // ---------------------------------- + #endregion #endif - public void MineDamage(int nPlayer) - { - this.db現在のゲージ値[nPlayer] = Math.Max(0, this.db現在のゲージ値[nPlayer] - HGaugeMethods.BombDamage); - } + 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 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)TJAPlayer3.stage演奏ドラム画面.n現在のコース[nPlayer]; + public void Damage(EInstrumentPad screenmode, EInstrumentPad part, ENoteJudge e今回の判定, int nPlayer) { + float fDamage; + int nコース = (int)TJAPlayer3.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]; + 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; - } + if (fDamage >= 0) { + fDamage = -fDamage; + } - var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(nPlayer)].data.Character]; + var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(nPlayer)].data.Character]; - int nanidou = TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[nPlayer]; - int level = this.DTX[nPlayer].LEVELtaiko[nanidou]; + int nanidou = TJAPlayer3.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; - } + 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--; - } - } + if (this.bRisky) { + this.nRiskyTimes--; + } + } - break; + break; - default: - { - if (this.DTX[nPlayer].bチップがある.Branch) - { - fDamage = this.dbゲージ増加量_Branch[nコース, 0][nPlayer]; - } - else - fDamage = this.dbゲージ増加量[0][nPlayer]; - 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); + 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; + 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; + //CDTXMania.stage演奏ドラム画面.nGauge = fDamage; - } + } - public virtual void Start(int nLane, ENoteJudge judge, int player) - { - } + public virtual void Start(int nLane, ENoteJudge judge, int player) { + } - //----------------- - #endregion + //----------------- + #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]; - } + 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 7b69aa60..89dd5f39 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏スクロール速度.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏スクロール速度.cs @@ -1,12 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Text; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - internal class CAct演奏スクロール速度 : CActivity - { +namespace TJAPlayer3 { + internal class CAct演奏スクロール速度 : CActivity { // プロパティ public double[] db現在の譜面スクロール速度 = new double[5]; @@ -14,70 +9,57 @@ namespace TJAPlayer3 // コンストラクタ - public CAct演奏スクロール速度() - { + public CAct演奏スクロール速度() { base.IsDeActivated = true; } // CActivity 実装 - public override void Activate() - { - for( int i = 0; i < 5; i++ ) - { - this.db現在の譜面スクロール速度[ i ] = (double) TJAPlayer3.ConfigIni.nScrollSpeed[ TJAPlayer3.GetActualPlayer(i) ]; - this.n速度変更制御タイマ[ i ] = -1; + public override void Activate() { + for (int i = 0; i < 5; i++) { + this.db現在の譜面スクロール速度[i] = (double)TJAPlayer3.ConfigIni.nScrollSpeed[TJAPlayer3.GetActualPlayer(i)]; + this.n速度変更制御タイマ[i] = -1; } - + base.Activate(); } - public override unsafe int Draw() - { - if( !base.IsDeActivated ) - { - if( base.IsFirstDraw ) - { + 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++) - { + for (int i = 0; i < 5; i++) { this.n速度変更制御タイマ[i] = (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed); } - + base.IsFirstDraw = false; } long n現在時刻 = SoundManager.PlayTimer.NowTime; - for( int i = 0; i < 5; i++ ) - { - double db譜面スクロールスピード = (double) TJAPlayer3.ConfigIni.nScrollSpeed[ TJAPlayer3.GetActualPlayer(i) ]; - if( n現在時刻 < this.n速度変更制御タイマ[ i ] ) - { - this.n速度変更制御タイマ[ i ] = n現在時刻; + for (int i = 0; i < 5; i++) { + double db譜面スクロールスピード = (double)TJAPlayer3.ConfigIni.nScrollSpeed[TJAPlayer3.GetActualPlayer(i)]; + if (n現在時刻 < this.n速度変更制御タイマ[i]) { + this.n速度変更制御タイマ[i] = n現在時刻; } - while( ( n現在時刻 - this.n速度変更制御タイマ[ i ] ) >= 2 ) // 2msに1回ループ + while ((n現在時刻 - this.n速度変更制御タイマ[i]) >= 2) // 2msに1回ループ { - if( this.db現在の譜面スクロール速度[ i ] < db譜面スクロールスピード ) // Config.iniのスクロール速度を変えると、それに追いつくように実画面のスクロール速度を変える + if (this.db現在の譜面スクロール速度[i] < db譜面スクロールスピード) // Config.iniのスクロール速度を変えると、それに追いつくように実画面のスクロール速度を変える { - this.db現在の譜面スクロール速度[ i ] += 0.012; + this.db現在の譜面スクロール速度[i] += 0.012; - if( this.db現在の譜面スクロール速度[ i ] > db譜面スクロールスピード ) - { - this.db現在の譜面スクロール速度[ i ] = db譜面スクロールスピード; + 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譜面スクロールスピード; } } - else if ( this.db現在の譜面スクロール速度[ i ] > db譜面スクロールスピード ) - { - this.db現在の譜面スクロール速度[ i ] -= 0.012; - - if( this.db現在の譜面スクロール速度[ i ] < db譜面スクロールスピード ) - { - this.db現在の譜面スクロール速度[ i ] = db譜面スクロールスピード; - } - } - this.n速度変更制御タイマ[ i ] += 2; + this.n速度変更制御タイマ[i] += 2; } } } diff --git a/OpenTaiko/src/Stages/07.Game/CAct演奏スコア共通.cs b/OpenTaiko/src/Stages/07.Game/CAct演奏スコア共通.cs index 88ccf921..cbb0c5e5 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏スコア共通.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏スコア共通.cs @@ -1,14 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Text; -using FDK; -using System.Drawing; +using System.Drawing; using System.Runtime.InteropServices; +using FDK; -namespace TJAPlayer3 -{ - internal class CAct演奏スコア共通 : CActivity - { +namespace TJAPlayer3 { + internal class CAct演奏スコア共通 : CActivity { // プロパティ protected long[] nScoreIncrease; @@ -16,176 +11,168 @@ namespace TJAPlayer3 protected long[] nCurrentlyDisplayedScore; //protected CTexture txScore; - // protected CTexture txScore_1P; - protected CCounter ctTimer; - public CCounter[] ct点数アニメタイマ; + // protected CTexture txScore_1P; + protected CCounter ctTimer; + public CCounter[] ct点数アニメタイマ; - public CCounter[] ctボーナス加算タイマ; + public CCounter[] ctボーナス加算タイマ; - protected STスコア[] stScore; - protected int nNowDisplayedAddScore; + protected STスコア[] stScore; + protected int nNowDisplayedAddScore; - [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)] + 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; + [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 ]; + this.stScore = new STスコア[256]; base.IsDeActivated = true; } - // メソッド + // メソッド - 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 ]; - } - public void Set(double nScore, int player) - { - if( this.nCurrentRealScore[ player ] != nScore ) + private float[,] n点数アニメ拡大率_座標 = new float[,] + { { - 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; + 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]; + } + 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; } } @@ -196,194 +183,166 @@ namespace TJAPlayer3 /// /// /// - public void Add(long delta, int player ) - { - if (TJAPlayer3.ConfigIni.bAIBattleMode && player == 1) return; + public void Add(long delta, int player) { + if (TJAPlayer3.ConfigIni.bAIBattleMode && player == 1) return; - double rev = 1.0; + double rev = 1.0; - delta = (long)(delta * TJAPlayer3.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, player)); + delta = (long)(delta * TJAPlayer3.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, player)); - this.ctTimer = new CCounter( 0, 400, 1, TJAPlayer3.Timer ); + this.ctTimer = new CCounter(0, 400, 1, TJAPlayer3.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, TJAPlayer3.Timer ); - this.stScore[ i ].bBonusScore = false; - 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, TJAPlayer3.Timer); + this.stScore[i].bBonusScore = false; + this.stScore[i].bAddEnd = false; + this.stScore[i].nPlayer = player; + this.nNowDisplayedAddScore++; + break; + } + } + } - this.Set(this.Get( player ) + delta * rev, player); + this.Set(this.Get(player) + delta * rev, player); } - public void BonusAdd( int player ) - { - if (TJAPlayer3.ConfigIni.bAIBattleMode && player == 1) return; + public void BonusAdd(int player) { + if (TJAPlayer3.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, TJAPlayer3.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 = 10000; + this.stScore[i].ctTimer = new CCounter(0, 100, 4, TJAPlayer3.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 ); - } + 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 }; + 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; - } + 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.nNowDisplayedAddScore = 0; - this.ctTimer = new CCounter(); + 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(); + 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() - { + 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")); + // this.txScore_1P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\7_Score_number_1P.png")); base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { //CDTXMania.tテクスチャの解放( ref this.txScore ); - // CDTXMania.tテクスチャの解放(ref this.txScore_1P); + // 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(TJAPlayer3.Skin.Game_Score_Size[0] * i, 0, TJAPlayer3.Skin.Game_Score_Size[0], TJAPlayer3.Skin.Game_Score_Size[1]); - switch( mode ) - { - case 0: - if( TJAPlayer3.Tx.Taiko_Score[0] != null ) - { - //this.txScore.color4 = new SlimDX.Color4( 1.0f, 1.0f, 1.0f ); - TJAPlayer3.Tx.Taiko_Score[0].Opacity = alpha; - if (TJAPlayer3.ConfigIni.SimpleMode) - { - TJAPlayer3.Tx.Taiko_Score[0].vcScaleRatio.Y = 1; - } - else - { - TJAPlayer3.Tx.Taiko_Score[0].vcScaleRatio.Y = ScoreScale[this.ct点数アニメタイマ[player].CurrentValue]; - } - TJAPlayer3.Tx.Taiko_Score[0].t2D拡大率考慮下基準描画( x , y, rectangle ); - - } - break; - case 1: - if(TJAPlayer3.Tx.Taiko_Score[1] != null ) - { - //this.txScore.color4 = new SlimDX.Color4( 1.0f, 0.5f, 0.4f ); - //this.txScore.color4 = CDTXMania.Skin.cScoreColor1P; - TJAPlayer3.Tx.Taiko_Score[1].Opacity = alpha; - TJAPlayer3.Tx.Taiko_Score[1].vcScaleRatio.Y = 1; - TJAPlayer3.Tx.Taiko_Score[1].t2D拡大率考慮下基準描画( x, y, rectangle ); - } - break; - case 2: - if (TJAPlayer3.Tx.Taiko_Score[2] != null) - { - //this.txScore.color4 = new SlimDX.Color4( 0.4f, 0.5f, 1.0f ); - //this.txScore.color4 = CDTXMania.Skin.cScoreColor2P; - TJAPlayer3.Tx.Taiko_Score[2].Opacity = alpha; - TJAPlayer3.Tx.Taiko_Score[2].vcScaleRatio.Y = 1; - TJAPlayer3.Tx.Taiko_Score[2].t2D拡大率考慮下基準描画(x, y, rectangle); - } - break; - case 3: - if (TJAPlayer3.Tx.Taiko_Score[3] != null) - { - //this.txScore.color4 = new SlimDX.Color4( 0.4f, 0.5f, 1.0f ); - //this.txScore.color4 = CDTXMania.Skin.cScoreColor2P; - TJAPlayer3.Tx.Taiko_Score[3].Opacity = alpha; - TJAPlayer3.Tx.Taiko_Score[3].vcScaleRatio.Y = 1; - TJAPlayer3.Tx.Taiko_Score[3].t2D拡大率考慮下基準描画(x, y, rectangle); - } - break; - case 4: - if (TJAPlayer3.Tx.Taiko_Score[4] != null) - { - //this.txScore.color4 = new SlimDX.Color4( 0.4f, 0.5f, 1.0f ); - //this.txScore.color4 = CDTXMania.Skin.cScoreColor2P; - TJAPlayer3.Tx.Taiko_Score[4].Opacity = alpha; - TJAPlayer3.Tx.Taiko_Score[4].vcScaleRatio.Y = 1; - TJAPlayer3.Tx.Taiko_Score[4].t2D拡大率考慮下基準描画(x, y, rectangle); - } - break; - case 5: - if (TJAPlayer3.Tx.Taiko_Score[5] != null) - { - //this.txScore.color4 = new SlimDX.Color4( 0.4f, 0.5f, 1.0f ); - //this.txScore.color4 = CDTXMania.Skin.cScoreColor2P; - TJAPlayer3.Tx.Taiko_Score[5].Opacity = alpha; - TJAPlayer3.Tx.Taiko_Score[5].vcScaleRatio.Y = 1; - TJAPlayer3.Tx.Taiko_Score[5].t2D拡大率考慮下基準描画(x, y, rectangle); - } - break; - } - break; - } - } - x += TJAPlayer3.Skin.Game_Score_Padding; - } - } + 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(TJAPlayer3.Skin.Game_Score_Size[0] * i, 0, TJAPlayer3.Skin.Game_Score_Size[0], TJAPlayer3.Skin.Game_Score_Size[1]); + switch (mode) { + case 0: + if (TJAPlayer3.Tx.Taiko_Score[0] != null) { + //this.txScore.color4 = new SlimDX.Color4( 1.0f, 1.0f, 1.0f ); + TJAPlayer3.Tx.Taiko_Score[0].Opacity = alpha; + if (TJAPlayer3.ConfigIni.SimpleMode) { + TJAPlayer3.Tx.Taiko_Score[0].vcScaleRatio.Y = 1; + } else { + TJAPlayer3.Tx.Taiko_Score[0].vcScaleRatio.Y = ScoreScale[this.ct点数アニメタイマ[player].CurrentValue]; + } + TJAPlayer3.Tx.Taiko_Score[0].t2D拡大率考慮下基準描画(x, y, rectangle); + + } + break; + case 1: + if (TJAPlayer3.Tx.Taiko_Score[1] != null) { + //this.txScore.color4 = new SlimDX.Color4( 1.0f, 0.5f, 0.4f ); + //this.txScore.color4 = CDTXMania.Skin.cScoreColor1P; + TJAPlayer3.Tx.Taiko_Score[1].Opacity = alpha; + TJAPlayer3.Tx.Taiko_Score[1].vcScaleRatio.Y = 1; + TJAPlayer3.Tx.Taiko_Score[1].t2D拡大率考慮下基準描画(x, y, rectangle); + } + break; + case 2: + if (TJAPlayer3.Tx.Taiko_Score[2] != null) { + //this.txScore.color4 = new SlimDX.Color4( 0.4f, 0.5f, 1.0f ); + //this.txScore.color4 = CDTXMania.Skin.cScoreColor2P; + TJAPlayer3.Tx.Taiko_Score[2].Opacity = alpha; + TJAPlayer3.Tx.Taiko_Score[2].vcScaleRatio.Y = 1; + TJAPlayer3.Tx.Taiko_Score[2].t2D拡大率考慮下基準描画(x, y, rectangle); + } + break; + case 3: + if (TJAPlayer3.Tx.Taiko_Score[3] != null) { + //this.txScore.color4 = new SlimDX.Color4( 0.4f, 0.5f, 1.0f ); + //this.txScore.color4 = CDTXMania.Skin.cScoreColor2P; + TJAPlayer3.Tx.Taiko_Score[3].Opacity = alpha; + TJAPlayer3.Tx.Taiko_Score[3].vcScaleRatio.Y = 1; + TJAPlayer3.Tx.Taiko_Score[3].t2D拡大率考慮下基準描画(x, y, rectangle); + } + break; + case 4: + if (TJAPlayer3.Tx.Taiko_Score[4] != null) { + //this.txScore.color4 = new SlimDX.Color4( 0.4f, 0.5f, 1.0f ); + //this.txScore.color4 = CDTXMania.Skin.cScoreColor2P; + TJAPlayer3.Tx.Taiko_Score[4].Opacity = alpha; + TJAPlayer3.Tx.Taiko_Score[4].vcScaleRatio.Y = 1; + TJAPlayer3.Tx.Taiko_Score[4].t2D拡大率考慮下基準描画(x, y, rectangle); + } + break; + case 5: + if (TJAPlayer3.Tx.Taiko_Score[5] != null) { + //this.txScore.color4 = new SlimDX.Color4( 0.4f, 0.5f, 1.0f ); + //this.txScore.color4 = CDTXMania.Skin.cScoreColor2P; + TJAPlayer3.Tx.Taiko_Score[5].Opacity = alpha; + TJAPlayer3.Tx.Taiko_Score[5].vcScaleRatio.Y = 1; + TJAPlayer3.Tx.Taiko_Score[5].t2D拡大率考慮下基準描画(x, y, rectangle); + } + break; + } + break; + } + } + x += TJAPlayer3.Skin.Game_Score_Padding; + } + } } } diff --git a/OpenTaiko/src/Stages/07.Game/CAct演奏ステージ失敗.cs b/OpenTaiko/src/Stages/07.Game/CAct演奏ステージ失敗.cs index 2c288659..a3dfcdd6 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏ステージ失敗.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏ステージ失敗.cs @@ -1,65 +1,58 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.IO; +using System.Drawing; using System.Runtime.InteropServices; using FDK; -namespace TJAPlayer3 -{ - internal class CAct演奏ステージ失敗 : CActivity - { +namespace TJAPlayer3 { + internal class CAct演奏ステージ失敗 : CActivity { // コンストラクタ - public CAct演奏ステージ失敗() - { - ST文字位置[] st文字位置Array = new ST文字位置[ 11 ]; + 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文字位置.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文字位置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文字位置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文字位置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文字位置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文字位置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文字位置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文字位置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文字位置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文字位置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; + st文字位置11.pt = new Point(558 + 62, 0); + st文字位置Array[10] = st文字位置11; this.st文字位置 = st文字位置Array; base.IsDeActivated = true; } @@ -67,38 +60,32 @@ namespace TJAPlayer3 // メソッド - public void Start() - { - this.dbFailedTime = TJAPlayer3.Timer.NowTime; - this.ct進行 = new CCounter( 0, 300, 22, TJAPlayer3.Timer ); - if ( TJAPlayer3.ConfigIni.eGameMode != EGame.OFF ) - { - this.ct進行 = new CCounter( 0, 4000, 2, TJAPlayer3.Timer ); - } + public void Start() { + this.dbFailedTime = TJAPlayer3.Timer.NowTime; + this.ct進行 = new CCounter(0, 300, 22, TJAPlayer3.Timer); + if (TJAPlayer3.ConfigIni.eGameMode != EGame.OFF) { + this.ct進行 = new CCounter(0, 4000, 2, TJAPlayer3.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() - { + public override void DeActivate() { this.ct進行 = null; - if( this.sd効果音 != null ) - { - TJAPlayer3.SoundManager.tDisposeSound( this.sd効果音 ); + if (this.sd効果音 != null) { + TJAPlayer3.SoundManager.tDisposeSound(this.sd効果音); this.sd効果音 = null; } base.DeActivate(); } - public override void CreateManagedResource() - { + 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" ) ); @@ -107,8 +94,7 @@ namespace TJAPlayer3 this.soundFailed = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Failed.ogg"), ESoundGroup.SoundEffect); base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { //CDTXMania.tテクスチャの解放( ref this.txStageFailed ); //CDTXMania.tテクスチャの解放( ref this.txGameFailed ); // CDTXMania.tテクスチャの解放( ref this.txBlack ); @@ -120,30 +106,25 @@ namespace TJAPlayer3 #region [Effect] - private void showEndEffect_Failed(int i) - { + private void showEndEffect_Failed(int i) { int[] y = new int[] { 0, 176 }; } #endregion - public override int Draw() - { - if( base.IsDeActivated ) - { + public override int Draw() { + if (base.IsDeActivated) { return 0; } - if( ( this.ct進行 == null ) || this.ct進行.IsStoped ) - { + if ((this.ct進行 == null) || this.ct進行.IsStoped) { return 0; } this.ct進行.Tick(); #region [Failed screen] - if (this.soundFailed != null && !this.failedSongPlayed) - { + if (this.soundFailed != null && !this.failedSongPlayed) { this.soundFailed.PlayStart(); this.failedSongPlayed = true; } @@ -215,13 +196,12 @@ namespace TJAPlayer3 */ - if( !this.ct進行.IsEnded ) - { + if (!this.ct進行.IsEnded) { return 0; } return 1; } - + // その他 @@ -239,36 +219,28 @@ namespace TJAPlayer3 // private CTexture tx数字; private double dbFailedTime; //----------------- - private ST文字位置[] st文字位置; + 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; - } - } + [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(TJAPlayer3.Tx.Balloon_Number_Roll != null ) - { - TJAPlayer3.Tx.Balloon_Number_Roll.t2D描画( x - ( 62 * str.Length / 2 ), y, rectangle ); + 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 (TJAPlayer3.Tx.Balloon_Number_Roll != null) { + TJAPlayer3.Tx.Balloon_Number_Roll.t2D描画(x - (62 * str.Length / 2), y, rectangle); } break; } diff --git a/OpenTaiko/src/Stages/07.Game/CAct演奏パネル文字列.cs b/OpenTaiko/src/Stages/07.Game/CAct演奏パネル文字列.cs index 955f5442..80dda50f 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏パネル文字列.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏パネル文字列.cs @@ -1,157 +1,129 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Diagnostics; -using SkiaSharp; +using System.Diagnostics; using FDK; +using SkiaSharp; using static TJAPlayer3.CActSelect曲リスト; - using Color = System.Drawing.Color; -namespace TJAPlayer3 -{ +namespace TJAPlayer3 { - internal class CAct演奏パネル文字列 : CActivity - { - public static int tToArgb(int r, int g, int b) - { - return (b * 65536 + g * 256 + r); - } - - // コンストラクタ - public CAct演奏パネル文字列() - { + 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(); } - 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 ) - { - TJAPlayer3.tテクスチャの解放( ref this.txPanel ); - if( (songName != null ) && (songName.Length > 0 ) ) - { - try - { - using (var bmpSongTitle = pfMusicName.DrawText(songName, TJAPlayer3.Skin.Game_MusicName_ForeColor, TJAPlayer3.Skin.Game_MusicName_BackColor, null, 30)) - { - this.txMusicName = TJAPlayer3.tテクスチャの生成( bmpSongTitle, false ); - } - if (txMusicName != null) - { - this.txMusicName.vcScaleRatio.X = TJAPlayer3.GetSongNameXScaling(ref txMusicName); - } - - SKBitmap bmpDiff; - string strDiff = ""; - if (TJAPlayer3.Skin.eDiffDispMode == E難易度表示タイプ.n曲目に表示) - { - switch (TJAPlayer3.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, TJAPlayer3.Skin.Game_StageText_ForeColor, TJAPlayer3.Skin.Game_StageText_BackColor, null, 30 ); - } - else - { - bmpDiff = pfMusicName.DrawText(stageText, TJAPlayer3.Skin.Game_StageText_ForeColor, TJAPlayer3.Skin.Game_StageText_BackColor, null, 30 ); - } + /// + /// 右上の曲名、曲数表示の更新を行います。 + /// + /// 曲名 + /// ジャンル名 + /// 曲数 + public void SetPanelString(string songName, string genreName, string stageText = null, CSongListNode songNode = null) { + if (base.IsActivated) { + TJAPlayer3.tテクスチャの解放(ref this.txPanel); + if ((songName != null) && (songName.Length > 0)) { + try { + using (var bmpSongTitle = pfMusicName.DrawText(songName, TJAPlayer3.Skin.Game_MusicName_ForeColor, TJAPlayer3.Skin.Game_MusicName_BackColor, null, 30)) { + this.txMusicName = TJAPlayer3.tテクスチャの生成(bmpSongTitle, false); + } + if (txMusicName != null) { + this.txMusicName.vcScaleRatio.X = TJAPlayer3.GetSongNameXScaling(ref txMusicName); + } - using (bmpDiff) - { - txStage = TJAPlayer3.Tx.TxCGen("Songs"); - } - } - catch( CTextureCreateFailedException e ) - { - Trace.TraceError( e.ToString() ); - Trace.TraceError( "パネル文字列テクスチャの生成に失敗しました。" ); + SKBitmap bmpDiff; + string strDiff = ""; + if (TJAPlayer3.Skin.eDiffDispMode == E難易度表示タイプ.n曲目に表示) { + switch (TJAPlayer3.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, TJAPlayer3.Skin.Game_StageText_ForeColor, TJAPlayer3.Skin.Game_StageText_BackColor, null, 30); + } else { + bmpDiff = pfMusicName.DrawText(stageText, TJAPlayer3.Skin.Game_StageText_ForeColor, TJAPlayer3.Skin.Game_StageText_BackColor, null, 30); + } + + using (bmpDiff) { + txStage = TJAPlayer3.Tx.TxCGen("Songs"); + } + } catch (CTextureCreateFailedException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("パネル文字列テクスチャの生成に失敗しました。"); this.txPanel = null; } } - this.txGENRE = TJAPlayer3.Tx.TxCGen("Template"); + this.txGENRE = TJAPlayer3.Tx.TxCGen("Template"); - Color stageColor = Color.White; - if (songNode != null && songNode.isChangedBoxColor) - stageColor = songNode.BoxColor; + 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(TJAPlayer3.Skin.Game_GenreText_FontSize); + 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); + } - this.ttkGENRE = new TitleTextureKey(genreName, this.pfGENRE, Color.White, Color.Black, 1000); + pfGENRE = HPrivateFastFont.tInstantiateBoxFont(TJAPlayer3.Skin.Game_GenreText_FontSize); - this.ct進行用 = new CCounter( 0, 2000, 2, TJAPlayer3.Timer ); + this.ttkGENRE = new TitleTextureKey(genreName, this.pfGENRE, Color.White, Color.Black, 1000); + + this.ct進行用 = new CCounter(0, 2000, 2, TJAPlayer3.Timer); this.Start(); @@ -159,171 +131,137 @@ namespace TJAPlayer3 } } - public void t歌詞テクスチャを生成する( SKBitmap bmplyric ) - { - TJAPlayer3.tDisposeSafely(ref this.tx歌詞テクスチャ); - this.tx歌詞テクスチャ = TJAPlayer3.tテクスチャの生成( bmplyric ); - } - public void t歌詞テクスチャを削除する() - { - TJAPlayer3.tテクスチャの解放(ref this.tx歌詞テクスチャ); - } - /// - /// レイヤー管理のため、On進行描画から分離。 - /// - public void t歌詞テクスチャを描画する() - { - if( this.tx歌詞テクスチャ != null ) - { - if (TJAPlayer3.Skin.Game_Lyric_ReferencePoint == CSkin.ReferencePoint.Left) - { - this.tx歌詞テクスチャ.t2D描画(TJAPlayer3.Skin.Game_Lyric_X , TJAPlayer3.Skin.Game_Lyric_Y - (this.tx歌詞テクスチャ.szTextureSize.Height)); - } - else if (TJAPlayer3.Skin.Game_Lyric_ReferencePoint == CSkin.ReferencePoint.Right) - { - this.tx歌詞テクスチャ.t2D描画(TJAPlayer3.Skin.Game_Lyric_X - this.tx歌詞テクスチャ.szTextureSize.Width, TJAPlayer3.Skin.Game_Lyric_Y - (this.tx歌詞テクスチャ.szTextureSize.Height)); - } - else - { - this.tx歌詞テクスチャ.t2D描画(TJAPlayer3.Skin.Game_Lyric_X - (this.tx歌詞テクスチャ.szTextureSize.Width / 2), TJAPlayer3.Skin.Game_Lyric_Y - (this.tx歌詞テクスチャ.szTextureSize.Height)); - } - } - } + public void t歌詞テクスチャを生成する(SKBitmap bmplyric) { + TJAPlayer3.tDisposeSafely(ref this.tx歌詞テクスチャ); + this.tx歌詞テクスチャ = TJAPlayer3.tテクスチャの生成(bmplyric); + } + public void t歌詞テクスチャを削除する() { + TJAPlayer3.tテクスチャの解放(ref this.tx歌詞テクスチャ); + } + /// + /// レイヤー管理のため、On進行描画から分離。 + /// + public void t歌詞テクスチャを描画する() { + if (this.tx歌詞テクスチャ != null) { + if (TJAPlayer3.Skin.Game_Lyric_ReferencePoint == CSkin.ReferencePoint.Left) { + this.tx歌詞テクスチャ.t2D描画(TJAPlayer3.Skin.Game_Lyric_X, TJAPlayer3.Skin.Game_Lyric_Y - (this.tx歌詞テクスチャ.szTextureSize.Height)); + } else if (TJAPlayer3.Skin.Game_Lyric_ReferencePoint == CSkin.ReferencePoint.Right) { + this.tx歌詞テクスチャ.t2D描画(TJAPlayer3.Skin.Game_Lyric_X - this.tx歌詞テクスチャ.szTextureSize.Width, TJAPlayer3.Skin.Game_Lyric_Y - (this.tx歌詞テクスチャ.szTextureSize.Height)); + } else { + this.tx歌詞テクスチャ.t2D描画(TJAPlayer3.Skin.Game_Lyric_X - (this.tx歌詞テクスチャ.szTextureSize.Width / 2), TJAPlayer3.Skin.Game_Lyric_Y - (this.tx歌詞テクスチャ.szTextureSize.Height)); + } + } + } - public void Stop() - { + public void Stop() { this.bMute = true; } - public void Start() - { + public void Start() { this.bMute = false; } // CActivity 実装 - public override void Activate() - { - this.pfMusicName = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Game_MusicName_FontSize); - this.txPanel = null; + public override void Activate() { + this.pfMusicName = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Game_MusicName_FontSize); + this.txPanel = null; this.ct進行用 = new CCounter(); this.Start(); - this.bFirst = true; + this.bFirst = true; base.Activate(); } - public override void DeActivate() - { + public override void DeActivate() { this.ct進行用 = null; - TJAPlayer3.tDisposeSafely( ref this.txPanel ); - TJAPlayer3.tDisposeSafely( ref this.txMusicName ); - TJAPlayer3.tDisposeSafely( ref this.txGENRE ); - TJAPlayer3.tDisposeSafely(ref this.pfGENRE); - TJAPlayer3.tDisposeSafely(ref this.txPanel); - TJAPlayer3.tDisposeSafely(ref this.pfMusicName); - TJAPlayer3.tDisposeSafely(ref this.pf歌詞フォント); - TJAPlayer3.tDisposeSafely(ref this.tx歌詞テクスチャ); + TJAPlayer3.tDisposeSafely(ref this.txPanel); + TJAPlayer3.tDisposeSafely(ref this.txMusicName); + TJAPlayer3.tDisposeSafely(ref this.txGENRE); + TJAPlayer3.tDisposeSafely(ref this.pfGENRE); + TJAPlayer3.tDisposeSafely(ref this.txPanel); + TJAPlayer3.tDisposeSafely(ref this.pfMusicName); + TJAPlayer3.tDisposeSafely(ref this.pf歌詞フォント); + TJAPlayer3.tDisposeSafely(ref this.tx歌詞テクスチャ); base.DeActivate(); } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { - base.ReleaseManagedResource(); + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); } - public override int Draw() - { - throw new InvalidOperationException( "t進行描画(x,y)のほうを使用してください。" ); + public override int Draw() { + throw new InvalidOperationException("t進行描画(x,y)のほうを使用してください。"); } - public int t進行描画( int x, int y ) - { - if (TJAPlayer3.stage演奏ドラム画面.actDan.IsAnimating || TJAPlayer3.ConfigIni.nPlayerCount > 2) return 0; - if( !base.IsDeActivated && !this.bMute ) - { + public int t進行描画(int x, int y) { + if (TJAPlayer3.stage演奏ドラム画面.actDan.IsAnimating || TJAPlayer3.ConfigIni.nPlayerCount > 2) return 0; + if (!base.IsDeActivated && !this.bMute) { this.ct進行用.TickLoop(); - if( this.txGENRE != null ) - { - this.txGENRE.t2D描画(TJAPlayer3.Skin.Game_Genre_X, TJAPlayer3.Skin.Game_Genre_Y); - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkGENRE).t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Game_Genre_X + TJAPlayer3.Skin.Game_GenreText_Offset[0], TJAPlayer3.Skin.Game_Genre_Y + TJAPlayer3.Skin.Game_GenreText_Offset[1]); - } - if( this.txStage != null ) - this.txStage.t2D描画( TJAPlayer3.Skin.Game_Genre_X, TJAPlayer3.Skin.Game_Genre_Y ); + if (this.txGENRE != null) { + this.txGENRE.t2D描画(TJAPlayer3.Skin.Game_Genre_X, TJAPlayer3.Skin.Game_Genre_Y); + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkGENRE).t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Game_Genre_X + TJAPlayer3.Skin.Game_GenreText_Offset[0], TJAPlayer3.Skin.Game_Genre_Y + TJAPlayer3.Skin.Game_GenreText_Offset[1]); + } + if (this.txStage != null) + this.txStage.t2D描画(TJAPlayer3.Skin.Game_Genre_X, TJAPlayer3.Skin.Game_Genre_Y); - if( TJAPlayer3.Skin.b現在のステージ数を表示しない ) - { - if( this.txMusicName != null ) - { - float fRate = (float)TJAPlayer3.Skin.Game_MusicName_MaxWidth / this.txMusicName.szTextureSize.Width; - if (this.txMusicName.szTextureSize.Width <= TJAPlayer3.Skin.Game_MusicName_MaxWidth) - fRate = 1.0f; + if (TJAPlayer3.Skin.b現在のステージ数を表示しない) { + if (this.txMusicName != null) { + float fRate = (float)TJAPlayer3.Skin.Game_MusicName_MaxWidth / this.txMusicName.szTextureSize.Width; + if (this.txMusicName.szTextureSize.Width <= TJAPlayer3.Skin.Game_MusicName_MaxWidth) + fRate = 1.0f; - this.txMusicName.vcScaleRatio.X = fRate; + this.txMusicName.vcScaleRatio.X = fRate; - this.txMusicName.t2D描画(TJAPlayer3.Skin.Game_MusicName_X - (this.txMusicName.szTextureSize.Width * fRate), TJAPlayer3.Skin.Game_MusicName_Y); - } - } - else - { - #region[ 透明度制御 ] + this.txMusicName.t2D描画(TJAPlayer3.Skin.Game_MusicName_X - (this.txMusicName.szTextureSize.Width * fRate), TJAPlayer3.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.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)TJAPlayer3.Skin.Game_MusicName_MaxWidth / this.txMusicName.szTextureSize.Width; - if (this.txMusicName.szTextureSize.Width <= TJAPlayer3.Skin.Game_MusicName_MaxWidth) - fRate = 1.0f; + if (this.txMusicName != null) { + if (this.IsFirstDraw) { + IsFirstDraw = false; + } + if (this.txMusicName != null) { + float fRate = (float)TJAPlayer3.Skin.Game_MusicName_MaxWidth / this.txMusicName.szTextureSize.Width; + if (this.txMusicName.szTextureSize.Width <= TJAPlayer3.Skin.Game_MusicName_MaxWidth) + fRate = 1.0f; - this.txMusicName.vcScaleRatio.X = fRate; + this.txMusicName.vcScaleRatio.X = fRate; - this.txMusicName.t2D描画(TJAPlayer3.Skin.Game_MusicName_X - (this.txMusicName.szTextureSize.Width * fRate), TJAPlayer3.Skin.Game_MusicName_Y); - } - } - } + this.txMusicName.t2D描画(TJAPlayer3.Skin.Game_MusicName_X - (this.txMusicName.szTextureSize.Width * fRate), TJAPlayer3.Skin.Game_MusicName_Y); + } + } + } - //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.白, this.ct進行用.n現在の値.ToString() ); + //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; } - public enum ESongType - { - REGULAR, - DAN, - TOWER, - BOSS, - TOTAL, - } + public enum ESongType { + REGULAR, + DAN, + TOWER, + BOSS, + TOTAL, + } // その他 @@ -334,18 +272,18 @@ namespace TJAPlayer3 private CTexture txPanel; private bool bMute; - private bool bFirst; + 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歌詞フォント; + 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 7ca7fc7f..52fc6572 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏演奏情報.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏演奏情報.cs @@ -1,86 +1,73 @@ -using System; -using System.Collections.Generic; -using System.Text; -using FDK; -using System.Diagnostics; -using System.Linq; +using FDK; -namespace TJAPlayer3 -{ - internal class CAct演奏演奏情報 : CActivity - { - // プロパティ +namespace TJAPlayer3 { + internal class CAct演奏演奏情報 : CActivity { + // プロパティ - public double[] dbBPM = new double[5]; + public double[] dbBPM = new double[5]; public readonly int[] NowMeasure = new int[5]; - public double dbSCROLL; + public double dbSCROLL; public int[] _chipCounts = new int[2]; // コンストラクタ - public CAct演奏演奏情報() - { + public CAct演奏演奏情報() { base.IsDeActivated = true; } - + // CActivity 実装 - public override void Activate() - { - for (int i = 0; i < 5; i++) - { - NowMeasure[i] = 0; + public override void Activate() { + for (int i = 0; i < 5; i++) { + NowMeasure[i] = 0; this.dbBPM[i] = TJAPlayer3.DTX.BASEBPM; } - this.dbSCROLL = 1.0; + this.dbSCROLL = 1.0; _chipCounts[0] = TJAPlayer3.DTX.listChip.Where(num => NotesManager.IsMissableNote(num)).Count(); _chipCounts[1] = TJAPlayer3.DTX.listChip_Branch[2].Where(num => NotesManager.IsMissableNote(num)).Count(); - NotesTextN = string.Format( "NoteN: {0:####0}", TJAPlayer3.DTX.nノーツ数_Branch[0]); - NotesTextE = string.Format( "NoteE: {0:####0}", TJAPlayer3.DTX.nノーツ数_Branch[1]); - NotesTextM = string.Format( "NoteM: {0:####0}", TJAPlayer3.DTX.nノーツ数_Branch[2]); - NotesTextC = string.Format( "NoteC: {0:####0}", TJAPlayer3.DTX.nノーツ数[3] ); - ScoreModeText = string.Format( "SCOREMODE: {0:####0}", TJAPlayer3.DTX.nScoreModeTmp ); - ListChipText = string.Format( "ListChip: {0:####0}", _chipCounts[0]); - ListChipMText = string.Format( "ListChipM: {0:####0}", _chipCounts[1]); + NotesTextN = string.Format("NoteN: {0:####0}", TJAPlayer3.DTX.nノーツ数_Branch[0]); + NotesTextE = string.Format("NoteE: {0:####0}", TJAPlayer3.DTX.nノーツ数_Branch[1]); + NotesTextM = string.Format("NoteM: {0:####0}", TJAPlayer3.DTX.nノーツ数_Branch[2]); + NotesTextC = string.Format("NoteC: {0:####0}", TJAPlayer3.DTX.nノーツ数[3]); + ScoreModeText = string.Format("SCOREMODE: {0:####0}", TJAPlayer3.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 override int Draw() { + throw new InvalidOperationException("t進行描画(int x, int y) のほうを使用してください。"); } - public void t進行描画( int x, int y ) - { - if ( !base.IsDeActivated ) - { + public void t進行描画(int x, int y) { + if (!base.IsDeActivated) { y += 0x153; - TJAPlayer3.actTextConsole.tPrint( x, y, CTextConsole.EFontType.White, string.Format( "Song/G. Offset:{0:####0}/{1:####0} ms", TJAPlayer3.DTX.nBGMAdjust, TJAPlayer3.ConfigIni.nGlobalOffsetMs ) ); + TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.White, string.Format("Song/G. Offset:{0:####0}/{1:####0} ms", TJAPlayer3.DTX.nBGMAdjust, TJAPlayer3.ConfigIni.nGlobalOffsetMs)); y -= 0x10; - int num = ( TJAPlayer3.DTX.listChip.Count > 0 ) ? TJAPlayer3.DTX.listChip[ TJAPlayer3.DTX.listChip.Count - 1 ].n発声時刻ms : 0; + int num = (TJAPlayer3.DTX.listChip.Count > 0) ? TJAPlayer3.DTX.listChip[TJAPlayer3.DTX.listChip.Count - 1].n発声時刻ms : 0; string str = "Time: " + ((((double)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed)) / 1000.0)).ToString("####0.00") + " / " + ((((double)num) / 1000.0)).ToString("####0.00"); - TJAPlayer3.actTextConsole.tPrint( x, y, CTextConsole.EFontType.White, str ); + TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.White, str); y -= 0x10; - TJAPlayer3.actTextConsole.tPrint( x, y, CTextConsole.EFontType.White, string.Format( "Part: {0:####0}/{1:####0}", NowMeasure[0], NowMeasure[1] ) ); + TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.White, string.Format("Part: {0:####0}/{1:####0}", NowMeasure[0], NowMeasure[1])); y -= 0x10; - TJAPlayer3.actTextConsole.tPrint( x, y, CTextConsole.EFontType.White, string.Format( "BPM: {0:####0.0000}", this.dbBPM[0] ) ); + TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.White, string.Format("BPM: {0:####0.0000}", this.dbBPM[0])); y -= 0x10; - TJAPlayer3.actTextConsole.tPrint( x, y, CTextConsole.EFontType.White, string.Format( "Frame: {0:####0} fps", TJAPlayer3.FPS.NowFPS ) ); + TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.White, string.Format("Frame: {0:####0} fps", TJAPlayer3.FPS.NowFPS)); y -= 0x10; - TJAPlayer3.actTextConsole.tPrint( x, y, CTextConsole.EFontType.White, NotesTextN); + TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.White, NotesTextN); y -= 0x10; - TJAPlayer3.actTextConsole.tPrint( x, y, CTextConsole.EFontType.White, NotesTextE ); + TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.White, NotesTextE); y -= 0x10; - TJAPlayer3.actTextConsole.tPrint( x, y, CTextConsole.EFontType.White, NotesTextM ); + TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.White, NotesTextM); y -= 0x10; - TJAPlayer3.actTextConsole.tPrint( x, y, CTextConsole.EFontType.White, NotesTextC ); + TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.White, NotesTextC); + y -= 0x10; + TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.White, string.Format("SCROLL: {0:####0.00}", this.dbSCROLL)); + y -= 0x10; + TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.White, ScoreModeText); y -= 0x10; - TJAPlayer3.actTextConsole.tPrint( x, y, CTextConsole.EFontType.White, string.Format( "SCROLL: {0:####0.00}", this.dbSCROLL ) ); - y -= 0x10; - TJAPlayer3.actTextConsole.tPrint( x, y, CTextConsole.EFontType.White, ScoreModeText ); - y -= 0x10; TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.White, ListChipText); y -= 0x10; TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.White, ListChipMText); diff --git a/OpenTaiko/src/Stages/07.Game/CFloorManagement.cs b/OpenTaiko/src/Stages/07.Game/CFloorManagement.cs index d7d3b63d..d71411ae 100644 --- a/OpenTaiko/src/Stages/07.Game/CFloorManagement.cs +++ b/OpenTaiko/src/Stages/07.Game/CFloorManagement.cs @@ -1,72 +1,58 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - // 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 TJAPlayer3 { + // 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 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; + 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, TJAPlayer3.Timer); - CFloorManagement.CurrentNumberOfLives--; - //TJAPlayer3.Skin.soundTowerMiss.t再生する(); - TJAPlayer3.Skin.voiceTowerMiss[TJAPlayer3.SaveFile]?.tPlay(); - } - } + if (CFloorManagement.CurrentNumberOfLives > 0) { + CFloorManagement.InvincibilityFrames = new CCounter(0, CFloorManagement.InvincibilityDurationSpeedDependent + 1000, 1, TJAPlayer3.Timer); + CFloorManagement.CurrentNumberOfLives--; + //TJAPlayer3.Skin.soundTowerMiss.t再生する(); + TJAPlayer3.Skin.voiceTowerMiss[TJAPlayer3.SaveFile]?.tPlay(); + } + } - public static bool isBlinking() - { - if (CFloorManagement.InvincibilityFrames == null || CFloorManagement.InvincibilityFrames.CurrentValue >= CFloorManagement.InvincibilityDurationSpeedDependent) - return false; + public static bool isBlinking() { + if (CFloorManagement.InvincibilityFrames == null || CFloorManagement.InvincibilityFrames.CurrentValue >= CFloorManagement.InvincibilityDurationSpeedDependent) + return false; - if (CFloorManagement.InvincibilityFrames.CurrentValue % 200 > 100) - return false; + if (CFloorManagement.InvincibilityFrames.CurrentValue % 200 > 100) + return false; - return true; - } + return true; + } - public static void loopFrames() - { - if (CFloorManagement.InvincibilityFrames != null) - CFloorManagement.InvincibilityFrames.Tick(); - } + 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 int LastRegisteredFloor = 1; + public static int MaxNumberOfLives = 5; + public static int CurrentNumberOfLives = 5; - public static double InvincibilityDurationSpeedDependent - { - get => ((double)InvincibilityDuration) / TJAPlayer3.ConfigIni.SongPlaybackSpeed; - } + public static double InvincibilityDurationSpeedDependent { + get => ((double)InvincibilityDuration) / TJAPlayer3.ConfigIni.SongPlaybackSpeed; + } - // ms - public static readonly int InvincibilityDuration = 2000; - public static CCounter InvincibilityFrames = null; - } + // 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 5d5f5db2..be4560e9 100644 --- a/OpenTaiko/src/Stages/07.Game/CInvisibleChip.cs +++ b/OpenTaiko/src/Stages/07.Game/CInvisibleChip.cs @@ -1,22 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - public class CInvisibleChip : IDisposable - { +namespace TJAPlayer3 { + public class CInvisibleChip : IDisposable { /// ミス後表示する時間(ms) - public int nDisplayTimeMs - { + public int nDisplayTimeMs { get; set; } /// 表示期間終了後、フェードアウトする時間 - public int nFadeoutTimeMs - { + public int nFadeoutTimeMs { get; set; } @@ -26,21 +18,18 @@ namespace TJAPlayer3 #region [ コンストラクタ ] - public CInvisibleChip() - { - Initialize( 3000, 2000 ); + public CInvisibleChip() { + Initialize(3000, 2000); } /// /// コンストラクタ /// /// ミス時再表示する時間(秒) /// 再表示後フェードアウトする時間(秒) - public CInvisibleChip( int _nDisplayTimeMs, int _nFadeoutTimeMs ) - { - Initialize( _nDisplayTimeMs, _nFadeoutTimeMs ); + public CInvisibleChip(int _nDisplayTimeMs, int _nFadeoutTimeMs) { + Initialize(_nDisplayTimeMs, _nFadeoutTimeMs); } - private void Initialize( int _nDisplayTimeMs, int _nFadeoutTimeMs ) - { + private void Initialize(int _nDisplayTimeMs, int _nFadeoutTimeMs) { nDisplayTimeMs = _nDisplayTimeMs; nFadeoutTimeMs = _nFadeoutTimeMs; Reset(); @@ -50,12 +39,10 @@ namespace TJAPlayer3 /// /// 内部状態を初期化する /// - 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; } } @@ -63,16 +50,13 @@ namespace TJAPlayer3 /// まだ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 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; } } } @@ -80,34 +64,29 @@ namespace TJAPlayer3 /// 一時的にチップを表示するモードを開始する /// /// 楽器パート - public void ShowChipTemporally( EInstrumentPad eInst ) - { - ccounter[ (int) eInst ].Start( 0, nDisplayTimeMs + nFadeoutTimeMs + 1, 1, TJAPlayer3.Timer ); + public void ShowChipTemporally(EInstrumentPad eInst) { + ccounter[(int)eInst].Start(0, nDisplayTimeMs + nFadeoutTimeMs + 1, 1, TJAPlayer3.Timer); } /// /// チップの表示/非表示の状態 /// - public enum EChipInvisibleState - { - SHOW, // Missなどしてチップを表示中 - FADEOUT, // 表示期間終了後、フェードアウト中 - INVISIBLE // 完全非表示 + public enum EChipInvisibleState { + SHOW, // Missなどしてチップを表示中 + FADEOUT, // 表示期間終了後、フェードアウト中 + INVISIBLE // 完全非表示 } - internal EChipInvisibleState SetInvisibleStatus( ref CDTX.CChip cc ) - { - if ( cc.e楽器パート == EInstrumentPad.UNKNOWN ) - { + internal EChipInvisibleState SetInvisibleStatus(ref CDTX.CChip cc) { + if (cc.e楽器パート == EInstrumentPad.UNKNOWN) { return EChipInvisibleState.SHOW; } - int nInst = (int) cc.e楽器パート; + int nInst = (int)cc.e楽器パート; EChipInvisibleState retcode = EChipInvisibleState.SHOW; - ccounter[ nInst ].Tick(); + ccounter[nInst].Tick(); - switch ( eInvisibleMode[ nInst ] ) - { + switch (eInvisibleMode[nInst]) { case EInvisible.OFF: cc.b可視 = true; retcode = EChipInvisibleState.SHOW; @@ -119,30 +98,28 @@ namespace TJAPlayer3 break; case EInvisible.SEMI: - if ( !b演奏チップが1つでもバーを通過した[ nInst ] ) // まだ1つもチップがバーを通過していない時は、チップを表示する + if (!b演奏チップが1つでもバーを通過した[nInst]) // まだ1つもチップがバーを通過していない時は、チップを表示する { cc.b可視 = true; cc.n透明度 = 255; return EChipInvisibleState.SHOW; } - if ( ccounter[ nInst ].CurrentValue <= 0 || ccounter[ nInst ].CurrentValue > nDisplayTimeMs + nFadeoutTimeMs ) + 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 ) // 表示期間 - { + } else if (ccounter[nInst].CurrentValue < nDisplayTimeMs) // 表示期間 + { cc.b可視 = true; cc.n透明度 = 255; retcode = EChipInvisibleState.SHOW; - } - else if ( ccounter[ nInst ].CurrentValue < nDisplayTimeMs + nFadeoutTimeMs ) // フェードアウト期間 - { + } else if (ccounter[nInst].CurrentValue < nDisplayTimeMs + nFadeoutTimeMs) // フェードアウト期間 + { cc.b可視 = true; - cc.n透明度 = 255 - (int) ( Convert.ToDouble( ccounter[ nInst ].CurrentValue - nDisplayTimeMs ) / nFadeoutTimeMs * 255.0 ); + cc.n透明度 = 255 - (int)(Convert.ToDouble(ccounter[nInst].CurrentValue - nDisplayTimeMs) / nFadeoutTimeMs * 255.0); retcode = EChipInvisibleState.FADEOUT; } break; @@ -154,27 +131,23 @@ namespace TJAPlayer3 } return retcode; } - + #region [ Dispose-Finalize パターン実装 ] //----------------- - public void Dispose() - { - this.Dispose( true ); - GC.SuppressFinalize( this ); + public void Dispose() { + this.Dispose(true); + GC.SuppressFinalize(this); } - protected void Dispose( bool disposeManagedObjects ) - { - if( this.bDispose完了済み ) + protected void Dispose(bool disposeManagedObjects) { + if (this.bDispose完了済み) return; - if( disposeManagedObjects ) - { + if (disposeManagedObjects) { // (A) Managed リソースの解放 - for ( int i = 0; i < 5; i++ ) - { + for (int i = 0; i < 5; i++) { // ctInvisibleTimer[ i ].Dispose(); - ccounter[ i ].Stop(); - ccounter[ i ] = null; + ccounter[i].Stop(); + ccounter[i] = null; } } @@ -182,9 +155,8 @@ namespace TJAPlayer3 this.bDispose完了済み = true; } - ~CInvisibleChip() - { - this.Dispose( false ); + ~CInvisibleChip() { + this.Dispose(false); } //----------------- #endregion diff --git a/OpenTaiko/src/Stages/07.Game/CLagLogger.cs b/OpenTaiko/src/Stages/07.Game/CLagLogger.cs index aac1aeeb..0559cf27 100644 --- a/OpenTaiko/src/Stages/07.Game/CLagLogger.cs +++ b/OpenTaiko/src/Stages/07.Game/CLagLogger.cs @@ -1,112 +1,91 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; +using System.Diagnostics; using System.Text; using FDK.ExtensionMethods; -namespace TJAPlayer3 -{ - internal static class CLagLogger - { - private const int MaximumLag = 200; - private const int MinimumLag = 0 - MaximumLag; - private const int Offset = 1 - MinimumLag; +namespace TJAPlayer3 { + internal static class CLagLogger { + private const int MaximumLag = 200; + private const int MinimumLag = 0 - MaximumLag; + private const int Offset = 1 - MinimumLag; - private static readonly List LagValues = new List(2000); + private static readonly List LagValues = new List(2000); - public static void Add(int nPlayer, CDTX.CChip pChip) - { - if (nPlayer != 0) - { - return; - } + 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; + var pChipNLag = pChip.nLag; - LagValues.Add(pChipNLag); - } + LagValues.Add(pChipNLag); + } - public static double? LogAndReturnMeanLag() - { - if (LagValues.Count < 30) - { - return null; - } + public static double? LogAndReturnMeanLag() { + if (LagValues.Count < 30) { + return null; + } - var orderedLagValues = LagValues.OrderBy(x => x).ToList(); + var orderedLagValues = LagValues.OrderBy(x => x).ToList(); - 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 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()); - Trace.TraceInformation( - $"{nameof(CLagLogger)}.{nameof(LogAndReturnMeanLag)}: Mean lag: {mean}. Median lag: {median}. Mode(s) of lag: {modes}. Standard deviation of lag: {stdev}."); + Trace.TraceInformation( + $"{nameof(CLagLogger)}.{nameof(LogAndReturnMeanLag)}: Mean lag: {mean}. Median lag: {median}. Mode(s) of lag: {modes}. Standard deviation of lag: {stdev}."); - var hitChipCountsIndexedByOffsetLag = new int[1 + MaximumLag + 1 + MaximumLag + 1]; - foreach (var pChipNLag in LagValues) - { - hitChipCountsIndexedByOffsetLag[pChipNLag.Clamp(MinimumLag - 1, MaximumLag + 1) + Offset]++; - } + var hitChipCountsIndexedByOffsetLag = new int[1 + MaximumLag + 1 + MaximumLag + 1]; + foreach (var pChipNLag in LagValues) { + hitChipCountsIndexedByOffsetLag[pChipNLag.Clamp(MinimumLag - 1, MaximumLag + 1) + Offset]++; + } - var sbHeader = new StringBuilder(); - var sbData = new StringBuilder(); + var sbHeader = new StringBuilder(); + var sbData = new StringBuilder(); - var doneOne = false; - for (var i = 0; i < hitChipCountsIndexedByOffsetLag.Length; i++) - { - var count = hitChipCountsIndexedByOffsetLag[i]; + var doneOne = false; + for (var i = 0; i < hitChipCountsIndexedByOffsetLag.Length; i++) { + var count = hitChipCountsIndexedByOffsetLag[i]; - if (count != 0) - { - if (doneOne) - { - sbHeader.Append(","); - sbData.Append(","); - } - else - { - doneOne = true; - } + 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); - } + var lag = i - Offset; + if (lag < MinimumLag) { + sbHeader.Append($"< {MinimumLag}"); + } else if (lag > MaximumLag) { + sbHeader.Append($"> {MaximumLag}"); + } else { + sbHeader.Append(lag); + } - sbData.Append(count); - } - } + sbData.Append(count); + } + } - Trace.TraceInformation( - $"{nameof(CLagLogger)}.{nameof(LogAndReturnMeanLag)}: Hit chip counts, indexed by lag in milliseconds:{Environment.NewLine}{sbHeader}{Environment.NewLine}{sbData}"); + Trace.TraceInformation( + $"{nameof(CLagLogger)}.{nameof(LogAndReturnMeanLag)}: Hit chip counts, indexed by lag in milliseconds:{Environment.NewLine}{sbHeader}{Environment.NewLine}{sbData}"); - LagValues.Clear(); + LagValues.Clear(); - return mean; - } - } + return mean; + } + } } diff --git a/OpenTaiko/src/Stages/07.Game/CStage演奏画面共通.cs b/OpenTaiko/src/Stages/07.Game/CStage演奏画面共通.cs index 3e852278..c24a046e 100644 --- a/OpenTaiko/src/Stages/07.Game/CStage演奏画面共通.cs +++ b/OpenTaiko/src/Stages/07.Game/CStage演奏画面共通.cs @@ -1,28 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; +using System.Diagnostics; using System.Drawing; -using System.Diagnostics; using FDK; using FDK.ExtensionMethods; -using TJAPlayer3; -using System.Linq; -using Silk.NET.Core; -namespace TJAPlayer3 -{ +namespace TJAPlayer3 { /// /// 演奏画面の共通クラス (ドラム演奏画面, ギター演奏画面の継承元) /// - internal abstract class CStage演奏画面共通 : CStage - { + internal abstract class CStage演奏画面共通 : CStage { // プロパティ // メソッド #region [ t演奏結果を格納する_ドラム() ] - public void t演奏結果を格納する_ドラム( out CScoreIni.C演奏記録 Drums ) - { + public void t演奏結果を格納する_ドラム(out CScoreIni.C演奏記録 Drums) { Drums = new CScoreIni.C演奏記録(); { @@ -30,136 +21,117 @@ namespace TJAPlayer3 Drums.nOkCount = TJAPlayer3.ConfigIni.bAutoPlay[0] ? this.nヒット数_Auto含む.Drums.Great : this.nヒット数_Auto含まない.Drums.Great; Drums.nBadCount = TJAPlayer3.ConfigIni.bAutoPlay[0] ? this.nヒット数_Auto含む.Drums.Miss : this.nヒット数_Auto含まない.Drums.Miss; - var danC = TJAPlayer3.stage演奏ドラム画面.actDan.GetExam(); - for (int i = 0; i < danC.Length; i++) - { - Drums.Dan_C[i] = danC[i]; - } + var danC = TJAPlayer3.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]; + // CStage 実装 - public override void Activate() - { - listChip = new List[ 5 ]; - List[] balloonChips = new List[5]; - for( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) - { - nNoteCount[i] = 0; - nBalloonCount[i] = 0; - nRollTimeMs[i] = 0; - nAddScoreNiji[i] = 0; + public int[] nNoteCount = new int[5]; + public int[] nBalloonCount = new int[5]; + public double[] nRollTimeMs = new double[5]; + public double[] nAddScoreNiji = new double[5]; - switch( i ) - { - case 0: - listChip[i] = TJAPlayer3.DTX.listChip; - break; - case 1: - listChip[i] = TJAPlayer3.DTX_2P.listChip; - break; - case 2: - listChip[i] = TJAPlayer3.DTX_3P.listChip; - break; - case 3: - listChip[i] = TJAPlayer3.DTX_4P.listChip; - break; - case 4: - listChip[i] = TJAPlayer3.DTX_5P.listChip; - break; - } + public override void Activate() { + listChip = new List[5]; + List[] balloonChips = new List[5]; + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + nNoteCount[i] = 0; + nBalloonCount[i] = 0; + nRollTimeMs[i] = 0; + nAddScoreNiji[i] = 0; - if (TJAPlayer3.ConfigIni.nPlayerCount >= 2) - { - balloonChips[i] = new(); - for(int j = 0; j < listChip[i].Count; j++) - { - var chip = listChip[i][j]; + switch (i) { + case 0: + listChip[i] = TJAPlayer3.DTX.listChip; + break; + case 1: + listChip[i] = TJAPlayer3.DTX_2P.listChip; + break; + case 2: + listChip[i] = TJAPlayer3.DTX_3P.listChip; + break; + case 3: + listChip[i] = TJAPlayer3.DTX_4P.listChip; + break; + case 4: + listChip[i] = TJAPlayer3.DTX_5P.listChip; + break; + } - if (NotesManager.IsGenericBalloon(chip)) - { - balloonChips[i].Add(chip); - } - } - } + if (TJAPlayer3.ConfigIni.nPlayerCount >= 2) { + balloonChips[i] = new(); + for (int j = 0; j < listChip[i].Count; j++) { + var chip = listChip[i][j]; - 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整数値管理++; - } - } - } + if (NotesManager.IsGenericBalloon(chip)) { + balloonChips[i].Add(chip); + } + } + } - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - CDTX _dtx = TJAPlayer3.DTX; - switch (i) //2017.08.11 kairera0467 - { - case 0: - break; - case 1: - _dtx = TJAPlayer3.DTX_2P; - break; - case 2: - _dtx = TJAPlayer3.DTX_3P; - break; - case 3: - _dtx = TJAPlayer3.DTX_4P; - break; - case 4: - _dtx = TJAPlayer3.DTX_5P; - break; - default: - break; - } + 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整数値管理++; + } + } + } - if (TJAPlayer3.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 < TJAPlayer3.ConfigIni.nPlayerCount; p++) - { - if (p == i) continue; - var chip2 = balloonChips[p].Find(x => Math.Abs(x.db発声時刻ms - chip.db発声時刻ms) < 100); + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + CDTX _dtx = TJAPlayer3.DTX; + switch (i) //2017.08.11 kairera0467 + { + case 0: + break; + case 1: + _dtx = TJAPlayer3.DTX_2P; + break; + case 2: + _dtx = TJAPlayer3.DTX_3P; + break; + case 3: + _dtx = TJAPlayer3.DTX_4P; + break; + case 4: + _dtx = TJAPlayer3.DTX_5P; + break; + default: + break; + } - 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; - } - } - } - } - /* + if (TJAPlayer3.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 < TJAPlayer3.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++) @@ -180,15 +152,15 @@ namespace TJAPlayer3 } } */ - } + } - int _totalNotes = 0; - int _totalBalloons = 0; - double _totalRolls = 0; + 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]; @@ -204,409 +176,364 @@ namespace TJAPlayer3 } */ - var _list = (_dtx.bチップがある.Branch) ? _dtx.listChip_Branch[2] : _dtx.listChip; + 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]; + _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; - } + 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); + } - nNoteCount[i] = _totalNotes; - nBalloonCount[i] = _totalBalloons; - nRollTimeMs[i] = _totalRolls; - } + if (NotesManager.IsRoll(_chip) || NotesManager.IsFuzeRoll(_chip)) + _totalRolls += (_chip.nノーツ終了時刻ms - _chip.n発声時刻ms) / 1000.0; + } - for (int k = 0; k < TJAPlayer3.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; - } + nNoteCount[i] = _totalNotes; + nBalloonCount[i] = _totalBalloons; + nRollTimeMs[i] = _totalRolls; + } - } + for (int k = 0; k < TJAPlayer3.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 = TJAPlayer3.DTX.listChip.Count - 1; index >= 0; index--) - { - if (TJAPlayer3.DTX.listChip[index].nチャンネル番号 == 0x01) - { - this.bgmlength = TJAPlayer3.DTX.listChip[index].GetDuration() + TJAPlayer3.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; + for (int index = TJAPlayer3.DTX.listChip.Count - 1; index >= 0; index--) { + if (TJAPlayer3.DTX.listChip[index].nチャンネル番号 == 0x01) { + this.bgmlength = TJAPlayer3.DTX.listChip[index].GetDuration() + TJAPlayer3.DTX.listChip[index].n発声時刻ms; + break; + } + } - int nowBattleSectionCount = 1; + _AIBattleState = 0; + _AIBattleStateBatch = new Queue[] { new Queue(), new Queue() }; - for (int i = 0; i < listChip[0].Count; i++) - { - CDTX.CChip chip = listChip[0][i]; + this.AIBattleSections = new List(); - if (nowBattleSectionCount == battleSectionCount) - { - chip = endChip; - i = listChip[0].Count - 1; - } + 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 endtime = endChip.n発声時刻ms / battleSectionCount; - - bool isAddSection = (nowBattleSectionCount != battleSectionCount) ? - chip.n発声時刻ms >= endtime * nowBattleSectionCount : - i == listChip[0].Count - 1; + int battleSectionCount = 3 + ((endChip.n発声時刻ms * 2) / 100000); + // Avoid single section + if (battleSectionCount <= 1) + battleSectionCount = 3; + // Avoid ties + if (battleSectionCount % 2 == 0) + battleSectionCount -= 1; - if (isAddSection) - { - AIBattleSection aIBattleSection = new AIBattleSection(); + int battleSectionTime = 0; - aIBattleSection.StartTime = battleSectionTime; - aIBattleSection.EndTime = chip.n発声時刻ms; - aIBattleSection.Length = aIBattleSection.EndTime - aIBattleSection.StartTime; + int nowBattleSectionCount = 1; - this.AIBattleSections.Add(aIBattleSection); + for (int i = 0; i < listChip[0].Count; i++) { + CDTX.CChip chip = listChip[0][i]; - battleSectionTime = aIBattleSection.EndTime; - nowBattleSectionCount++; - } - } + if (nowBattleSectionCount == battleSectionCount) { + chip = endChip; + i = listChip[0].Count - 1; + } - NowAIBattleSectionCount = 0; - bIsAIBattleWin = false; + int endtime = endChip.n発声時刻ms / battleSectionCount; - ctChipAnime = new CCounter[5]; - ctChipAnimeLag = new CCounter[5]; - for (int i = 0; i < 5; i++) - { - ctChipAnime[i] = new CCounter(); - ctChipAnimeLag[i] = new CCounter(); - } + bool isAddSection = (nowBattleSectionCount != battleSectionCount) ? + chip.n発声時刻ms >= endtime * nowBattleSectionCount : + i == listChip[0].Count - 1; - listWAV = TJAPlayer3.DTX.listWAV; + + 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 = TJAPlayer3.DTX.listWAV; this.eフェードアウト完了時の戻り値 = E演奏画面の戻り値.継続; - this.n現在のトップChip = ( listChip[0].Count > 0 ) ? 0 : -1; - this.L最後に再生したHHの実WAV番号 = new List( 16 ); + 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; + for (int i = 0; i < 50; i++) { + this.n最後に再生したBGMの実WAV番号[i] = -1; } - cInvisibleChip = new CInvisibleChip( TJAPlayer3.ConfigIni.nDisplayTimesMs, TJAPlayer3.ConfigIni.nFadeoutTimeMs ); - for ( int k = 0; k < 4; k++ ) - { + cInvisibleChip = new CInvisibleChip(TJAPlayer3.ConfigIni.nDisplayTimesMs, TJAPlayer3.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.nヒット数_Auto含まない[k] = new CHITCOUNTOFRANK(); + this.nヒット数_Auto含む[k] = new CHITCOUNTOFRANK(); //} - this.r現在の歓声Chip[ k ] = null; - cInvisibleChip.eInvisibleMode[ k ] = TJAPlayer3.ConfigIni.eInvisible[ k ]; + this.r現在の歓声Chip[k] = null; + cInvisibleChip.eInvisibleMode[k] = TJAPlayer3.ConfigIni.eInvisible[k]; - this.bReverse[ k ] = TJAPlayer3.ConfigIni.bReverse[ k ]; + this.bReverse[k] = TJAPlayer3.ConfigIni.bReverse[k]; } - this.b演奏にキーボードを使った = false; - this.b演奏にジョイパッドを使った = false; - this.b演奏にMIDI入力を使った = false; - this.b演奏にマウスを使った = false; + 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; + //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; + for (int i = 0; i < 5; i++) { + this.b強制的に分岐させた[i] = false; - this.CChartScore[i] = new CBRANCHSCORE(); - this.CSectionScore[i] = new CBRANCHSCORE(); + this.CChartScore[i] = new CBRANCHSCORE(); + this.CSectionScore[i] = new CBRANCHSCORE(); - TJAPlayer3.stage演奏ドラム画面.actMtaiko.After[i] = CDTX.ECourse.eNormal; - TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.stBranch[i].nAfter = CDTX.ECourse.eNormal; - TJAPlayer3.stage演奏ドラム画面.actMtaiko.Before[i] = CDTX.ECourse.eNormal; - TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.stBranch[i].nBefore = CDTX.ECourse.eNormal; - } + TJAPlayer3.stage演奏ドラム画面.actMtaiko.After[i] = CDTX.ECourse.eNormal; + TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.stBranch[i].nAfter = CDTX.ECourse.eNormal; + TJAPlayer3.stage演奏ドラム画面.actMtaiko.Before[i] = CDTX.ECourse.eNormal; + TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.stBranch[i].nBefore = CDTX.ECourse.eNormal; + } - for (int i = 0; i < CBranchScore.Length; i++) - { - this.CBranchScore[i] = new CBRANCHSCORE(); + for (int i = 0; i < CBranchScore.Length; i++) { + this.CBranchScore[i] = new CBRANCHSCORE(); - //大音符分岐時の情報をまとめるため - this.CBranchScore[i].cBigNotes = 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]; + 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 = TJAPlayer3.ConfigIni.nPlayerCount >= 2 ? true : false; + // Double play set here + this.bDoublePlay = TJAPlayer3.ConfigIni.nPlayerCount >= 2 ? true : false; - this.nLoopCount_Clear = 1; + this.nLoopCount_Clear = 1; - this.tBranchReset(0); + this.tBranchReset(0); - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - actGauge.Init(TJAPlayer3.ConfigIni.nRisky, i); // #23559 2011.7.28 yyagi - eFirstGameType[i] = TJAPlayer3.ConfigIni.nGameType[i]; - } + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + actGauge.Init(TJAPlayer3.ConfigIni.nRisky, i); // #23559 2011.7.28 yyagi + eFirstGameType[i] = TJAPlayer3.ConfigIni.nGameType[i]; + } this.nPolyphonicSounds = TJAPlayer3.ConfigIni.nPoliphonicSounds; - TJAPlayer3.Skin.tRemoveMixerAll(); // 効果音のストリームをミキサーから解除しておく + TJAPlayer3.Skin.tRemoveMixerAll(); // 効果音のストリームをミキサーから解除しておく - queueMixerSound = new Queue( 64 ); - bIsDirectSound = ( TJAPlayer3.SoundManager.GetCurrentSoundDeviceType() == "DirectSound" ); + queueMixerSound = new Queue(64); + bIsDirectSound = (TJAPlayer3.SoundManager.GetCurrentSoundDeviceType() == "DirectSound"); bUseOSTimer = TJAPlayer3.ConfigIni.bUseOSTimer; this.bPAUSE = false; - if ( TJAPlayer3.DTXVmode.Enabled ) - { + if (TJAPlayer3.DTXVmode.Enabled) { db再生速度 = TJAPlayer3.DTX.dbDTXVPlaySpeed; - TJAPlayer3.ConfigIni.nSongSpeed = (int) (TJAPlayer3.DTX.dbDTXVPlaySpeed * 20 + 0.5 ); - } - else - { + TJAPlayer3.ConfigIni.nSongSpeed = (int)(TJAPlayer3.DTX.dbDTXVPlaySpeed * 20 + 0.5); + } else { db再生速度 = TJAPlayer3.ConfigIni.SongPlaybackSpeed; } - bValidScore = ( TJAPlayer3.DTXVmode.Enabled ) ? false : true; + bValidScore = (TJAPlayer3.DTXVmode.Enabled) ? false : 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 ) - { + 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 ) - { - TJAPlayer3.SoundManager.AddMixer( wc.rSound[ i ], db再生速度, pChip.b演奏終了後も再生が続くチップである ); + // 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) { + TJAPlayer3.SoundManager.AddMixer(wc.rSound[i], db再生速度, pChip.b演奏終了後も再生が続くチップである); //AddMixer( wc.rSound[ i ] ); // 最初はqueueを介さず直接ミキサー登録する } } } } - } - else - { + } else { break; } } - #endregion + #endregion - // Note - if(TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - { - n良 = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; - nCombo = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; - nHighestCombo = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; - n可 = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; - n不可 = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; - n連打 = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; - nADLIB = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; - nMine = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; - } + // Note + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + n良 = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; + nCombo = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; + nHighestCombo = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; + n可 = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; + n不可 = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; + n連打 = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; + nADLIB = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; + nMine = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; + } - this.sw = new Stopwatch(); + 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 < TJAPlayer3.ConfigIni.nPlayerCount; player++) - { - var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.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.gclatencymode = GCSettings.LatencyMode; + // GCSettings.LatencyMode = GCLatencyMode.Batch; // 演奏画面中はGCを抑止する + this.bIsAlreadyCleared = new bool[5]; + for (int player = 0; player < TJAPlayer3.ConfigIni.nPlayerCount; player++) { + var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.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.ListDan_Number = 0; + this.IsDanFailed = false; + + this.objHandlers = new Dictionary(); - 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 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); + public void ftDanReSetBranches(bool hasBranches) { + this.tBranchReset(0); - TJAPlayer3.stage演奏ドラム画面.nレーン用表示コース[0] = CDTX.ECourse.eNormal; - TJAPlayer3.stage演奏ドラム画面.bUseBranch[0] = hasBranches; + TJAPlayer3.stage演奏ドラム画面.nレーン用表示コース[0] = CDTX.ECourse.eNormal; + TJAPlayer3.stage演奏ドラム画面.bUseBranch[0] = hasBranches; - // TJAPlayer3.stage選曲.r確定されたスコア.譜面情報.b譜面分岐[(int)Difficulty.Dan] = 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; // + 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; + this.ctCamHMove = null; + this.ctCamVMove = null; + this.ctCamHScale = null; + this.ctCamVScale = null; + this.ctCamRotation = null; + this.ctCamZoom = null; - TJAPlayer3.borderColor = new Color4(0f, 0f, 0f, 0f); - TJAPlayer3.fCamXOffset = 0.0f; - TJAPlayer3.fCamYOffset = 0.0f; - TJAPlayer3.fCamXScale = 1.0f; - TJAPlayer3.fCamYScale = 1.0f; - TJAPlayer3.fCamRotation = 0.0f; - TJAPlayer3.fCamZoomFactor = 1.0f; + TJAPlayer3.borderColor = new Color4(0f, 0f, 0f, 0f); + TJAPlayer3.fCamXOffset = 0.0f; + TJAPlayer3.fCamYOffset = 0.0f; + TJAPlayer3.fCamXScale = 1.0f; + TJAPlayer3.fCamYScale = 1.0f; + TJAPlayer3.fCamRotation = 0.0f; + TJAPlayer3.fCamZoomFactor = 1.0f; - for (int i = 0; i < 5; i++) - { - ctChipAnime[i] = null; - ctChipAnimeLag[i] = null; - TJAPlayer3.ConfigIni.nGameType[i] = eFirstGameType[i]; - bSplitLane[i] = false; - } + for (int i = 0; i < 5; i++) { + ctChipAnime[i] = null; + ctChipAnimeLag[i] = null; + TJAPlayer3.ConfigIni.nGameType[i] = eFirstGameType[i]; + bSplitLane[i] = false; + } listWAV.Clear(); listWAV = null; - listChip = null; + listChip = null; queueMixerSound.Clear(); queueMixerSound = null; cInvisibleChip.Dispose(); cInvisibleChip = null; -// GCSettings.LatencyMode = this.gclatencymode; + // GCSettings.LatencyMode = this.gclatencymode; var meanLag = CLagLogger.LogAndReturnMeanLag(); - if (TJAPlayer3.IsPerformingCalibration && meanLag != null) - { - var oldInputAdjustTimeMs = TJAPlayer3.ConfigIni.nInputAdjustTimeMs; - var newInputAdjustTimeMs = oldInputAdjustTimeMs - (int) Math.Round(meanLag.Value); - Trace.TraceInformation($"Calibration complete. Updating InputAdjustTime from {oldInputAdjustTimeMs}ms to {newInputAdjustTimeMs}ms."); - TJAPlayer3.ConfigIni.nInputAdjustTimeMs = newInputAdjustTimeMs; + if (TJAPlayer3.IsPerformingCalibration && meanLag != null) { + var oldInputAdjustTimeMs = TJAPlayer3.ConfigIni.nInputAdjustTimeMs; + var newInputAdjustTimeMs = oldInputAdjustTimeMs - (int)Math.Round(meanLag.Value); + Trace.TraceInformation($"Calibration complete. Updating InputAdjustTime from {oldInputAdjustTimeMs}ms to {newInputAdjustTimeMs}ms."); + TJAPlayer3.ConfigIni.nInputAdjustTimeMs = newInputAdjustTimeMs; } - this.actDan.IsAnimating = false;// IsAnimating=trueのときにそのまま選曲画面に戻ると、文字列が描画されない問題修正用。 - TJAPlayer3.tテクスチャの解放( ref this.tx背景 ); + this.actDan.IsAnimating = false;// IsAnimating=trueのときにそのまま選曲画面に戻ると、文字列が描画されない問題修正用。 + TJAPlayer3.tテクスチャの解放(ref this.tx背景); - base.DeActivate(); + base.DeActivate(); } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { - Trace.TraceInformation("CStage演奏画面共通 リソースの開放"); - base.ReleaseManagedResource(); + public override void ReleaseManagedResource() { + Trace.TraceInformation("CStage演奏画面共通 リソースの開放"); + base.ReleaseManagedResource(); } // その他 //----------------- - public class CHITCOUNTOFRANK - { + public class CHITCOUNTOFRANK { // Fields public int Good; public int Great; @@ -615,12 +542,9 @@ namespace TJAPlayer3 public int Poor; // Properties - public int this[ int index ] - { - get - { - switch ( index ) - { + public int this[int index] { + get { + switch (index) { case 0: return this.Perfect; @@ -638,10 +562,8 @@ namespace TJAPlayer3 } throw new IndexOutOfRangeException(); } - set - { - switch ( index ) - { + set { + switch (index) { case 0: this.Perfect = value; return; @@ -669,117 +591,99 @@ namespace TJAPlayer3 - protected struct stmixer - { + 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; - } + /// + /// 分岐用のスコアをまとめるクラス。 + /// .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 = TJAPlayer3.Skin.Resolution[0] / 1280.0; - return (int)(JPOSCROLLX[player] * screen_ratio); - } - public int[] NoteOriginX - { - get - { - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - return new int[] { - TJAPlayer3.Skin.nScrollField_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * 0) + GetJPOSCROLLX(0), - TJAPlayer3.Skin.nScrollField_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * 1) + GetJPOSCROLLX(1), - TJAPlayer3.Skin.nScrollField_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * 2) + GetJPOSCROLLX(2), - TJAPlayer3.Skin.nScrollField_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * 3) + GetJPOSCROLLX(3), - TJAPlayer3.Skin.nScrollField_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * 4) + GetJPOSCROLLX(4) - }; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - return new int[] { - TJAPlayer3.Skin.nScrollField_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * 0) + GetJPOSCROLLX(0), - TJAPlayer3.Skin.nScrollField_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * 1) + GetJPOSCROLLX(1), - TJAPlayer3.Skin.nScrollField_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * 2) + GetJPOSCROLLX(2), - TJAPlayer3.Skin.nScrollField_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * 3) + GetJPOSCROLLX(3) - }; - } - else - { - return new int[] { - TJAPlayer3.Skin.nScrollFieldX[0] + GetJPOSCROLLX(0), - TJAPlayer3.Skin.nScrollFieldX[1] + GetJPOSCROLLX(1) - }; - } - } - } + public int[] JPOSCROLLX = new int[5]; + public int GetJPOSCROLLX(int player) { + double screen_ratio = TJAPlayer3.Skin.Resolution[0] / 1280.0; + return (int)(JPOSCROLLX[player] * screen_ratio); + } + public int[] NoteOriginX { + get { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + return new int[] { + TJAPlayer3.Skin.nScrollField_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * 0) + GetJPOSCROLLX(0), + TJAPlayer3.Skin.nScrollField_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * 1) + GetJPOSCROLLX(1), + TJAPlayer3.Skin.nScrollField_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * 2) + GetJPOSCROLLX(2), + TJAPlayer3.Skin.nScrollField_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * 3) + GetJPOSCROLLX(3), + TJAPlayer3.Skin.nScrollField_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * 4) + GetJPOSCROLLX(4) + }; + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + return new int[] { + TJAPlayer3.Skin.nScrollField_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * 0) + GetJPOSCROLLX(0), + TJAPlayer3.Skin.nScrollField_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * 1) + GetJPOSCROLLX(1), + TJAPlayer3.Skin.nScrollField_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * 2) + GetJPOSCROLLX(2), + TJAPlayer3.Skin.nScrollField_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * 3) + GetJPOSCROLLX(3) + }; + } else { + return new int[] { + TJAPlayer3.Skin.nScrollFieldX[0] + GetJPOSCROLLX(0), + TJAPlayer3.Skin.nScrollFieldX[1] + GetJPOSCROLLX(1) + }; + } + } + } - public int[] JPOSCROLLY = new int[5]; - public int GetJPOSCROLLY(int player) - { - double screen_ratio = TJAPlayer3.Skin.Resolution[1] / 720.0; - return (int)(JPOSCROLLY[player] * screen_ratio); - } - public int[] NoteOriginY - { - get - { - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - return new int[] { - TJAPlayer3.Skin.nScrollField_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * 0) + GetJPOSCROLLY(0), - TJAPlayer3.Skin.nScrollField_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * 1) + GetJPOSCROLLY(1), - TJAPlayer3.Skin.nScrollField_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * 2) + GetJPOSCROLLY(2), - TJAPlayer3.Skin.nScrollField_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * 3) + GetJPOSCROLLY(3), - TJAPlayer3.Skin.nScrollField_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * 4) + GetJPOSCROLLY(4) - }; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - return new int[] { - TJAPlayer3.Skin.nScrollField_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * 0) + GetJPOSCROLLY(0), - TJAPlayer3.Skin.nScrollField_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * 1) + GetJPOSCROLLY(1), - TJAPlayer3.Skin.nScrollField_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * 2) + GetJPOSCROLLY(2), - TJAPlayer3.Skin.nScrollField_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * 3) + GetJPOSCROLLY(3) - }; - } - else - { - return new int[] { - TJAPlayer3.Skin.nScrollFieldY[0] + GetJPOSCROLLY(0), - TJAPlayer3.Skin.nScrollFieldY[1] + GetJPOSCROLLY(1) - }; - } - } - } + public int[] JPOSCROLLY = new int[5]; + public int GetJPOSCROLLY(int player) { + double screen_ratio = TJAPlayer3.Skin.Resolution[1] / 720.0; + return (int)(JPOSCROLLY[player] * screen_ratio); + } + public int[] NoteOriginY { + get { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + return new int[] { + TJAPlayer3.Skin.nScrollField_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * 0) + GetJPOSCROLLY(0), + TJAPlayer3.Skin.nScrollField_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * 1) + GetJPOSCROLLY(1), + TJAPlayer3.Skin.nScrollField_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * 2) + GetJPOSCROLLY(2), + TJAPlayer3.Skin.nScrollField_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * 3) + GetJPOSCROLLY(3), + TJAPlayer3.Skin.nScrollField_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * 4) + GetJPOSCROLLY(4) + }; + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + return new int[] { + TJAPlayer3.Skin.nScrollField_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * 0) + GetJPOSCROLLY(0), + TJAPlayer3.Skin.nScrollField_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * 1) + GetJPOSCROLLY(1), + TJAPlayer3.Skin.nScrollField_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * 2) + GetJPOSCROLLY(2), + TJAPlayer3.Skin.nScrollField_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * 3) + GetJPOSCROLLY(3) + }; + } else { + return new int[] { + TJAPlayer3.Skin.nScrollFieldY[0] + GetJPOSCROLLY(0), + TJAPlayer3.Skin.nScrollFieldY[1] + GetJPOSCROLLY(1) + }; + } + } + } - public CAct演奏AVI actAVI; - public Rainbow Rainbow; + 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; + //protected CActFIFOBlack actFI; + public CActFIFOStart actFI; + protected CActFIFOBlack actFO; + protected CActFIFOResult actFOClear; + public CAct演奏ゲージ共通 actGauge; - public CActImplDancer actDancer; + public CActImplDancer actDancer; protected CActImplJudgeText actJudgeString; public TaikoLaneFlash actTaikoLaneFlash; public CAct演奏パネル文字列 actPanel; @@ -787,63 +691,63 @@ namespace TJAPlayer3 public CAct演奏スコア共通 actScore; public CAct演奏ステージ失敗 actStageFailed; protected CAct演奏スクロール速度 act譜面スクロール速度; - protected CActImplRoll actRoll; - protected 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 CActImplRoll actRoll; + protected 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 E演奏画面の戻り値 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 E演奏画面の戻り値 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 }; + 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 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 ]; + 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 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 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 bool bDTXVmode; protected STDGBVALUE bReverse; protected STDGBVALUE r現在の歓声Chip; @@ -852,216 +756,186 @@ namespace TJAPlayer3 protected CTexture tx背景; -// protected int nRisky_InitialVar, nRiskyTime; // #23559 2011.7.28 yyagi → CAct演奏ゲージ共通クラスに隠蔽 + // 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 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[] 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; + 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 E連打State eRollState; - protected bool[] ifp = { false, false, false, false, false }; - protected bool[] isDeniedPlaying = { false, false, false, false, false }; + 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 E連打State 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 nタイマ番号; + protected int n現在の音符の顔番号; - protected int nWaitButton; + protected int nWaitButton; - protected int[] nStoredHit; - private EGameType[] eFirstGameType; - protected bool[] bSplitLane; + protected int[] nStoredHit; + private EGameType[] eFirstGameType; + protected bool[] bSplitLane; - public CDTX.CChip[] chip現在処理中の連打チップ = new CDTX.CChip[ 5 ]; + 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; + 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; - } + 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 class AIBattleSection { + public enum EndType { + None, + Clear, + Lose + } - public int Length; - public int StartTime; - public int EndTime; + public int Length; + public int StartTime; + public int EndTime; - public EndType End; - public bool IsAnimated; - } + public EndType End; + public bool IsAnimated; + } - public List AIBattleSections; + public List AIBattleSections; - public int NowAIBattleSectionCount; - public int NowAIBattleSectionTime; - public AIBattleSection NowAIBattleSection - { - get - { - return AIBattleSections[Math.Min(NowAIBattleSectionCount, AIBattleSections.Count - 1)]; - } - } + 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 (TJAPlayer3.ConfigIni.nAILevel < 10) - TJAPlayer3.ConfigIni.nAILevel++; - } - else - { - NowAIBattleSection.End = AIBattleSection.EndType.Lose; - if (TJAPlayer3.ConfigIni.nAILevel > 1) - TJAPlayer3.ConfigIni.nAILevel--; - } - actAIBattle.BatchAnimeCounter.CurrentValue = 0; - _AIBattleState = 0; + private void PassAIBattleSection() { + if (AIBattleState >= 0) { + NowAIBattleSection.End = AIBattleSection.EndType.Clear; + if (TJAPlayer3.ConfigIni.nAILevel < 10) + TJAPlayer3.ConfigIni.nAILevel++; + } else { + NowAIBattleSection.End = AIBattleSection.EndType.Lose; + if (TJAPlayer3.ConfigIni.nAILevel > 1) + TJAPlayer3.ConfigIni.nAILevel--; + } + actAIBattle.BatchAnimeCounter.CurrentValue = 0; + _AIBattleState = 0; - for (int i = 0; i < 5; i++) - { - this.CSectionScore[i] = new CBRANCHSCORE(); - } + for (int i = 0; i < 5; i++) { + this.CSectionScore[i] = new CBRANCHSCORE(); + } - int clearCount = 0; - for (int i = 0; i < TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count; i++) - { - if (TJAPlayer3.stage演奏ドラム画面.AIBattleSections[i].End == CStage演奏画面共通.AIBattleSection.EndType.Clear) - { - clearCount++; - } - } - bIsAIBattleWin = clearCount >= TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count / 2.0; - } + int clearCount = 0; + for (int i = 0; i < TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count; i++) { + if (TJAPlayer3.stage演奏ドラム画面.AIBattleSections[i].End == CStage演奏画面共通.AIBattleSection.EndType.Clear) { + clearCount++; + } + } + bIsAIBattleWin = clearCount >= TJAPlayer3.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 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 / TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[i] * 1 / 4 / TJAPlayer3.ConfigIni.SongPlaybackSpeed, SoundManager.PlayTimer); - } + private void UpdateCharaCounter(int nPlayer) { + for (int i = 0; i < 5; i++) { + ctChipAnime[i] = new CCounter(0, 3, 60.0 / TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[i] * 1 / 4 / TJAPlayer3.ConfigIni.SongPlaybackSpeed, SoundManager.PlayTimer); + } - TJAPlayer3.stage演奏ドラム画面.PuchiChara.ChangeBPM(60.0 / TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer] / TJAPlayer3.ConfigIni.SongPlaybackSpeed); - } + TJAPlayer3.stage演奏ドラム画面.PuchiChara.ChangeBPM(60.0 / TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer] / TJAPlayer3.ConfigIni.SongPlaybackSpeed); + } - public void AddMixer( CSound cs, bool _b演奏終了後も再生が続くチップである ) - { - stmixer stm = new stmixer() - { + 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ファイル名 )); + queueMixerSound.Enqueue(stm); + // Debug.WriteLine( "★Queue: add " + Path.GetFileName( stm.csound.strファイル名 )); } - public void RemoveMixer( CSound cs ) - { - stmixer stm = new stmixer() - { + 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ファイル名 )); + queueMixerSound.Enqueue(stm); + // Debug.WriteLine( "★Queue: remove " + Path.GetFileName( stm.csound.strファイル名 )); } - public void ManageMixerQueue() - { + public void ManageMixerQueue() { // もしサウンドの登録/削除が必要なら、実行する - if ( queueMixerSound.Count > 0 ) - { + 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++ ) - { + if (ts.Milliseconds > 7) { + for (int i = 0; i < 2 && queueMixerSound.Count > 0; i++) { dtLastQueueOperation = dtnow; stmixer stm = queueMixerSound.Dequeue(); - if ( stm.bIsAdd ) - { - TJAPlayer3.SoundManager.AddMixer( stm.csound, db再生速度, stm.b演奏終了後も再生が続くチップである ); - } - else - { - TJAPlayer3.SoundManager.RemoveMixer( stm.csound ); + if (stm.bIsAdd) { + TJAPlayer3.SoundManager.AddMixer(stm.csound, db再生速度, stm.b演奏終了後も再生が続くチップである); + } else { + TJAPlayer3.SoundManager.RemoveMixer(stm.csound); } } } @@ -1070,717 +944,597 @@ namespace TJAPlayer3 - internal ENoteJudge e指定時刻からChipのJUDGEを返す(long nTime, CDTX.CChip pChip, int player = 0) - { - var e判定 = e指定時刻からChipのJUDGEを返すImpl(nTime, pChip, player); + internal ENoteJudge e指定時刻からChipのJUDGEを返す(long nTime, CDTX.CChip pChip, int player = 0) { + var e判定 = e指定時刻からChipのJUDGEを返すImpl(nTime, pChip, player); - // When performing calibration, reduce audio distraction from user input. - // For users who play primarily by watching notes cross the judgment position, - // you might think that we want them to see visual judgment feedback 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 hits with the perfect, good, etc. judgment results based on their - // current (and soon to be replaced) input adjust time values. - // Instead, we want them focused on the sounds of their keyboard, tatacon, - // other controller, etc. and the visuals of notes crossing the judgment position. - if (TJAPlayer3.IsPerformingCalibration) - { - return e判定 < ENoteJudge.Good ? ENoteJudge.Good : e判定; - } - else - { - return e判定; - } - } + // When performing calibration, reduce audio distraction from user input. + // For users who play primarily by watching notes cross the judgment position, + // you might think that we want them to see visual judgment feedback 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 hits with the perfect, good, etc. judgment results based on their + // current (and soon to be replaced) input adjust time values. + // Instead, we want them focused on the sounds of their keyboard, tatacon, + // other controller, etc. and the visuals of notes crossing the judgment position. + if (TJAPlayer3.IsPerformingCalibration) { + return e判定 < ENoteJudge.Good ? ENoteJudge.Good : e判定; + } else { + return e判定; + } + } - private bool tEasyTimeZones(int nPlayer) - { - bool _timingzonesAreEasy = false; + private bool tEasyTimeZones(int nPlayer) { + bool _timingzonesAreEasy = false; - int diff = TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[nPlayer]; + int diff = TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[nPlayer]; - // Diff = Normal or Easy - if (diff <= (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 = TJAPlayer3.stage演奏ドラム画面.actDan.NowShowingNumber; - var _danSongs = TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs; + // Diff = Dan and current song is Normal or Easy + if (diff == (int)Difficulty.Dan) { + int _nb = TJAPlayer3.stage演奏ドラム画面.actDan.NowShowingNumber; + var _danSongs = TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs; - if (_nb < _danSongs.Count) - { - var _currentDiff = _danSongs[_nb].Difficulty; - if (_currentDiff <= (int)Difficulty.Normal) - _timingzonesAreEasy = true; + 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 = TJAPlayer3.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]; - } - - private ENoteJudge e指定時刻からChipのJUDGEを返すImpl( long nTime, CDTX.CChip pChip, int player = 0 ) - { - - 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 * TJAPlayer3.ConfigIni.SongPlaybackSpeed) > pChip.n発声時刻ms && (SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed) < pChip.nノーツ終了時刻ms) - { - return ENoteJudge.Perfect; - } - } - else if(NotesManager.IsGenericBalloon(pChip)) - { - if ((SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed) >= pChip.n発声時刻ms - 17 && (SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed) < pChip.nノーツ終了時刻ms) - { - return ENoteJudge.Perfect; - } - } - - - - // To change later to adapt to Tower Ama-kuchi - //diff = Math.Min(diff, (int)Difficulty.Oni); - - int actual = TJAPlayer3.GetActualPlayer(player); - - int timingShift = TJAPlayer3.ConfigIni.nTimingZones[actual]; - - bool _timingzonesAreEasy = tEasyTimeZones(player); - - CConfigIni.CTimingZones tz = (_timingzonesAreEasy == true) ? TJAPlayer3.ConfigIni.tzLevels[timingShift] : TJAPlayer3.ConfigIni.tzLevels[2 + timingShift]; - - if (nDeltaTime <= tz.nGoodZone * TJAPlayer3.ConfigIni.SongPlaybackSpeed) - { - return ENoteJudge.Perfect; } - if (nDeltaTime <= tz.nOkZone * TJAPlayer3.ConfigIni.SongPlaybackSpeed) - { - if ( TJAPlayer3.ConfigIni.bJust[actual] == 1 && NotesManager.IsMissableNote(pChip)) // Just - return ENoteJudge.Poor; + } + + // Diff = Tower and SIDE is Normal + if (diff == (int)Difficulty.Tower) { + _timingzonesAreEasy = TJAPlayer3.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]; + } + + private ENoteJudge e指定時刻からChipのJUDGEを返すImpl(long nTime, CDTX.CChip pChip, int player = 0) { + + 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 * TJAPlayer3.ConfigIni.SongPlaybackSpeed) > pChip.n発声時刻ms && (SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed) < pChip.nノーツ終了時刻ms) { + return ENoteJudge.Perfect; + } + } else if (NotesManager.IsGenericBalloon(pChip)) { + if ((SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed) >= pChip.n発声時刻ms - 17 && (SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed) < pChip.nノーツ終了時刻ms) { + return ENoteJudge.Perfect; + } + } + + + + // To change later to adapt to Tower Ama-kuchi + //diff = Math.Min(diff, (int)Difficulty.Oni); + + int actual = TJAPlayer3.GetActualPlayer(player); + + int timingShift = TJAPlayer3.ConfigIni.nTimingZones[actual]; + + bool _timingzonesAreEasy = tEasyTimeZones(player); + + CConfigIni.CTimingZones tz = (_timingzonesAreEasy == true) ? TJAPlayer3.ConfigIni.tzLevels[timingShift] : TJAPlayer3.ConfigIni.tzLevels[2 + timingShift]; + + if (nDeltaTime <= tz.nGoodZone * TJAPlayer3.ConfigIni.SongPlaybackSpeed) { + return ENoteJudge.Perfect; + } + if (nDeltaTime <= tz.nOkZone * TJAPlayer3.ConfigIni.SongPlaybackSpeed) { + if (TJAPlayer3.ConfigIni.bJust[actual] == 1 && NotesManager.IsMissableNote(pChip)) // Just + return ENoteJudge.Poor; return ENoteJudge.Good; } - - if (nDeltaTime <= tz.nBadZone * TJAPlayer3.ConfigIni.SongPlaybackSpeed) - { - if (TJAPlayer3.ConfigIni.bJust[actual] == 2 || !NotesManager.IsMissableNote(pChip)) // Safe - return ENoteJudge.Good; - return ENoteJudge.Poor; - } - + + if (nDeltaTime <= tz.nBadZone * TJAPlayer3.ConfigIni.SongPlaybackSpeed) { + if (TJAPlayer3.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 ) - { + 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 + //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個もチップがない場合は + if (this.n現在のトップChip == -1) // 演奏データとして1個もチップがない場合は { //sw2.Stop(); return null; } - List playerListChip = listChip[ nPlayer ]; - int count = playerListChip.Count; + List playerListChip = listChip[nPlayer]; + int count = playerListChip.Count; int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = this.n現在のトップChip; - if ( this.n現在のトップChip >= count ) // その時点で演奏すべきチップが既に全部無くなっていたら + 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 ]; + 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 ) - { + if (chip.nチャンネル番号 == nChannel) { + if (chip.n発声時刻ms > nTime) { + break; + } + if (chip.nコース != this.n次回のコース[nPlayer]) { break; } - if( chip.nコース != this.n次回のコース[ nPlayer ] ) - { - break; - } nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; } - continue; // ほんの僅かながら高速化 + 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 ]; + 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))) { break; } } // nIndex_NearestChip_Past--; } - if ( nIndex_NearestChip_Future >= count ) - { - if ( nIndex_NearestChip_Past < 0 ) // 検索対象が過去未来どちらにも見つからなかった場合 + if (nIndex_NearestChip_Future >= count) { + if (nIndex_NearestChip_Past < 0) // 検索対象が過去未来どちらにも見つからなかった場合 { return null; - } - else // 検索対象が未来方向には見つからなかった(しかし過去方向には見つかった)場合 - { + } else // 検索対象が未来方向には見つからなかった(しかし過去方向には見つかった)場合 + { //sw2.Stop(); - return playerListChip[ nIndex_NearestChip_Past ]; + return playerListChip[nIndex_NearestChip_Past]; } - } - else if ( nIndex_NearestChip_Past < 0 ) // 検索対象が過去方向には見つからなかった(しかし未来方向には見つかった)場合 - { + } else if (nIndex_NearestChip_Past < 0) // 検索対象が過去方向には見つからなかった(しかし未来方向には見つかった)場合 + { //sw2.Stop(); - return playerListChip[ nIndex_NearestChip_Future ]; + 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 ) - { + // 検索対象が過去未来の双方に見つかったなら、より近い方を採用する + 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 = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(nPlayer)]; + protected void tサウンド再生(CDTX.CChip pChip, int nPlayer) { + var _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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(); + } + + 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, TJAPlayer3.Timer); - this.actRoll.ct連打アニメ[nPlayer].CurrentValue = 1; - } - else - { - this.actRoll.ct連打アニメ[nPlayer] = new CCounter(0, 9, 14, TJAPlayer3.Timer); - } + 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, TJAPlayer3.Timer); + this.actRoll.ct連打アニメ[nPlayer].CurrentValue = 1; + } else { + this.actRoll.ct連打アニメ[nPlayer] = new CCounter(0, 9, 14, TJAPlayer3.Timer); + } - pChip.RollEffectLevel += 10; - if(pChip.RollEffectLevel >= 100) - { - pChip.RollEffectLevel = 100; - pChip.RollInputTime = new CCounter(0, 1500, 1, TJAPlayer3.Timer); - pChip.RollDelay?.Stop(); - } else - { - pChip.RollInputTime = new CCounter(0, 150, 1, TJAPlayer3.Timer); - pChip.RollDelay?.Stop(); - } + pChip.RollEffectLevel += 10; + if (pChip.RollEffectLevel >= 100) { + pChip.RollEffectLevel = 100; + pChip.RollInputTime = new CCounter(0, 1500, 1, TJAPlayer3.Timer); + pChip.RollDelay?.Stop(); + } else { + pChip.RollInputTime = new CCounter(0, 150, 1, TJAPlayer3.Timer); + pChip.RollDelay?.Stop(); + } - if ( pChip.nチャンネル番号 == 0x15 ) - this.eRollState = E連打State.roll; - else - this.eRollState = E連打State.rollB; + if (pChip.nチャンネル番号 == 0x15) + this.eRollState = E連打State.roll; + else + this.eRollState = E連打State.rollB; - pChip.nRollCount++; + pChip.nRollCount++; - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - this.n連打[actDan.NowShowingNumber]++; + if (TJAPlayer3.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]++; - this.n合計連打数[ nPlayer ]++; - if(TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) this.actRollChara.Start(nPlayer); + this.CBranchScore[nPlayer].nRoll++; + this.CChartScore[nPlayer].nRoll++; + this.CSectionScore[nPlayer].nRoll++; + + this.n合計連打数[nPlayer]++; + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) this.actRollChara.Start(nPlayer); - long nAddScore = 0; + long nAddScore = 0; - if (!TJAPlayer3.ConfigIni.ShinuchiMode) - { - // 旧配点・旧筐体配点 - if (TJAPlayer3.DTX.nScoreModeTmp == 0 || TJAPlayer3.DTX.nScoreModeTmp == 1) - { - if (pChip.nチャンネル番号 == 0x15) - nAddScore = 300L; - else - nAddScore = 360L; - } - // 新配点 - else - { - if (pChip.nチャンネル番号 == 0x15) - nAddScore = 100L; - else - nAddScore = 200L; - } - } - else - { - nAddScore = 100L; - } + if (!TJAPlayer3.ConfigIni.ShinuchiMode) { + // 旧配点・旧筐体配点 + if (TJAPlayer3.DTX.nScoreModeTmp == 0 || TJAPlayer3.DTX.nScoreModeTmp == 1) { + if (pChip.nチャンネル番号 == 0x15) + nAddScore = 300L; + else + nAddScore = 360L; + } + // 新配点 + else { + if (pChip.nチャンネル番号 == 0x15) + nAddScore = 100L; + else + nAddScore = 200L; + } + } else { + nAddScore = 100L; + } - if (!TJAPlayer3.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 = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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 ); - TJAPlayer3.stage演奏ドラム画面.FlyingNotes.Start(1, nPlayer, true); - } - else - { - //CDTXMania.Skin.soundRed.t再生する(); - //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( 3, nPlayer ); - TJAPlayer3.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 ); - TJAPlayer3.stage演奏ドラム画面.FlyingNotes.Start(2, nPlayer, true); - } - else - { - //CDTXMania.Skin.soundBlue.t再生する(); - //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( 4, nPlayer ); - TJAPlayer3.stage演奏ドラム画面.FlyingNotes.Start(4, nPlayer, true); - } - } - else if (sort == 4) - { - this.soundClap[pChip.nPlayerSide]?.PlayStart(); - TJAPlayer3.stage演奏ドラム画面.FlyingNotes.Start(4, nPlayer, true); - } - - //TJAPlayer3.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Hit); - } - else - { - this.b連打中[ nPlayer ] = false; - return 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 * TJAPlayer3.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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - this.b連打中[i] = true; - - - if (this.actBalloon.ct風船アニメ[i].IsUnEnded) - { - this.actBalloon.ct風船アニメ[i] = new CCounter(0, 9, 14, TJAPlayer3.Timer); - this.actBalloon.ct風船アニメ[i].CurrentValue = 1; - } - else - { - this.actBalloon.ct風船アニメ[i] = new CCounter(0, 9, 14, TJAPlayer3.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, TJAPlayer3.Timer); - this.actBalloon.ct風船アニメ[player].CurrentValue = 1; - } - else - { - this.actBalloon.ct風船アニメ[player] = new CCounter(0, 9, 14, TJAPlayer3.Timer); - } - } - - this.eRollState = E連打State.balloon; + if (!TJAPlayer3.ConfigIni.ShinuchiMode && pChip.bGOGOTIME) this.actScore.Add((long)(nAddScore * 1.2f), nPlayer); + else this.actScore.Add(nAddScore, nPlayer); - - if (IsKusudama) - { - //pChip.nRollCount = nCurrentKusudamaRollCount; - for(int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - pChip.nRollCount = nCurrentKusudamaRollCount; - this.n風船残り[i] = balloon - rollCount; - } - } - else - { - pChip.nRollCount++; - rollCount = pChip.nRollCount; - this.n風船残り[player] = balloon - rollCount; - } + // 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; - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - this.n連打[actDan.NowShowingNumber]++; - this.CBranchScore[player].nRoll++; - this.CChartScore[player].nRoll++; - this.CSectionScore[player].nRoll++; + EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(nPlayer)]; - this.n合計連打数[player]++; // 成績発表の連打数に風船を含めるように (AioiLight) + //赤か青かの分岐 + 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 ); + TJAPlayer3.stage演奏ドラム画面.FlyingNotes.Start(1, nPlayer, true); + } else { + //CDTXMania.Skin.soundRed.t再生する(); + //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( 3, nPlayer ); + TJAPlayer3.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 ); + TJAPlayer3.stage演奏ドラム画面.FlyingNotes.Start(2, nPlayer, true); + } else { + //CDTXMania.Skin.soundBlue.t再生する(); + //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( 4, nPlayer ); + TJAPlayer3.stage演奏ドラム画面.FlyingNotes.Start(4, nPlayer, true); + } + } else if (sort == 4) { + this.soundClap[pChip.nPlayerSide]?.PlayStart(); + TJAPlayer3.stage演奏ドラム画面.FlyingNotes.Start(4, nPlayer, true); + } - long nAddScore = 0; + //TJAPlayer3.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Hit); + } else { + this.b連打中[nPlayer] = false; + return true; + } - if (!TJAPlayer3.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) - { - TJAPlayer3.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 < TJAPlayer3.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, TJAPlayer3.Skin.Characters_Balloon_Delay[actChara.iCurrentCharacter[i]] - 1, 1, TJAPlayer3.Timer); - } - } - else - { - //パァーン - TJAPlayer3.Skin.soundBalloon.tPlay(); - //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( 3, player ); //ここで飛ばす。飛ばされるのは大音符のみ。 - TJAPlayer3.stage演奏ドラム画面.FlyingNotes.Start(3, player); - TJAPlayer3.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, TJAPlayer3.Skin.Characters_Balloon_Delay[actChara.iCurrentCharacter[player]] - 1, 1, TJAPlayer3.Timer); - } - } - this.eRollState = E連打State.none; // Unused variable ? - } - } - else - { - if (IsKusudama) - { - for(int i = 0; i < TJAPlayer3.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 ); + return false; } - protected unsafe ENoteJudge tチップのヒット処理(long nHitTime, CDTX.CChip pChip, EInstrumentPad screenmode, bool bCorrectLane, int nNowInput, int nPlayer, bool rollEffectHit = false) - { - //unsafeコードにつき、デバッグ中の変更厳禁! - bool bAutoPlay = TJAPlayer3.ConfigIni.bAutoPlay[nPlayer]; - bool bBombHit = 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 * TJAPlayer3.ConfigIni.SongPlaybackSpeed); + bool IsKusudama = NotesManager.IsKusudama(pChip); + bool IsFuze = NotesManager.IsFuzeRoll(pChip); - switch (nPlayer) - { - case 1: - bAutoPlay = TJAPlayer3.ConfigIni.bAutoPlay[nPlayer] || TJAPlayer3.ConfigIni.bAIBattleMode; - break; - } + int rollCount = pChip.nRollCount; + int balloon = pChip.nBalloon; - if (!pChip.b可視) - return ENoteJudge.Auto; + if (IsKusudama) { + nCurrentKusudamaRollCount++; + rollCount = nCurrentKusudamaRollCount; + balloon = nCurrentKusudamaCount; + } - if (!NotesManager.IsGenericRoll(pChip)) - { - if (!pChip.IsMissed)//通り越したチップでなければ判定! - { - pChip.bHit = true; - pChip.IsHitted = true; - } - } + 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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + this.b連打中[i] = true; + + + if (this.actBalloon.ct風船アニメ[i].IsUnEnded) { + this.actBalloon.ct風船アニメ[i] = new CCounter(0, 9, 14, TJAPlayer3.Timer); + this.actBalloon.ct風船アニメ[i].CurrentValue = 1; + } else { + this.actBalloon.ct風船アニメ[i] = new CCounter(0, 9, 14, TJAPlayer3.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, TJAPlayer3.Timer); + this.actBalloon.ct風船アニメ[player].CurrentValue = 1; + } else { + this.actBalloon.ct風船アニメ[player] = new CCounter(0, 9, 14, TJAPlayer3.Timer); + } + } + + this.eRollState = E連打State.balloon; + + + + if (IsKusudama) { + //pChip.nRollCount = nCurrentKusudamaRollCount; + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + pChip.nRollCount = nCurrentKusudamaRollCount; + this.n風船残り[i] = balloon - rollCount; + } + } else { + pChip.nRollCount++; + rollCount = pChip.nRollCount; + this.n風船残り[player] = balloon - rollCount; + } + + if (TJAPlayer3.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 (!TJAPlayer3.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) { + TJAPlayer3.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 < TJAPlayer3.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, TJAPlayer3.Skin.Characters_Balloon_Delay[actChara.iCurrentCharacter[i]] - 1, 1, TJAPlayer3.Timer); + } + } else { + //パァーン + TJAPlayer3.Skin.soundBalloon.tPlay(); + //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( 3, player ); //ここで飛ばす。飛ばされるのは大音符のみ。 + TJAPlayer3.stage演奏ドラム画面.FlyingNotes.Start(3, player); + TJAPlayer3.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, TJAPlayer3.Skin.Characters_Balloon_Delay[actChara.iCurrentCharacter[player]] - 1, 1, TJAPlayer3.Timer); + } + } + this.eRollState = E連打State.none; // Unused variable ? + } + } else { + if (IsKusudama) { + for (int i = 0; i < TJAPlayer3.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 = TJAPlayer3.ConfigIni.bAutoPlay[nPlayer]; + bool bBombHit = false; + + switch (nPlayer) { + case 1: + bAutoPlay = TJAPlayer3.ConfigIni.bAutoPlay[nPlayer] || TJAPlayer3.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: + 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; + case EInstrumentPad.TAIKO: { + //連打が短すぎると発声されない + eJudgeResult = (bCorrectLane) ? this.e指定時刻からChipのJUDGEを返す(nHitTime, pChip, nPlayer) : ENoteJudge.Miss; - // AI judges - eJudgeResult = AlterJudgement(nPlayer, eJudgeResult, true); + // AI judges + eJudgeResult = AlterJudgement(nPlayer, eJudgeResult, true); - if (!bAutoPlay && eJudgeResult != ENoteJudge.Miss) - { - CLagLogger.Add(nPlayer, pChip); - } + if (!bAutoPlay && eJudgeResult != ENoteJudge.Miss) { + CLagLogger.Add(nPlayer, pChip); + } - var puchichara = TJAPlayer3.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(TJAPlayer3.GetActualPlayer(nPlayer))]; + var puchichara = TJAPlayer3.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(TJAPlayer3.GetActualPlayer(nPlayer))]; - if (NotesManager.IsRoll(pChip)) - { - #region[ Drumroll ] - //--------------------------- - this.b連打中[nPlayer] = true; - if (bAutoPlay || rollEffectHit) - { - int rollSpeed = bAutoPlay ? TJAPlayer3.ConfigIni.nRollsPerSec : puchichara.effect.Autoroll; - if (TJAPlayer3.ConfigIni.bAIBattleMode && nPlayer == 1) - rollSpeed = TJAPlayer3.ConfigIni.apAIPerformances[TJAPlayer3.ConfigIni.nAILevel - 1].nRollSpeed; + if (NotesManager.IsRoll(pChip)) { + #region[ Drumroll ] + //--------------------------- + this.b連打中[nPlayer] = true; + if (bAutoPlay || rollEffectHit) { + int rollSpeed = bAutoPlay ? TJAPlayer3.ConfigIni.nRollsPerSec : puchichara.effect.Autoroll; + if (TJAPlayer3.ConfigIni.bAIBattleMode && nPlayer == 1) + rollSpeed = TJAPlayer3.ConfigIni.apAIPerformances[TJAPlayer3.ConfigIni.nAILevel - 1].nRollSpeed; - if (this.bPAUSE == false && rollSpeed > 0) // && TJAPlayer3.ConfigIni.bAuto先生の連打) - { - if (((SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed) - * TJAPlayer3.ConfigIni.SongPlaybackSpeed) - > (pChip.n発声時刻ms + (1000.0 / (double)rollSpeed) * pChip.nRollCount)) - { - EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(nPlayer)]; - int nLane = 0; + if (this.bPAUSE == false && rollSpeed > 0) // && TJAPlayer3.ConfigIni.bAuto先生の連打) + { + if (((SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed) + * TJAPlayer3.ConfigIni.SongPlaybackSpeed) + > (pChip.n発声時刻ms + (1000.0 / (double)rollSpeed) * pChip.nRollCount)) { + EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(nPlayer)]; + int nLane = 0; - if (this.nHand[nPlayer] == 0) - this.nHand[nPlayer]++; - else - this.nHand[nPlayer] = 0; + if (this.nHand[nPlayer] == 0) + this.nHand[nPlayer]++; + else + this.nHand[nPlayer] = 0; - if (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer] < 0 && (pChip.eScrollMode == EScrollMode.HBSCROLL)) - pChip.fBMSCROLLTime -= TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer] * -0.05; + if (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer] < 0 && (pChip.eScrollMode == EScrollMode.HBSCROLL)) + pChip.fBMSCROLLTime -= TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer] * -0.05; - TJAPlayer3.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Red); - //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( pChip.nチャンネル番号 == 0x15 ? 1 : 3, nPlayer ); - TJAPlayer3.stage演奏ドラム画面.FlyingNotes.Start(pChip.nチャンネル番号 == 0x15 ? 1 : 3, nPlayer, true); - TJAPlayer3.stage演奏ドラム画面.actMtaiko.tMtaikoEvent(pChip.nチャンネル番号, this.nHand[nPlayer], nPlayer); + TJAPlayer3.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Red); + //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( pChip.nチャンネル番号 == 0x15 ? 1 : 3, nPlayer ); + TJAPlayer3.stage演奏ドラム画面.FlyingNotes.Start(pChip.nチャンネル番号 == 0x15 ? 1 : 3, nPlayer, true); + TJAPlayer3.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; + 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 * TJAPlayer3.ConfigIni.SongPlaybackSpeed), 1, nLane, 0, nPlayer); - } - } - } - if (!bAutoPlay && !rollEffectHit) - { - this.eRollState = E連打State.roll; - this.tRollProcess(pChip, (SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed), 1, nNowInput, 0, nPlayer); - } + this.tRollProcess(pChip, (SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed), 1, nLane, 0, nPlayer); + } + } + } + if (!bAutoPlay && !rollEffectHit) { + this.eRollState = E連打State.roll; + this.tRollProcess(pChip, (SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed), 1, nNowInput, 0, nPlayer); + } - break; - //--------------------------- - #endregion - } - else if (NotesManager.IsGenericBalloon(pChip)) - { - #region [ Balloon ] + break; + //--------------------------- + #endregion + } else if (NotesManager.IsGenericBalloon(pChip)) { + #region [ Balloon ] - bool IsKusudama = NotesManager.IsKusudama(pChip); + bool IsKusudama = NotesManager.IsKusudama(pChip); - if (IsKusudama) - { - if (nCurrentKusudamaCount > 0) - { - /* + if (IsKusudama) { + if (nCurrentKusudamaCount > 0) { + /* if (!this.b連打中[nPlayer] && nPlayer == 0) { actBalloon.KusuIn(); @@ -1792,22 +1546,18 @@ namespace TJAPlayer3 this.actChara.b風船連打中[i] = true; } */ - } - } - else - { - this.b連打中[nPlayer] = true; - this.actChara.b風船連打中[nPlayer] = true; - } + } + } else { + this.b連打中[nPlayer] = true; + this.actChara.b風船連打中[nPlayer] = true; + } - if (bAutoPlay || rollEffectHit) - { + if (bAutoPlay || rollEffectHit) { - int rollCount = pChip.nRollCount; - int balloon = pChip.nBalloon; - if (IsKusudama) - { - /* + int rollCount = pChip.nRollCount; + int balloon = pChip.nBalloon; + if (IsKusudama) { + /* var ts = pChip.db発声時刻ms; var km = TJAPlayer3.DTX.kusudaMAP; @@ -1817,575 +1567,483 @@ namespace TJAPlayer3 balloon = km[ts].nBalloon; } */ - rollCount = nCurrentKusudamaRollCount; - balloon = nCurrentKusudamaCount; - - } + rollCount = nCurrentKusudamaRollCount; + balloon = nCurrentKusudamaCount; - if (balloon != 0 && this.bPAUSE == false) - { - int rollSpeed = bAutoPlay ? balloon : puchichara.effect.Autoroll; + } - int balloonDuration = bAutoPlay ? (pChip.nノーツ終了時刻ms - pChip.n発声時刻ms) : 1000; + if (balloon != 0 && this.bPAUSE == false) { + int rollSpeed = bAutoPlay ? balloon : puchichara.effect.Autoroll; - if ((SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed) > - (pChip.n発声時刻ms + (balloonDuration / (double)rollSpeed) * rollCount)) - { - if (this.nHand[nPlayer] == 0) - this.nHand[nPlayer]++; - else - this.nHand[nPlayer] = 0; + int balloonDuration = bAutoPlay ? (pChip.nノーツ終了時刻ms - pChip.n発声時刻ms) : 1000; - TJAPlayer3.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Red); - TJAPlayer3.stage演奏ドラム画面.actMtaiko.tMtaikoEvent(pChip.nチャンネル番号, this.nHand[nPlayer], nPlayer); + if ((SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed) > + (pChip.n発声時刻ms + (balloonDuration / (double)rollSpeed) * rollCount)) { + if (this.nHand[nPlayer] == 0) + this.nHand[nPlayer]++; + else + this.nHand[nPlayer] = 0; - this.tBalloonProcess(pChip, (SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed), nPlayer); - } - } - } - if (!bAutoPlay && !rollEffectHit) - { - if (!IsKusudama || nCurrentKusudamaCount > 0) - { - this.tBalloonProcess(pChip, (SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed), nPlayer); - } - } - break; - #endregion - } - else if (NotesManager.IsRollEnd(pChip)) - { - if (pChip.nノーツ終了時刻ms <= (SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed)) - { - if (NotesManager.IsKusudama(pChip)) - { - for(int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - chip現在処理中の連打チップ[i].bHit = true; - this.b連打中[i] = false; - } - } - else - { - this.b連打中[nPlayer] = false; - } - - - // this.actChara.b風船連打中[nPlayer] = false; + TJAPlayer3.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Red); + TJAPlayer3.stage演奏ドラム画面.actMtaiko.tMtaikoEvent(pChip.nチャンネル番号, this.nHand[nPlayer], nPlayer); - 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 - TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.Start(0x11, eJudgeResult, true, nPlayer); - TJAPlayer3.stage演奏ドラム画面.actChipFireD.Start(0x11, eJudgeResult, nPlayer); - this.CChartScore[nPlayer].nADLIB++; - this.CSectionScore[nPlayer].nADLIB++; - this.CBranchScore[nPlayer].nADLIB++; - if (TJAPlayer3.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; - TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.Start(0x11, eJudgeResult, true, nPlayer); - TJAPlayer3.stage演奏ドラム画面.actChipFireD.Start(0x11, ENoteJudge.Mine, nPlayer); - TJAPlayer3.Skin.soundBomb?.tPlay(); - actGauge.MineDamage(nPlayer); - this.CChartScore[nPlayer].nMine++; - this.CSectionScore[nPlayer].nMine++; - this.CBranchScore[nPlayer].nMine++; - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - this.nMine[actDan.NowShowingNumber]++; - } - break; - } - else - { - if (eJudgeResult != ENoteJudge.Miss) - { - pChip.bShow = false; - } - } + this.tBalloonProcess(pChip, (SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed), nPlayer); + } + } + } + if (!bAutoPlay && !rollEffectHit) { + if (!IsKusudama || nCurrentKusudamaCount > 0) { + this.tBalloonProcess(pChip, (SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed), nPlayer); + } + } + break; + #endregion + } else if (NotesManager.IsRollEnd(pChip)) { + if (pChip.nノーツ終了時刻ms <= (SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed)) { + if (NotesManager.IsKusudama(pChip)) { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + chip現在処理中の連打チップ[i].bHit = true; + this.b連打中[i] = false; + } + } else { + this.b連打中[nPlayer] = false; + } - if (eJudgeResult != ENoteJudge.Auto && eJudgeResult != ENoteJudge.Miss) - { - this.actJudgeString.Start(nPlayer, (bAutoPlay && !TJAPlayer3.ConfigIni.bAIBattleMode) ? ENoteJudge.Auto : eJudgeResult); - TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.Start(pChip.nチャンネル番号, eJudgeResult, true, nPlayer); - TJAPlayer3.stage演奏ドラム画面.actChipFireD.Start(pChip.nチャンネル番号, eJudgeResult, nPlayer); - } + // 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 + TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.Start(0x11, eJudgeResult, true, nPlayer); + TJAPlayer3.stage演奏ドラム画面.actChipFireD.Start(0x11, eJudgeResult, nPlayer); + this.CChartScore[nPlayer].nADLIB++; + this.CSectionScore[nPlayer].nADLIB++; + this.CBranchScore[nPlayer].nADLIB++; + if (TJAPlayer3.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; + TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.Start(0x11, eJudgeResult, true, nPlayer); + TJAPlayer3.stage演奏ドラム画面.actChipFireD.Start(0x11, ENoteJudge.Mine, nPlayer); + TJAPlayer3.Skin.soundBomb?.tPlay(); + actGauge.MineDamage(nPlayer); + this.CChartScore[nPlayer].nMine++; + this.CSectionScore[nPlayer].nMine++; + this.CBranchScore[nPlayer].nMine++; + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + this.nMine[actDan.NowShowingNumber]++; + } + break; + } else { + if (eJudgeResult != ENoteJudge.Miss) { + pChip.bShow = false; + } + } + + if (eJudgeResult != ENoteJudge.Auto && eJudgeResult != ENoteJudge.Miss) { + + this.actJudgeString.Start(nPlayer, (bAutoPlay && !TJAPlayer3.ConfigIni.bAIBattleMode) ? ENoteJudge.Auto : eJudgeResult); + TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.Start(pChip.nチャンネル番号, eJudgeResult, true, nPlayer); + TJAPlayer3.stage演奏ドラム画面.actChipFireD.Start(pChip.nチャンネル番号, eJudgeResult, nPlayer); + } + + } break; } - if ((pChip.e楽器パート != EInstrumentPad.UNKNOWN)) - { - if (NotesManager.IsMissableNote(pChip)) - { - actGauge.Damage(screenmode, pChip.e楽器パート, eJudgeResult, nPlayer); - } - } - - - - - - - var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(nPlayer)].data.Character]; - bool cleared = HGaugeMethods.UNSAFE_FastNormaCheck(nPlayer); - - if (eJudgeResult != ENoteJudge.Poor && eJudgeResult != ENoteJudge.Miss) - { - double dbUnit = (((60.0 / (TJAPlayer3.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(TJAPlayer3.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(TJAPlayer3.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; - TJAPlayer3.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(TJAPlayer3.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(TJAPlayer3.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(TJAPlayer3.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 (TJAPlayer3.Skin.Characters_ClearOut_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) - { - this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.ClearOut, true); - } - TJAPlayer3.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 < TJAPlayer3.ConfigIni.nPlayerCount; p++) - { - if (!isDeniedPlaying[p]) - { - allDeniedPlaying = false; - break; - } - } - if (allDeniedPlaying) TJAPlayer3.DTX.t全チップの再生停止(); // Stop playing song - - // Stop timer : Pauses the whole game (to remove once is denied playing will work) - //CSound管理.rc演奏用タイマ.t一時停止(); - } - break; - } - } - cInvisibleChip.ShowChipTemporally( pChip.e楽器パート ); + if ((pChip.e楽器パート != EInstrumentPad.UNKNOWN)) { + if (NotesManager.IsMissableNote(pChip)) { + actGauge.Damage(screenmode, pChip.e楽器パート, eJudgeResult, nPlayer); + } } - void returnChara() - { - int Character = this.actChara.iCurrentCharacter[nPlayer]; - double dbUnit = (((60.0 / (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer])))); - dbUnit = (((60.0 / pChip.dbBPM))); - if (TJAPlayer3.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楽器パート ) - { + + + var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(nPlayer)].data.Character]; + bool cleared = HGaugeMethods.UNSAFE_FastNormaCheck(nPlayer); + + if (eJudgeResult != ENoteJudge.Poor && eJudgeResult != ENoteJudge.Miss) { + double dbUnit = (((60.0 / (TJAPlayer3.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 (TJAPlayer3.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 (TJAPlayer3.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; + TJAPlayer3.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 (TJAPlayer3.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 (TJAPlayer3.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 (TJAPlayer3.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 (TJAPlayer3.Skin.Characters_ClearOut_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { + this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.ClearOut, true); + } + TJAPlayer3.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 < TJAPlayer3.ConfigIni.nPlayerCount; p++) { + if (!isDeniedPlaying[p]) { + allDeniedPlaying = false; + break; + } + } + if (allDeniedPlaying) TJAPlayer3.DTX.t全チップの再生停止(); // Stop playing song + + // 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 / (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer])))); + dbUnit = (((60.0 / pChip.dbBPM))); + + if (TJAPlayer3.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; + case EInstrumentPad.TAIKO: + if (!bAutoPlay) { + if (NotesManager.IsGenericRoll(pChip)) + break; - switch ( eJudgeResult ) - { - case ENoteJudge.Perfect: - { - if (NotesManager.IsADLIB(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; + 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 (nPlayer == 0) this.nヒット数_Auto含まない.Drums.Perfect++; + this.actCombo.n現在のコンボ数[nPlayer]++; - if (TJAPlayer3.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; - } + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + this.n良[actDan.NowShowingNumber]++; + this.tIncreaseComboDan(actDan.NowShowingNumber); + } - AIRegisterInput(nPlayer, 1); - - TJAPlayer3.stage演奏ドラム画面.actMtaiko.BackSymbolEvent(nPlayer); - - - if (this.bIsMiss[nPlayer]) - { - returnChara(); - } - - this.bIsMiss[nPlayer] = false; - } - break; - case ENoteJudge.Great: - case ENoteJudge.Good: - { - 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 (TJAPlayer3.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; - } + if (this.actCombo.ctコンボ加算[nPlayer].IsUnEnded) { + this.actCombo.ctコンボ加算[nPlayer].CurrentValue = 1; + } else { + this.actCombo.ctコンボ加算[nPlayer].CurrentValue = 0; + } - AIRegisterInput(nPlayer, 0.5f); + AIRegisterInput(nPlayer, 1); - TJAPlayer3.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; - - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - CFloorManagement.damage(); - - if (!bBombHit) - { - if (TJAPlayer3.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 (TJAPlayer3.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; - - if (TJAPlayer3.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); - - TJAPlayer3.stage演奏ドラム画面.actMtaiko.BackSymbolEvent(nPlayer); - - if (this.bIsMiss[nPlayer]) - { - returnChara(); - } - - this.bIsMiss[nPlayer] = false; - } - } - break; - - case ENoteJudge.Great: - case ENoteJudge.Good: - { - if (!NotesManager.IsGenericRoll(pChip)) - { - if (TJAPlayer3.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; - } + TJAPlayer3.stage演奏ドラム画面.actMtaiko.BackSymbolEvent(nPlayer); - AIRegisterInput(nPlayer, 0.5f); + if (this.bIsMiss[nPlayer]) { + returnChara(); + } - TJAPlayer3.stage演奏ドラム画面.actMtaiko.BackSymbolEvent(nPlayer); + this.bIsMiss[nPlayer] = false; + } + break; + case ENoteJudge.Great: + case ENoteJudge.Good: { + this.CBranchScore[nPlayer].nGood++; + this.CChartScore[nPlayer].nGood++; + this.CSectionScore[nPlayer].nGood++; + this.Chara_MissCount[nPlayer] = 0; - if (this.bIsMiss[nPlayer]) - { - returnChara(); - } + if (nPlayer == 0) this.nヒット数_Auto含まない.Drums.Great++; + this.actCombo.n現在のコンボ数[nPlayer]++; - this.bIsMiss[nPlayer] = false; - } - } - break; + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + this.n可[actDan.NowShowingNumber]++; + this.tIncreaseComboDan(actDan.NowShowingNumber); + } - default: - { - if(!NotesManager.IsGenericRoll(pChip)) - { - if (!NotesManager.IsMissableNote(pChip) && !bBombHit) - break; - - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - CFloorManagement.damage(); - - if (!bBombHit) - { - if (TJAPlayer3.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 (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - this.nCombo[actDan.NowShowingNumber] = 0; - this.actComboVoice.tReset(nPlayer); - - AIRegisterInput(nPlayer, 0f); + if (this.actCombo.ctコンボ加算[nPlayer].IsUnEnded) { + this.actCombo.ctコンボ加算[nPlayer].CurrentValue = 1; + } else { + this.actCombo.ctコンボ加算[nPlayer].CurrentValue = 0; + } - this.bIsMiss[nPlayer] = true; - } - } + AIRegisterInput(nPlayer, 0.5f); + + TJAPlayer3.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; + + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) + CFloorManagement.damage(); + + if (!bBombHit) { + if (TJAPlayer3.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 (TJAPlayer3.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; + + if (TJAPlayer3.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); + + TJAPlayer3.stage演奏ドラム画面.actMtaiko.BackSymbolEvent(nPlayer); + + if (this.bIsMiss[nPlayer]) { + returnChara(); + } + + this.bIsMiss[nPlayer] = false; + } + } + break; + + case ENoteJudge.Great: + case ENoteJudge.Good: { + if (!NotesManager.IsGenericRoll(pChip)) { + if (TJAPlayer3.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); + + TJAPlayer3.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 (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) + CFloorManagement.damage(); + + if (!bBombHit) { + if (TJAPlayer3.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 (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + this.nCombo[actDan.NowShowingNumber] = 0; + this.actComboVoice.tReset(nPlayer); + + AIRegisterInput(nPlayer, 0f); + + + this.bIsMiss[nPlayer] = true; + } + } break; } } - actDan.Update(); - - #region[ Combo voice ] + actDan.Update(); - 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 ); - } + #region[ Combo voice ] - // Combo voice here - this.actComboVoice.t再生( this.actCombo.n現在のコンボ数[ nPlayer ], nPlayer ); + 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); + } - double dbUnit = (((60.0 / (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer])))); - dbUnit = (((60.0 / pChip.dbBPM))); + // Combo voice here + this.actComboVoice.t再生(this.actCombo.n現在のコンボ数[nPlayer], nPlayer); - //CDTXMania.act文字コンソール.tPrint(620, 80, C文字コンソール.Eフォント種別.白, "BPM: " + dbUnit.ToString()); + double dbUnit = (((60.0 / (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer])))); + dbUnit = (((60.0 / pChip.dbBPM))); - 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, TJAPlayer3.Timer); - } - } + //CDTXMania.act文字コンソール.tPrint(620, 80, C文字コンソール.Eフォント種別.白, "BPM: " + dbUnit.ToString()); - 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 (TJAPlayer3.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 (TJAPlayer3.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); - } - } - } + 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, TJAPlayer3.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 (TJAPlayer3.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 (TJAPlayer3.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 + } + + this.t紙吹雪_開始(); + } + #endregion break; @@ -2394,208 +2052,152 @@ namespace TJAPlayer3 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 = TJAPlayer3.DTX.nScoreInit[0, TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[nPlayer]]; - long nDiff = TJAPlayer3.DTX.nScoreDiff[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[nPlayer]]; - long nAddScore = 0; + 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 = TJAPlayer3.DTX.nScoreInit[0, TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[nPlayer]]; + long nDiff = TJAPlayer3.DTX.nScoreDiff[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[nPlayer]]; + long nAddScore = 0; - if ( TJAPlayer3.ConfigIni.ShinuchiMode ) //2016.07.04 kairera0467 真打モード。 - { - nAddScore = (long)nAddScoreNiji[nPlayer]; + if (TJAPlayer3.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; - } + if (eJudgeResult == ENoteJudge.Great || eJudgeResult == ENoteJudge.Good) { + nAddScore = (long)nAddScoreNiji[nPlayer] / 20; + nAddScore = (long)nAddScore * 10; + } - this.actScore.Add((long)nAddScore, nPlayer ); - } - else if( TJAPlayer3.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 ]; - } + this.actScore.Add((long)nAddScore, nPlayer); + } else if (TJAPlayer3.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 (eJudgeResult == ENoteJudge.Great || eJudgeResult == ENoteJudge.Good) { + nAddScore = nAddScore / 2; + } - if (pChip.bGOGOTIME) //2018.03.11 kairera0467 チップに埋め込んだフラグから読み取る - { - nAddScore = (int)(nAddScore * 1.2f); - } + 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, TJAPlayer3.Timer); - } + //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, TJAPlayer3.Timer); + } - nAddScore = (int)(nAddScore / 10); - nAddScore = (int)(nAddScore * 10); + nAddScore = (int)(nAddScore / 10); + nAddScore = (int)(nAddScore * 10); - //大音符のボーナス - if (pChip.nチャンネル番号 == 0x13 || pChip.nチャンネル番号 == 0x14 || pChip.nチャンネル番号 == 0x1A || pChip.nチャンネル番号 == 0x1B) - { - nAddScore = nAddScore * 2; - } + //大音符のボーナス + if (pChip.nチャンネル番号 == 0x13 || pChip.nチャンネル番号 == 0x14 || pChip.nチャンネル番号 == 0x1A || pChip.nチャンネル番号 == 0x1B) { + nAddScore = nAddScore * 2; + } - this.actScore.Add(nAddScore, nPlayer); - } - else if (TJAPlayer3.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]; - } + this.actScore.Add(nAddScore, nPlayer); + } else if (TJAPlayer3.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 (eJudgeResult == ENoteJudge.Great || eJudgeResult == ENoteJudge.Good) { + nAddScore = nAddScore / 2; + } - if (pChip.bGOGOTIME) //2018.03.11 kairera0467 チップに埋め込んだフラグから読み取る - nAddScore = (int)(nAddScore * 1.2f); + if (pChip.bGOGOTIME) //2018.03.11 kairera0467 チップに埋め込んだフラグから読み取る + nAddScore = (int)(nAddScore * 1.2f); - nAddScore = (int)(nAddScore / 10.0); - nAddScore = (int)(nAddScore * 10); + 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; - } + //大音符のボーナス + 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; - } - } + 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.bGOGOTIME) //2018.03.11 kairera0467 チップに埋め込んだフラグから読み取る + nAddScore = (int)(nAddScore * 1.2f); - //大音符のボーナス - if (pChip.nチャンネル番号 == 0x13 || pChip.nチャンネル番号 == 0x25) - { - nAddScore = nAddScore * 2; - } + //大音符のボーナス + if (pChip.nチャンネル番号 == 0x13 || pChip.nチャンネル番号 == 0x25) { + nAddScore = nAddScore * 2; + } - this.actScore.Add(nAddScore, nPlayer); - } + this.actScore.Add(nAddScore, nPlayer); + } - //キーを押したときにスコア情報 + nAddScoreを置き換える様に - int __score = (int)(this.actScore.GetScore(nPlayer) + nAddScore); - this.CBranchScore[nPlayer].nScore = __score; - this.CChartScore[nPlayer].nScore = __score; - this.CSectionScore[nPlayer].nScore = __score; - } + //キーを押したときにスコア情報 + nAddScoreを置き換える様に + int __score = (int)(this.actScore.GetScore(nPlayer) + nAddScore); + this.CBranchScore[nPlayer].nScore = __score; + this.CChartScore[nPlayer].nScore = __score; + this.CSectionScore[nPlayer].nScore = __score; + } - return ENoteJudge.Auto; - } + return ENoteJudge.Auto; + } - 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 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 ); + protected void tチップのヒット処理_BadならびにTight時のMiss(CDTX.ECourse eCourse, EInstrumentPad part, int nLane, EInstrumentPad screenmode) { + cInvisibleChip.StartSemiInvisible(part); + cInvisibleChip.ShowChipTemporally(part); - //ChipのCourseをベースにゲージの伸びを調節 - actGauge.Damage(screenmode, part, ENoteJudge.Miss, 0); - switch ( part ) - { + //ChipのCourseをベースにゲージの伸びを調節 + actGauge.Damage(screenmode, part, ENoteJudge.Miss, 0); + switch (part) { case EInstrumentPad.DRUMS: case EInstrumentPad.GUITAR: case EInstrumentPad.BASS: @@ -2603,147 +2205,127 @@ namespace TJAPlayer3 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; + 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 ) - { + 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個もチップがない場合は + int count = listChip[nPlayer].Count; + if (count <= 0) // 演奏データとして1個もチップがない場合は { //sw2.Stop(); return null; } int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = this.n現在のトップChip; - if ( this.n現在のトップChip >= count ) // その時点で演奏すべきチップが既に全部無くなっていたら + if (this.n現在のトップChip >= count) // その時点で演奏すべきチップが既に全部無くなっていたら { - nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = count - 1; + 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( nIndex_NearestChip_Future < 0 ) - continue; - + // while ( nIndex_NearestChip_Future < count ) // 未来方向への検索 + for (; nIndex_NearestChip_Future < count; nIndex_NearestChip_Future++) { - CDTX.CChip chip = listChip[ nPlayer ][ nIndex_NearestChip_Future ]; - if ( !chip.bHit && chip.b可視 ) - { - if (NotesManager.IsHittableNote(chip)) - { - if ( chip.n発声時刻ms > nTime ) - { + 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; + 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; - break; - } - } - } -// 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; + 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 ) ) ) + // 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 ) ) // 検索対象が過去未来どちらにも見つからなかった場合 + 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 ) // 検索対象が未来方向には見つからなかった(しかし過去方向には見つかった)場合 + 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 ) ); + 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 ) ); + 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]; + 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 ]; - } - } + //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 ) ) // チップは見つかったが、検索範囲時間外だった場合 + nTimeDiff = Math.Abs((int)(nTime - nearestChip.n発声時刻ms)); + int n検索範囲時間ms = 0; + if ((n検索範囲時間ms > 0) && (nTimeDiff > n検索範囲時間ms)) // チップは見つかったが、検索範囲時間外だった場合 { //sw2.Stop(); return null; @@ -2752,14 +2334,14 @@ namespace TJAPlayer3 return nearestChip; } - /// - /// 最も判定枠に近いドンカツを返します。 - /// - /// 判定時の時間。 - /// プレイヤー。 - /// ドンかどうか。 - /// 最も判定枠に近いノーツ。 - /* + /// + /// 最も判定枠に近いドンカツを返します。 + /// + /// 判定時の時間。 + /// プレイヤー。 + /// ドンかどうか。 + /// 最も判定枠に近いノーツ。 + /* protected CDTX.CChip GetChipOfNearest(long nowTime, int player, bool don) { var nearestChip = new CDTX.CChip(); @@ -2896,142 +2478,122 @@ namespace TJAPlayer3 */ - protected CDTX.CChip r指定時刻に一番近い未ヒットChip( long nTime, int nChannel, int nInputAdjustTime, int n検索範囲時間ms, int nPlayer ) - { + 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 ); + //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個もチップがない場合は + if (this.n現在のトップChip == -1) // 演奏データとして1個もチップがない場合は { //sw2.Stop(); return null; } - int count = listChip[ nPlayer ].Count; + int count = listChip[nPlayer].Count; int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = this.n現在のトップChip; - if ( this.n現在のトップChip >= count ) // その時点で演奏すべきチップが既に全部無くなっていたら + if (this.n現在のトップChip >= count) // その時点で演奏すべきチップが既に全部無くなっていたら { - nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = count - 1; + 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; - } + // 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 ( ( ( 0x50 == nChannel ) ) ) - { - if( chip.nチャンネル番号 == nChannel ) - { - if ( chip.n発声時刻ms > nTime ) - { - break; - } - nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; - } + //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++; + // nIndex_NearestChip_Future++; } - // Channel is always 50, following code is unreachable + // 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) && + // 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 >= 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 == 0xDF)) && (chip.nチャンネル番号 == nChannel)) ) || ( - // ( ( ( nChannel >= 0xDE ) && ( nChannel <= 0xDF ) ) && ( chip.nチャンネル番号 == nChannel ) ) - ( ( ( nChannel == 0x50 ) ) && ( chip.nチャンネル番号 == nChannel ) ) + // ( ( ( nChannel >= 0xDE ) && ( nChannel <= 0xDF ) ) && ( chip.nチャンネル番号 == nChannel ) ) + (((nChannel == 0x50)) && (chip.nチャンネル番号 == nChannel)) ) ) - ) - { - break; - } -// nIndex_NearestChip_Past--; + ) { + break; + } + // nIndex_NearestChip_Past--; } - if ( ( nIndex_NearestChip_Future >= count ) && ( nIndex_NearestChip_Past < 0 ) ) // 検索対象が過去未来どちらにも見つからなかった場合 + 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 ) // 検索対象が未来方向には見つからなかった(しかし過去方向には見つかった)場合 + 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 ) ); + 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 ) + if (nChannel == 0xDF) //0xDFの場合は過去方向への検索をしない { - nearestChip = listChip[ nPlayer ][ nIndex_NearestChip_Future ]; -// nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); + return listChip[nPlayer][nIndex_NearestChip_Future]; } - else - { - nearestChip = listChip[ nPlayer ][ nIndex_NearestChip_Past ]; -// nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); + + 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 ) ) // チップは見つかったが、検索範囲時間外だった場合 + nTimeDiff = Math.Abs((int)(nTime - nearestChip.n発声時刻ms)); + if ((n検索範囲時間ms > 0) && (nTimeDiff > n検索範囲時間ms)) // チップは見つかったが、検索範囲時間外だった場合 { //sw2.Stop(); return null; @@ -3039,739 +2601,639 @@ namespace TJAPlayer3 //sw2.Stop(); return nearestChip; } - public bool r検索範囲内にチップがあるか調べる( long nTime, int nInputAdjustTime, int n検索範囲時間ms, int nPlayer ) - { + 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; + 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. + 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)) - { + keyboard.KeyPressing((int)SlimDXKeys.Key.RightControl)) { offset = plusminus; - } - else - { + } else { offset = plusminus * 10; } - var newInputAdjustTimeMs = (TJAPlayer3.ConfigIni.nInputAdjustTimeMs + offset).Clamp(-99, 99); + var newInputAdjustTimeMs = (TJAPlayer3.ConfigIni.nInputAdjustTimeMs + offset).Clamp(-99, 99); TJAPlayer3.ConfigIni.nInputAdjustTimeMs = newInputAdjustTimeMs; } protected abstract void t入力処理_ドラム(); protected abstract void ドラムスクロール速度アップ(); protected abstract void ドラムスクロール速度ダウン(); - protected void tキー入力() - { - // Inputs + protected void tキー入力() { + // Inputs IInputDevice keyboard = TJAPlayer3.InputManager.Keyboard; - if ( ( !this.bPAUSE && ( base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED ) ) && ( base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED_FadeOut ) ) - { + 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) - TJAPlayer3.DTX.t各自動再生音チップの再生時刻を変更する( ( keyboard.KeyPressing( (int)SlimDXKeys.Key.LeftControl ) || keyboard.KeyPressing( (int)SlimDXKeys.Key.RightControl ) ) ? 1 : 10 ); + // 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) + TJAPlayer3.DTX.t各自動再生音チップの再生時刻を変更する((keyboard.KeyPressing((int)SlimDXKeys.Key.LeftControl) || keyboard.KeyPressing((int)SlimDXKeys.Key.RightControl)) ? 1 : 10); + TJAPlayer3.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) + TJAPlayer3.DTX.t各自動再生音チップの再生時刻を変更する((keyboard.KeyPressing((int)SlimDXKeys.Key.LeftControl) || keyboard.KeyPressing((int)SlimDXKeys.Key.RightControl)) ? -1 : -10); TJAPlayer3.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) - TJAPlayer3.DTX.t各自動再生音チップの再生時刻を変更する( ( keyboard.KeyPressing( (int)SlimDXKeys.Key.LeftControl ) || keyboard.KeyPressing( (int)SlimDXKeys.Key.RightControl ) ) ? -1 : -10 ); - TJAPlayer3.DTX.tWave再生位置自動補正(); - } - // Tokkun only - else if (TJAPlayer3.ConfigIni.bTokkunMode && - TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingIncreaseScrollSpeed) ) - { // UpArrow(scrollspeed up) + // Tokkun only + else if (TJAPlayer3.ConfigIni.bTokkunMode && + TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingIncreaseScrollSpeed)) { // UpArrow(scrollspeed up) ドラムスクロール速度アップ(); - } - else if (TJAPlayer3.ConfigIni.bTokkunMode && - TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingDecreaseScrollSpeed) ) - { // DownArrow (scrollspeed down) + } else if (TJAPlayer3.ConfigIni.bTokkunMode && + TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingDecreaseScrollSpeed)) { // DownArrow (scrollspeed down) ドラムスクロール速度ダウン(); } - // Debug mode - else if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.DisplayDebug) ) - { // del (debug info) + // Debug mode + else if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.DisplayDebug)) { // del (debug info) TJAPlayer3.ConfigIni.bDisplayDebugInfo = !TJAPlayer3.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 ) || TJAPlayer3.Pad.bPressedGB( EPad.FT ) ) && !this.actPauseMenu.bIsActivePopupMenu ) - { // escape (exit) - if (!this.actPauseMenu.bIsActivePopupMenu && this.bPAUSE == false) - { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - SoundManager.PlayTimer.Pause(); - TJAPlayer3.Timer.Pause(); - TJAPlayer3.DTX.t全チップの再生一時停止(); - this.actAVI.tPauseControl(); + /* + 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.bPAUSE = true; - this.actPauseMenu.tActivatePopupMenu(0); - } - // this.t演奏中止(); - } - else if ( TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingBranchNormal) && - (TJAPlayer3.ConfigIni.bTokkunMode || TJAPlayer3.ConfigIni.bAutoPlay[0]) ) - { - if (!TJAPlayer3.DTX.bHasBranch[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]]) return; + else if ((base.ePhaseID == CStage.EPhase.Common_NORMAL) && (keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || TJAPlayer3.Pad.bPressedGB(EPad.FT)) && !this.actPauseMenu.bIsActivePopupMenu) { // escape (exit) + if (!this.actPauseMenu.bIsActivePopupMenu && this.bPAUSE == false) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); - //listBRANCHを廃止したため強制分岐の開始値を - //rc演奏用タイマ.n現在時刻msから引っ張ることに + SoundManager.PlayTimer.Pause(); + TJAPlayer3.Timer.Pause(); + TJAPlayer3.DTX.t全チップの再生一時停止(); + this.actAVI.tPauseControl(); - //判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26 + this.bPAUSE = true; + this.actPauseMenu.tActivatePopupMenu(0); + } + // this.t演奏中止(); + } else if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingBranchNormal) && + (TJAPlayer3.ConfigIni.bTokkunMode || TJAPlayer3.ConfigIni.bAutoPlay[0])) { + if (!TJAPlayer3.DTX.bHasBranch[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]]) return; - var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.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); + //listBRANCHを廃止したため強制分岐の開始値を + //rc演奏用タイマ.n現在時刻msから引っ張ることに - this.t分岐処理(CDTX.ECourse.eNormal, 0, (SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed) + db一小節後); + //判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26 - TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.t分岐レイヤー_コース変化(TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.stBranch[0].nAfter, CDTX.ECourse.eNormal, 0); - TJAPlayer3.stage演奏ドラム画面.actMtaiko.tBranchEvent(TJAPlayer3.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; - + var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.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.b強制的に分岐させた[0] = true; - } - else if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingBranchExpert) && - (TJAPlayer3.ConfigIni.bTokkunMode || TJAPlayer3.ConfigIni.bAutoPlay[0])) // #24243 2011.1.16 yyagi UI for InputAdjustTime in playing screen. - { - if (!TJAPlayer3.DTX.bHasBranch[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]]) return; + this.t分岐処理(CDTX.ECourse.eNormal, 0, (SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed) + db一小節後); - //listBRANCHを廃止したため強制分岐の開始値を - //rc演奏用タイマ.n現在時刻msから引っ張ることに + TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.t分岐レイヤー_コース変化(TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.stBranch[0].nAfter, CDTX.ECourse.eNormal, 0); + TJAPlayer3.stage演奏ドラム画面.actMtaiko.tBranchEvent(TJAPlayer3.stage演奏ドラム画面.actMtaiko.After[0], CDTX.ECourse.eNormal, 0); - //判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26 - var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.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.eExpert, 0, (SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed) + db一小節後); - - TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.t分岐レイヤー_コース変化(TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.stBranch[0].nAfter, CDTX.ECourse.eExpert, 0); - TJAPlayer3.stage演奏ドラム画面.actMtaiko.tBranchEvent(TJAPlayer3.stage演奏ドラム画面.actMtaiko.After[0], CDTX.ECourse.eExpert, 0); + this.n現在のコース[0] = CDTX.ECourse.eNormal; + this.n次回のコース[0] = CDTX.ECourse.eNormal; + this.nレーン用表示コース[0] = CDTX.ECourse.eNormal; - this.n現在のコース[0] = CDTX.ECourse.eExpert; - this.n次回のコース[0] = CDTX.ECourse.eExpert; - this.nレーン用表示コース[0] = CDTX.ECourse.eExpert; + this.b強制的に分岐させた[0] = true; + } else if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingBranchExpert) && + (TJAPlayer3.ConfigIni.bTokkunMode || TJAPlayer3.ConfigIni.bAutoPlay[0])) // #24243 2011.1.16 yyagi UI for InputAdjustTime in playing screen. + { + if (!TJAPlayer3.DTX.bHasBranch[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]]) return; - this.b強制的に分岐させた[0] = true; - } - else if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingBranchMaster) && - (TJAPlayer3.ConfigIni.bTokkunMode || TJAPlayer3.ConfigIni.bAutoPlay[0])) // #24243 2011.1.16 yyagi UI for InputAdjustTime in playing screen. - { - if (!TJAPlayer3.DTX.bHasBranch[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]]) return; + //listBRANCHを廃止したため強制分岐の開始値を + //rc演奏用タイマ.n現在時刻msから引っ張ることに - //listBRANCHを廃止したため強制分岐の開始値を - //rc演奏用タイマ.n現在時刻msから引っ張ることに + //判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26 + var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed), 0); - //判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26 - var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.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); - 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.eExpert, 0, (SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed) + db一小節後); - this.t分岐処理(CDTX.ECourse.eMaster, 0, (SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed) + db一小節後); + TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.t分岐レイヤー_コース変化(TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.stBranch[0].nAfter, CDTX.ECourse.eExpert, 0); + TJAPlayer3.stage演奏ドラム画面.actMtaiko.tBranchEvent(TJAPlayer3.stage演奏ドラム画面.actMtaiko.After[0], CDTX.ECourse.eExpert, 0); - TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.t分岐レイヤー_コース変化(TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.stBranch[0].nAfter, CDTX.ECourse.eMaster, 0); - TJAPlayer3.stage演奏ドラム画面.actMtaiko.tBranchEvent(TJAPlayer3.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.n現在のコース[0] = CDTX.ECourse.eExpert; + this.n次回のコース[0] = CDTX.ECourse.eExpert; + this.nレーン用表示コース[0] = CDTX.ECourse.eExpert; - this.b強制的に分岐させた[0] = true; - } + this.b強制的に分岐させた[0] = true; + } else if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingBranchMaster) && + (TJAPlayer3.ConfigIni.bTokkunMode || TJAPlayer3.ConfigIni.bAutoPlay[0])) // #24243 2011.1.16 yyagi UI for InputAdjustTime in playing screen. + { + if (!TJAPlayer3.DTX.bHasBranch[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]]) return; - if ( TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.DisplayHits) ) - { - if( TJAPlayer3.ConfigIni.bJudgeCountDisplay == false ) - TJAPlayer3.ConfigIni.bJudgeCountDisplay = true; - else - TJAPlayer3.ConfigIni.bJudgeCountDisplay = false; - } + //listBRANCHを廃止したため強制分岐の開始値を + //rc演奏用タイマ.n現在時刻msから引っ張ることに - if ( TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.CycleVideoDisplayMode) ) - { - switch( TJAPlayer3.ConfigIni.eClipDispType ) - { - case EClipDispType.OFF: - TJAPlayer3.ConfigIni.eClipDispType = EClipDispType.背景のみ; - break; - case EClipDispType.背景のみ: - TJAPlayer3.ConfigIni.eClipDispType = EClipDispType.ウィンドウのみ; - break; - case EClipDispType.ウィンドウのみ: - TJAPlayer3.ConfigIni.eClipDispType = EClipDispType.両方; - break; - case EClipDispType.両方: - TJAPlayer3.ConfigIni.eClipDispType = EClipDispType.OFF; - break; - } + //判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26 + var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.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 * TJAPlayer3.ConfigIni.SongPlaybackSpeed) + db一小節後); + + TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.t分岐レイヤー_コース変化(TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.stBranch[0].nAfter, CDTX.ECourse.eMaster, 0); + TJAPlayer3.stage演奏ドラム画面.actMtaiko.tBranchEvent(TJAPlayer3.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 (TJAPlayer3.ConfigIni.bTokkunMode && TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingToggleAuto) ) - { - TJAPlayer3.ConfigIni.bAutoPlay[0] = !TJAPlayer3.ConfigIni.bAutoPlay[0]; - } - } + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.DisplayHits)) { + if (TJAPlayer3.ConfigIni.bJudgeCountDisplay == false) + TJAPlayer3.ConfigIni.bJudgeCountDisplay = true; + else + TJAPlayer3.ConfigIni.bJudgeCountDisplay = false; + } + + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.CycleVideoDisplayMode)) { + switch (TJAPlayer3.ConfigIni.eClipDispType) { + case EClipDispType.OFF: + TJAPlayer3.ConfigIni.eClipDispType = EClipDispType.背景のみ; + break; + case EClipDispType.背景のみ: + TJAPlayer3.ConfigIni.eClipDispType = EClipDispType.ウィンドウのみ; + break; + case EClipDispType.ウィンドウのみ: + TJAPlayer3.ConfigIni.eClipDispType = EClipDispType.両方; + break; + case EClipDispType.両方: + TJAPlayer3.ConfigIni.eClipDispType = EClipDispType.OFF; + break; + } + } + + if (TJAPlayer3.ConfigIni.bTokkunMode && TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingToggleAuto)) { + TJAPlayer3.ConfigIni.bAutoPlay[0] = !TJAPlayer3.ConfigIni.bAutoPlay[0]; + } + } #if DEBUG - if (keyboard.KeyPressed((int)SlimDXKeys.Key.F7)) - { - TJAPlayer3.ConfigIni.bAutoPlay[1] = !TJAPlayer3.ConfigIni.bAutoPlay[1]; - } + if (keyboard.KeyPressed((int)SlimDXKeys.Key.F7)) { + TJAPlayer3.ConfigIni.bAutoPlay[1] = !TJAPlayer3.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) + 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 (keyboard.KeyPressed((int)SlimDXKeys.Key.DownArrow)) { // DownArrow (scrollspeed down) ドラムスクロール速度ダウン(); - } - else if ( TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.DisplayDebug) ) - { // del (debug info) + } else if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.DisplayDebug)) { // del (debug info) TJAPlayer3.ConfigIni.bDisplayDebugInfo = !TJAPlayer3.ConfigIni.bDisplayDebugInfo; + } else if ((keyboard.KeyPressed((int)SlimDXKeys.Key.Escape))) { // escape (exit) + SoundManager.PlayTimer.Resume(); + TJAPlayer3.Timer.Resume(); + this.t演奏中止(); } - else if ((keyboard.KeyPressed((int)SlimDXKeys.Key.Escape))) - { // escape (exit) - SoundManager.PlayTimer.Resume(); - TJAPlayer3.Timer.Resume(); - this.t演奏中止(); - } - } + } -#region [ Minus & Equals Sound Group Level ] - KeyboardSoundGroupLevelControlHandler.Handle( - keyboard, TJAPlayer3.SoundGroupLevelController, TJAPlayer3.Skin, false); -#endregion + #region [ Minus & Equals Sound Group Level ] + KeyboardSoundGroupLevelControlHandler.Handle( + keyboard, TJAPlayer3.SoundGroupLevelController, TJAPlayer3.Skin, false); + #endregion } - protected void t入力メソッド記憶( EInstrumentPad part ) - { - if ( TJAPlayer3.Pad.st検知したデバイス.Keyboard ) - { + protected void t入力メソッド記憶(EInstrumentPad part) { + if (TJAPlayer3.Pad.st検知したデバイス.Keyboard) { this.b演奏にキーボードを使った = true; } - if ( TJAPlayer3.Pad.st検知したデバイス.Joypad ) - { + if (TJAPlayer3.Pad.st検知したデバイス.Joypad) { this.b演奏にジョイパッドを使った = true; } - if ( TJAPlayer3.Pad.st検知したデバイス.MIDIIN ) - { + if (TJAPlayer3.Pad.st検知したデバイス.MIDIIN) { this.b演奏にMIDI入力を使った = true; } - if ( TJAPlayer3.Pad.st検知したデバイス.Mouse ) - { + if (TJAPlayer3.Pad.st検知したデバイス.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 ) ) && ( !TJAPlayer3.ConfigIni.bストイックモード && TJAPlayer3.ConfigIni.bEnableAVI ) ) - { - this.actAVI.t進行描画( x, y ); + protected void t進行描画_AVI(int x, int y) { + if (((base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED) && (base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED_FadeOut)) && (!TJAPlayer3.ConfigIni.bストイックモード && TJAPlayer3.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 (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - { - this.eフェードアウト完了時の戻り値 = E演奏画面の戻り値.ステージクリア; - } - else - { - this.eフェードアウト完了時の戻り値 = E演奏画面の戻り値.ステージ失敗; - - } - base.ePhaseID = CStage.EPhase.Game_STAGE_FAILED_FadeOut; - this.actFO.tフェードアウト開始(); - } + 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 (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + this.eフェードアウト完了時の戻り値 = E演奏画面の戻り値.ステージクリア; + } else { + this.eフェードアウト完了時の戻り値 = E演奏画面の戻り値.ステージ失敗; + + } + 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進行描画_パネル文字列(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パネル文字列の設定() - { - // When performing calibration, inform the player that - // calibration is taking place, rather than - // displaying the panel title or song title as usual. + protected void tパネル文字列の設定() { + // When performing calibration, inform the player that + // calibration is taking place, rather than + // displaying the panel title or song title as usual. - var panelString = TJAPlayer3.IsPerformingCalibration - ? "Calibrating input..." - : string.IsNullOrEmpty( TJAPlayer3.DTX.PANEL ) ? TJAPlayer3.DTX.TITLE.GetString(""): TJAPlayer3.DTX.PANEL; + var panelString = TJAPlayer3.IsPerformingCalibration + ? "Calibrating input..." + : string.IsNullOrEmpty(TJAPlayer3.DTX.PANEL) ? TJAPlayer3.DTX.TITLE.GetString("") : TJAPlayer3.DTX.PANEL; - this.actPanel.SetPanelString( panelString, - TJAPlayer3.stageSongSelect.rChoosenSong.str本当のジャンル, - TJAPlayer3.Skin.Game_StageText, - songNode: TJAPlayer3.stageSongSelect.rChoosenSong); + this.actPanel.SetPanelString(panelString, + TJAPlayer3.stageSongSelect.rChoosenSong.str本当のジャンル, + TJAPlayer3.Skin.Game_StageText, + songNode: TJAPlayer3.stageSongSelect.rChoosenSong); } - protected void t進行描画_ゲージ() - { - if ( ( ( ( base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED ) && ( base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED_FadeOut ) ) ) ) - { + 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進行描画_コンボ() - { + protected void t進行描画_コンボ() { this.actCombo.Draw(); } - protected void t進行描画_スコア() - { + 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 ) ) - { + 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 ) ) - { + if ((this.n現在のトップChip == -1) || (this.n現在のトップChip >= listChip[nPlayer].Count)) { + return true; + } + if (IsDanFailed) { return true; } - if (IsDanFailed) - { - return true; - } - var n現在時刻ms = (long)(SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed); + var n現在時刻ms = (long)(SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - NowAIBattleSectionTime = (int)n現在時刻ms - NowAIBattleSection.StartTime; + NowAIBattleSectionTime = (int)n現在時刻ms - NowAIBattleSection.StartTime; - if ( this.r指定時刻に一番近い未ヒットChip( (long)n現在時刻ms, 0x50, 0, 1000000, nPlayer ) == null ) - { - this.actChara.b演奏中[nPlayer] = false; - } + 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] + 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; + 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 = TJAPlayer3.ConfigIni; CDTX dTX = TJAPlayer3.DTX; - bool bAutoPlay = configIni.bAutoPlay[nPlayer]; - switch ( nPlayer ) //2017.08.11 kairera0467 - { - case 1: - bAutoPlay = configIni.bAutoPlay[nPlayer] || TJAPlayer3.ConfigIni.bAIBattleMode; - dTX = TJAPlayer3.DTX_2P; - break; - case 2: - dTX = TJAPlayer3.DTX_3P; - break; - case 3: - dTX = TJAPlayer3.DTX_4P; - break; - case 4: - dTX = TJAPlayer3.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-- ) + bool bAutoPlay = configIni.bAutoPlay[nPlayer]; + switch (nPlayer) //2017.08.11 kairera0467 { - 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 ); + case 1: + bAutoPlay = configIni.bAutoPlay[nPlayer] || TJAPlayer3.ConfigIni.bAIBattleMode; + dTX = TJAPlayer3.DTX_2P; + break; + case 2: + dTX = TJAPlayer3.DTX_3P; + break; + case 3: + dTX = TJAPlayer3.DTX_4P; + break; + case 4: + dTX = TJAPlayer3.DTX_5P; + break; + default: + break; + } - 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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.Skin.Game_Notes_Interval, play_bpm_time, pChip.eScrollMode, true); - } - + if (this.n分岐した回数[nPlayer] == 0) { + this.bUseBranch[nPlayer] = dTX.bHIDDENBRANCH ? false : dTX.bチップがある.Branch; + } - if ( pChip.eScrollMode == EScrollMode.BMSCROLL || pChip.eScrollMode == EScrollMode.HBSCROLL ) - { - /* + //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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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楽器パート; + 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); - } - } - } - } + 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); + } + } + } + } - if( pChip.nバーからの距離dot[ instIndex ] < -150 ) - { - if( !(NotesManager.IsMissableNote(pChip))) - { - //2016.02.11 kairera0467 - //太鼓の単音符の場合は座標による判定を行わない。 - //(ここで判定をすると高スピードでスクロールしている時に見逃し不可判定が行われない。) - pChip.bHit = 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 ) - { + var cChipCurrentlyInProcess = chip現在処理中の連打チップ[nPlayer]; + if (cChipCurrentlyInProcess != null && !cChipCurrentlyInProcess.bHit) { - //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 ) ) ) - { - 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) + //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 ) ) ) { - pChip.bHit = true; - if ( configIni.bBGM音を発声する ) - { - dTX.tチップの再生(pChip, SoundManager.PlayTimer.PrevResetTime + (long)(pChip.n発声時刻ms / TJAPlayer3.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); + 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.bBGM音を発声する) { + dTX.tチップの再生(pChip, SoundManager.PlayTimer.PrevResetTime + (long)(pChip.n発声時刻ms / TJAPlayer3.ConfigIni.SongPlaybackSpeed)); + } } break; -#endregion + #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); -#region [ 11-1f & 101-: Taiko ] + //} + } + 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 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 - //描画順序を変えるため、メイン処理だけをこちらに残して描画処理は分離。 + 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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - this.b連打中[i] = true; - this.actChara.b風船連打中[i] = true; - } - } + //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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + this.b連打中[i] = true; + this.actChara.b風船連打中[i] = true; + } + } - nCurrentKusudamaRollCount = 0; - nCurrentKusudamaCount += pChip.nBalloon; - for(int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - n風船残り[i] = nCurrentKusudamaCount; - } - pChip.bProcessed = true; - } - } - if (pChip.n描画優先度 <= 0) - this.t進行描画_チップ_Taiko連打(configIni, ref dTX, ref pChip, nPlayer); - } + nCurrentKusudamaRollCount = 0; + nCurrentKusudamaCount += pChip.nBalloon; + for (int i = 0; i < TJAPlayer3.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(); - TJAPlayer3.Skin.soundKusudamaMiss.tPlay(); - for (int p = 0; p < TJAPlayer3.ConfigIni.nPlayerCount; p++) - { - { - this.actChara.ChangeAnime(p, CActImplCharacter.Anime.Kusudama_Miss, true); + 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(); + TJAPlayer3.Skin.soundKusudamaMiss.tPlay(); + for (int p = 0; p < TJAPlayer3.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, - TJAPlayer3.Skin.Characters_Balloon_Delay[actChara.iCurrentCharacter[p]] - 1, - 1, - TJAPlayer3.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[p] != null) actChara.CharaAction_Balloon_Delay[p] = new CCounter(0, + TJAPlayer3.Skin.Characters_Balloon_Delay[actChara.iCurrentCharacter[p]] - 1, + 1, + TJAPlayer3.Timer); + } + } + nCurrentKusudamaRollCount = 0; + nCurrentKusudamaCount = 0; + } - if (actChara.CharaAction_Balloon_Delay[nPlayer] != null) actChara.CharaAction_Balloon_Delay[nPlayer] = new CCounter(0, - TJAPlayer3.Skin.Characters_Balloon_Delay[actChara.iCurrentCharacter[nPlayer]] - 1, - 1, - TJAPlayer3.Timer); - } - } - } - if (chip現在処理中の連打チップ[nPlayer].nBalloon > chip現在処理中の連打チップ[nPlayer].nRollCount) - { - if (pChip.n連打音符State == 13) - { - this.actJudgeString.Start(nPlayer, ENoteJudge.Mine); - TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.Start(0x11, ENoteJudge.Bad, true, nPlayer); - TJAPlayer3.stage演奏ドラム画面.actChipFireD.Start(0x11, ENoteJudge.Mine, nPlayer); - actGauge.MineDamage(nPlayer); - TJAPlayer3.Skin.soundBomb?.tPlay(); - this.CChartScore[nPlayer].nMine++; - this.CSectionScore[nPlayer].nMine++; - this.CBranchScore[nPlayer].nMine++; - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - CFloorManagement.damage(); - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - this.nMine[actDan.NowShowingNumber]++; - this.actCombo.n現在のコンボ数[nPlayer] = 0; - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - this.nCombo[actDan.NowShowingNumber] = 0; - this.actComboVoice.tReset(nPlayer); - this.bIsMiss[nPlayer] = true; - } - } - chip現在処理中の連打チップ[nPlayer] = null; + } + } else { + if (chip現在処理中の連打チップ[nPlayer].nBalloon > chip現在処理中の連打チップ[nPlayer].nRollCount + && chip現在処理中の連打チップ[nPlayer].nRollCount > 0) { + { + this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.Balloon_Miss, true); - } - this.eRollState = E連打State.none; - } - if( pChip.n描画優先度 <= 0 ) - this.t進行描画_チップ_Taiko連打(configIni, ref dTX, ref pChip, nPlayer); - } + if (actChara.CharaAction_Balloon_Delay[nPlayer] != null) actChara.CharaAction_Balloon_Delay[nPlayer] = new CCounter(0, + TJAPlayer3.Skin.Characters_Balloon_Delay[actChara.iCurrentCharacter[nPlayer]] - 1, + 1, + TJAPlayer3.Timer); + } + } + } + if (chip現在処理中の連打チップ[nPlayer].nBalloon > chip現在処理中の連打チップ[nPlayer].nRollCount) { + if (pChip.n連打音符State == 13) { + this.actJudgeString.Start(nPlayer, ENoteJudge.Mine); + TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.Start(0x11, ENoteJudge.Bad, true, nPlayer); + TJAPlayer3.stage演奏ドラム画面.actChipFireD.Start(0x11, ENoteJudge.Mine, nPlayer); + actGauge.MineDamage(nPlayer); + TJAPlayer3.Skin.soundBomb?.tPlay(); + this.CChartScore[nPlayer].nMine++; + this.CSectionScore[nPlayer].nMine++; + this.CBranchScore[nPlayer].nMine++; + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) + CFloorManagement.damage(); + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + this.nMine[actDan.NowShowingNumber]++; + this.actCombo.n現在のコンボ数[nPlayer] = 0; + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + this.nCombo[actDan.NowShowingNumber] = 0; + this.actComboVoice.tReset(nPlayer); + this.bIsMiss[nPlayer] = true; + } + } + chip現在処理中の連打チップ[nPlayer] = null; - break; + } + this.eRollState = E連打State.none; + } + if (pChip.n描画優先度 <= 0) + this.t進行描画_チップ_Taiko連打(configIni, ref dTX, ref pChip, nPlayer); + } - case 0x1e: - break; + break; + + case 0x1e: + break; case 0x1a: - case 0x1b: - case 0x1f: - { - this.t進行描画_チップ_Taiko( configIni, ref dTX, ref pChip, nPlayer ); - } + case 0x1b: + case 0x1f: { + this.t進行描画_チップ_Taiko(configIni, ref dTX, ref pChip, nPlayer); + } break; -#endregion -#region [ 20-2F: EmptySlot ] + #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 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: + case 0x29: + case 0x2a: + case 0x2b: + case 0x2c: + case 0x2d: + case 0x2e: + case 0x2f: break; -#endregion -#region [ 31-3f: EmptySlot ] + #endregion + #region [ 31-3f: EmptySlot ] case 0x31: case 0x32: case 0x33: @@ -3782,114 +3244,99 @@ namespace TJAPlayer3 case 0x38: case 0x39: case 0x3a: - case 0x3b: - case 0x3c: - case 0x3d: - case 0x3e: - case 0x3f: + case 0x3b: + case 0x3c: + case 0x3d: + case 0x3e: + case 0x3f: break; -#endregion + #endregion -#region [ 50: 小節線 ] - case 0x50: // 小節線 + #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(); + 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++; + NowAIBattleSectionCount++; - if (AIBattleSections.Count > NowAIBattleSectionCount) - { - NowAIBattleSectionTime = 0; - } - NowAIBattleSectionTime = (int)n現在時刻ms - NowAIBattleSection.StartTime; - } + 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 ); + 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) - { + #endregion + #region [ 51: 拍線 ] + case 0x51: // 拍線 + if (!pChip.bHit && time < 0) { pChip.bHit = true; } break; -#endregion -#region [ 54: 動画再生 ] - case 0x54: // 動画再生 - if ( !pChip.bHit && time < 0) - { + #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 (TJAPlayer3.ConfigIni.bEnableAVI && vd != null) - { - this.actAVI.Start(pChip.nチャンネル番号, vd); - this.actAVI.Seek(pChip.VideoStartTimeMs); - } - } + if (configIni.bEnableAVI) { + if ((dTX.listVD.TryGetValue(pChip.n整数値_内部番号, out CVideoDecoder vd))) { + ShowVideo = true; + if (TJAPlayer3.ConfigIni.bEnableAVI && vd != null) { + this.actAVI.Start(pChip.nチャンネル番号, vd); + this.actAVI.Seek(pChip.VideoStartTimeMs); + } + } } } break; case 0x55: - if ( !pChip.bHit && time < 0) - { + if (!pChip.bHit && time < 0) { pChip.bHit = true; - if ( configIni.bEnableAVI ) - { - if ((dTX.listVD.TryGetValue(pChip.n整数値_内部番号, out CVideoDecoder vd))) - { - ShowVideo = false; - if (TJAPlayer3.ConfigIni.bEnableAVI && vd != null) - { - this.actAVI.Stop(); - } - } + if (configIni.bEnableAVI) { + if ((dTX.listVD.TryGetValue(pChip.n整数値_内部番号, out CVideoDecoder vd))) { + ShowVideo = false; + if (TJAPlayer3.ConfigIni.bEnableAVI && vd != null) { + this.actAVI.Stop(); + } + } - if ((dTX.listVD.TryGetValue(1, out CVideoDecoder vd2))) - { - ShowVideo = true; - if (TJAPlayer3.ConfigIni.bEnableAVI && vd != null) - { - this.actAVI.Start(pChip.nチャンネル番号, vd); - } - } + if ((dTX.listVD.TryGetValue(1, out CVideoDecoder vd2))) { + ShowVideo = true; + if (TJAPlayer3.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: + #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: @@ -3912,84 +3359,74 @@ namespace TJAPlayer3 case 0x81: case 0x82: case 0x83: - case 0x84: - case 0x85: - case 0x86: - case 0x87: - case 0x88: - case 0x89: - break; -#endregion + case 0x84: + case 0x85: + case 0x86: + case 0x87: + case 0x88: + case 0x89: + break; + #endregion -#region[ 90-9A: EmptySlot ] - case 0x90: + #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: + case 0x93: + case 0x94: + case 0x95: + case 0x96: + case 0x97: + case 0x98: + case 0x99: + case 0x9A: break; -#endregion + #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 = TJAPlayer3.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) - { + #region[ 9B-9F: 太鼓 ] + case 0x9B: + // 段位認定モードの幕アニメーション + 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; - } + 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 = TJAPlayer3.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 / TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer] * 1 / 4, SoundManager.PlayTimer); - } + for (int i = 0; i < 5; i++) { + ctChipAnime[i] = new CCounter(0, 3, 60.0 / TJAPlayer3.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 - /* + 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演奏用タイマ ); @@ -3997,1668 +3434,1440 @@ namespace TJAPlayer3 this.actDancer.ctモブ = new CCounter( 1.0, 16.0, (int)((60.0 / bpm / 16.0 ) * 1000 ), CSound管理.rc演奏用タイマ ); //#endif */ - } + } - } - break; + } + break; - case 0x9D: //SCROLL - if ( !pChip.bHit && time < 0) - { + 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; + //this.actPlayInfo.dbBPM = ( dTX.listBPM[ pChip.n整数値_内部番号 ].dbBPM値 * ( ( (double) configIni.n演奏速度 ) / 20.0 ) );// + dTX.BASEBPM; //} } - break; + 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 (TJAPlayer3.Skin.Characters_GoGoStart_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) - { - if (!HGaugeMethods.UNSAFE_IsRainbow(nPlayer) && (!HGaugeMethods.UNSAFE_FastNormaCheck(nPlayer) || TJAPlayer3.Skin.Characters_GoGoStart_Clear_Ptn[Character] == 0)) - { - // 魂ゲージMAXではない - // ゴーゴースタート_ノーマル - this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.GoGoStart, true); - //this.actChara.キャラクター_アクション_10コンボ(); - } - } - if (TJAPlayer3.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 (TJAPlayer3.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); - } - } - - } - TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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; - TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.Timer); - } - break; - case 0xb9: //reset camera - if (!pChip.bHit && time < 0) - { - pChip.bHit = true; - - TJAPlayer3.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, TJAPlayer3.Timer); - this.ctCamHMove = new CCounter(0, 0, 1, TJAPlayer3.Timer); - - this.ctCamZoom = new CCounter(0, 0, 1, TJAPlayer3.Timer); - this.ctCamRotation = new CCounter(0, 0, 1, TJAPlayer3.Timer); - - this.ctCamVScale = new CCounter(0, 0, 1, TJAPlayer3.Timer); - this.ctCamHScale = new CCounter(0, 0, 1, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.Timer)); - } - break; - case 0xd1: //change texture - if (!pChip.bHit && time < 0) - { - pChip.bHit = true; - - if (TJAPlayer3.Tx.trackedTextures.ContainsKey(pChip.strTargetTxName)) - { - TJAPlayer3.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 (TJAPlayer3.Tx.trackedTextures.ContainsKey(pChip.strTargetTxName)) - { - TJAPlayer3.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) - { - TJAPlayer3.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 ); + case 0x9E: //ゴーゴータイム + if (!pChip.bHit && time < 0) { pChip.bHit = true; - if ( listWAV.TryGetValue( pChip.n整数値_内部番号, out CDTX.CWAV wc ) ) // 参照が遠いので後日最適化する + this.bIsGOGOTIME[nPlayer] = true; + //double dbUnit = (((60.0 / (CDTXMania.stage演奏ドラム画面.actPlayInfo.dbBPM)))); + double dbUnit = (((60.0 / pChip.dbBPM))); + + int Character = this.actChara.iCurrentCharacter[nPlayer]; + { - for ( int i = 0; i < nPolyphonicSounds; i++ ) - { - if ( wc.rSound[ i ] != null ) - { + if (TJAPlayer3.Skin.Characters_GoGoStart_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { + if (!HGaugeMethods.UNSAFE_IsRainbow(nPlayer) && (!HGaugeMethods.UNSAFE_FastNormaCheck(nPlayer) || TJAPlayer3.Skin.Characters_GoGoStart_Clear_Ptn[Character] == 0)) { + // 魂ゲージMAXではない + // ゴーゴースタート_ノーマル + this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.GoGoStart, true); + //this.actChara.キャラクター_アクション_10コンボ(); + } + } + if (TJAPlayer3.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 (TJAPlayer3.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); + } + } + + } + TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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; + TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.Timer); + } + break; + case 0xb9: //reset camera + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + + TJAPlayer3.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, TJAPlayer3.Timer); + this.ctCamHMove = new CCounter(0, 0, 1, TJAPlayer3.Timer); + + this.ctCamZoom = new CCounter(0, 0, 1, TJAPlayer3.Timer); + this.ctCamRotation = new CCounter(0, 0, 1, TJAPlayer3.Timer); + + this.ctCamVScale = new CCounter(0, 0, 1, TJAPlayer3.Timer); + this.ctCamHScale = new CCounter(0, 0, 1, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.Timer)); + } + break; + case 0xd1: //change texture + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + + if (TJAPlayer3.Tx.trackedTextures.ContainsKey(pChip.strTargetTxName)) { + TJAPlayer3.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 (TJAPlayer3.Tx.trackedTextures.ContainsKey(pChip.strTargetTxName)) { + TJAPlayer3.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) { + TJAPlayer3.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演奏終了後も再生が続くチップである ); + AddMixer(wc.rSound[i], pChip.b演奏終了後も再生が続くチップである); } } } } break; -#endregion -#region [ db: ミキサーからチップ音削除 ] + #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 ); + 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 ) ) // 参照が遠いので後日最適化する + if (listWAV.TryGetValue(pChip.n整数値_内部番号, out CDTX.CWAV wc)) // 参照が遠いので後日最適化する { - for ( int i = 0; i < nPolyphonicSounds; i++ ) - { - if ( wc.rSound[ i ] != null ) - { + 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 ] ); // (ミキサー解除のタイミングが遅延する場合の対応が面倒なので。) - } // そこで、代わりにフラグをチェックしてミキサー削除ロジックへの遷移をカットする。 + if (!wc.rSound[i].b演奏終了後も再生が続くチップである) // #32248 2013.10.16 yyagi + { // DTX終了後も再生が続くチップの0xDB登録をなくすことはできず。 + RemoveMixer(wc.rSound[i]); // (ミキサー解除のタイミングが遅延する場合の対応が面倒なので。) + } // そこで、代わりにフラグをチェックしてミキサー削除ロジックへの遷移をカットする。 } - } + } } } break; -#endregion + #endregion -#region[ dc-df:太鼓(特殊命令) ] - case 0xDC: //DELAY - if ( !pChip.bHit && time < 0) - { + #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; + //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); - - TJAPlayer3.stage演奏ドラム画面.bUseBranch[nPlayer] = true; - - CBRANCHSCORE branchScore; - if (TJAPlayer3.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分岐の種類); - - TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.t分岐レイヤー_コース変化(TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.stBranch[nPlayer].nAfter, this.n次回のコース[nPlayer], nPlayer); - TJAPlayer3.stage演奏ドラム画面.actMtaiko.tBranchEvent(TJAPlayer3.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) - { - TJAPlayer3.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 (TJAPlayer3.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 (TJAPlayer3.ConfigIni.bTokkunMode) - { - foreach (CDTX.CWAV cwav in TJAPlayer3.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) - { + break; + case 0xDD: //SECTION + if (!pChip.bHit && time < 0) { + // 分岐毎にリセットしていたのでSECTIONの命令が来たらリセットする。 + this.tBranchReset(nPlayer); pChip.bHit = true; } break; -#endregion - } - } + 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); + + TJAPlayer3.stage演奏ドラム画面.bUseBranch[nPlayer] = true; + + CBRANCHSCORE branchScore; + if (TJAPlayer3.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分岐の種類); + + TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.t分岐レイヤー_コース変化(TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.stBranch[nPlayer].nAfter, this.n次回のコース[nPlayer], nPlayer); + TJAPlayer3.stage演奏ドラム画面.actMtaiko.tBranchEvent(TJAPlayer3.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) { + TJAPlayer3.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 (TJAPlayer3.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 (TJAPlayer3.ConfigIni.bTokkunMode) { + foreach (CDTX.CWAV cwav in TJAPlayer3.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 + } + + } - #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); - TJAPlayer3.fCamYOffset = float.IsNaN(value) ? currentCamVMoveChip.fCamScrollStartY : value; + #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); + TJAPlayer3.fCamYOffset = float.IsNaN(value) ? currentCamVMoveChip.fCamScrollStartY : value; - if (ctCamVMove.IsEnded) - { - ctCamVMove = null; - TJAPlayer3.fCamYOffset = currentCamVMoveChip.fCamScrollEndY; - } - } + if (ctCamVMove.IsEnded) { + ctCamVMove = null; + TJAPlayer3.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); - TJAPlayer3.fCamXOffset = float.IsNaN(value) ? currentCamHMoveChip.fCamScrollStartX : value; + 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); + TJAPlayer3.fCamXOffset = float.IsNaN(value) ? currentCamHMoveChip.fCamScrollStartX : value; - if (ctCamHMove.IsEnded) - { - ctCamHMove = null; - TJAPlayer3.fCamXOffset = currentCamHMoveChip.fCamScrollEndX; - } - } + if (ctCamHMove.IsEnded) { + ctCamHMove = null; + TJAPlayer3.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); - TJAPlayer3.fCamZoomFactor = float.IsNaN(value) ? currentCamZoomChip.fCamZoomStart : value; + 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); + TJAPlayer3.fCamZoomFactor = float.IsNaN(value) ? currentCamZoomChip.fCamZoomStart : value; - if (ctCamZoom.IsEnded) - { - ctCamZoom = null; - TJAPlayer3.fCamZoomFactor = currentCamZoomChip.fCamZoomEnd; - } - } + if (ctCamZoom.IsEnded) { + ctCamZoom = null; + TJAPlayer3.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); - TJAPlayer3.fCamRotation = float.IsNaN(value) ? currentCamRotateChip.fCamRotationStart : value; + 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); + TJAPlayer3.fCamRotation = float.IsNaN(value) ? currentCamRotateChip.fCamRotationStart : value; - if (ctCamRotation.IsEnded) - { - ctCamRotation = null; - TJAPlayer3.fCamRotation = currentCamRotateChip.fCamRotationEnd; - } - } + if (ctCamRotation.IsEnded) { + ctCamRotation = null; + TJAPlayer3.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); - TJAPlayer3.fCamYScale = float.IsNaN(value) ? currentCamVScaleChip.fCamScaleStartY : value; + 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); + TJAPlayer3.fCamYScale = float.IsNaN(value) ? currentCamVScaleChip.fCamScaleStartY : value; - if (ctCamVScale.IsEnded) - { - ctCamVScale = null; - TJAPlayer3.fCamYScale = currentCamVScaleChip.fCamScaleEndY; - } - } + if (ctCamVScale.IsEnded) { + ctCamVScale = null; + TJAPlayer3.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); - TJAPlayer3.fCamXScale = float.IsNaN(value) ? currentCamHScaleChip.fCamScaleStartX : value; + 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); + TJAPlayer3.fCamXScale = float.IsNaN(value) ? currentCamHScaleChip.fCamScaleStartX : value; - if (ctCamHScale.IsEnded) - { - ctCamHScale = null; - TJAPlayer3.fCamXScale = currentCamHScaleChip.fCamScaleEndX; - } - } + if (ctCamHScale.IsEnded) { + ctCamHScale = null; + TJAPlayer3.fCamXScale = currentCamHScaleChip.fCamScaleEndX; + } + } - foreach (KeyValuePair pair in objHandlers) - { - CDTX.CChip chip = pair.Key; - CCounter counter = pair.Value; + foreach (KeyValuePair pair in objHandlers) { + CDTX.CChip chip = pair.Key; + CCounter counter = pair.Value; - if (counter != null) - { - counter.Tick(); + 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; - } + 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チャンネル番号 == 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 + 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; + 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 ) ) - { + 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 ) ) - { + if ((this.n現在のトップChip == -1) || (this.n現在のトップChip >= listChip[nPlayer].Count)) { return true; } CConfigIni configIni = TJAPlayer3.ConfigIni; CDTX dTX = TJAPlayer3.DTX; - bool bAutoPlay = configIni.bAutoPlay[nPlayer]; - switch ( nPlayer ) //2017.08.11 kairera0467 - { - case 1: - bAutoPlay = configIni.bAutoPlay[nPlayer] || TJAPlayer3.ConfigIni.bAIBattleMode; - dTX = TJAPlayer3.DTX_2P; - break; - case 2: - dTX = TJAPlayer3.DTX_3P; - break; - case 3: - dTX = TJAPlayer3.DTX_4P; - break; - case 4: - dTX = TJAPlayer3.DTX_5P; - break; - default: - break; - } - - var n現在時刻ms = (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - - //for ( int nCurrentTopChip = this.n現在のトップChip; nCurrentTopChip < dTX.listChip.Count; nCurrentTopChip++ ) - for ( int nCurrentTopChip = dTX.listChip.Count - 1; nCurrentTopChip > 0; nCurrentTopChip-- ) + bool bAutoPlay = configIni.bAutoPlay[nPlayer]; + switch (nPlayer) //2017.08.11 kairera0467 { - CDTX.CChip pChip = dTX.listChip[ nCurrentTopChip ]; + case 1: + bAutoPlay = configIni.bAutoPlay[nPlayer] || TJAPlayer3.ConfigIni.bAIBattleMode; + dTX = TJAPlayer3.DTX_2P; + break; + case 2: + dTX = TJAPlayer3.DTX_3P; + break; + case 3: + dTX = TJAPlayer3.DTX_4P; + break; + case 4: + dTX = TJAPlayer3.DTX_5P; + break; + default: + break; + } - 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 ); - } - } - } - } + var n現在時刻ms = (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - 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 - } + //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); + } + } + } + } + + 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 + } + + } 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; + 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[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; - } - } - } + 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 + 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; + if (this.b強制的に分岐させた[nPlayer]) return; - var e種類 = pChip.e分岐の種類; + var e種類 = pChip.e分岐の種類; - //分岐の仕方が同じなので一緒にしていいと思う。 - var b分岐種類が一致 = e種類 == CDTX.E分岐種類.e精度分岐 || e種類 == CDTX.E分岐種類.eスコア分岐; + //分岐の仕方が同じなので一緒にしていいと思う。 + var b分岐種類が一致 = e種類 == CDTX.E分岐種類.e精度分岐 || e種類 == CDTX.E分岐種類.eスコア分岐; - double dbRate = 0; + 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 (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; - } + 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; - } - 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; + } + } + } 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精度分岐) - { + public void t分岐処理(CDTX.ECourse n分岐先, int nPlayer, double n発声位置, CDTX.E分岐種類 e分岐種類 = CDTX.E分岐種類.e精度分岐) { - CDTX dTX = TJAPlayer3.DTX; - switch ( nPlayer ) - { - case 1: - dTX = TJAPlayer3.DTX_2P; - break; - case 2: - dTX = TJAPlayer3.DTX_3P; - break; - case 3: - dTX = TJAPlayer3.DTX_4P; - break; - case 4: - dTX = TJAPlayer3.DTX_5P; - break; - default: - break; - } + CDTX dTX = TJAPlayer3.DTX; + switch (nPlayer) { + case 1: + dTX = TJAPlayer3.DTX_2P; + break; + case 2: + dTX = TJAPlayer3.DTX_3P; + break; + case 3: + dTX = TJAPlayer3.DTX_4P; + break; + case 4: + dTX = TJAPlayer3.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]; + 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; + 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 (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) { + 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].bShow = true; - dTX.listChip[A].b可視 = true; - } - } - } - } - } - } - } + 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].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)TJAPlayer3.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)TJAPlayer3.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; - 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; - } + 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; + } + } + 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 (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; + } + } - return bpm_time; - } + return bpm_time; + } - public void t再読込() - { + public void t再読込() { TJAPlayer3.DTX.t全チップの再生停止とミキサーからの削除(); this.eフェードアウト完了時の戻り値 = E演奏画面の戻り値.再読込_再演奏; base.ePhaseID = CStage.EPhase.Game_Reload; this.bPAUSE = false; } - public void t演奏やりなおし() - { - _AIBattleState = 0; - _AIBattleStateBatch = new Queue[] { new Queue(), new Queue() }; + public void t演奏やりなおし() { + _AIBattleState = 0; + _AIBattleStateBatch = new Queue[] { new Queue(), new Queue() }; - NowAIBattleSectionCount = 0; - NowAIBattleSectionTime = 0; + NowAIBattleSectionCount = 0; + NowAIBattleSectionTime = 0; - CFloorManagement.reload(); + CFloorManagement.reload(); - for (int i = 0; i < AIBattleSections.Count; i++) - { - AIBattleSections[i].End = AIBattleSection.EndType.None; - AIBattleSections[i].IsAnimated = false; - } + for (int i = 0; i < AIBattleSections.Count; i++) { + AIBattleSections[i].End = AIBattleSection.EndType.None; + AIBattleSections[i].IsAnimated = false; + } - TJAPlayer3.fCamXOffset = 0; + TJAPlayer3.fCamXOffset = 0; - TJAPlayer3.fCamYOffset = 0; + TJAPlayer3.fCamYOffset = 0; - TJAPlayer3.fCamZoomFactor = 1.0f; - TJAPlayer3.fCamRotation = 0; + TJAPlayer3.fCamZoomFactor = 1.0f; + TJAPlayer3.fCamRotation = 0; - TJAPlayer3.fCamXScale = 1.0f; - TJAPlayer3.fCamYScale = 1.0f; + TJAPlayer3.fCamXScale = 1.0f; + TJAPlayer3.fCamYScale = 1.0f; - TJAPlayer3.borderColor = new Color4(1f, 0f, 0f, 0f); + TJAPlayer3.borderColor = new Color4(1f, 0f, 0f, 0f); - foreach (var chip in TJAPlayer3.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; - } + foreach (var chip in TJAPlayer3.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; + } - TJAPlayer3.DTX.t全チップの再生停止とミキサーからの削除(); - this.t数値の初期化( true, true ); - //this.actAVI.Stop(); - foreach(var vd in TJAPlayer3.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; - - TJAPlayer3.ConfigIni.nGameType[i] = eFirstGameType[i]; - bSplitLane[i] = false; - } - TJAPlayer3.stage演奏ドラム画面.Activate(); - for( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) - { - if (!bIsAlreadyCleared[i] && cleared[i]) - { - TJAPlayer3.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停止() - { TJAPlayer3.DTX.t全チップの再生停止とミキサーからの削除(); - foreach(var vd in TJAPlayer3.DTX.listVD) - { - vd.Value.Stop(); - } + this.t数値の初期化(true, true); + //this.actAVI.Stop(); + foreach (var vd in TJAPlayer3.DTX.listVD) { + vd.Value.Stop(); + } this.actAVI.Stop(); - this.actPanel.Stop(); // PANEL表示停止 - TJAPlayer3.Timer.Pause(); // 再生時刻カウンタ停止 + 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; - this.n現在のトップChip = TJAPlayer3.DTX.listChip.Count - 1; // 終端にシーク + TJAPlayer3.ConfigIni.nGameType[i] = eFirstGameType[i]; + bSplitLane[i] = false; + } + TJAPlayer3.stage演奏ドラム画面.Activate(); + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (!bIsAlreadyCleared[i] && cleared[i]) { + TJAPlayer3.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停止() { + TJAPlayer3.DTX.t全チップの再生停止とミキサーからの削除(); + foreach (var vd in TJAPlayer3.DTX.listVD) { + vd.Value.Stop(); + } + this.actAVI.Stop(); + this.actPanel.Stop(); // PANEL表示停止 + TJAPlayer3.Timer.Pause(); // 再生時刻カウンタ停止 + + this.n現在のトップChip = TJAPlayer3.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; + 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.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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - this.actGauge.Init(TJAPlayer3.ConfigIni.nRisky, i); - } - } - if( b演奏状態 ) - { - for( int i = 0; i < TJAPlayer3.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.actCombo.Activate(); + this.actScore.Activate(); + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + this.actGauge.Init(TJAPlayer3.ConfigIni.nRisky, i); + } + } + if (b演奏状態) { + for (int i = 0; i < TJAPlayer3.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(TJAPlayer3.DTX.nScoreInit[0, TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]], TJAPlayer3.DTX.nScoreDiff[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]]); - this.nHand = new int[]{ 0, 0, 0, 0, 0 }; - } + this.ReSetScore(TJAPlayer3.DTX.nScoreInit[0, TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]], TJAPlayer3.DTX.nScoreDiff[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]]); + this.nHand = new int[] { 0, 0, 0, 0, 0 }; + } - public void t演奏位置の変更( int nStartBar, int nPlayer ) - { + public void t演奏位置の変更(int nStartBar, int nPlayer) { // まず全サウンドオフにする TJAPlayer3.DTX.t全チップの再生停止(); this.actAVI.Stop(); - CDTX dTX = TJAPlayer3.DTX; - switch (nPlayer) - { - case 1: - dTX = TJAPlayer3.DTX_2P; - break; - case 2: - dTX = TJAPlayer3.DTX_3P; - break; - case 3: - dTX = TJAPlayer3.DTX_4P; - break; - case 4: - dTX = TJAPlayer3.DTX_5P; - break; - default: - break; - } + CDTX dTX = TJAPlayer3.DTX; + switch (nPlayer) { + case 1: + dTX = TJAPlayer3.DTX_2P; + break; + case 2: + dTX = TJAPlayer3.DTX_3P; + break; + case 3: + dTX = TJAPlayer3.DTX_4P; + break; + case 4: + dTX = TJAPlayer3.DTX_5P; + break; + default: + break; + } - if (dTX == null) return; //CDTXがnullの場合はプレイヤーが居ないのでその場で処理終了 + if (dTX == null) return; //CDTXがnullの場合はプレイヤーが居ないのでその場で処理終了 -#region [ 再生開始小節の変更 ] - //nStartBar++; // +1が必要 + #region [ 再生開始小節の変更 ] + //nStartBar++; // +1が必要 -#region [ 演奏済みフラグのついたChipをリセットする ] - for ( int i = 0; i < dTX.listChip.Count; i++ ) - { - //if(dTX.listChip[i].bHit) フラグが付いてなくてもすべてのチップをリセットする。(必要がある).2020.04.23.akasoko26 + #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 + 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 [ 処理を開始するチップの特定 ] + #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; - } - } + 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 (!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[TJAPlayer3.stage演奏ドラム画面.n現在のトップChip - 1].n発声時刻ms) + TJAPlayer3.stage演奏ドラム画面.n現在のトップChip--; } - else - { - while (this.n現在のトップChip != 0 && dTX.listChip[this.n現在のトップChip].n発声時刻ms == dTX.listChip[TJAPlayer3.stage演奏ドラム画面.n現在のトップChip - 1].n発声時刻ms) - TJAPlayer3.stage演奏ドラム画面.n現在のトップChip--; - } -#endregion -#region [ 演奏開始の発声時刻msを取得し、タイマに設定 ] - int nStartTime = (int)(dTX.listChip[this.n現在のトップChip].n発声時刻ms / TJAPlayer3.ConfigIni.SongPlaybackSpeed); + #endregion + #region [ 演奏開始の発声時刻msを取得し、タイマに設定 ] + int nStartTime = (int)(dTX.listChip[this.n現在のトップChip].n発声時刻ms / TJAPlayer3.ConfigIni.SongPlaybackSpeed); - SoundManager.PlayTimer.Reset(); // これでPAUSE解除されるので、次のPAUSEチェックは不要 - //if ( !this.bPAUSE ) - //{ - SoundManager.PlayTimer.Pause(); + SoundManager.PlayTimer.Reset(); // これでPAUSE解除されるので、次のPAUSEチェックは不要 + //if ( !this.bPAUSE ) + //{ + SoundManager.PlayTimer.Pause(); //} SoundManager.PlayTimer.NowTime = nStartTime; -#endregion + #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 ]; + #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 / TJAPlayer3.ConfigIni.SongPlaybackSpeed); + long n発声時刻ms = (long)(pChip.n発声時刻ms / TJAPlayer3.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 ((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 && TJAPlayer3.ConfigIni.bBGM音を発声する ) || ( !wc.bIsBGMSound ) ) - { - TJAPlayer3.DTX.tチップの再生(pChip, (long)(SoundManager.PlayTimer.PrevResetTime) + (long)(pChip.n発声時刻ms / TJAPlayer3.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 ] ); + if ((wc.bIsBGMSound && TJAPlayer3.ConfigIni.bBGM音を発声する) || (!wc.bIsBGMSound)) { + TJAPlayer3.DTX.tチップの再生(pChip, (long)(SoundManager.PlayTimer.PrevResetTime) + (long)(pChip.n発声時刻ms / TJAPlayer3.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 } } } } -#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していたサウンドを一斉に再生再開する(ただしタイマを止めているので、ここではまだ再生開始しない) ] + #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 (!(TJAPlayer3.ConfigIni.b演奏速度が一倍速であるとき以外音声を再生しない && TJAPlayer3.ConfigIni.nSongSpeed != 20)) - foreach (CSound cs in pausedCSound) - { - cs.tPlaySound(); - } -#endregion - pausedCSound.Clear(); -#region [ タイマを再開して、PAUSEから復帰する ] - SoundManager.PlayTimer.NowTime = nStartTime; - TJAPlayer3.Timer.Reset(); // これでPAUSE解除されるので、3行先の再開()は不要 - TJAPlayer3.Timer.NowTime = nStartTime; // Debug表示のTime: 表記を正しくするために必要 + if (!(TJAPlayer3.ConfigIni.b演奏速度が一倍速であるとき以外音声を再生しない && TJAPlayer3.ConfigIni.nSongSpeed != 20)) + foreach (CSound cs in pausedCSound) { + cs.tPlaySound(); + } + #endregion + pausedCSound.Clear(); + #region [ タイマを再開して、PAUSEから復帰する ] + SoundManager.PlayTimer.NowTime = nStartTime; + TJAPlayer3.Timer.Reset(); // これでPAUSE解除されるので、3行先の再開()は不要 + TJAPlayer3.Timer.NowTime = nStartTime; // Debug表示のTime: 表記を正しくするために必要 SoundManager.PlayTimer.Resume(); //CDTXMania.Timer.t再開(); - this.bPAUSE = false; // システムがPAUSE状態だったら、強制解除 + this.bPAUSE = false; // システムがPAUSE状態だったら、強制解除 this.actPanel.Start(); -#endregion -#endregion + #endregion + #endregion } - public void t演奏中止() - { - this.actFO.tフェードアウト開始(); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - this.eフェードアウト完了時の戻り値 = E演奏画面の戻り値.演奏中断; - } + public void t演奏中止() { + this.actFO.tフェードアウト開始(); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + this.eフェードアウト完了時の戻り値 = E演奏画面の戻り値.演奏中断; + } /// /// DTXV用の設定をする。(全AUTOなど) /// 元の設定のバックアップなどはしないので、あとでConfig.iniを上書き保存しないこと。 /// - protected void tDTXV用の設定() - { + 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); + 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 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 ) - { + protected bool t進行描画_フェードイン_アウト() { + switch (base.ePhaseID) { case CStage.EPhase.Common_FADEIN: - if ( this.actFI.Draw() != 0) - { + 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 ) - { + if (this.actFO.Draw() != 0) { return true; } break; case CStage.EPhase.Game_STAGE_CLEAR_FadeOut: - if ( this.actFOClear.Draw() == 0 ) - { + if (this.actFOClear.Draw() == 0) { break; } return true; - + } return false; } protected abstract void t進行描画_演奏情報(); - protected void t進行描画_演奏情報(int x, int y) - { - if ( !TJAPlayer3.ConfigIni.b演奏情報を表示しない ) - { - this.actPlayInfo.t進行描画( x, y ); + protected void t進行描画_演奏情報(int x, int y) { + if (!TJAPlayer3.ConfigIni.b演奏情報を表示しない) { + this.actPlayInfo.t進行描画(x, y); } } - protected void t進行描画_背景() - { - if ( this.tx背景 != null ) - { - this.tx背景.t2D描画( 0, 0 ); + protected void t進行描画_背景() { + if (this.tx背景 != null) { + this.tx背景.t2D描画(0, 0); } } - protected void t進行描画_判定文字列1_通常位置指定の場合() - { - if ( ( (E判定文字表示位置) TJAPlayer3.ConfigIni.判定文字表示位置.Drums ) != E判定文字表示位置.コンボ下 ) // 判定ライン上または横 - { - this.actJudgeString.Draw(); - } + protected void t進行描画_判定文字列1_通常位置指定の場合() { + if (((E判定文字表示位置)TJAPlayer3.ConfigIni.判定文字表示位置.Drums) != E判定文字表示位置.コンボ下) // 判定ライン上または横 + { + this.actJudgeString.Draw(); + } } - protected void t進行描画_譜面スクロール速度() - { + protected void t進行描画_譜面スクロール速度() { this.act譜面スクロール速度.Draw(); } - protected abstract void t紙吹雪_開始(); + protected abstract void t紙吹雪_開始(); protected abstract void t背景テクスチャの生成(); - protected void t背景テクスチャの生成( string DefaultBgFilename, Rectangle bgrect, string bgfilename ) - { - try - { - if( !String.IsNullOrEmpty( bgfilename ) ) - this.tx背景 = TJAPlayer3.tテクスチャの生成( TJAPlayer3.stageSongSelect.r確定されたスコア.ファイル情報.フォルダの絶対パス + bgfilename ); - else - this.tx背景 = TJAPlayer3.tテクスチャの生成( CSkin.Path( DefaultBgFilename ) ); - } - catch (Exception e) - { - Trace.TraceError( e.ToString() ); - Trace.TraceError( "例外が発生しましたが処理を継続します。 (a80767e1-4de7-4fec-b072-d078b3659e62)" ); - this.tx背景 = null; - } + protected void t背景テクスチャの生成(string DefaultBgFilename, Rectangle bgrect, string bgfilename) { + try { + if (!String.IsNullOrEmpty(bgfilename)) + this.tx背景 = TJAPlayer3.tテクスチャの生成(TJAPlayer3.stageSongSelect.r確定されたスコア.ファイル情報.フォルダの絶対パス + bgfilename); + else + this.tx背景 = TJAPlayer3.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; + private int nDice = 0; - public ENoteJudge AlterJudgement(int player, ENoteJudge judgement, bool reroll) - { - int AILevel = TJAPlayer3.ConfigIni.nAILevel; - if (TJAPlayer3.ConfigIni.bAIBattleMode && player == 1) - { - if (reroll) - nDice = TJAPlayer3.Random.Next(1000); + public ENoteJudge AlterJudgement(int player, ENoteJudge judgement, bool reroll) { + int AILevel = TJAPlayer3.ConfigIni.nAILevel; + if (TJAPlayer3.ConfigIni.bAIBattleMode && player == 1) { + if (reroll) + nDice = TJAPlayer3.Random.Next(1000); - if (nDice < TJAPlayer3.ConfigIni.apAIPerformances[AILevel - 1].nBadOdds) - return ENoteJudge.Poor; - else if (nDice - TJAPlayer3.ConfigIni.apAIPerformances[AILevel - 1].nBadOdds - < TJAPlayer3.ConfigIni.apAIPerformances[AILevel - 1].nGoodOdds) - return ENoteJudge.Good; - } - return judgement; - } + if (nDice < TJAPlayer3.ConfigIni.apAIPerformances[AILevel - 1].nBadOdds) + return ENoteJudge.Poor; + else if (nDice - TJAPlayer3.ConfigIni.apAIPerformances[AILevel - 1].nBadOdds + < TJAPlayer3.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 }; + 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( TJAPlayer3.DTX.nScoreModeTmp == 1 ) - { - for( int i = 0; i < 11; i++ ) - { - this.nScore[ i ] = (int)( nInit + ( nDiff * ( i ) ) ); - } - } - else if( TJAPlayer3.DTX.nScoreModeTmp == 2 ) - { - for( int i = 0; i < 5; i++ ) - { - this.nScore[ i ] = (int)( nInit + ( nDiff * n倍率[ i ] ) ); + if (TJAPlayer3.DTX.nScoreModeTmp == 1) { + for (int i = 0; i < 11; i++) { + this.nScore[i] = (int)(nInit + (nDiff * (i))); + } + } else if (TJAPlayer3.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; + 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; + #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 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 Dictionary camHandlers; + private Dictionary objHandlers; - private Easing easing = new Easing(); + private Easing easing = new Easing(); - public bool bCustomDoron = false; - private bool bConfigUpdated = false; - #endregion - } + 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 ff487993..a6e854ec 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/AIBattle.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/AIBattle.cs @@ -1,242 +1,203 @@ -using System; -using System.Drawing; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Drawing; using FDK; // Minimalist menu class to use for custom menus -namespace TJAPlayer3 -{ - class AIBattle : CStage - { - public AIBattle() - { - base.IsDeActivated = true; - } +namespace TJAPlayer3 { + class AIBattle : CStage { + public AIBattle() { + base.IsDeActivated = true; + } - public override void Activate() - { - // On activation + public override void Activate() { + // On activation - BarFlashCounter = new CCounter(0, 1000.0, 0.00035, SoundManager.PlayTimer); + BarFlashCounter = new CCounter(0, 1000.0, 0.00035, SoundManager.PlayTimer); - BatchAnimeCounter = new CCounter(0, 10000.0, 1.0 / 1000.0, SoundManager.PlayTimer); + BatchAnimeCounter = new CCounter(0, 10000.0, 1.0 / 1000.0, SoundManager.PlayTimer); - 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() - { - // Ressource allocation + public override void CreateManagedResource() { + // Ressource allocation - base.CreateManagedResource(); - } + base.CreateManagedResource(); + } - public override void ReleaseManagedResource() - { - // Ressource freeing + public override void ReleaseManagedResource() { + // Ressource freeing - base.ReleaseManagedResource(); - } + base.ReleaseManagedResource(); + } - public override int Draw() - { - BarFlashCounter.TickLoopDB(); - BatchAnimeCounter.TickDB(); + public override int Draw() { + BarFlashCounter.TickLoopDB(); + BatchAnimeCounter.TickDB(); - TJAPlayer3.Tx.AIBattle_SectionTime_Panel?.t2D描画(TJAPlayer3.Skin.Game_AIBattle_SectionTime_Panel[0], TJAPlayer3.Skin.Game_AIBattle_SectionTime_Panel[1]); + TJAPlayer3.Tx.AIBattle_SectionTime_Panel?.t2D描画(TJAPlayer3.Skin.Game_AIBattle_SectionTime_Panel[0], TJAPlayer3.Skin.Game_AIBattle_SectionTime_Panel[1]); - TJAPlayer3.Tx.AIBattle_SectionTime_Bar_Base?.t2D描画(TJAPlayer3.Skin.Game_AIBattle_SectionTime_Bar[0], TJAPlayer3.Skin.Game_AIBattle_SectionTime_Bar[1], - new System.Drawing.RectangleF(0, 0, TJAPlayer3.Tx.AIBattle_SectionTime_Bar_Base.szTextureSize.Width, TJAPlayer3.Tx.AIBattle_SectionTime_Bar_Base.szTextureSize.Height)); + TJAPlayer3.Tx.AIBattle_SectionTime_Bar_Base?.t2D描画(TJAPlayer3.Skin.Game_AIBattle_SectionTime_Bar[0], TJAPlayer3.Skin.Game_AIBattle_SectionTime_Bar[1], + new System.Drawing.RectangleF(0, 0, TJAPlayer3.Tx.AIBattle_SectionTime_Bar_Base.szTextureSize.Width, TJAPlayer3.Tx.AIBattle_SectionTime_Bar_Base.szTextureSize.Height)); - void drawBar(CTexture barTex, float length) - { - barTex?.t2D描画(TJAPlayer3.Skin.Game_AIBattle_SectionTime_Bar[0], TJAPlayer3.Skin.Game_AIBattle_SectionTime_Bar[1], - new System.Drawing.RectangleF(0, 0, barTex.szTextureSize.Width * length, barTex.szTextureSize.Height)); - } + void drawBar(CTexture barTex, float length) { + barTex?.t2D描画(TJAPlayer3.Skin.Game_AIBattle_SectionTime_Bar[0], TJAPlayer3.Skin.Game_AIBattle_SectionTime_Bar[1], + new System.Drawing.RectangleF(0, 0, barTex.szTextureSize.Width * length, barTex.szTextureSize.Height)); + } - var nowSection = TJAPlayer3.stage演奏ドラム画面.NowAIBattleSection; + var nowSection = TJAPlayer3.stage演奏ドラム画面.NowAIBattleSection; - float nowLength = TJAPlayer3.stage演奏ドラム画面.NowAIBattleSectionTime / (float)nowSection.Length; - nowLength = Math.Min(nowLength, 1.0f); + float nowLength = TJAPlayer3.stage演奏ドラム画面.NowAIBattleSectionTime / (float)nowSection.Length; + nowLength = Math.Min(nowLength, 1.0f); - if (nowLength < 0.75) - { - drawBar(TJAPlayer3.Tx.AIBattle_SectionTime_Bar_Normal, nowLength); - } - else - { - TJAPlayer3.Tx.AIBattle_SectionTime_Bar_Finish.Opacity = (int)(Math.Sin((BarFlashCounter.CurrentValue / 1000.0) * Math.PI) * 255); - drawBar(TJAPlayer3.Tx.AIBattle_SectionTime_Bar_Finish, nowLength); - } + if (nowLength < 0.75) { + drawBar(TJAPlayer3.Tx.AIBattle_SectionTime_Bar_Normal, nowLength); + } else { + TJAPlayer3.Tx.AIBattle_SectionTime_Bar_Finish.Opacity = (int)(Math.Sin((BarFlashCounter.CurrentValue / 1000.0) * Math.PI) * 255); + drawBar(TJAPlayer3.Tx.AIBattle_SectionTime_Bar_Finish, nowLength); + } - for (int i = 0; i < TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count; i++) - { - int upDown = (i % 2); + for (int i = 0; i < TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count; i++) { + int upDown = (i % 2); - int base_width = TJAPlayer3.Tx.AIBattle_Batch_Base.szTextureSize.Width / 6; - int base_height = TJAPlayer3.Tx.AIBattle_Batch_Base.szTextureSize.Height; + int base_width = TJAPlayer3.Tx.AIBattle_Batch_Base.szTextureSize.Width / 6; + int base_height = TJAPlayer3.Tx.AIBattle_Batch_Base.szTextureSize.Height; - int base_x = TJAPlayer3.Skin.Game_AIBattle_Batch_Base[0] + (TJAPlayer3.Skin.Game_AIBattle_Batch_Move[0] * i); - int base_y = TJAPlayer3.Skin.Game_AIBattle_Batch_Base[1] + (TJAPlayer3.Skin.Game_AIBattle_Batch_Move[1] * upDown); + int base_x = TJAPlayer3.Skin.Game_AIBattle_Batch_Base[0] + (TJAPlayer3.Skin.Game_AIBattle_Batch_Move[0] * i); + int base_y = TJAPlayer3.Skin.Game_AIBattle_Batch_Base[1] + (TJAPlayer3.Skin.Game_AIBattle_Batch_Move[1] * upDown); - int nowBatchBaseRectX; + int nowBatchBaseRectX; - if (i == 0) - { - nowBatchBaseRectX = 2 + (upDown == 0 ? 0 : 1); - } - else if (i == TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count - 1) - { - nowBatchBaseRectX = 4 + (upDown == 0 ? 0 : 1); - } - else - { - nowBatchBaseRectX = (upDown == 0 ? 0 : 1); - } + if (i == 0) { + nowBatchBaseRectX = 2 + (upDown == 0 ? 0 : 1); + } else if (i == TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count - 1) { + nowBatchBaseRectX = 4 + (upDown == 0 ? 0 : 1); + } else { + nowBatchBaseRectX = (upDown == 0 ? 0 : 1); + } - TJAPlayer3.Tx.AIBattle_Batch_Base?.t2D描画(base_x, base_y, new System.Drawing.RectangleF(base_width * nowBatchBaseRectX, 0, base_width, base_height)); - } + TJAPlayer3.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 < TJAPlayer3.stage演奏ドラム画面.NowAIBattleSectionCount; i++) - { + for (int i = 0; i < TJAPlayer3.stage演奏ドラム画面.NowAIBattleSectionCount; i++) { - var section = TJAPlayer3.stage演奏ドラム画面.AIBattleSections[i]; + var section = TJAPlayer3.stage演奏ドラム画面.AIBattleSections[i]; - int upDown = (i % 2); + int upDown = (i % 2); - int width = TJAPlayer3.Tx.AIBattle_Batch.szTextureSize.Width / 6; - int height = TJAPlayer3.Tx.AIBattle_Batch.szTextureSize.Height / 2; + int width = TJAPlayer3.Tx.AIBattle_Batch.szTextureSize.Width / 6; + int height = TJAPlayer3.Tx.AIBattle_Batch.szTextureSize.Height / 2; - float value = 0.0f; + float value = 0.0f; - float inScale = 0.0f; + float inScale = 0.0f; - int drawFrame = 5; + 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; - } - } + 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 = TJAPlayer3.Skin.Game_AIBattle_Batch[0] + (TJAPlayer3.Skin.Game_AIBattle_Batch_Move[0] * i); - float _y = TJAPlayer3.Skin.Game_AIBattle_Batch[1] + (TJAPlayer3.Skin.Game_AIBattle_Batch_Move[1] * upDown); + float _x = TJAPlayer3.Skin.Game_AIBattle_Batch[0] + (TJAPlayer3.Skin.Game_AIBattle_Batch_Move[0] * i); + float _y = TJAPlayer3.Skin.Game_AIBattle_Batch[1] + (TJAPlayer3.Skin.Game_AIBattle_Batch_Move[1] * upDown); - _x = TJAPlayer3.Skin.Game_AIBattle_Batch_Anime[0] + ((_x - TJAPlayer3.Skin.Game_AIBattle_Batch_Anime[0]) * value); - _y = TJAPlayer3.Skin.Game_AIBattle_Batch_Anime[1] + ((_y - TJAPlayer3.Skin.Game_AIBattle_Batch_Anime[1]) * value); + _x = TJAPlayer3.Skin.Game_AIBattle_Batch_Anime[0] + ((_x - TJAPlayer3.Skin.Game_AIBattle_Batch_Anime[0]) * value); + _y = TJAPlayer3.Skin.Game_AIBattle_Batch_Anime[1] + ((_y - TJAPlayer3.Skin.Game_AIBattle_Batch_Anime[1]) * value); - float size_x = TJAPlayer3.Skin.Game_AIBattle_Batch_Anime_Size[0] + - ((TJAPlayer3.Skin.Game_AIBattle_Batch_Size[0] - TJAPlayer3.Skin.Game_AIBattle_Batch_Anime_Size[0]) * value); + float size_x = TJAPlayer3.Skin.Game_AIBattle_Batch_Anime_Size[0] + + ((TJAPlayer3.Skin.Game_AIBattle_Batch_Size[0] - TJAPlayer3.Skin.Game_AIBattle_Batch_Anime_Size[0]) * value); - float size_y = TJAPlayer3.Skin.Game_AIBattle_Batch_Anime_Size[1] + - ((TJAPlayer3.Skin.Game_AIBattle_Batch_Size[1] - TJAPlayer3.Skin.Game_AIBattle_Batch_Anime_Size[1]) * value); + float size_y = TJAPlayer3.Skin.Game_AIBattle_Batch_Anime_Size[1] + + ((TJAPlayer3.Skin.Game_AIBattle_Batch_Size[1] - TJAPlayer3.Skin.Game_AIBattle_Batch_Anime_Size[1]) * value); - TJAPlayer3.Tx.AIBattle_Batch.vcScaleRatio.X = (size_x / (float)width) + inScale; - TJAPlayer3.Tx.AIBattle_Batch.vcScaleRatio.Y = (size_y / (float)height) + inScale; + TJAPlayer3.Tx.AIBattle_Batch.vcScaleRatio.X = (size_x / (float)width) + inScale; + TJAPlayer3.Tx.AIBattle_Batch.vcScaleRatio.Y = (size_y / (float)height) + inScale; - switch (section.End) - { - case CStage演奏画面共通.AIBattleSection.EndType.Clear: - TJAPlayer3.Tx.AIBattle_Batch?.t2D拡大率考慮中央基準描画(_x, _y, new System.Drawing.RectangleF(width * drawFrame, 0, width, height)); - break; - case CStage演奏画面共通.AIBattleSection.EndType.Lose: - TJAPlayer3.Tx.AIBattle_Batch?.t2D拡大率考慮中央基準描画(_x, _y, new System.Drawing.RectangleF(width * drawFrame, height, width, height)); - break; - } - } + switch (section.End) { + case CStage演奏画面共通.AIBattleSection.EndType.Clear: + TJAPlayer3.Tx.AIBattle_Batch?.t2D拡大率考慮中央基準描画(_x, _y, new System.Drawing.RectangleF(width * drawFrame, 0, width, height)); + break; + case CStage演奏画面共通.AIBattleSection.EndType.Lose: + TJAPlayer3.Tx.AIBattle_Batch?.t2D拡大率考慮中央基準描画(_x, _y, new System.Drawing.RectangleF(width * drawFrame, height, width, height)); + break; + } + } - for (int player = 0; player < 2; player++) - { - TJAPlayer3.Tx.AIBattle_Judge_Meter[player]?.t2D描画(TJAPlayer3.Skin.Game_AIBattle_Judge_Meter_X[player], TJAPlayer3.Skin.Game_AIBattle_Judge_Meter_Y[player]); + for (int player = 0; player < 2; player++) { + TJAPlayer3.Tx.AIBattle_Judge_Meter[player]?.t2D描画(TJAPlayer3.Skin.Game_AIBattle_Judge_Meter_X[player], TJAPlayer3.Skin.Game_AIBattle_Judge_Meter_Y[player]); - int[] numArr = new int[4] - { - TJAPlayer3.stage演奏ドラム画面.CSectionScore[player].nGreat, - TJAPlayer3.stage演奏ドラム画面.CSectionScore[player].nGood, - TJAPlayer3.stage演奏ドラム画面.CSectionScore[player].nMiss, - TJAPlayer3.stage演奏ドラム画面.CSectionScore[player].nRoll - }; + int[] numArr = new int[4] + { + TJAPlayer3.stage演奏ドラム画面.CSectionScore[player].nGreat, + TJAPlayer3.stage演奏ドラム画面.CSectionScore[player].nGood, + TJAPlayer3.stage演奏ドラム画面.CSectionScore[player].nMiss, + TJAPlayer3.stage演奏ドラム画面.CSectionScore[player].nRoll + }; - int[] num_x = new int[4] - { - TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Perfect_X[player], - TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Good_X[player], - TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Miss_X[player], - TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Roll_X[player] - }; + int[] num_x = new int[4] + { + TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Perfect_X[player], + TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Good_X[player], + TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Miss_X[player], + TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Roll_X[player] + }; - int[] num_y = new int[4] - { - TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Perfect_Y[player], - TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Good_Y[player], - TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Miss_Y[player], - TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Roll_Y[player] - }; + int[] num_y = new int[4] + { + TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Perfect_Y[player], + TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Good_Y[player], + TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Miss_Y[player], + TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Roll_Y[player] + }; - for (int i = 0; i < 4; i++) - { - DrawJudgeNumber(num_x[i], num_y[i], numArr[i]); - } - } + for (int i = 0; i < 4; i++) { + DrawJudgeNumber(num_x[i], num_y[i], numArr[i]); + } + } - return 0; - } + return 0; + } - #region [Private] + #region [Private] - private CCounter BarFlashCounter; - public CCounter BatchAnimeCounter; + 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); + 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 = TJAPlayer3.Tx.AIBattle_Judge_Number.sz画像サイズ.Width / 10.0f; - float height = TJAPlayer3.Tx.AIBattle_Judge_Number.sz画像サイズ.Height; + float width = TJAPlayer3.Tx.AIBattle_Judge_Number.sz画像サイズ.Width / 10.0f; + float height = TJAPlayer3.Tx.AIBattle_Judge_Number.sz画像サイズ.Height; - float _x = x - (TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Interval[0] * offset); - float _y = y - (TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Interval[1] * offset); + float _x = x - (TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Interval[0] * offset); + float _y = y - (TJAPlayer3.Skin.Game_AIBattle_Judge_Number_Interval[1] * offset); - TJAPlayer3.Tx.AIBattle_Judge_Number.t2D拡大率考慮中央基準描画(_x + (width / 2), _y + (height / 2), - new RectangleF(width * nums[j], 0, width, height)); - } - } + TJAPlayer3.Tx.AIBattle_Judge_Number.t2D拡大率考慮中央基準描画(_x + (width / 2), _y + (height / 2), + new RectangleF(width * nums[j], 0, width, height)); + } + } - #endregion - } + #endregion + } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBackground.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBackground.cs index b1cdcf2c..6c31c6c7 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBackground.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBackground.cs @@ -1,122 +1,98 @@ -using System; -using FDK; -using System.Drawing; +using FDK; using static TJAPlayer3.CActSelect曲リスト; - using Color = System.Drawing.Color; using Rectangle = System.Drawing.Rectangle; -using System.Collections.Generic; -namespace TJAPlayer3 -{ - internal class CActImplBackground : CActivity - { - // 本家っぽい背景を表示させるメソッド。 - // - // 拡張性とかないんで。はい、ヨロシクゥ! - // - public CActImplBackground() - { - base.IsDeActivated = true; - } +namespace TJAPlayer3 { + 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 = EFIFOモード.フェードイン; - } + public void tFadeIn(int player) { + //this.ct上背景クリアインタイマー[player] = new CCounter(0, 100, 2, TJAPlayer3.Timer); + this.eFadeMode = EFIFOモード.フェードイン; + } - //public void tFadeOut(int player) - //{ - // this.ct上背景フェードタイマー[player] = new CCounter( 0, 100, 6, CDTXMania.Timer ); - // this.eFadeMode = EFIFOモード.フェードアウト; - //} + //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); + 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); - } + UpScript?.ClearIn(player); + DownScript?.ClearIn(player); + } - public void ClearOut(int player) - { - UpScript?.ClearOut(player); - DownScript?.ClearOut(player); - } + public void ClearOut(int player) { + UpScript?.ClearOut(player); + DownScript?.ClearOut(player); + } - public override void Activate() - { - if (!this.IsDeActivated) - return; + public override void Activate() { + if (!this.IsDeActivated) + return; - var bgOrigindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.BACKGROUND}"); - var preset = HScenePreset.GetBGPreset(); - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - { - bgOrigindir += "Tower"; - } - else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - { - bgOrigindir += "Dan"; - } - else if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - bgOrigindir += "AI"; - } - else - { - bgOrigindir += "Normal"; - } + var bgOrigindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.BACKGROUND}"); + var preset = HScenePreset.GetBGPreset(); + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + bgOrigindir += "Tower"; + } else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + bgOrigindir += "Dan"; + } else if (TJAPlayer3.ConfigIni.bAIBattleMode) { + bgOrigindir += "AI"; + } else { + bgOrigindir += "Normal"; + } - Random random = new Random(); + Random random = new Random(); - if (System.IO.Directory.Exists($@"{bgOrigindir}{Path.DirectorySeparatorChar}Up")) - { - var upDirs = System.IO.Directory.GetDirectories($@"{bgOrigindir}{Path.DirectorySeparatorChar}Up"); + 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)]; + // 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(); + UpScript = new ScriptBG($@"{upPath}{Path.DirectorySeparatorChar}Script.lua"); + UpScript.Init(); - IsUpNotFound = false; - } - else - { - IsUpNotFound = true; - } + 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 (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)]; + // 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(); + DownScript = new ScriptBG($@"{downPath}{Path.DirectorySeparatorChar}Script.lua"); + DownScript?.Init(); - if (DownScript.Exists()) IsDownNotFound = false; - } - else - { - IsDownNotFound = true; - } + if (DownScript.Exists()) IsDownNotFound = false; + } else { + IsDownNotFound = true; + } - this.pfTowerText = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Game_Tower_Font_TowerText); + this.pfTowerText = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.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); @@ -127,487 +103,448 @@ namespace TJAPlayer3 } */ - 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, TJAPlayer3.Timer); - - this.currentCharacter = Math.Max(0, Math.Min(TJAPlayer3.SaveFileInstances[0].data.Character, TJAPlayer3.Skin.Characters_Ptn - 1)); - - float resolutionScaleX = TJAPlayer3.Skin.Resolution[0] / (float)TJAPlayer3.Skin.Characters_Resolution[currentCharacter][0]; - float resolutionScaleY = TJAPlayer3.Skin.Resolution[1] / (float)TJAPlayer3.Skin.Characters_Resolution[currentCharacter][1]; - - // Scale tower chara - foreach (CTexture texture in TJAPlayer3.Tx.Characters_Tower_Standing[currentCharacter]) - { - texture.vcScaleRatio.X = resolutionScaleX; - texture.vcScaleRatio.Y = resolutionScaleY; - } - foreach (CTexture texture in TJAPlayer3.Tx.Characters_Tower_Climbing[currentCharacter]) - { - texture.vcScaleRatio.X = resolutionScaleX; - texture.vcScaleRatio.Y = resolutionScaleY; - } - foreach (CTexture texture in TJAPlayer3.Tx.Characters_Tower_Running[currentCharacter]) - { - texture.vcScaleRatio.X = resolutionScaleX; - texture.vcScaleRatio.Y = resolutionScaleY; - } - foreach (CTexture texture in TJAPlayer3.Tx.Characters_Tower_Clear[currentCharacter]) - { - texture.vcScaleRatio.X = resolutionScaleX; - texture.vcScaleRatio.Y = resolutionScaleY; - } - foreach (CTexture texture in TJAPlayer3.Tx.Characters_Tower_Fail[currentCharacter]) - { - texture.vcScaleRatio.X = resolutionScaleX; - texture.vcScaleRatio.Y = resolutionScaleY; - } - foreach (CTexture texture in TJAPlayer3.Tx.Characters_Tower_Standing_Tired[currentCharacter]) - { - texture.vcScaleRatio.X = resolutionScaleX; - texture.vcScaleRatio.Y = resolutionScaleY; - } - foreach (CTexture texture in TJAPlayer3.Tx.Characters_Tower_Climbing_Tired[currentCharacter]) - { - texture.vcScaleRatio.X = resolutionScaleX; - texture.vcScaleRatio.Y = resolutionScaleY; - } - foreach (CTexture texture in TJAPlayer3.Tx.Characters_Tower_Running_Tired[currentCharacter]) - { - texture.vcScaleRatio.X = resolutionScaleX; - texture.vcScaleRatio.Y = resolutionScaleY; - } - foreach (CTexture texture in TJAPlayer3.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)(TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0] * TJAPlayer3.ConfigIni.SongPlaybackSpeed)) * TJAPlayer3.Skin.Characters_Beat_Tower_Standing[currentCharacter] / TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[currentCharacter], TJAPlayer3.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; - - TJAPlayer3.tDisposeSafely(ref UpScript); - TJAPlayer3.tDisposeSafely(ref DownScript); - - TJAPlayer3.tDisposeSafely(ref pfTowerText); - - base.DeActivate(); - } - - public override void CreateManagedResource() - { - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() - { - base.ReleaseManagedResource(); - } + 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, TJAPlayer3.Timer); + + this.currentCharacter = Math.Max(0, Math.Min(TJAPlayer3.SaveFileInstances[0].data.Character, TJAPlayer3.Skin.Characters_Ptn - 1)); + + float resolutionScaleX = TJAPlayer3.Skin.Resolution[0] / (float)TJAPlayer3.Skin.Characters_Resolution[currentCharacter][0]; + float resolutionScaleY = TJAPlayer3.Skin.Resolution[1] / (float)TJAPlayer3.Skin.Characters_Resolution[currentCharacter][1]; + + // Scale tower chara + foreach (CTexture texture in TJAPlayer3.Tx.Characters_Tower_Standing[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; + } + foreach (CTexture texture in TJAPlayer3.Tx.Characters_Tower_Climbing[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; + } + foreach (CTexture texture in TJAPlayer3.Tx.Characters_Tower_Running[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; + } + foreach (CTexture texture in TJAPlayer3.Tx.Characters_Tower_Clear[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; + } + foreach (CTexture texture in TJAPlayer3.Tx.Characters_Tower_Fail[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; + } + foreach (CTexture texture in TJAPlayer3.Tx.Characters_Tower_Standing_Tired[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; + } + foreach (CTexture texture in TJAPlayer3.Tx.Characters_Tower_Climbing_Tired[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; + } + foreach (CTexture texture in TJAPlayer3.Tx.Characters_Tower_Running_Tired[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; + } + foreach (CTexture texture in TJAPlayer3.Tx.Characters_Tower_Clear_Tired[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; + } - public override int Draw() - { - if (base.IsDeActivated) - return 0; + this.ctSlideAnimation = new CCounter(); + this.ctClimbDuration = new CCounter(); + this.ctStandingAnimation = new CCounter(0, 1000, (60000f / (float)(TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0] * TJAPlayer3.ConfigIni.SongPlaybackSpeed)) * TJAPlayer3.Skin.Characters_Beat_Tower_Standing[currentCharacter] / TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[currentCharacter], TJAPlayer3.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; - //this.ct上背景FIFOタイマー?.t進行(); + base.Activate(); + } + public override void DeActivate() { + if (this.IsDeActivated) + return; - #region [Tower specific variables declaration] - - float currentFloorPositionMax140 = 0; + TJAPlayer3.tDisposeSafely(ref UpScript); + TJAPlayer3.tDisposeSafely(ref DownScript); - #endregion - - // fNow_Measure_s (/ m) - - #region [Upper background] + TJAPlayer3.tDisposeSafely(ref pfTowerText); - if (!IsUpNotFound) - { - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) UpScript?.Update(); - UpScript?.Draw(); - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - { - #region [Tower animations variables] + base.DeActivate(); + } - this.bFloorChanged = CFloorManagement.LastRegisteredFloor > 0 && (CFloorManagement.LastRegisteredFloor < TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1); + public override void CreateManagedResource() { + base.CreateManagedResource(); + } - int maxFloor = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor; - int nightTime = Math.Max(140, maxFloor / 2); + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } - currentFloorPositionMax140 = Math.Min(TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] / (float)nightTime, 1f); + public override int Draw() { + if (base.IsDeActivated) + return 0; - #endregion - #region [Tower background informations] + //this.ct上背景FIFOタイマー?.t進行(); - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - { - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkTouTatsuKaiSuu).t2D描画(TJAPlayer3.Skin.Game_Tower_Font_TouTatsuKaiSuu[0], TJAPlayer3.Skin.Game_Tower_Font_TouTatsuKaiSuu[1]); - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkKai).t2D描画(TJAPlayer3.Skin.Game_Tower_Font_Kai[0], TJAPlayer3.Skin.Game_Tower_Font_Kai[1]); - this.ct炎.TickLoop(); - CFloorManagement.loopFrames(); + #region [Tower specific variables declaration] - #region [Floor number] + float currentFloorPositionMax140 = 0; - if (CFloorManagement.CurrentNumberOfLives > 0) - CFloorManagement.LastRegisteredFloor = TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1; + #endregion - string floorStr = CFloorManagement.LastRegisteredFloor.ToString(); + // fNow_Measure_s (/ m) - int len = floorStr.Length; + #region [Upper background] - int digitLength = TJAPlayer3.Tx.Taiko_Combo[0].szTextureSize.Width / 10; + if (!IsUpNotFound) { + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) UpScript?.Update(); + UpScript?.Draw(); + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + #region [Tower animations variables] - TJAPlayer3.Tx.Taiko_Combo[0].color4 = new Color4(1f, 0.6f, 0.2f, 1f); - TJAPlayer3.Tx.Taiko_Combo[0].vcScaleRatio.X = 1.4f; - TJAPlayer3.Tx.Taiko_Combo[0].vcScaleRatio.Y = 1.4f; + this.bFloorChanged = CFloorManagement.LastRegisteredFloor > 0 && (CFloorManagement.LastRegisteredFloor < TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1); - for (int idx = len - 1; idx >= 0; idx--) - { - int currentNum = int.Parse(floorStr[idx].ToString()); + int maxFloor = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor; + int nightTime = Math.Max(140, maxFloor / 2); - TJAPlayer3.Tx.Taiko_Combo[0].t2D描画(TJAPlayer3.Skin.Game_Tower_Floor_Number[0] - ((digitLength - 8) * (len - idx) * 1.4f), - TJAPlayer3.Skin.Game_Tower_Floor_Number[1], - new Rectangle(digitLength * currentNum, 0, - digitLength, TJAPlayer3.Tx.Taiko_Combo[0].szTextureSize.Height)); - } + currentFloorPositionMax140 = Math.Min(TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] / (float)nightTime, 1f); - #endregion + #endregion - #region [Life Tamashii icon] + #region [Tower background informations] - int soulfire_width = TJAPlayer3.Tx.Gauge_Soul_Fire.szTextureSize.Width / 8; - int soulfire_height = TJAPlayer3.Tx.Gauge_Soul_Fire.szTextureSize.Height; + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkTouTatsuKaiSuu).t2D描画(TJAPlayer3.Skin.Game_Tower_Font_TouTatsuKaiSuu[0], TJAPlayer3.Skin.Game_Tower_Font_TouTatsuKaiSuu[1]); + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkKai).t2D描画(TJAPlayer3.Skin.Game_Tower_Font_Kai[0], TJAPlayer3.Skin.Game_Tower_Font_Kai[1]); - int soul_height = TJAPlayer3.Tx.Gauge_Soul.szTextureSize.Height / 2; + this.ct炎.TickLoop(); + CFloorManagement.loopFrames(); - TJAPlayer3.Tx.Gauge_Soul_Fire?.t2D描画(TJAPlayer3.Skin.Gauge_Soul_Fire_X_Tower, TJAPlayer3.Skin.Gauge_Soul_Fire_Y_Tower, new Rectangle(soulfire_width * (this.ct炎.CurrentValue), 0, soulfire_width, soulfire_height)); - TJAPlayer3.Tx.Gauge_Soul?.t2D描画(TJAPlayer3.Skin.Gauge_Soul_X_Tower, TJAPlayer3.Skin.Gauge_Soul_Y_Tower, new Rectangle(0, soul_height, TJAPlayer3.Tx.Gauge_Soul.szTextureSize.Width, soul_height)); + #region [Floor number] - #endregion + if (CFloorManagement.CurrentNumberOfLives > 0) + CFloorManagement.LastRegisteredFloor = TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1; - #region [Life number] + string floorStr = CFloorManagement.LastRegisteredFloor.ToString(); - if (CFloorManagement.MaxNumberOfLives <= 0) - { - CFloorManagement.MaxNumberOfLives = 5; - CFloorManagement.CurrentNumberOfLives = 5; - } + int len = floorStr.Length; - string lifeStr = CFloorManagement.CurrentNumberOfLives.ToString(); + int digitLength = TJAPlayer3.Tx.Taiko_Combo[0].szTextureSize.Width / 10; - len = lifeStr.Length; + TJAPlayer3.Tx.Taiko_Combo[0].color4 = new Color4(1f, 0.6f, 0.2f, 1f); + TJAPlayer3.Tx.Taiko_Combo[0].vcScaleRatio.X = 1.4f; + TJAPlayer3.Tx.Taiko_Combo[0].vcScaleRatio.Y = 1.4f; - bool lifeSpecialCase = CFloorManagement.CurrentNumberOfLives == 1 && CFloorManagement.MaxNumberOfLives != 1; - float lifeRatio = CFloorManagement.CurrentNumberOfLives / (float)CFloorManagement.MaxNumberOfLives; + for (int idx = len - 1; idx >= 0; idx--) { + int currentNum = int.Parse(floorStr[idx].ToString()); - 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)); + TJAPlayer3.Tx.Taiko_Combo[0].t2D描画(TJAPlayer3.Skin.Game_Tower_Floor_Number[0] - ((digitLength - 8) * (len - idx) * 1.4f), + TJAPlayer3.Skin.Game_Tower_Floor_Number[1], + new Rectangle(digitLength * currentNum, 0, + digitLength, TJAPlayer3.Tx.Taiko_Combo[0].szTextureSize.Height)); + } - TJAPlayer3.Tx.Taiko_Combo[0].color4 = lifeColor; - TJAPlayer3.Tx.Taiko_Combo[0].vcScaleRatio.X = 1.1f; - TJAPlayer3.Tx.Taiko_Combo[0].vcScaleRatio.Y = 1.1f; + #endregion - for (int idx = 0; idx < len; idx++) - { - int currentNum = int.Parse(lifeStr[len - idx - 1].ToString()); + #region [Life Tamashii icon] - TJAPlayer3.Tx.Taiko_Combo[0].t2D描画(TJAPlayer3.Skin.Game_Tower_Life_Number[0] + ((digitLength - 8) * (len - idx) * 1.1f), - TJAPlayer3.Skin.Game_Tower_Life_Number[1], - new Rectangle(digitLength * currentNum, 0, - digitLength, TJAPlayer3.Tx.Taiko_Combo[0].szTextureSize.Height)); - } + int soulfire_width = TJAPlayer3.Tx.Gauge_Soul_Fire.szTextureSize.Width / 8; + int soulfire_height = TJAPlayer3.Tx.Gauge_Soul_Fire.szTextureSize.Height; - TJAPlayer3.Tx.Taiko_Combo[0].color4 = new Color4(1f, 1f, 1f, 1f); + int soul_height = TJAPlayer3.Tx.Gauge_Soul.szTextureSize.Height / 2; - #endregion + TJAPlayer3.Tx.Gauge_Soul_Fire?.t2D描画(TJAPlayer3.Skin.Gauge_Soul_Fire_X_Tower, TJAPlayer3.Skin.Gauge_Soul_Fire_Y_Tower, new Rectangle(soulfire_width * (this.ct炎.CurrentValue), 0, soulfire_width, soulfire_height)); + TJAPlayer3.Tx.Gauge_Soul?.t2D描画(TJAPlayer3.Skin.Gauge_Soul_X_Tower, TJAPlayer3.Skin.Gauge_Soul_Y_Tower, new Rectangle(0, soul_height, TJAPlayer3.Tx.Gauge_Soul.szTextureSize.Width, soul_height)); - } + #endregion - #endregion - } - } + #region [Life number] - #endregion + if (CFloorManagement.MaxNumberOfLives <= 0) { + CFloorManagement.MaxNumberOfLives = 5; + CFloorManagement.CurrentNumberOfLives = 5; + } - #region [Lower background] + string lifeStr = CFloorManagement.CurrentNumberOfLives.ToString(); + len = lifeStr.Length; - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - { - int maxFloor = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor; + bool lifeSpecialCase = CFloorManagement.CurrentNumberOfLives == 1 && CFloorManagement.MaxNumberOfLives != 1; + float lifeRatio = CFloorManagement.CurrentNumberOfLives / (float)CFloorManagement.MaxNumberOfLives; - TJAPlayer3.actTextConsole.tPrint(0, 0, CTextConsole.EFontType.White, maxFloor.ToString()); + 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)); - int nightTime = Math.Max(140, maxFloor / 2); + TJAPlayer3.Tx.Taiko_Combo[0].color4 = lifeColor; + TJAPlayer3.Tx.Taiko_Combo[0].vcScaleRatio.X = 1.1f; + TJAPlayer3.Tx.Taiko_Combo[0].vcScaleRatio.Y = 1.1f; - int currentTowerType = Array.IndexOf(TJAPlayer3.Skin.Game_Tower_Names, TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTowerType); + for (int idx = 0; idx < len; idx++) { + int currentNum = int.Parse(lifeStr[len - idx - 1].ToString()); - if (currentTowerType < 0 || currentTowerType >= TJAPlayer3.Skin.Game_Tower_Ptn) - currentTowerType = 0; + TJAPlayer3.Tx.Taiko_Combo[0].t2D描画(TJAPlayer3.Skin.Game_Tower_Life_Number[0] + ((digitLength - 8) * (len - idx) * 1.1f), + TJAPlayer3.Skin.Game_Tower_Life_Number[1], + new Rectangle(digitLength * currentNum, 0, + digitLength, TJAPlayer3.Tx.Taiko_Combo[0].szTextureSize.Height)); + } - #region [Tower lower background] + TJAPlayer3.Tx.Taiko_Combo[0].color4 = new Color4(1f, 1f, 1f, 1f); - float nextPositionMax140 = Math.Min((TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1) / (float)nightTime, 1f); + #endregion - if (bFloorChanged == true) - ctSlideAnimation.Start(0, 1000, 120f / ((float)TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0] * TJAPlayer3.ConfigIni.SongPlaybackSpeed), TJAPlayer3.Timer); + } - float progressFactor = (nextPositionMax140 - currentFloorPositionMax140) * (ctSlideAnimation.CurrentValue / 1000f); + #endregion + } + } + #endregion + #region [Lower background] - #region [Skybox] - //int skyboxYPosition = (int)((TJAPlayer3.Tx.Tower_Sky_Gradient.szテクスチャサイズ.Height - TJAPlayer3.Skin.Game_Tower_Sky_Gradient_Size[1]) * (1f - (currentFloorPositionMax140 + progressFactor))); + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + int maxFloor = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor; - //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 (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) DownScript.Update(); - DownScript.Draw(); - - #endregion + TJAPlayer3.actTextConsole.tPrint(0, 0, CTextConsole.EFontType.White, maxFloor.ToString()); + int nightTime = Math.Max(140, maxFloor / 2); - #region [Tower body] + int currentTowerType = Array.IndexOf(TJAPlayer3.Skin.Game_Tower_Names, TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTowerType); - progressFactor = ctSlideAnimation.CurrentValue / 1000f; + if (currentTowerType < 0 || currentTowerType >= TJAPlayer3.Skin.Game_Tower_Ptn) + currentTowerType = 0; - int currentTower = currentTowerType; + #region [Tower lower background] - // Will implement the roof later, need the beforehand total floor count calculation before - int nextTowerBase = ((TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1) / 10) % TJAPlayer3.Skin.Game_Tower_Ptn_Base[currentTower]; - int towerBase = (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] / 10) % TJAPlayer3.Skin.Game_Tower_Ptn_Base[currentTower]; + float nextPositionMax140 = Math.Min((TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1) / (float)nightTime, 1f); - int currentDeco = TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] % TJAPlayer3.Skin.Game_Tower_Ptn_Deco[currentTower]; - int nextDeco = (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1) % TJAPlayer3.Skin.Game_Tower_Ptn_Deco[currentTower]; + if (bFloorChanged == true) + ctSlideAnimation.Start(0, 1000, 120f / ((float)TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0] * TJAPlayer3.ConfigIni.SongPlaybackSpeed), TJAPlayer3.Timer); - // Microfix for the first floor suddenly changing texture - if (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] == 0 && TJAPlayer3.Skin.Game_Tower_Ptn_Deco[currentTower] > 1) - currentDeco++; - if (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] == 0 && TJAPlayer3.Skin.Game_Tower_Ptn_Base[currentTower] > 1) - towerBase++; - - int widthChange = (int)(progressFactor * TJAPlayer3.Skin.Game_Tower_Floors_Move[0]); - int heightChange = (int)(progressFactor * TJAPlayer3.Skin.Game_Tower_Floors_Move[1]); - - // Current trunk - if (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] < maxFloor) - TJAPlayer3.Tx.Tower_Base[currentTower][towerBase]?.t2D下中央基準描画( - TJAPlayer3.Skin.Game_Tower_Floors_Body[0] + widthChange, - TJAPlayer3.Skin.Game_Tower_Floors_Body[1] + heightChange); // 316 + 360 - else - TJAPlayer3.Tx.Tower_Top[currentTower]?.t2D下中央基準描画( - TJAPlayer3.Skin.Game_Tower_Floors_Body[0] + widthChange, - TJAPlayer3.Skin.Game_Tower_Floors_Body[1] + heightChange); - - // Current deco - TJAPlayer3.Tx.Tower_Deco[currentTower][currentDeco]?.t2D下中央基準描画( - TJAPlayer3.Skin.Game_Tower_Floors_Deco[0] + widthChange, - TJAPlayer3.Skin.Game_Tower_Floors_Deco[1] + heightChange); - - int originY = TJAPlayer3.Skin.Game_Tower_Floors_Move[1] - heightChange; - - // Next trunk - if (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1 < maxFloor) - TJAPlayer3.Tx.Tower_Base[currentTower][nextTowerBase]?.t2D下中央基準描画( - TJAPlayer3.Skin.Game_Tower_Floors_Body[0] - TJAPlayer3.Skin.Game_Tower_Floors_Move[0] + widthChange, - TJAPlayer3.Skin.Game_Tower_Floors_Body[1] - TJAPlayer3.Skin.Game_Tower_Floors_Move[1] + heightChange, - new Rectangle(0, originY, TJAPlayer3.Tx.Tower_Base[currentTower][nextTowerBase].szTextureSize.Width, TJAPlayer3.Tx.Tower_Base[currentTower][nextTowerBase].szTextureSize.Height - originY)); - else if (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1 == maxFloor) - { - TJAPlayer3.Tx.Tower_Top[currentTower]?.t2D下中央基準描画( - TJAPlayer3.Skin.Game_Tower_Floors_Body[0] - TJAPlayer3.Skin.Game_Tower_Floors_Move[0] + widthChange, - TJAPlayer3.Skin.Game_Tower_Floors_Body[1] - TJAPlayer3.Skin.Game_Tower_Floors_Move[1] + heightChange, - new Rectangle(0, originY, TJAPlayer3.Tx.Tower_Top[currentTower].szTextureSize.Width, TJAPlayer3.Tx.Tower_Top[currentTower].szTextureSize.Height - originY)); - } - - // Next deco - if (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1 <= maxFloor) - TJAPlayer3.Tx.Tower_Deco[currentTower][nextDeco]?.t2D下中央基準描画( - TJAPlayer3.Skin.Game_Tower_Floors_Deco[0] - TJAPlayer3.Skin.Game_Tower_Floors_Move[0] + widthChange, - TJAPlayer3.Skin.Game_Tower_Floors_Deco[1] - TJAPlayer3.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 = TJAPlayer3.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_EndStage || TJAPlayer3.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_STAGE_CLEAR_FadeOut || CFloorManagement.CurrentNumberOfLives == 0; - - if (bFloorChanged == true) - { - float floorBPM = (float)(TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0] * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - ctClimbDuration.Start(0, 1500, 120f / floorBPM, TJAPlayer3.Timer); - ctStandingAnimation.Start(0, 1000, (60000f / floorBPM) * TJAPlayer3.Skin.Characters_Beat_Tower_Standing[currentCharacter] / TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[currentCharacter], TJAPlayer3.Timer); - ctClimbingAnimation.Start(0, 1000, (120000f / floorBPM) / TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[currentCharacter], TJAPlayer3.Timer); - ctRunningAnimation.Start(0, 1000, (60000f / floorBPM) / TJAPlayer3.Skin.Characters_Tower_Running_Ptn[currentCharacter], TJAPlayer3.Timer); - ctStandTiredAnimation.Start(0, 1000, (60000f / floorBPM) * TJAPlayer3.Skin.Characters_Beat_Tower_Standing_Tired[currentCharacter] / TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn[currentCharacter], TJAPlayer3.Timer); - ctClimbTiredAnimation.Start(0, 1000, (120000f / floorBPM) / TJAPlayer3.Skin.Characters_Tower_Climbing_Tired_Ptn[currentCharacter], TJAPlayer3.Timer); - ctRunTiredAnimation.Start(0, 1000, (60000f / floorBPM) / TJAPlayer3.Skin.Characters_Tower_Running_Tired_Ptn[currentCharacter], TJAPlayer3.Timer); - } - - bool isClimbing = ctClimbDuration.CurrentValue > 0 && ctClimbDuration.CurrentValue < 1500; - - if (stageEnded && !TowerFinished && !isClimbing) - { - float floorBPM = (float)(TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0] * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - ctClearAnimation.Start(0, 20000, (60000f / floorBPM) * TJAPlayer3.Skin.Characters_Beat_Tower_Clear[currentCharacter] / TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[currentCharacter], TJAPlayer3.Timer); - ctClearTiredAnimation.Start(0, 20000, (60000f / floorBPM) * TJAPlayer3.Skin.Characters_Beat_Tower_Clear_Tired[currentCharacter] / TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[currentCharacter], TJAPlayer3.Timer); - ctFailAnimation.Start(0, 20000, (60000f / floorBPM) * TJAPlayer3.Skin.Characters_Beat_Tower_Fail[currentCharacter] / TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[currentCharacter], TJAPlayer3.Timer); - TowerFinished = true; - } - - if (isClimbing) - { - // Tired Climb - if (ctIsTired && (ctClimbDuration.CurrentValue <= 1000) && TJAPlayer3.Skin.Characters_Tower_Climbing_Tired_Ptn[currentCharacter] > 0) - { - int animChar = ctClimbTiredAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[currentCharacter]; - int distDonX = (int)(ctClimbDuration.CurrentValue * (TJAPlayer3.Skin.Game_Tower_Don_Move[0] / 1000f)); - int distDonY = (int)(ctClimbDuration.CurrentValue * (TJAPlayer3.Skin.Game_Tower_Don_Move[1] / 1000f)); - TJAPlayer3.Tx.Characters_Tower_Climbing_Tired[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0] + distDonX, TJAPlayer3.Skin.Game_Tower_Don[1] + distDonY); - } - // Tired Run - else if (ctIsTired && (ctClimbDuration.CurrentValue > 1000 && ctClimbDuration.CurrentValue < 1500) && TJAPlayer3.Skin.Characters_Tower_Running_Tired_Ptn[currentCharacter] > 0) - { - int animChar = ctRunTiredAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Running_Ptn[currentCharacter]; - int distDonX = (int)((1500 - ctClimbDuration.CurrentValue) * (TJAPlayer3.Skin.Game_Tower_Don_Move[0] / 500f)); - int distDonY = (int)((1500 - ctClimbDuration.CurrentValue) * (TJAPlayer3.Skin.Game_Tower_Don_Move[1] / 500f)); - TJAPlayer3.Tx.Characters_Tower_Running_Tired[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0] + distDonX, TJAPlayer3.Skin.Game_Tower_Don[1] + distDonY); - } - // Climb - else if ((ctClimbDuration.CurrentValue <= 1000) && TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[currentCharacter] > 0) - { - int animChar = ctClimbingAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[currentCharacter]; - int distDonX = (int)(ctClimbDuration.CurrentValue * (TJAPlayer3.Skin.Game_Tower_Don_Move[0] / 1000f)); - int distDonY = (int)(ctClimbDuration.CurrentValue * (TJAPlayer3.Skin.Game_Tower_Don_Move[1] / 1000f)); - TJAPlayer3.Tx.Characters_Tower_Climbing[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0] + distDonX, TJAPlayer3.Skin.Game_Tower_Don[1] + distDonY); - } - // Run - else if ((ctClimbDuration.CurrentValue > 1000 && ctClimbDuration.CurrentValue < 1500) && TJAPlayer3.Skin.Characters_Tower_Running_Ptn[currentCharacter] > 0) - { - int animChar = ctRunningAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Running_Ptn[currentCharacter]; - int distDonX = (int)((1500 - ctClimbDuration.CurrentValue) * (TJAPlayer3.Skin.Game_Tower_Don_Move[0] / 500f)); - int distDonY = (int)((1500 - ctClimbDuration.CurrentValue) * (TJAPlayer3.Skin.Game_Tower_Don_Move[1] / 500f)); - TJAPlayer3.Tx.Characters_Tower_Running[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0] + distDonX, TJAPlayer3.Skin.Game_Tower_Don[1] + distDonY); - } - } - else - { - // Fail - if (TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[currentCharacter] > 0 && CFloorManagement.CurrentNumberOfLives == 0) - { - int animChar = TJAPlayer3.Skin.Characters_Tower_Fail_IsLooping[currentCharacter] ? - ctFailAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[currentCharacter] : - Math.Min(ctFailAnimation.CurrentValue, TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[currentCharacter] - 1); - TJAPlayer3.Tx.Characters_Tower_Fail[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0], TJAPlayer3.Skin.Game_Tower_Don[1]); - } - // Tired Clear - else if (ctIsTired && stageEnded && TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[currentCharacter] > 0 && CFloorManagement.CurrentNumberOfLives > 0) - { - int animChar = TJAPlayer3.Skin.Characters_Tower_Clear_Tired_IsLooping[currentCharacter] ? - ctClearTiredAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[currentCharacter] : - Math.Min(ctClearTiredAnimation.CurrentValue, TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[currentCharacter] - 1); - TJAPlayer3.Tx.Characters_Tower_Clear_Tired[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0], TJAPlayer3.Skin.Game_Tower_Don[1]); - } - // Clear - else if (stageEnded && TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[currentCharacter] > 0 && CFloorManagement.CurrentNumberOfLives > 0) - { - int animChar = TJAPlayer3.Skin.Characters_Tower_Clear_IsLooping[currentCharacter] ? - ctClearAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[currentCharacter] : - Math.Min(ctClearAnimation.CurrentValue, TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[currentCharacter] - 1); - TJAPlayer3.Tx.Characters_Tower_Clear[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0], TJAPlayer3.Skin.Game_Tower_Don[1]); - } - - // Tired Stand - else if (ctIsTired && TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn[currentCharacter] > 0) - { - int animChar = ctStandTiredAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn[currentCharacter]; - TJAPlayer3.Tx.Characters_Tower_Standing_Tired[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0], TJAPlayer3.Skin.Game_Tower_Don[1]); // Center X - 50 - } - // Stand - else if (TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[currentCharacter] > 0) - { - int animChar = ctStandingAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[currentCharacter]; - TJAPlayer3.Tx.Characters_Tower_Standing[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0], TJAPlayer3.Skin.Game_Tower_Don[1]); // Center X - 50 - } - } - - #endregion - - #region [Miss icon] - - if (CFloorManagement.InvincibilityFrames != null && CFloorManagement.InvincibilityFrames.CurrentValue < CFloorManagement.InvincibilityDurationSpeedDependent) - { - if (TJAPlayer3.Tx.Tower_Miss != null) - TJAPlayer3.Tx.Tower_Miss.Opacity = Math.Min(255, 1000 - CFloorManagement.InvincibilityFrames.CurrentValue); - TJAPlayer3.Tx.Tower_Miss?.t2D下中央基準描画(TJAPlayer3.Skin.Game_Tower_Miss[0], TJAPlayer3.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 (!TJAPlayer3.stage演奏ドラム画面.bDoublePlay && TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) - { - if (!IsDownNotFound) - { - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) DownScript?.Update(); - DownScript?.Draw(); - } - } - - - #endregion - - return base.Draw(); - } - - #region[ private ] - //----------------- - - #region 背景 - /*private CTexture Background, + 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 (!TJAPlayer3.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 = ((TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1) / 10) % TJAPlayer3.Skin.Game_Tower_Ptn_Base[currentTower]; + int towerBase = (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] / 10) % TJAPlayer3.Skin.Game_Tower_Ptn_Base[currentTower]; + + int currentDeco = TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] % TJAPlayer3.Skin.Game_Tower_Ptn_Deco[currentTower]; + int nextDeco = (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1) % TJAPlayer3.Skin.Game_Tower_Ptn_Deco[currentTower]; + + // Microfix for the first floor suddenly changing texture + if (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] == 0 && TJAPlayer3.Skin.Game_Tower_Ptn_Deco[currentTower] > 1) + currentDeco++; + if (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] == 0 && TJAPlayer3.Skin.Game_Tower_Ptn_Base[currentTower] > 1) + towerBase++; + + int widthChange = (int)(progressFactor * TJAPlayer3.Skin.Game_Tower_Floors_Move[0]); + int heightChange = (int)(progressFactor * TJAPlayer3.Skin.Game_Tower_Floors_Move[1]); + + // Current trunk + if (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] < maxFloor) + TJAPlayer3.Tx.Tower_Base[currentTower][towerBase]?.t2D下中央基準描画( + TJAPlayer3.Skin.Game_Tower_Floors_Body[0] + widthChange, + TJAPlayer3.Skin.Game_Tower_Floors_Body[1] + heightChange); // 316 + 360 + else + TJAPlayer3.Tx.Tower_Top[currentTower]?.t2D下中央基準描画( + TJAPlayer3.Skin.Game_Tower_Floors_Body[0] + widthChange, + TJAPlayer3.Skin.Game_Tower_Floors_Body[1] + heightChange); + + // Current deco + TJAPlayer3.Tx.Tower_Deco[currentTower][currentDeco]?.t2D下中央基準描画( + TJAPlayer3.Skin.Game_Tower_Floors_Deco[0] + widthChange, + TJAPlayer3.Skin.Game_Tower_Floors_Deco[1] + heightChange); + + int originY = TJAPlayer3.Skin.Game_Tower_Floors_Move[1] - heightChange; + + // Next trunk + if (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1 < maxFloor) + TJAPlayer3.Tx.Tower_Base[currentTower][nextTowerBase]?.t2D下中央基準描画( + TJAPlayer3.Skin.Game_Tower_Floors_Body[0] - TJAPlayer3.Skin.Game_Tower_Floors_Move[0] + widthChange, + TJAPlayer3.Skin.Game_Tower_Floors_Body[1] - TJAPlayer3.Skin.Game_Tower_Floors_Move[1] + heightChange, + new Rectangle(0, originY, TJAPlayer3.Tx.Tower_Base[currentTower][nextTowerBase].szTextureSize.Width, TJAPlayer3.Tx.Tower_Base[currentTower][nextTowerBase].szTextureSize.Height - originY)); + else if (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1 == maxFloor) { + TJAPlayer3.Tx.Tower_Top[currentTower]?.t2D下中央基準描画( + TJAPlayer3.Skin.Game_Tower_Floors_Body[0] - TJAPlayer3.Skin.Game_Tower_Floors_Move[0] + widthChange, + TJAPlayer3.Skin.Game_Tower_Floors_Body[1] - TJAPlayer3.Skin.Game_Tower_Floors_Move[1] + heightChange, + new Rectangle(0, originY, TJAPlayer3.Tx.Tower_Top[currentTower].szTextureSize.Width, TJAPlayer3.Tx.Tower_Top[currentTower].szTextureSize.Height - originY)); + } + + // Next deco + if (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1 <= maxFloor) + TJAPlayer3.Tx.Tower_Deco[currentTower][nextDeco]?.t2D下中央基準描画( + TJAPlayer3.Skin.Game_Tower_Floors_Deco[0] - TJAPlayer3.Skin.Game_Tower_Floors_Move[0] + widthChange, + TJAPlayer3.Skin.Game_Tower_Floors_Deco[1] - TJAPlayer3.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 = TJAPlayer3.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_EndStage || TJAPlayer3.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_STAGE_CLEAR_FadeOut || CFloorManagement.CurrentNumberOfLives == 0; + + if (bFloorChanged == true) { + float floorBPM = (float)(TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0] * TJAPlayer3.ConfigIni.SongPlaybackSpeed); + ctClimbDuration.Start(0, 1500, 120f / floorBPM, TJAPlayer3.Timer); + ctStandingAnimation.Start(0, 1000, (60000f / floorBPM) * TJAPlayer3.Skin.Characters_Beat_Tower_Standing[currentCharacter] / TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[currentCharacter], TJAPlayer3.Timer); + ctClimbingAnimation.Start(0, 1000, (120000f / floorBPM) / TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[currentCharacter], TJAPlayer3.Timer); + ctRunningAnimation.Start(0, 1000, (60000f / floorBPM) / TJAPlayer3.Skin.Characters_Tower_Running_Ptn[currentCharacter], TJAPlayer3.Timer); + ctStandTiredAnimation.Start(0, 1000, (60000f / floorBPM) * TJAPlayer3.Skin.Characters_Beat_Tower_Standing_Tired[currentCharacter] / TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn[currentCharacter], TJAPlayer3.Timer); + ctClimbTiredAnimation.Start(0, 1000, (120000f / floorBPM) / TJAPlayer3.Skin.Characters_Tower_Climbing_Tired_Ptn[currentCharacter], TJAPlayer3.Timer); + ctRunTiredAnimation.Start(0, 1000, (60000f / floorBPM) / TJAPlayer3.Skin.Characters_Tower_Running_Tired_Ptn[currentCharacter], TJAPlayer3.Timer); + } + + bool isClimbing = ctClimbDuration.CurrentValue > 0 && ctClimbDuration.CurrentValue < 1500; + + if (stageEnded && !TowerFinished && !isClimbing) { + float floorBPM = (float)(TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0] * TJAPlayer3.ConfigIni.SongPlaybackSpeed); + ctClearAnimation.Start(0, 20000, (60000f / floorBPM) * TJAPlayer3.Skin.Characters_Beat_Tower_Clear[currentCharacter] / TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[currentCharacter], TJAPlayer3.Timer); + ctClearTiredAnimation.Start(0, 20000, (60000f / floorBPM) * TJAPlayer3.Skin.Characters_Beat_Tower_Clear_Tired[currentCharacter] / TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[currentCharacter], TJAPlayer3.Timer); + ctFailAnimation.Start(0, 20000, (60000f / floorBPM) * TJAPlayer3.Skin.Characters_Beat_Tower_Fail[currentCharacter] / TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[currentCharacter], TJAPlayer3.Timer); + TowerFinished = true; + } + + if (isClimbing) { + // Tired Climb + if (ctIsTired && (ctClimbDuration.CurrentValue <= 1000) && TJAPlayer3.Skin.Characters_Tower_Climbing_Tired_Ptn[currentCharacter] > 0) { + int animChar = ctClimbTiredAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[currentCharacter]; + int distDonX = (int)(ctClimbDuration.CurrentValue * (TJAPlayer3.Skin.Game_Tower_Don_Move[0] / 1000f)); + int distDonY = (int)(ctClimbDuration.CurrentValue * (TJAPlayer3.Skin.Game_Tower_Don_Move[1] / 1000f)); + TJAPlayer3.Tx.Characters_Tower_Climbing_Tired[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0] + distDonX, TJAPlayer3.Skin.Game_Tower_Don[1] + distDonY); + } + // Tired Run + else if (ctIsTired && (ctClimbDuration.CurrentValue > 1000 && ctClimbDuration.CurrentValue < 1500) && TJAPlayer3.Skin.Characters_Tower_Running_Tired_Ptn[currentCharacter] > 0) { + int animChar = ctRunTiredAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Running_Ptn[currentCharacter]; + int distDonX = (int)((1500 - ctClimbDuration.CurrentValue) * (TJAPlayer3.Skin.Game_Tower_Don_Move[0] / 500f)); + int distDonY = (int)((1500 - ctClimbDuration.CurrentValue) * (TJAPlayer3.Skin.Game_Tower_Don_Move[1] / 500f)); + TJAPlayer3.Tx.Characters_Tower_Running_Tired[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0] + distDonX, TJAPlayer3.Skin.Game_Tower_Don[1] + distDonY); + } + // Climb + else if ((ctClimbDuration.CurrentValue <= 1000) && TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[currentCharacter] > 0) { + int animChar = ctClimbingAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[currentCharacter]; + int distDonX = (int)(ctClimbDuration.CurrentValue * (TJAPlayer3.Skin.Game_Tower_Don_Move[0] / 1000f)); + int distDonY = (int)(ctClimbDuration.CurrentValue * (TJAPlayer3.Skin.Game_Tower_Don_Move[1] / 1000f)); + TJAPlayer3.Tx.Characters_Tower_Climbing[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0] + distDonX, TJAPlayer3.Skin.Game_Tower_Don[1] + distDonY); + } + // Run + else if ((ctClimbDuration.CurrentValue > 1000 && ctClimbDuration.CurrentValue < 1500) && TJAPlayer3.Skin.Characters_Tower_Running_Ptn[currentCharacter] > 0) { + int animChar = ctRunningAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Running_Ptn[currentCharacter]; + int distDonX = (int)((1500 - ctClimbDuration.CurrentValue) * (TJAPlayer3.Skin.Game_Tower_Don_Move[0] / 500f)); + int distDonY = (int)((1500 - ctClimbDuration.CurrentValue) * (TJAPlayer3.Skin.Game_Tower_Don_Move[1] / 500f)); + TJAPlayer3.Tx.Characters_Tower_Running[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0] + distDonX, TJAPlayer3.Skin.Game_Tower_Don[1] + distDonY); + } + } else { + // Fail + if (TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[currentCharacter] > 0 && CFloorManagement.CurrentNumberOfLives == 0) { + int animChar = TJAPlayer3.Skin.Characters_Tower_Fail_IsLooping[currentCharacter] ? + ctFailAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[currentCharacter] : + Math.Min(ctFailAnimation.CurrentValue, TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[currentCharacter] - 1); + TJAPlayer3.Tx.Characters_Tower_Fail[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0], TJAPlayer3.Skin.Game_Tower_Don[1]); + } + // Tired Clear + else if (ctIsTired && stageEnded && TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[currentCharacter] > 0 && CFloorManagement.CurrentNumberOfLives > 0) { + int animChar = TJAPlayer3.Skin.Characters_Tower_Clear_Tired_IsLooping[currentCharacter] ? + ctClearTiredAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[currentCharacter] : + Math.Min(ctClearTiredAnimation.CurrentValue, TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[currentCharacter] - 1); + TJAPlayer3.Tx.Characters_Tower_Clear_Tired[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0], TJAPlayer3.Skin.Game_Tower_Don[1]); + } + // Clear + else if (stageEnded && TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[currentCharacter] > 0 && CFloorManagement.CurrentNumberOfLives > 0) { + int animChar = TJAPlayer3.Skin.Characters_Tower_Clear_IsLooping[currentCharacter] ? + ctClearAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[currentCharacter] : + Math.Min(ctClearAnimation.CurrentValue, TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[currentCharacter] - 1); + TJAPlayer3.Tx.Characters_Tower_Clear[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0], TJAPlayer3.Skin.Game_Tower_Don[1]); + } + + // Tired Stand + else if (ctIsTired && TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn[currentCharacter] > 0) { + int animChar = ctStandTiredAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn[currentCharacter]; + TJAPlayer3.Tx.Characters_Tower_Standing_Tired[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0], TJAPlayer3.Skin.Game_Tower_Don[1]); // Center X - 50 + } + // Stand + else if (TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[currentCharacter] > 0) { + int animChar = ctStandingAnimation.CurrentValue % TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[currentCharacter]; + TJAPlayer3.Tx.Characters_Tower_Standing[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Tower_Don[0], TJAPlayer3.Skin.Game_Tower_Don[1]); // Center X - 50 + } + } + + #endregion + + #region [Miss icon] + + if (CFloorManagement.InvincibilityFrames != null && CFloorManagement.InvincibilityFrames.CurrentValue < CFloorManagement.InvincibilityDurationSpeedDependent) { + if (TJAPlayer3.Tx.Tower_Miss != null) + TJAPlayer3.Tx.Tower_Miss.Opacity = Math.Min(255, 1000 - CFloorManagement.InvincibilityFrames.CurrentValue); + TJAPlayer3.Tx.Tower_Miss?.t2D下中央基準描画(TJAPlayer3.Skin.Game_Tower_Miss[0], TJAPlayer3.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 (!TJAPlayer3.stage演奏ドラム画面.bDoublePlay && TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { + if (!IsDownNotFound) { + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) DownScript?.Update(); + DownScript?.Draw(); + } + } + + + #endregion + + return base.Draw(); + } + + #region[ private ] + //----------------- + + #region 背景 + /*private CTexture Background, Background_Down, Background_Down_Clear, Background_Down_Scroll; @@ -616,9 +553,9 @@ namespace TJAPlayer3 Background_Up_3rd, Background_Up_Dan = new CTexture[6], Background_Up_Tower = new CTexture[8];*/ - #endregion + #endregion - /*private CCounter[] ct上背景スクロール用タイマー1st; //上背景のX方向スクロール用 + /*private CCounter[] ct上背景スクロール用タイマー1st; //上背景のX方向スクロール用 private CCounter[] ct上背景スクロール用タイマー2nd; //上背景のY方向スクロール用 private CCounter[] ct上背景スクロール用タイマー3rd; //上背景のY方向スクロール用 private CCounter ct下背景スクロール用タイマー1; //下背景パーツ1のX方向スクロール用 @@ -630,41 +567,41 @@ namespace TJAPlayer3 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; + //private CTexture tx上背景メイン; + //private CTexture tx上背景クリアメイン; + //private CTexture tx下背景メイン; + //private CTexture tx下背景クリアメイン; + //private CTexture tx下背景クリアサブ1; - private ScriptBG UpScript; - private ScriptBG DownScript; + private ScriptBG UpScript; + private ScriptBG DownScript; - private TitleTextureKey ttkTouTatsuKaiSuu; - private TitleTextureKey ttkKai; - private CCachedFontRenderer pfTowerText; + 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 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 CCounter ct炎; - private bool IsUpNotFound; - private bool IsDownNotFound; + private bool IsUpNotFound; + private bool IsDownNotFound; - private EFIFOモード eFadeMode; - //----------------- - #endregion - } + private EFIFOモード eFadeMode; + //----------------- + #endregion + } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBalloon.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBalloon.cs index 84b8b8a5..c827b722 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBalloon.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBalloon.cs @@ -1,297 +1,251 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Diagnostics; +using System.Drawing; using System.Runtime.InteropServices; using FDK; -namespace TJAPlayer3 -{ - internal class CActImplBalloon : CActivity - { +namespace TJAPlayer3 { + 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(); - } - - this.ct風船ふきだしアニメ = new CCounter(0, 1, 100, TJAPlayer3.Timer); + 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(); + } - KusudamaScript = new (CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.BALLOON}{TextureLoader.KUSUDAMA}Script.lua")); - KusudamaScript.Init(); + this.ct風船ふきだしアニメ = new CCounter(0, 1, 100, TJAPlayer3.Timer); - base.Activate(); - } + KusudamaScript = new(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.BALLOON}{TextureLoader.KUSUDAMA}Script.lua")); + KusudamaScript.Init(); - public override void DeActivate() - { - KusudamaScript.Dispose(); + base.Activate(); + } - this.ct風船終了 = null; - this.ct風船ふきだしアニメ = null; + public override void DeActivate() { + KusudamaScript.Dispose(); - base.DeActivate(); - } + this.ct風船終了 = null; + this.ct風船ふきだしアニメ = null; - public override void CreateManagedResource() - { - base.CreateManagedResource(); - } + base.DeActivate(); + } - public override void ReleaseManagedResource() - { - base.ReleaseManagedResource(); - } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } - public override int Draw() - { - return base.Draw(); - } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } - public void KusuIn() => KusudamaScript.KusuIn(); - public void KusuBroke() => KusudamaScript.KusuBroke(); - public void KusuMiss() => KusudamaScript.KusuMiss(); + public override int Draw() { + return base.Draw(); + } - public enum EBalloonType - { - BALLOON, - KUSUDAMA, - FUSEROLL - } + public void KusuIn() => KusudamaScript.KusuIn(); + public void KusuBroke() => KusudamaScript.KusuBroke(); + public void KusuMiss() => KusudamaScript.KusuMiss(); - public void tDrawKusudama() - { - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) - { - KusudamaScript.Update(); - } - KusudamaScript.Draw(); - } + public enum EBalloonType { + BALLOON, + KUSUDAMA, + FUSEROLL + } - public int On進行描画(int n連打ノルマ, int n連打数, int player, EBalloonType btype) - { - this.ct風船ふきだしアニメ.TickLoop(); - this.ct風船アニメ[player].Tick(); + public void tDrawKusudama() { + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) { + KusudamaScript.Update(); + } + KusudamaScript.Draw(); + } - //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 + public int On進行描画(int n連打ノルマ, int n連打数, int player, EBalloonType btype) { + this.ct風船ふきだしアニメ.TickLoop(); + this.ct風船アニメ[player].Tick(); - if (n連打数 != 0) - { - int x; - int y; - int frame_x; - int frame_y; - int num_x; - int num_y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - x = TJAPlayer3.Skin.Game_Balloon_Balloon_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * player); - y = TJAPlayer3.Skin.Game_Balloon_Balloon_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * player); - frame_x = TJAPlayer3.Skin.Game_Balloon_Balloon_Frame_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * player); - frame_y = TJAPlayer3.Skin.Game_Balloon_Balloon_Frame_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * player); - num_x = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * player); - num_y = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * player); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - x = TJAPlayer3.Skin.Game_Balloon_Balloon_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * player); - y = TJAPlayer3.Skin.Game_Balloon_Balloon_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * player); - frame_x = TJAPlayer3.Skin.Game_Balloon_Balloon_Frame_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * player); - frame_y = TJAPlayer3.Skin.Game_Balloon_Balloon_Frame_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * player); - num_x = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * player); - num_y = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * player); - } - else - { - x = TJAPlayer3.Skin.Game_Balloon_Balloon_X[player]; - y = TJAPlayer3.Skin.Game_Balloon_Balloon_Y[player]; - frame_x = TJAPlayer3.Skin.Game_Balloon_Balloon_Frame_X[player]; - frame_y = TJAPlayer3.Skin.Game_Balloon_Balloon_Frame_Y[player]; - num_x = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_X[player]; - num_y = TJAPlayer3.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++) - { + //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残り打数[j] < n連打数 && btype == EBalloonType.BALLOON) - { - if (TJAPlayer3.Tx.Balloon_Breaking[j] != null) - TJAPlayer3.Tx.Balloon_Breaking[j].t2D描画(x + (this.ct風船ふきだしアニメ.CurrentValue == 1 ? 3 : 0), y); - break; - } - } - //1P:31 2P:329 + if (n連打数 != 0) { + int x; + int y; + int frame_x; + int frame_y; + int num_x; + int num_y; + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + x = TJAPlayer3.Skin.Game_Balloon_Balloon_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * player); + y = TJAPlayer3.Skin.Game_Balloon_Balloon_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * player); + frame_x = TJAPlayer3.Skin.Game_Balloon_Balloon_Frame_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * player); + frame_y = TJAPlayer3.Skin.Game_Balloon_Balloon_Frame_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * player); + num_x = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * player); + num_y = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * player); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + x = TJAPlayer3.Skin.Game_Balloon_Balloon_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * player); + y = TJAPlayer3.Skin.Game_Balloon_Balloon_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * player); + frame_x = TJAPlayer3.Skin.Game_Balloon_Balloon_Frame_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * player); + frame_y = TJAPlayer3.Skin.Game_Balloon_Balloon_Frame_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * player); + num_x = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * player); + num_y = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * player); + } else { + x = TJAPlayer3.Skin.Game_Balloon_Balloon_X[player]; + y = TJAPlayer3.Skin.Game_Balloon_Balloon_Y[player]; + frame_x = TJAPlayer3.Skin.Game_Balloon_Balloon_Frame_X[player]; + frame_y = TJAPlayer3.Skin.Game_Balloon_Balloon_Frame_Y[player]; + num_x = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_X[player]; + num_y = TJAPlayer3.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 (btype == EBalloonType.BALLOON) - { - if (TJAPlayer3.Tx.Balloon_Balloon != null) - TJAPlayer3.Tx.Balloon_Balloon.t2D描画(frame_x, frame_y); - this.t文字表示(num_x, num_y, n連打数, player); - } - else if (btype == EBalloonType.FUSEROLL) - { - if (TJAPlayer3.Tx.Fuse_Balloon != null) - TJAPlayer3.Tx.Fuse_Balloon.t2D描画(frame_x, frame_y); - this.tFuseNumber(num_x, num_y, n連打数, player); - } - else if (btype == EBalloonType.KUSUDAMA && player == 0) - { - /* + if (n残り打数[j] < n連打数 && btype == EBalloonType.BALLOON) { + if (TJAPlayer3.Tx.Balloon_Breaking[j] != null) + TJAPlayer3.Tx.Balloon_Breaking[j].t2D描画(x + (this.ct風船ふきだしアニメ.CurrentValue == 1 ? 3 : 0), y); + break; + } + } + //1P:31 2P:329 + + if (btype == EBalloonType.BALLOON) { + if (TJAPlayer3.Tx.Balloon_Balloon != null) + TJAPlayer3.Tx.Balloon_Balloon.t2D描画(frame_x, frame_y); + this.t文字表示(num_x, num_y, n連打数, player); + } else if (btype == EBalloonType.FUSEROLL) { + if (TJAPlayer3.Tx.Fuse_Balloon != null) + TJAPlayer3.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); */ - this.tKusudamaNumber(n連打数); - } - - //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.白, n連打数.ToString() ); - } - if (btype == EBalloonType.KUSUDAMA) - { - /* + 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 && TJAPlayer3.stage演奏ドラム画面.actChara.b風船連打中[player]) - { - TJAPlayer3.stage演奏ドラム画面.actChara.b風船連打中[player] = false; - TJAPlayer3.stage演奏ドラム画面.b連打中[player] = false; - } - } + } else { + if (n連打数 == 0 && TJAPlayer3.stage演奏ドラム画面.actChara.b風船連打中[player]) { + TJAPlayer3.stage演奏ドラム画面.actChara.b風船連打中[player] = false; + TJAPlayer3.stage演奏ドラム画面.b連打中[player] = false; + } + } - return base.Draw(); - } + return base.Draw(); + } - private KusudamaScript KusudamaScript; + private KusudamaScript KusudamaScript; - private CCounter ct風船終了; - private CCounter ct風船ふきだしアニメ; + private CCounter ct風船終了; + private CCounter ct風船ふきだしアニメ; - public CCounter[] ct風船アニメ; - private float[] RollScale = new float[] - { - 0.000f, - 0.123f, // リピート + 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 - }; + 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; - } + [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 - (TJAPlayer3.Skin.Game_Balloon_Number_Interval[0] * offset); - float _y = y - (TJAPlayer3.Skin.Game_Balloon_Number_Interval[1] * offset); + 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 - (TJAPlayer3.Skin.Game_Balloon_Number_Interval[0] * offset); + float _y = y - (TJAPlayer3.Skin.Game_Balloon_Number_Interval[1] * offset); - float width = tx.sz画像サイズ.Width / 10.0f; - float height = tx.sz画像サイズ.Height; + float width = tx.sz画像サイズ.Width / 10.0f; + float height = tx.sz画像サイズ.Height; - tx.t2D拡大率考慮下基準描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - } - } + tx.t2D拡大率考慮下基準描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); + } + } - private void tKusudamaNumber(int num) - { - if (TJAPlayer3.Tx.Kusudama_Number == null) return; - TJAPlayer3.Tx.Kusudama_Number.vcScaleRatio.X = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_Scale; - TJAPlayer3.Tx.Kusudama_Number.vcScaleRatio.Y = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_Scale; - int x = TJAPlayer3.Skin.Game_Kusudama_Number_X; - int y = TJAPlayer3.Skin.Game_Kusudama_Number_Y; + private void tKusudamaNumber(int num) { + if (TJAPlayer3.Tx.Kusudama_Number == null) return; + TJAPlayer3.Tx.Kusudama_Number.vcScaleRatio.X = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_Scale; + TJAPlayer3.Tx.Kusudama_Number.vcScaleRatio.Y = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_Scale; + int x = TJAPlayer3.Skin.Game_Kusudama_Number_X; + int y = TJAPlayer3.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 = TJAPlayer3.Tx.Kusudama_Number.sz画像サイズ.Width / 10.0f; - float height = TJAPlayer3.Tx.Kusudama_Number.sz画像サイズ.Height; - float _x = x - (width * offset); - float _y = y; + int[] nums = CConversion.SeparateDigits(num); + for (int j = 0; j < nums.Length; j++) { + float offset = j - ((nums.Length - 2) / 2.0f); + float width = TJAPlayer3.Tx.Kusudama_Number.sz画像サイズ.Width / 10.0f; + float height = TJAPlayer3.Tx.Kusudama_Number.sz画像サイズ.Height; + float _x = x - (width * offset); + float _y = y; - TJAPlayer3.Tx.Kusudama_Number.t2D拡大率考慮下基準描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - } - } + TJAPlayer3.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 (TJAPlayer3.Tx.Fuse_Number == null) return; - TJAPlayer3.Tx.Fuse_Number.vcScaleRatio.X = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_Scale; - TJAPlayer3.Tx.Fuse_Number.vcScaleRatio.Y = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_Scale + RollScale[this.ct風船アニメ[nPlayer].CurrentValue]; + private void tFuseNumber(int x, int y, int num, int nPlayer) { + if (TJAPlayer3.Tx.Fuse_Number == null) return; + TJAPlayer3.Tx.Fuse_Number.vcScaleRatio.X = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_Scale; + TJAPlayer3.Tx.Fuse_Number.vcScaleRatio.Y = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_Scale + RollScale[this.ct風船アニメ[nPlayer].CurrentValue]; - _nbDisplay(TJAPlayer3.Tx.Fuse_Number, num, x, y); - } + _nbDisplay(TJAPlayer3.Tx.Fuse_Number, num, x, y); + } - private void t文字表示(int x, int y, int num, int nPlayer) - { - if (TJAPlayer3.Tx.Balloon_Number_Roll == null) return; - TJAPlayer3.Tx.Balloon_Number_Roll.vcScaleRatio.X = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_Scale; - TJAPlayer3.Tx.Balloon_Number_Roll.vcScaleRatio.Y = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_Scale + RollScale[this.ct風船アニメ[nPlayer].CurrentValue]; + private void t文字表示(int x, int y, int num, int nPlayer) { + if (TJAPlayer3.Tx.Balloon_Number_Roll == null) return; + TJAPlayer3.Tx.Balloon_Number_Roll.vcScaleRatio.X = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_Scale; + TJAPlayer3.Tx.Balloon_Number_Roll.vcScaleRatio.Y = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_Scale + RollScale[this.ct風船アニメ[nPlayer].CurrentValue]; - _nbDisplay(TJAPlayer3.Tx.Balloon_Number_Roll, num, x, y); - } + _nbDisplay(TJAPlayer3.Tx.Balloon_Number_Roll, num, x, y); + } - public void tEnd() - { - this.ct風船終了 = new CCounter(0, 80, 10, SoundManager.PlayTimer); - } - } + 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 83b6147c..7b2bbc7f 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplCharacter.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplCharacter.cs @@ -1,36 +1,24 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Globalization; -using System.Runtime.InteropServices; -using System.Drawing; -using System.Diagnostics; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - //クラスの設置位置は必ず演奏画面共通に置くこと。 - //そうしなければBPM変化に対応できません。 +namespace TJAPlayer3 { + //クラスの設置位置は必ず演奏画面共通に置くこと。 + //そうしなければBPM変化に対応できません。 - //完成している部分は以下のとおり。(画像完成+動作確認完了で完成とする) - //_通常モーション - //_ゴーゴータイムモーション - //_クリア時モーション - // - internal class CActImplCharacter : CActivity - { - public CActImplCharacter() - { + //完成している部分は以下のとおり。(画像完成+動作確認完了で完成とする) + //_通常モーション + //_ゴーゴータイムモーション + //_クリア時モーション + // + internal class CActImplCharacter : CActivity { + public CActImplCharacter() { - } + } - public override void Activate() - { - for(int i = 0; i < 5; i++) - { + 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(); @@ -46,50 +34,48 @@ namespace TJAPlayer3 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(); + //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 = TJAPlayer3.GetActualPlayer(i); + // Currently used character + int p = TJAPlayer3.GetActualPlayer(i); - this.iCurrentCharacter[i] = Math.Max(0, Math.Min(TJAPlayer3.SaveFileInstances[p].data.Character, TJAPlayer3.Skin.Characters_Ptn - 1)); + this.iCurrentCharacter[i] = Math.Max(0, Math.Min(TJAPlayer3.SaveFileInstances[p].data.Character, TJAPlayer3.Skin.Characters_Ptn - 1)); - if (TJAPlayer3.Skin.Characters_Normal_Ptn[this.iCurrentCharacter[i]] != 0) ChangeAnime(i, Anime.Normal, true); - else ChangeAnime(i, Anime.None, true); + if (TJAPlayer3.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; + 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(TJAPlayer3.Skin.Characters_Balloon_FadeOut[this.iCurrentCharacter[i]]); + // CharaAction_Balloon_FadeOut[i] = new Animations.FadeOut(TJAPlayer3.Skin.Game_Chara_Balloon_FadeOut); + CharaAction_Balloon_FadeOut[i] = new Animations.FadeOut(TJAPlayer3.Skin.Characters_Balloon_FadeOut[this.iCurrentCharacter[i]]); - var tick = TJAPlayer3.Skin.Characters_Balloon_Timer[this.iCurrentCharacter[i]]; + var tick = TJAPlayer3.Skin.Characters_Balloon_Timer[this.iCurrentCharacter[i]]; - var balloonBrokePtn = TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn[this.iCurrentCharacter[i]]; - var balloonMissPtn = TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn[this.iCurrentCharacter[i]]; + var balloonBrokePtn = TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn[this.iCurrentCharacter[i]]; + var balloonMissPtn = TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn[this.iCurrentCharacter[i]]; - CharaAction_Balloon_FadeOut_StartMs[i] = new int[2]; + CharaAction_Balloon_FadeOut_StartMs[i] = new int[2]; - CharaAction_Balloon_FadeOut_StartMs[i][0] = (balloonBrokePtn * tick) - TJAPlayer3.Skin.Characters_Balloon_FadeOut[this.iCurrentCharacter[i]]; - CharaAction_Balloon_FadeOut_StartMs[i][1] = (balloonMissPtn * tick) - TJAPlayer3.Skin.Characters_Balloon_FadeOut[this.iCurrentCharacter[i]]; + CharaAction_Balloon_FadeOut_StartMs[i][0] = (balloonBrokePtn * tick) - TJAPlayer3.Skin.Characters_Balloon_FadeOut[this.iCurrentCharacter[i]]; + CharaAction_Balloon_FadeOut_StartMs[i][1] = (balloonMissPtn * tick) - TJAPlayer3.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 (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; - } + if (CharaAction_Balloon_Delay[i] != null) CharaAction_Balloon_Delay[i].CurrentValue = (int)CharaAction_Balloon_Delay[i].EndValue; + } - base.Activate(); - } + base.Activate(); + } - public override void DeActivate() - { - for (int i = 0; i < 5; i++) - { - /* + public override void DeActivate() { + for (int i = 0; i < 5; i++) { + /* ctChara_Normal[i] = null; ctChara_Miss[i] = null; ctChara_MissDown[i] = null; @@ -104,974 +90,799 @@ namespace TJAPlayer3 this.ctキャラクターアクション_Return[i] = null; */ - //CharaAction_Balloon_Breaking[i] = null; - //CharaAction_Balloon_Broke[i] = null; - //CharaAction_Balloon_Miss[i] = null; - CharaAction_Balloon_Delay[i] = null; - - CharaAction_Balloon_FadeOut[i] = null; - } - - base.DeActivate(); - } - - 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]]); - - //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 ReleaseManagedResource() - { - base.ReleaseManagedResource(); - } - - public override int Draw() - { - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - int Character = this.iCurrentCharacter[i]; - - if (TJAPlayer3.Skin.Characters_Ptn == 0) - break; - - // Blinking animation during invincibility frames - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - { - if (CFloorManagement.isBlinking() == true) - break; - } - - CTexture nowChara = null; - - void updateNormal() - { - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) - { - nNowCharaCounter[i] += ((Math.Abs((float)TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[i]) / 60.0f) * (float)TJAPlayer3.FPS.DeltaTime) / nCharaBeat[i]; - } - } - void updateBalloon() - { - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) - { - nNowCharaCounter[i] += (float)TJAPlayer3.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 = TJAPlayer3.Tx.Characters_Normal[Character][TJAPlayer3.Skin.Characters_Motion_Normal[Character][nNowCharaFrame[i]]]; - if (endAnime) - { - nNowCharaCounter[i] = 0; - nNowCharaFrame[i] = 0; - } - } - break; - case Anime.Miss: - { - updateNormal(); - ReturnDefaultAnime(i, false); - nowChara = TJAPlayer3.Tx.Characters_Normal_Missed[Character][TJAPlayer3.Skin.Characters_Motion_Miss[Character][nNowCharaFrame[i]]]; - if (endAnime) - { - nNowCharaCounter[i] = 0; - nNowCharaFrame[i] = 0; - } - } - break; - case Anime.MissDown: - { - updateNormal(); - ReturnDefaultAnime(i, false); - nowChara = TJAPlayer3.Tx.Characters_Normal_MissedDown[Character][TJAPlayer3.Skin.Characters_Motion_MissDown[Character][nNowCharaFrame[i]]]; - if (endAnime) - { - nNowCharaCounter[i] = 0; - nNowCharaFrame[i] = 0; - } - } - break; - case Anime.Cleared: - { - updateNormal(); - ReturnDefaultAnime(i, false); - nowChara = TJAPlayer3.Tx.Characters_Normal_Cleared[Character][TJAPlayer3.Skin.Characters_Motion_Clear[Character][nNowCharaFrame[i]]]; - if (endAnime) - { - nNowCharaCounter[i] = 0; - nNowCharaFrame[i] = 0; - } - } - break; - case Anime.Maxed: - { - updateNormal(); - ReturnDefaultAnime(i, false); - nowChara = TJAPlayer3.Tx.Characters_Normal_Maxed[Character][TJAPlayer3.Skin.Characters_Motion_ClearMax[Character][nNowCharaFrame[i]]]; - if (endAnime) - { - nNowCharaCounter[i] = 0; - nNowCharaFrame[i] = 0; - } - } - break; - case Anime.MissIn: - { - updateNormal(); - if (TJAPlayer3.Tx.Characters_MissIn[Character] != null && TJAPlayer3.Skin.Characters_MissIn_Ptn[Character] != 0) - { - nowChara = TJAPlayer3.Tx.Characters_MissIn[Character][TJAPlayer3.Skin.Characters_Motion_MissIn[Character][nNowCharaFrame[i]]]; - } - if (endAnime) - { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.MissDownIn: - { - updateNormal(); - if (TJAPlayer3.Tx.Characters_MissDownIn[Character] != null && TJAPlayer3.Skin.Characters_MissDownIn_Ptn[Character] != 0) - { - nowChara = TJAPlayer3.Tx.Characters_MissDownIn[Character][TJAPlayer3.Skin.Characters_Motion_MissDownIn[Character][nNowCharaFrame[i]]]; - } - if (endAnime) - { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.GoGoTime: - { - updateNormal(); - ReturnDefaultAnime(i, false); - nowChara = TJAPlayer3.Tx.Characters_GoGoTime[Character][TJAPlayer3.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 = TJAPlayer3.Tx.Characters_GoGoTime_Maxed[Character][TJAPlayer3.Skin.Characters_Motion_GoGoMax[Character][nNowCharaFrame[i]]]; - if (endAnime) - { - nNowCharaCounter[i] = 0; - nNowCharaFrame[i] = 0; - } - } - break; - case Anime.Combo10: - { - updateNormal(); - if (TJAPlayer3.Tx.Characters_10Combo[Character] != null && TJAPlayer3.Skin.Characters_10Combo_Ptn[Character] != 0) - { - nowChara = TJAPlayer3.Tx.Characters_10Combo[Character][TJAPlayer3.Skin.Characters_Motion_10Combo[Character][nNowCharaFrame[i]]]; - } - if (endAnime) - { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.Combo10_Clear: - { - updateNormal(); - if (TJAPlayer3.Tx.Characters_10Combo_Clear[Character] != null && TJAPlayer3.Skin.Characters_10Combo_Clear_Ptn[Character] != 0) - { - nowChara = TJAPlayer3.Tx.Characters_10Combo_Clear[Character][TJAPlayer3.Skin.Characters_Motion_10Combo_Clear[Character][nNowCharaFrame[i]]]; - } - if (endAnime) - { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.Combo10_Max: - { - updateNormal(); - if (TJAPlayer3.Tx.Characters_10Combo_Maxed[Character] != null && TJAPlayer3.Skin.Characters_10Combo_Maxed_Ptn[Character] != 0) - { - nowChara = TJAPlayer3.Tx.Characters_10Combo_Maxed[Character][TJAPlayer3.Skin.Characters_Motion_10ComboMax[Character][nNowCharaFrame[i]]]; - } - if (endAnime) - { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.GoGoStart: - { - updateNormal(); - if (TJAPlayer3.Tx.Characters_GoGoStart[Character] != null && TJAPlayer3.Skin.Characters_GoGoStart_Ptn[Character] != 0) - { - nowChara = TJAPlayer3.Tx.Characters_GoGoStart[Character][TJAPlayer3.Skin.Characters_Motion_GoGoStart[Character][nNowCharaFrame[i]]]; - } - if (endAnime) - { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.GoGoStart_Clear: - { - updateNormal(); - if (TJAPlayer3.Tx.Characters_GoGoStart_Clear[Character] != null && TJAPlayer3.Skin.Characters_GoGoStart_Clear_Ptn[Character] != 0) - { - nowChara = TJAPlayer3.Tx.Characters_GoGoStart_Clear[Character][TJAPlayer3.Skin.Characters_Motion_GoGoStart_Clear[Character][nNowCharaFrame[i]]]; - } - if (endAnime) - { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.GoGoStart_Max: - { - updateNormal(); - if (TJAPlayer3.Tx.Characters_GoGoStart_Maxed[Character] != null && TJAPlayer3.Skin.Characters_GoGoStart_Maxed_Ptn[Character] != 0) - { - nowChara = TJAPlayer3.Tx.Characters_GoGoStart_Maxed[Character][TJAPlayer3.Skin.Characters_Motion_GoGoStartMax[Character][nNowCharaFrame[i]]]; - } - if (endAnime) - { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.Become_Cleared: - { - updateNormal(); - if (TJAPlayer3.Tx.Characters_Become_Cleared[Character] != null && TJAPlayer3.Skin.Characters_Become_Cleared_Ptn[Character] != 0) - { - nowChara = TJAPlayer3.Tx.Characters_Become_Cleared[Character][TJAPlayer3.Skin.Characters_Motion_ClearIn[Character][nNowCharaFrame[i]]]; - } - if (endAnime) - { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.Become_Maxed: - { - updateNormal(); - if (TJAPlayer3.Tx.Characters_Become_Maxed[Character] != null && TJAPlayer3.Skin.Characters_Become_Maxed_Ptn[Character] != 0) - { - nowChara = TJAPlayer3.Tx.Characters_Become_Maxed[Character][TJAPlayer3.Skin.Characters_Motion_SoulIn[Character][nNowCharaFrame[i]]]; - } - if (endAnime) - { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.SoulOut: - { - updateNormal(); - if (TJAPlayer3.Tx.Characters_SoulOut[Character] != null && TJAPlayer3.Skin.Characters_SoulOut_Ptn[Character] != 0) - { - nowChara = TJAPlayer3.Tx.Characters_SoulOut[Character][TJAPlayer3.Skin.Characters_Motion_SoulOut[Character][nNowCharaFrame[i]]]; - } - if (endAnime) - { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.ClearOut: - { - updateNormal(); - if (TJAPlayer3.Tx.Characters_ClearOut[Character] != null && TJAPlayer3.Skin.Characters_ClearOut_Ptn[Character] != 0) - { - nowChara = TJAPlayer3.Tx.Characters_ClearOut[Character][TJAPlayer3.Skin.Characters_Motion_ClearOut[Character][nNowCharaFrame[i]]]; - } - if (endAnime) - { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.Return: - { - updateNormal(); - if (TJAPlayer3.Tx.Characters_Return[Character] != null && TJAPlayer3.Skin.Characters_Return_Ptn[Character] != 0) - { - nowChara = TJAPlayer3.Tx.Characters_Return[Character][TJAPlayer3.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 = TJAPlayer3.ConfigIni.bAIBattleMode ? (i == 1) : false; - - float resolutionScaleX = TJAPlayer3.Skin.Resolution[0] / (float)TJAPlayer3.Skin.Characters_Resolution[Character][0]; - float resolutionScaleY = TJAPlayer3.Skin.Resolution[1] / (float)TJAPlayer3.Skin.Characters_Resolution[Character][1]; - - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - chara_x = (TJAPlayer3.Skin.Characters_X_AI[Character][i] * resolutionScaleX); - chara_y = (TJAPlayer3.Skin.Characters_Y_AI[Character][i] * resolutionScaleY); - - if (nowChara != null) - { - charaScale = 0.58f; - } - } - else if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) - { - chara_x = (TJAPlayer3.Skin.Characters_X[Character][i] * resolutionScaleX); - chara_y = (TJAPlayer3.Skin.Characters_Y[Character][i] * resolutionScaleY); - - if (nowChara != null) - { - charaScale = 1.0f; - } - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - chara_x = (TJAPlayer3.Skin.Characters_5P[Character][0] * resolutionScaleX) + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - chara_y = (TJAPlayer3.Skin.Characters_5P[Character][1] * resolutionScaleY) + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - - if (nowChara != null) - { - charaScale = 0.58f; - } - } - else - { - chara_x = (TJAPlayer3.Skin.Characters_4P[Character][0] * resolutionScaleX) + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - chara_y = (TJAPlayer3.Skin.Characters_4P[Character][1] * resolutionScaleY) + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - - if (nowChara != null) - { - charaScale = 0.58f; - } - } - - charaScale *= resolutionScaleY; - //chara_x *= resolutionScaleX; - //chara_y *= resolutionScaleY; - - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - chara_x += TJAPlayer3.Skin.Game_AIBattle_CharaMove * TJAPlayer3.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) || TJAPlayer3.ConfigIni.nPlayerCount > 2) - { - if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) - { - TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画(TJAPlayer3.Skin.Game_PuchiChara_X[i], TJAPlayer3.Skin.Game_PuchiChara_Y[i], TJAPlayer3.stage演奏ドラム画面.bIsAlreadyMaxed[i], player: i); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画(TJAPlayer3.Skin.Game_PuchiChara_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i), TJAPlayer3.Skin.Game_PuchiChara_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i), TJAPlayer3.stage演奏ドラム画面.bIsAlreadyMaxed[i], player: i, scale: 0.5f); - } - else - { - TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画(TJAPlayer3.Skin.Game_PuchiChara_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i), TJAPlayer3.Skin.Game_PuchiChara_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i), TJAPlayer3.stage演奏ドラム画面.bIsAlreadyMaxed[i], player: i, scale: 0.5f); - } - } - } - return base.Draw(); - } - - public void OnDraw_Balloon() - { - for (int i = 0; i < TJAPlayer3.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 = TJAPlayer3.Skin.Resolution[0] / (float)TJAPlayer3.Skin.Characters_Resolution[this.iCurrentCharacter[i]][0]; - float resolutionScaleY = TJAPlayer3.Skin.Resolution[1] / (float)TJAPlayer3.Skin.Characters_Resolution[this.iCurrentCharacter[i]][1]; - - float chara_x = 0; - float chara_y = 0; - float kusu_chara_x = TJAPlayer3.Skin.Characters_Kusudama_X[this.iCurrentCharacter[i]][i] * resolutionScaleX; - float kusu_chara_y = TJAPlayer3.Skin.Characters_Kusudama_Y[this.iCurrentCharacter[i]][i] * resolutionScaleY; - - if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) - { - chara_x = TJAPlayer3.Skin.Characters_Balloon_X[this.iCurrentCharacter[i]][i]; - chara_y = TJAPlayer3.Skin.Characters_Balloon_Y[this.iCurrentCharacter[i]][i]; - } - else - { - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - chara_x = TJAPlayer3.Skin.Characters_Balloon_5P[this.iCurrentCharacter[i]][0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - chara_y = TJAPlayer3.Skin.Characters_Balloon_5P[this.iCurrentCharacter[i]][1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - } - else - { - chara_x = TJAPlayer3.Skin.Characters_Balloon_4P[this.iCurrentCharacter[i]][0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - chara_y = TJAPlayer3.Skin.Characters_Balloon_4P[this.iCurrentCharacter[i]][1] + (TJAPlayer3.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 (TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn[this.iCurrentCharacter[i]] != 0 && TJAPlayer3.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) - { - TJAPlayer3.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].Opacity = nowOpacity; - TJAPlayer3.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; - TJAPlayer3.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; - TJAPlayer3.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画( - TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(i) + chara_x, - TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(i) + chara_y); - } - - if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) - TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( - TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(i) + TJAPlayer3.Skin.Game_PuchiChara_BalloonX[i], - TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(i) + TJAPlayer3.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 (TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn[this.iCurrentCharacter[i]] != 0 && TJAPlayer3.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) - { - TJAPlayer3.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].Opacity = nowOpacity; - TJAPlayer3.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; - TJAPlayer3.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; - TJAPlayer3.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画( - TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(i) + chara_x, - TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(i) + chara_y); - } - - if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) - TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( - TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(i) + TJAPlayer3.Skin.Game_PuchiChara_BalloonX[i], - TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(i) + TJAPlayer3.Skin.Game_PuchiChara_BalloonY[i], false, nowOpacity, true, player : i); - - if (endAnime) - { - ReturnDefaultAnime(i, true); - } - } - else if (eNowAnime[i] == Anime.Balloon_Breaking) - { - if (TJAPlayer3.Skin.Characters_Balloon_Breaking_Ptn[this.iCurrentCharacter[i]] != 0 && TJAPlayer3.Tx.Characters_Balloon_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) - { - TJAPlayer3.Tx.Characters_Balloon_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; - TJAPlayer3.Tx.Characters_Balloon_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; - TJAPlayer3.Tx.Characters_Balloon_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画( - TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(i) + chara_x, - TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(i) + chara_y); - } - - if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) - TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( - TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(i) + TJAPlayer3.Skin.Game_PuchiChara_BalloonX[i], - TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(i) + TJAPlayer3.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)) * TJAPlayer3.Skin.Resolution[0] / 2.0f) * resolutionScaleX; - float kusuOutY = (MathF.Sin(nNowCharaCounter[i] * MathF.PI / 2) * TJAPlayer3.Skin.Resolution[1] / 2.0f) * resolutionScaleY; - - if (TJAPlayer3.Skin.Characters_Kusudama_Broke_Ptn[this.iCurrentCharacter[i]] != 0 && TJAPlayer3.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) - { - TJAPlayer3.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].Opacity = nowOpacity; - TJAPlayer3.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; - TJAPlayer3.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; - if (i % 2 == 0) - { - TJAPlayer3.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画(kusu_chara_x - kusuOutX, kusu_chara_y - kusuOutY); - } - else - { - TJAPlayer3.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D左右反転描画(kusu_chara_x + kusuOutX, kusu_chara_y - kusuOutY); - } - } - if (i % 2 == 0) - { - TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( - TJAPlayer3.Skin.Game_PuchiChara_KusudamaX[i] - (int)kusuOutX, - TJAPlayer3.Skin.Game_PuchiChara_KusudamaY[i] - (int)kusuOutY, false, nowOpacity, true, player : i); - } - else - { - TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( - TJAPlayer3.Skin.Game_PuchiChara_KusudamaX[i] + (int)kusuOutX, - TJAPlayer3.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) * TJAPlayer3.Skin.Resolution[1] * 2) * resolutionScaleY; - - if (TJAPlayer3.Skin.Characters_Kusudama_Miss_Ptn[this.iCurrentCharacter[i]] != 0 && TJAPlayer3.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) - { - TJAPlayer3.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].Opacity = nowOpacity; - TJAPlayer3.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; - TJAPlayer3.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; - - - if (i % 2 == 0) - { - TJAPlayer3.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画(kusu_chara_x, kusu_chara_y + kusuOutY); - } - else - { - TJAPlayer3.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D左右反転描画(kusu_chara_x, kusu_chara_y + kusuOutY); - } - } - - TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( - TJAPlayer3.Skin.Game_PuchiChara_KusudamaX[i], - TJAPlayer3.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)) * TJAPlayer3.Skin.Resolution[0] / 2.0f) * resolutionScaleX; - float kusuInY = -((MathF.Cos(ctKusuIn[i].CurrentValue / 1000.0f * MathF.PI / 2)) * TJAPlayer3.Skin.Resolution[1] / 2.0f) * resolutionScaleY; - - - if (TJAPlayer3.Skin.Characters_Kusudama_Breaking_Ptn[this.iCurrentCharacter[i]] != 0 && TJAPlayer3.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) - { - TJAPlayer3.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; - TJAPlayer3.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; - if (i % 2 == 0) - { - TJAPlayer3.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画(kusu_chara_x - kusuInX, kusu_chara_y + kusuInY); - } - else - { - TJAPlayer3.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D左右反転描画(kusu_chara_x + kusuInX, kusu_chara_y + kusuInY); - } - } - - if (i % 2 == 0) - { - TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( - TJAPlayer3.Skin.Game_PuchiChara_KusudamaX[i] - (int)kusuInX, - TJAPlayer3.Skin.Game_PuchiChara_KusudamaY[i] + (int)kusuInY, false, 255, true, player : i); - } - else - { - TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( - TJAPlayer3.Skin.Game_PuchiChara_KusudamaX[i] + (int)kusuInX, - TJAPlayer3.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)) * TJAPlayer3.Skin.Resolution[0] / 2.0f) * resolutionScaleX; - float kusuInY = -((MathF.Cos(ctKusuIn[i].CurrentValue / 1000.0f * MathF.PI / 2)) * TJAPlayer3.Skin.Resolution[1] / 2.0f) * resolutionScaleY; - - if (TJAPlayer3.Skin.Characters_Kusudama_Idle_Ptn[this.iCurrentCharacter[i]] != 0 && TJAPlayer3.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) - { - TJAPlayer3.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; - TJAPlayer3.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; - if (i % 2 == 0) - { - TJAPlayer3.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画(kusu_chara_x - kusuInX, kusu_chara_y + kusuInY); - } - else - { - TJAPlayer3.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D左右反転描画(kusu_chara_x + kusuInX, kusu_chara_y + kusuInY); - } - } - - if (i % 2 == 0) - { - TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( - TJAPlayer3.Skin.Game_PuchiChara_KusudamaX[i] - (int)kusuInX, - TJAPlayer3.Skin.Game_PuchiChara_KusudamaY[i] + (int)kusuInY, false, 255, true, player : i); - } - else - { - TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( - TJAPlayer3.Skin.Game_PuchiChara_KusudamaX[i] + (int)kusuInX, - TJAPlayer3.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 (TJAPlayer3.stage演奏ドラム画面.bIsGOGOTIME[player] && TJAPlayer3.Skin.Characters_GoGoTime_Ptn[this.iCurrentCharacter[player]] != 0) - { - if (TJAPlayer3.stage演奏ドラム画面.bIsAlreadyMaxed[player] && TJAPlayer3.Skin.Characters_GoGoTime_Maxed_Ptn[this.iCurrentCharacter[player]] != 0) - { - ChangeAnime(player, Anime.GoGoTime_Maxed, resetCounter); - } - else - { - ChangeAnime(player, Anime.GoGoTime, resetCounter); - } - } - else - { - if (TJAPlayer3.stage演奏ドラム画面.bIsMiss[player] && TJAPlayer3.Skin.Characters_Normal_Missed_Ptn[this.iCurrentCharacter[player]] != 0) - { - if (TJAPlayer3.stage演奏ドラム画面.Chara_MissCount[player] >= 6 && TJAPlayer3.Skin.Characters_Normal_MissedDown_Ptn[this.iCurrentCharacter[player]] != 0) - { - ChangeAnime(player, Anime.MissDown, resetCounter); - } - else - { - ChangeAnime(player, Anime.Miss, resetCounter); - } - } - else - { - if (TJAPlayer3.stage演奏ドラム画面.bIsAlreadyMaxed[player] && TJAPlayer3.Skin.Characters_Normal_Maxed_Ptn[this.iCurrentCharacter[player]] != 0) - { - ChangeAnime(player, Anime.Maxed, resetCounter); - } - else if (TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared[player] && TJAPlayer3.Skin.Characters_Normal_Cleared_Ptn[this.iCurrentCharacter[player]] != 0) - { - ChangeAnime(player, Anime.Cleared, resetCounter); - } - else if (TJAPlayer3.Skin.Characters_Normal_Ptn[this.iCurrentCharacter[player]] != 0) - { - ChangeAnime(player, Anime.Normal, resetCounter); - } - else - { - 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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - ChangeAnime(i, Anime.Kusudama_Idle, true); - ctKusuIn[i] = new CCounter(0, 1000, 0.4f, TJAPlayer3.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] = TJAPlayer3.Skin.Characters_Motion_Normal[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_Normal[iCurrentCharacter[player]]; - break; - case Anime.Miss: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_Miss[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_Miss[iCurrentCharacter[player]]; - break; - case Anime.MissDown: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_MissDown[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_MissDown[iCurrentCharacter[player]]; - break; - case Anime.Cleared: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_Clear[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_Clear[iCurrentCharacter[player]]; - break; - case Anime.Maxed: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_ClearMax[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_ClearMax[iCurrentCharacter[player]]; - break; - case Anime.MissIn: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_MissIn[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_MissIn[iCurrentCharacter[player]]; - break; - case Anime.MissDownIn: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_MissDownIn[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_MissDownIn[iCurrentCharacter[player]]; - break; - case Anime.GoGoTime: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_GoGo[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_GoGo[iCurrentCharacter[player]]; - break; - case Anime.GoGoTime_Maxed: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_GoGoMax[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_GoGoMax[iCurrentCharacter[player]]; - break; - case Anime.Combo10: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_10Combo[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_10Combo[iCurrentCharacter[player]]; - break; - case Anime.Combo10_Clear: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_10Combo_Clear[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_10Combo_Clear[iCurrentCharacter[player]]; - break; - case Anime.Combo10_Max: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_10ComboMax[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_10ComboMax[iCurrentCharacter[player]]; - break; - case Anime.GoGoStart: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_GoGoStart[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_GoGoStart[iCurrentCharacter[player]]; - break; - case Anime.GoGoStart_Clear: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_GoGoStart_Clear[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_GoGoStart_Clear[iCurrentCharacter[player]]; - break; - case Anime.GoGoStart_Max: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_GoGoStartMax[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_GoGoStartMax[iCurrentCharacter[player]]; - break; - case Anime.Become_Cleared: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_ClearIn[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_ClearIn[iCurrentCharacter[player]]; - break; - case Anime.Become_Maxed: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_SoulIn[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_SoulIn[iCurrentCharacter[player]]; - break; - case Anime.SoulOut: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_SoulOut[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_SoulOut[iCurrentCharacter[player]]; - break; - case Anime.ClearOut: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_ClearOut[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_ClearOut[iCurrentCharacter[player]]; - break; - case Anime.Return: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_Return[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_Return[iCurrentCharacter[player]]; - break; - case Anime.Balloon_Breaking: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Balloon_Breaking_Ptn[iCurrentCharacter[player]] - 1; - nCharaBeat[player] = 0.2f; - break; - case Anime.Balloon_Broke: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn[iCurrentCharacter[player]] - 1; - nCharaBeat[player] = 0.2f; - break; - case Anime.Balloon_Miss: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn[iCurrentCharacter[player]] - 1; - nCharaBeat[player] = 0.2f; - break; - case Anime.Kusudama_Idle: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Kusudama_Idle_Ptn[iCurrentCharacter[player]] - 1; - nCharaBeat[player] = 0.4f; - break; - case Anime.Kusudama_Breaking: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Kusudama_Breaking_Ptn[iCurrentCharacter[player]] - 1; - nCharaBeat[player] = 0.2f; - break; - case Anime.Kusudama_Broke: - nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Kusudama_Broke_Ptn[iCurrentCharacter[player]] - 1; - nCharaBeat[player] = 1f; - break; - case Anime.Kusudama_Miss: - nCharaFrameCount[player] = TJAPlayer3.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 }; - } + //CharaAction_Balloon_Breaking[i] = null; + //CharaAction_Balloon_Broke[i] = null; + //CharaAction_Balloon_Miss[i] = null; + CharaAction_Balloon_Delay[i] = null; + + CharaAction_Balloon_FadeOut[i] = null; + } + + base.DeActivate(); + } + + 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]]); + + //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 ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + + public override int Draw() { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + int Character = this.iCurrentCharacter[i]; + + if (TJAPlayer3.Skin.Characters_Ptn == 0) + break; + + // Blinking animation during invincibility frames + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + if (CFloorManagement.isBlinking() == true) + break; + } + + CTexture nowChara = null; + + void updateNormal() { + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) { + nNowCharaCounter[i] += ((Math.Abs((float)TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[i]) / 60.0f) * (float)TJAPlayer3.FPS.DeltaTime) / nCharaBeat[i]; + } + } + void updateBalloon() { + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) { + nNowCharaCounter[i] += (float)TJAPlayer3.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 = TJAPlayer3.Tx.Characters_Normal[Character][TJAPlayer3.Skin.Characters_Motion_Normal[Character][nNowCharaFrame[i]]]; + if (endAnime) { + nNowCharaCounter[i] = 0; + nNowCharaFrame[i] = 0; + } + } + break; + case Anime.Miss: { + updateNormal(); + ReturnDefaultAnime(i, false); + nowChara = TJAPlayer3.Tx.Characters_Normal_Missed[Character][TJAPlayer3.Skin.Characters_Motion_Miss[Character][nNowCharaFrame[i]]]; + if (endAnime) { + nNowCharaCounter[i] = 0; + nNowCharaFrame[i] = 0; + } + } + break; + case Anime.MissDown: { + updateNormal(); + ReturnDefaultAnime(i, false); + nowChara = TJAPlayer3.Tx.Characters_Normal_MissedDown[Character][TJAPlayer3.Skin.Characters_Motion_MissDown[Character][nNowCharaFrame[i]]]; + if (endAnime) { + nNowCharaCounter[i] = 0; + nNowCharaFrame[i] = 0; + } + } + break; + case Anime.Cleared: { + updateNormal(); + ReturnDefaultAnime(i, false); + nowChara = TJAPlayer3.Tx.Characters_Normal_Cleared[Character][TJAPlayer3.Skin.Characters_Motion_Clear[Character][nNowCharaFrame[i]]]; + if (endAnime) { + nNowCharaCounter[i] = 0; + nNowCharaFrame[i] = 0; + } + } + break; + case Anime.Maxed: { + updateNormal(); + ReturnDefaultAnime(i, false); + nowChara = TJAPlayer3.Tx.Characters_Normal_Maxed[Character][TJAPlayer3.Skin.Characters_Motion_ClearMax[Character][nNowCharaFrame[i]]]; + if (endAnime) { + nNowCharaCounter[i] = 0; + nNowCharaFrame[i] = 0; + } + } + break; + case Anime.MissIn: { + updateNormal(); + if (TJAPlayer3.Tx.Characters_MissIn[Character] != null && TJAPlayer3.Skin.Characters_MissIn_Ptn[Character] != 0) { + nowChara = TJAPlayer3.Tx.Characters_MissIn[Character][TJAPlayer3.Skin.Characters_Motion_MissIn[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.MissDownIn: { + updateNormal(); + if (TJAPlayer3.Tx.Characters_MissDownIn[Character] != null && TJAPlayer3.Skin.Characters_MissDownIn_Ptn[Character] != 0) { + nowChara = TJAPlayer3.Tx.Characters_MissDownIn[Character][TJAPlayer3.Skin.Characters_Motion_MissDownIn[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.GoGoTime: { + updateNormal(); + ReturnDefaultAnime(i, false); + nowChara = TJAPlayer3.Tx.Characters_GoGoTime[Character][TJAPlayer3.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 = TJAPlayer3.Tx.Characters_GoGoTime_Maxed[Character][TJAPlayer3.Skin.Characters_Motion_GoGoMax[Character][nNowCharaFrame[i]]]; + if (endAnime) { + nNowCharaCounter[i] = 0; + nNowCharaFrame[i] = 0; + } + } + break; + case Anime.Combo10: { + updateNormal(); + if (TJAPlayer3.Tx.Characters_10Combo[Character] != null && TJAPlayer3.Skin.Characters_10Combo_Ptn[Character] != 0) { + nowChara = TJAPlayer3.Tx.Characters_10Combo[Character][TJAPlayer3.Skin.Characters_Motion_10Combo[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.Combo10_Clear: { + updateNormal(); + if (TJAPlayer3.Tx.Characters_10Combo_Clear[Character] != null && TJAPlayer3.Skin.Characters_10Combo_Clear_Ptn[Character] != 0) { + nowChara = TJAPlayer3.Tx.Characters_10Combo_Clear[Character][TJAPlayer3.Skin.Characters_Motion_10Combo_Clear[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.Combo10_Max: { + updateNormal(); + if (TJAPlayer3.Tx.Characters_10Combo_Maxed[Character] != null && TJAPlayer3.Skin.Characters_10Combo_Maxed_Ptn[Character] != 0) { + nowChara = TJAPlayer3.Tx.Characters_10Combo_Maxed[Character][TJAPlayer3.Skin.Characters_Motion_10ComboMax[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.GoGoStart: { + updateNormal(); + if (TJAPlayer3.Tx.Characters_GoGoStart[Character] != null && TJAPlayer3.Skin.Characters_GoGoStart_Ptn[Character] != 0) { + nowChara = TJAPlayer3.Tx.Characters_GoGoStart[Character][TJAPlayer3.Skin.Characters_Motion_GoGoStart[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.GoGoStart_Clear: { + updateNormal(); + if (TJAPlayer3.Tx.Characters_GoGoStart_Clear[Character] != null && TJAPlayer3.Skin.Characters_GoGoStart_Clear_Ptn[Character] != 0) { + nowChara = TJAPlayer3.Tx.Characters_GoGoStart_Clear[Character][TJAPlayer3.Skin.Characters_Motion_GoGoStart_Clear[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.GoGoStart_Max: { + updateNormal(); + if (TJAPlayer3.Tx.Characters_GoGoStart_Maxed[Character] != null && TJAPlayer3.Skin.Characters_GoGoStart_Maxed_Ptn[Character] != 0) { + nowChara = TJAPlayer3.Tx.Characters_GoGoStart_Maxed[Character][TJAPlayer3.Skin.Characters_Motion_GoGoStartMax[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.Become_Cleared: { + updateNormal(); + if (TJAPlayer3.Tx.Characters_Become_Cleared[Character] != null && TJAPlayer3.Skin.Characters_Become_Cleared_Ptn[Character] != 0) { + nowChara = TJAPlayer3.Tx.Characters_Become_Cleared[Character][TJAPlayer3.Skin.Characters_Motion_ClearIn[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.Become_Maxed: { + updateNormal(); + if (TJAPlayer3.Tx.Characters_Become_Maxed[Character] != null && TJAPlayer3.Skin.Characters_Become_Maxed_Ptn[Character] != 0) { + nowChara = TJAPlayer3.Tx.Characters_Become_Maxed[Character][TJAPlayer3.Skin.Characters_Motion_SoulIn[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.SoulOut: { + updateNormal(); + if (TJAPlayer3.Tx.Characters_SoulOut[Character] != null && TJAPlayer3.Skin.Characters_SoulOut_Ptn[Character] != 0) { + nowChara = TJAPlayer3.Tx.Characters_SoulOut[Character][TJAPlayer3.Skin.Characters_Motion_SoulOut[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.ClearOut: { + updateNormal(); + if (TJAPlayer3.Tx.Characters_ClearOut[Character] != null && TJAPlayer3.Skin.Characters_ClearOut_Ptn[Character] != 0) { + nowChara = TJAPlayer3.Tx.Characters_ClearOut[Character][TJAPlayer3.Skin.Characters_Motion_ClearOut[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.Return: { + updateNormal(); + if (TJAPlayer3.Tx.Characters_Return[Character] != null && TJAPlayer3.Skin.Characters_Return_Ptn[Character] != 0) { + nowChara = TJAPlayer3.Tx.Characters_Return[Character][TJAPlayer3.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 = TJAPlayer3.ConfigIni.bAIBattleMode ? (i == 1) : false; + + float resolutionScaleX = TJAPlayer3.Skin.Resolution[0] / (float)TJAPlayer3.Skin.Characters_Resolution[Character][0]; + float resolutionScaleY = TJAPlayer3.Skin.Resolution[1] / (float)TJAPlayer3.Skin.Characters_Resolution[Character][1]; + + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + chara_x = (TJAPlayer3.Skin.Characters_X_AI[Character][i] * resolutionScaleX); + chara_y = (TJAPlayer3.Skin.Characters_Y_AI[Character][i] * resolutionScaleY); + + if (nowChara != null) { + charaScale = 0.58f; + } + } else if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) { + chara_x = (TJAPlayer3.Skin.Characters_X[Character][i] * resolutionScaleX); + chara_y = (TJAPlayer3.Skin.Characters_Y[Character][i] * resolutionScaleY); + + if (nowChara != null) { + charaScale = 1.0f; + } + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + chara_x = (TJAPlayer3.Skin.Characters_5P[Character][0] * resolutionScaleX) + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + chara_y = (TJAPlayer3.Skin.Characters_5P[Character][1] * resolutionScaleY) + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + + if (nowChara != null) { + charaScale = 0.58f; + } + } else { + chara_x = (TJAPlayer3.Skin.Characters_4P[Character][0] * resolutionScaleX) + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + chara_y = (TJAPlayer3.Skin.Characters_4P[Character][1] * resolutionScaleY) + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + + if (nowChara != null) { + charaScale = 0.58f; + } + } + + charaScale *= resolutionScaleY; + //chara_x *= resolutionScaleX; + //chara_y *= resolutionScaleY; + + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + chara_x += TJAPlayer3.Skin.Game_AIBattle_CharaMove * TJAPlayer3.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) || TJAPlayer3.ConfigIni.nPlayerCount > 2) { + if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) { + TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画(TJAPlayer3.Skin.Game_PuchiChara_X[i], TJAPlayer3.Skin.Game_PuchiChara_Y[i], TJAPlayer3.stage演奏ドラム画面.bIsAlreadyMaxed[i], player: i); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画(TJAPlayer3.Skin.Game_PuchiChara_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i), TJAPlayer3.Skin.Game_PuchiChara_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i), TJAPlayer3.stage演奏ドラム画面.bIsAlreadyMaxed[i], player: i, scale: 0.5f); + } else { + TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画(TJAPlayer3.Skin.Game_PuchiChara_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i), TJAPlayer3.Skin.Game_PuchiChara_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i), TJAPlayer3.stage演奏ドラム画面.bIsAlreadyMaxed[i], player: i, scale: 0.5f); + } + } + } + return base.Draw(); + } + + public void OnDraw_Balloon() { + for (int i = 0; i < TJAPlayer3.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 = TJAPlayer3.Skin.Resolution[0] / (float)TJAPlayer3.Skin.Characters_Resolution[this.iCurrentCharacter[i]][0]; + float resolutionScaleY = TJAPlayer3.Skin.Resolution[1] / (float)TJAPlayer3.Skin.Characters_Resolution[this.iCurrentCharacter[i]][1]; + + float chara_x = 0; + float chara_y = 0; + float kusu_chara_x = TJAPlayer3.Skin.Characters_Kusudama_X[this.iCurrentCharacter[i]][i] * resolutionScaleX; + float kusu_chara_y = TJAPlayer3.Skin.Characters_Kusudama_Y[this.iCurrentCharacter[i]][i] * resolutionScaleY; + + if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) { + chara_x = TJAPlayer3.Skin.Characters_Balloon_X[this.iCurrentCharacter[i]][i]; + chara_y = TJAPlayer3.Skin.Characters_Balloon_Y[this.iCurrentCharacter[i]][i]; + } else { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + chara_x = TJAPlayer3.Skin.Characters_Balloon_5P[this.iCurrentCharacter[i]][0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + chara_y = TJAPlayer3.Skin.Characters_Balloon_5P[this.iCurrentCharacter[i]][1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + } else { + chara_x = TJAPlayer3.Skin.Characters_Balloon_4P[this.iCurrentCharacter[i]][0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + chara_y = TJAPlayer3.Skin.Characters_Balloon_4P[this.iCurrentCharacter[i]][1] + (TJAPlayer3.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 (TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn[this.iCurrentCharacter[i]] != 0 && TJAPlayer3.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { + TJAPlayer3.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].Opacity = nowOpacity; + TJAPlayer3.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; + TJAPlayer3.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; + TJAPlayer3.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画( + TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(i) + chara_x, + TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(i) + chara_y); + } + + if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) + TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( + TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(i) + TJAPlayer3.Skin.Game_PuchiChara_BalloonX[i], + TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(i) + TJAPlayer3.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 (TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn[this.iCurrentCharacter[i]] != 0 && TJAPlayer3.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { + TJAPlayer3.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].Opacity = nowOpacity; + TJAPlayer3.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; + TJAPlayer3.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; + TJAPlayer3.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画( + TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(i) + chara_x, + TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(i) + chara_y); + } + + if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) + TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( + TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(i) + TJAPlayer3.Skin.Game_PuchiChara_BalloonX[i], + TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(i) + TJAPlayer3.Skin.Game_PuchiChara_BalloonY[i], false, nowOpacity, true, player: i); + + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } else if (eNowAnime[i] == Anime.Balloon_Breaking) { + if (TJAPlayer3.Skin.Characters_Balloon_Breaking_Ptn[this.iCurrentCharacter[i]] != 0 && TJAPlayer3.Tx.Characters_Balloon_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { + TJAPlayer3.Tx.Characters_Balloon_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; + TJAPlayer3.Tx.Characters_Balloon_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; + TJAPlayer3.Tx.Characters_Balloon_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画( + TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(i) + chara_x, + TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(i) + chara_y); + } + + if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) + TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( + TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(i) + TJAPlayer3.Skin.Game_PuchiChara_BalloonX[i], + TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(i) + TJAPlayer3.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)) * TJAPlayer3.Skin.Resolution[0] / 2.0f) * resolutionScaleX; + float kusuOutY = (MathF.Sin(nNowCharaCounter[i] * MathF.PI / 2) * TJAPlayer3.Skin.Resolution[1] / 2.0f) * resolutionScaleY; + + if (TJAPlayer3.Skin.Characters_Kusudama_Broke_Ptn[this.iCurrentCharacter[i]] != 0 && TJAPlayer3.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { + TJAPlayer3.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].Opacity = nowOpacity; + TJAPlayer3.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; + TJAPlayer3.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; + if (i % 2 == 0) { + TJAPlayer3.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画(kusu_chara_x - kusuOutX, kusu_chara_y - kusuOutY); + } else { + TJAPlayer3.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D左右反転描画(kusu_chara_x + kusuOutX, kusu_chara_y - kusuOutY); + } + } + if (i % 2 == 0) { + TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( + TJAPlayer3.Skin.Game_PuchiChara_KusudamaX[i] - (int)kusuOutX, + TJAPlayer3.Skin.Game_PuchiChara_KusudamaY[i] - (int)kusuOutY, false, nowOpacity, true, player: i); + } else { + TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( + TJAPlayer3.Skin.Game_PuchiChara_KusudamaX[i] + (int)kusuOutX, + TJAPlayer3.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) * TJAPlayer3.Skin.Resolution[1] * 2) * resolutionScaleY; + + if (TJAPlayer3.Skin.Characters_Kusudama_Miss_Ptn[this.iCurrentCharacter[i]] != 0 && TJAPlayer3.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { + TJAPlayer3.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].Opacity = nowOpacity; + TJAPlayer3.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; + TJAPlayer3.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; + + + if (i % 2 == 0) { + TJAPlayer3.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画(kusu_chara_x, kusu_chara_y + kusuOutY); + } else { + TJAPlayer3.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D左右反転描画(kusu_chara_x, kusu_chara_y + kusuOutY); + } + } + + TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( + TJAPlayer3.Skin.Game_PuchiChara_KusudamaX[i], + TJAPlayer3.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)) * TJAPlayer3.Skin.Resolution[0] / 2.0f) * resolutionScaleX; + float kusuInY = -((MathF.Cos(ctKusuIn[i].CurrentValue / 1000.0f * MathF.PI / 2)) * TJAPlayer3.Skin.Resolution[1] / 2.0f) * resolutionScaleY; + + + if (TJAPlayer3.Skin.Characters_Kusudama_Breaking_Ptn[this.iCurrentCharacter[i]] != 0 && TJAPlayer3.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { + TJAPlayer3.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; + TJAPlayer3.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; + if (i % 2 == 0) { + TJAPlayer3.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画(kusu_chara_x - kusuInX, kusu_chara_y + kusuInY); + } else { + TJAPlayer3.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D左右反転描画(kusu_chara_x + kusuInX, kusu_chara_y + kusuInY); + } + } + + if (i % 2 == 0) { + TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( + TJAPlayer3.Skin.Game_PuchiChara_KusudamaX[i] - (int)kusuInX, + TJAPlayer3.Skin.Game_PuchiChara_KusudamaY[i] + (int)kusuInY, false, 255, true, player: i); + } else { + TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( + TJAPlayer3.Skin.Game_PuchiChara_KusudamaX[i] + (int)kusuInX, + TJAPlayer3.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)) * TJAPlayer3.Skin.Resolution[0] / 2.0f) * resolutionScaleX; + float kusuInY = -((MathF.Cos(ctKusuIn[i].CurrentValue / 1000.0f * MathF.PI / 2)) * TJAPlayer3.Skin.Resolution[1] / 2.0f) * resolutionScaleY; + + if (TJAPlayer3.Skin.Characters_Kusudama_Idle_Ptn[this.iCurrentCharacter[i]] != 0 && TJAPlayer3.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { + TJAPlayer3.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; + TJAPlayer3.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; + if (i % 2 == 0) { + TJAPlayer3.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画(kusu_chara_x - kusuInX, kusu_chara_y + kusuInY); + } else { + TJAPlayer3.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D左右反転描画(kusu_chara_x + kusuInX, kusu_chara_y + kusuInY); + } + } + + if (i % 2 == 0) { + TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( + TJAPlayer3.Skin.Game_PuchiChara_KusudamaX[i] - (int)kusuInX, + TJAPlayer3.Skin.Game_PuchiChara_KusudamaY[i] + (int)kusuInY, false, 255, true, player: i); + } else { + TJAPlayer3.stage演奏ドラム画面.PuchiChara.On進行描画( + TJAPlayer3.Skin.Game_PuchiChara_KusudamaX[i] + (int)kusuInX, + TJAPlayer3.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 (TJAPlayer3.stage演奏ドラム画面.bIsGOGOTIME[player] && TJAPlayer3.Skin.Characters_GoGoTime_Ptn[this.iCurrentCharacter[player]] != 0) { + if (TJAPlayer3.stage演奏ドラム画面.bIsAlreadyMaxed[player] && TJAPlayer3.Skin.Characters_GoGoTime_Maxed_Ptn[this.iCurrentCharacter[player]] != 0) { + ChangeAnime(player, Anime.GoGoTime_Maxed, resetCounter); + } else { + ChangeAnime(player, Anime.GoGoTime, resetCounter); + } + } else { + if (TJAPlayer3.stage演奏ドラム画面.bIsMiss[player] && TJAPlayer3.Skin.Characters_Normal_Missed_Ptn[this.iCurrentCharacter[player]] != 0) { + if (TJAPlayer3.stage演奏ドラム画面.Chara_MissCount[player] >= 6 && TJAPlayer3.Skin.Characters_Normal_MissedDown_Ptn[this.iCurrentCharacter[player]] != 0) { + ChangeAnime(player, Anime.MissDown, resetCounter); + } else { + ChangeAnime(player, Anime.Miss, resetCounter); + } + } else { + if (TJAPlayer3.stage演奏ドラム画面.bIsAlreadyMaxed[player] && TJAPlayer3.Skin.Characters_Normal_Maxed_Ptn[this.iCurrentCharacter[player]] != 0) { + ChangeAnime(player, Anime.Maxed, resetCounter); + } else if (TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared[player] && TJAPlayer3.Skin.Characters_Normal_Cleared_Ptn[this.iCurrentCharacter[player]] != 0) { + ChangeAnime(player, Anime.Cleared, resetCounter); + } else if (TJAPlayer3.Skin.Characters_Normal_Ptn[this.iCurrentCharacter[player]] != 0) { + ChangeAnime(player, Anime.Normal, resetCounter); + } else { + 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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + ChangeAnime(i, Anime.Kusudama_Idle, true); + ctKusuIn[i] = new CCounter(0, 1000, 0.4f, TJAPlayer3.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] = TJAPlayer3.Skin.Characters_Motion_Normal[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_Normal[iCurrentCharacter[player]]; + break; + case Anime.Miss: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_Miss[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_Miss[iCurrentCharacter[player]]; + break; + case Anime.MissDown: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_MissDown[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_MissDown[iCurrentCharacter[player]]; + break; + case Anime.Cleared: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_Clear[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_Clear[iCurrentCharacter[player]]; + break; + case Anime.Maxed: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_ClearMax[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_ClearMax[iCurrentCharacter[player]]; + break; + case Anime.MissIn: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_MissIn[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_MissIn[iCurrentCharacter[player]]; + break; + case Anime.MissDownIn: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_MissDownIn[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_MissDownIn[iCurrentCharacter[player]]; + break; + case Anime.GoGoTime: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_GoGo[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_GoGo[iCurrentCharacter[player]]; + break; + case Anime.GoGoTime_Maxed: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_GoGoMax[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_GoGoMax[iCurrentCharacter[player]]; + break; + case Anime.Combo10: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_10Combo[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_10Combo[iCurrentCharacter[player]]; + break; + case Anime.Combo10_Clear: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_10Combo_Clear[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_10Combo_Clear[iCurrentCharacter[player]]; + break; + case Anime.Combo10_Max: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_10ComboMax[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_10ComboMax[iCurrentCharacter[player]]; + break; + case Anime.GoGoStart: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_GoGoStart[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_GoGoStart[iCurrentCharacter[player]]; + break; + case Anime.GoGoStart_Clear: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_GoGoStart_Clear[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_GoGoStart_Clear[iCurrentCharacter[player]]; + break; + case Anime.GoGoStart_Max: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_GoGoStartMax[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_GoGoStartMax[iCurrentCharacter[player]]; + break; + case Anime.Become_Cleared: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_ClearIn[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_ClearIn[iCurrentCharacter[player]]; + break; + case Anime.Become_Maxed: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_SoulIn[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_SoulIn[iCurrentCharacter[player]]; + break; + case Anime.SoulOut: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_SoulOut[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_SoulOut[iCurrentCharacter[player]]; + break; + case Anime.ClearOut: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_ClearOut[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_ClearOut[iCurrentCharacter[player]]; + break; + case Anime.Return: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Motion_Return[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = TJAPlayer3.Skin.Characters_Beat_Return[iCurrentCharacter[player]]; + break; + case Anime.Balloon_Breaking: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Balloon_Breaking_Ptn[iCurrentCharacter[player]] - 1; + nCharaBeat[player] = 0.2f; + break; + case Anime.Balloon_Broke: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn[iCurrentCharacter[player]] - 1; + nCharaBeat[player] = 0.2f; + break; + case Anime.Balloon_Miss: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn[iCurrentCharacter[player]] - 1; + nCharaBeat[player] = 0.2f; + break; + case Anime.Kusudama_Idle: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Kusudama_Idle_Ptn[iCurrentCharacter[player]] - 1; + nCharaBeat[player] = 0.4f; + break; + case Anime.Kusudama_Breaking: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Kusudama_Breaking_Ptn[iCurrentCharacter[player]] - 1; + nCharaBeat[player] = 0.2f; + break; + case Anime.Kusudama_Broke: + nCharaFrameCount[player] = TJAPlayer3.Skin.Characters_Kusudama_Broke_Ptn[iCurrentCharacter[player]] - 1; + nCharaBeat[player] = 1f; + break; + case Anime.Kusudama_Miss: + nCharaFrameCount[player] = TJAPlayer3.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 a8691282..dacc0375 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplChipEffects.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplChipEffects.cs @@ -1,147 +1,121 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; using FDK; - using Rectangle = System.Drawing.Rectangle; -namespace TJAPlayer3 -{ - internal class CActImplChipEffects : CActivity - { - // コンストラクタ +namespace TJAPlayer3 { + internal class CActImplChipEffects : CActivity { + // コンストラクタ - public CActImplChipEffects() - { - //base.b活性化してない = true; - } + public CActImplChipEffects() { + //base.b活性化してない = true; + } - // メソッド - public virtual void Start(int nPlayer, int Lane) - { - if (TJAPlayer3.Tx.Gauge_Soul_Explosion != null && TJAPlayer3.ConfigIni.nPlayerCount <= 2 && !TJAPlayer3.ConfigIni.bAIBattleMode) - { - for (int i = 0; i < 128; i++) - { - if (!st[i].b使用中) - { - st[i].b使用中 = true; - st[i].ct進行 = new CCounter(0, TJAPlayer3.Skin.Game_Effect_NotesFlash[2], TJAPlayer3.Skin.Game_Effect_NotesFlash_Timer, TJAPlayer3.Timer); - st[i].ctChipEffect = new CCounter(0, 24, 17, TJAPlayer3.Timer); - st[i].nプレイヤー = nPlayer; - st[i].Lane = Lane; - break; - } - } - } - } + // メソッド + public virtual void Start(int nPlayer, int Lane) { + if (TJAPlayer3.Tx.Gauge_Soul_Explosion != null && TJAPlayer3.ConfigIni.nPlayerCount <= 2 && !TJAPlayer3.ConfigIni.bAIBattleMode) { + for (int i = 0; i < 128; i++) { + if (!st[i].b使用中) { + st[i].b使用中 = true; + st[i].ct進行 = new CCounter(0, TJAPlayer3.Skin.Game_Effect_NotesFlash[2], TJAPlayer3.Skin.Game_Effect_NotesFlash_Timer, TJAPlayer3.Timer); + st[i].ctChipEffect = new CCounter(0, 24, 17, TJAPlayer3.Timer); + st[i].nプレイヤー = nPlayer; + st[i].Lane = Lane; + break; + } + } + } + } - // CActivity 実装 + // 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; - } + 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: - TJAPlayer3.Tx.Gauge_Soul_Explosion[TJAPlayer3.P1IsBlue() ? 1 : 0]?.t2D中心基準描画(TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[0], TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[0], new Rectangle(st[i].ct進行.CurrentValue * TJAPlayer3.Skin.Game_Effect_NotesFlash[0], 0, TJAPlayer3.Skin.Game_Effect_NotesFlash[0], TJAPlayer3.Skin.Game_Effect_NotesFlash[1])); - - if (this.st[i].ctChipEffect.CurrentValue < 13) - NotesManager.DisplayNote( - st[i].nプレイヤー, - TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[0], - TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[0], - st[i].Lane); - break; + switch (st[i].nプレイヤー) { + case 0: + TJAPlayer3.Tx.Gauge_Soul_Explosion[TJAPlayer3.P1IsBlue() ? 1 : 0]?.t2D中心基準描画(TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[0], TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[0], new Rectangle(st[i].ct進行.CurrentValue * TJAPlayer3.Skin.Game_Effect_NotesFlash[0], 0, TJAPlayer3.Skin.Game_Effect_NotesFlash[0], TJAPlayer3.Skin.Game_Effect_NotesFlash[1])); - case 1: - TJAPlayer3.Tx.Gauge_Soul_Explosion[1]?.t2D中心基準描画(TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[1], TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[1], new Rectangle(st[i].ct進行.CurrentValue * TJAPlayer3.Skin.Game_Effect_NotesFlash[0], 0, TJAPlayer3.Skin.Game_Effect_NotesFlash[0], TJAPlayer3.Skin.Game_Effect_NotesFlash[1])); - if (this.st[i].ctChipEffect.CurrentValue < 13) - NotesManager.DisplayNote( - st[i].nプレイヤー, - TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[1], - TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[1], - st[i].Lane); - break; - } + if (this.st[i].ctChipEffect.CurrentValue < 13) + NotesManager.DisplayNote( + st[i].nプレイヤー, + TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[0], + TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[0], + st[i].Lane); + break; - if (TJAPlayer3.Tx.ChipEffect != null) - { - if (this.st[i].ctChipEffect.CurrentValue < 12) - { - TJAPlayer3.Tx.ChipEffect.color4 = new Color4(1.0f, 1.0f, 0.0f, 1.0f); - TJAPlayer3.Tx.ChipEffect.Opacity = (int)(this.st[i].ctChipEffect.CurrentValue * (float)(225 / 11)); - TJAPlayer3.Tx.ChipEffect.t2D中心基準描画(TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[st[i].nプレイヤー], TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[st[i].nプレイヤー], new Rectangle(st[i].Lane * TJAPlayer3.Skin.Game_Notes_Size[0], 0, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); - } - if (this.st[i].ctChipEffect.CurrentValue > 12 && this.st[i].ctChipEffect.CurrentValue < 24) - { - TJAPlayer3.Tx.ChipEffect.color4 = new Color4(1.0f, 1.0f, 1.0f, 1.0f); - TJAPlayer3.Tx.ChipEffect.Opacity = 255 - (int)((this.st[i].ctChipEffect.CurrentValue - 10) * (float)(255 / 14)); - TJAPlayer3.Tx.ChipEffect.t2D中心基準描画(TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[st[i].nプレイヤー], TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[st[i].nプレイヤー], new Rectangle(st[i].Lane * TJAPlayer3.Skin.Game_Notes_Size[0], 0, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); - } - } - - } - } - return 0; - } + case 1: + TJAPlayer3.Tx.Gauge_Soul_Explosion[1]?.t2D中心基準描画(TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[1], TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[1], new Rectangle(st[i].ct進行.CurrentValue * TJAPlayer3.Skin.Game_Effect_NotesFlash[0], 0, TJAPlayer3.Skin.Game_Effect_NotesFlash[0], TJAPlayer3.Skin.Game_Effect_NotesFlash[1])); + if (this.st[i].ctChipEffect.CurrentValue < 13) + NotesManager.DisplayNote( + st[i].nプレイヤー, + TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[1], + TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[1], + st[i].Lane); + break; + } + + if (TJAPlayer3.Tx.ChipEffect != null) { + if (this.st[i].ctChipEffect.CurrentValue < 12) { + TJAPlayer3.Tx.ChipEffect.color4 = new Color4(1.0f, 1.0f, 0.0f, 1.0f); + TJAPlayer3.Tx.ChipEffect.Opacity = (int)(this.st[i].ctChipEffect.CurrentValue * (float)(225 / 11)); + TJAPlayer3.Tx.ChipEffect.t2D中心基準描画(TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[st[i].nプレイヤー], TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[st[i].nプレイヤー], new Rectangle(st[i].Lane * TJAPlayer3.Skin.Game_Notes_Size[0], 0, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); + } + if (this.st[i].ctChipEffect.CurrentValue > 12 && this.st[i].ctChipEffect.CurrentValue < 24) { + TJAPlayer3.Tx.ChipEffect.color4 = new Color4(1.0f, 1.0f, 1.0f, 1.0f); + TJAPlayer3.Tx.ChipEffect.Opacity = 255 - (int)((this.st[i].ctChipEffect.CurrentValue - 10) * (float)(255 / 14)); + TJAPlayer3.Tx.ChipEffect.t2D中心基準描画(TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[st[i].nプレイヤー], TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[st[i].nプレイヤー], new Rectangle(st[i].Lane * TJAPlayer3.Skin.Game_Notes_Size[0], 0, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); + } + } + + } + } + return 0; + } - // その他 + // その他 - #region [ private ] - //----------------- - //private CTexture[] txChara; + #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]; + [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 - } + //----------------- + #endregion + } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplClearAnimation.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplClearAnimation.cs index 0f5126bb..80b98f7f 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplClearAnimation.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplClearAnimation.cs @@ -1,37 +1,24 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; -using System.Drawing; -using FDK; +using FDK; -using Rectangle = System.Drawing.Rectangle; -using Point = System.Drawing.Point; -using Color = System.Drawing.Color; +namespace TJAPlayer3 { + internal class CActImplClearAnimation : CActivity { + /// + /// 課題 + /// _クリア失敗 →素材不足(確保はできる。切り出しと加工をしてないだけ。) + /// _ + /// + public CActImplClearAnimation() { + base.IsDeActivated = true; + } -namespace TJAPlayer3 -{ - internal class CActImplClearAnimation : CActivity - { - /// - /// 課題 - /// _クリア失敗 →素材不足(確保はできる。切り出しと加工をしてないだけ。) - /// _ - /// - public CActImplClearAnimation() - { - base.IsDeActivated = true; - } + public void Start() { + // this.ct進行メイン = new CCounter(0, 500, 1000 / 60, TJAPlayer3.Timer); - public void Start() - { - // this.ct進行メイン = new CCounter(0, 500, 1000 / 60, TJAPlayer3.Timer); + bSongsPlayed = false; - bSongsPlayed = false; + this.ct進行メイン = new CCounter(0, 300, 22, TJAPlayer3.Timer); - this.ct進行メイン = new CCounter(0, 300, 22, TJAPlayer3.Timer); - - /* + /* 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); @@ -39,315 +26,265 @@ namespace TJAPlayer3 this.ctEnd_DondaFullComboLoop = new CCounter(0, 2, 30, TJAPlayer3.Timer); */ - // モードの決定。クリア失敗・フルコンボも事前に作っとく。 - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - { - if (CFloorManagement.CurrentNumberOfLives > 0) - { - if (TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMine == 0) - { - if (TJAPlayer3.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; - } - else - this.Mode[0] = EndMode.Tower_Dropout; - } - else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - { - // 段位認定モード。 - if (!TJAPlayer3.stage演奏ドラム画面.actDan.GetFailedAllChallenges()) - { - // 段位認定モード、クリア成功 - // this.Mode[0] = EndMode.StageCleared; + // モードの決定。クリア失敗・フルコンボも事前に作っとく。 + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + if (CFloorManagement.CurrentNumberOfLives > 0) { + if (TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMine == 0) { + if (TJAPlayer3.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; + } else + this.Mode[0] = EndMode.Tower_Dropout; + } else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + // 段位認定モード。 + if (!TJAPlayer3.stage演奏ドラム画面.actDan.GetFailedAllChallenges()) { + // 段位認定モード、クリア成功 + // this.Mode[0] = EndMode.StageCleared; - bool bgold = TJAPlayer3.stage演奏ドラム画面.actDan.GetExamStatus(TJAPlayer3.stage結果.st演奏記録.Drums.Dan_C) == Exam.Status.Better_Success; + bool bgold = TJAPlayer3.stage演奏ドラム画面.actDan.GetExamStatus(TJAPlayer3.stage結果.st演奏記録.Drums.Dan_C) == Exam.Status.Better_Success; - if (TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMine == 0) - { - if (TJAPlayer3.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 (TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMine == 0) { + if (TJAPlayer3.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 (TJAPlayer3.ConfigIni.bAIBattleMode) - { - if (TJAPlayer3.stage演奏ドラム画面.bIsAIBattleWin) - { - if (TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMine == 0) - { - if (TJAPlayer3.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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (HGaugeMethods.UNSAFE_FastNormaCheck(i)) - { - if (TJAPlayer3.stage演奏ドラム画面.CChartScore[i].nMiss == 0 && TJAPlayer3.stage演奏ドラム画面.CChartScore[i].nMine == 0) - //if (TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Miss == 0) - { - if (TJAPlayer3.stage演奏ドラム画面.CChartScore[i].nGood == 0) - //if (TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great == 0) - { - this.Mode[i] = EndMode.StagePerfectCombo; - } - else - { - this.Mode[i] = EndMode.StageFullCombo; - } - } - else - { - this.Mode[i] = EndMode.StageCleared; - } - } - else - { - this.Mode[i] = EndMode.StageFailed; - } - } - } - } + } else { + // 段位認定モード、クリア失敗 + this.Mode[0] = EndMode.Dan_Fail; + } + } else if (TJAPlayer3.ConfigIni.bAIBattleMode) { + if (TJAPlayer3.stage演奏ドラム画面.bIsAIBattleWin) { + if (TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMine == 0) { + if (TJAPlayer3.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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (HGaugeMethods.UNSAFE_FastNormaCheck(i)) { + if (TJAPlayer3.stage演奏ドラム画面.CChartScore[i].nMiss == 0 && TJAPlayer3.stage演奏ドラム画面.CChartScore[i].nMine == 0) + //if (TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Miss == 0) + { + if (TJAPlayer3.stage演奏ドラム画面.CChartScore[i].nGood == 0) + //if (TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great == 0) + { + this.Mode[i] = EndMode.StagePerfectCombo; + } else { + this.Mode[i] = EndMode.StageFullCombo; + } + } else { + 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}"); - - - if (TJAPlayer3.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_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 = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_Dropout.ogg"), ESoundGroup.SoundEffect); - this.soundTowerTopPass = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_Pass.ogg"), ESoundGroup.SoundEffect); - this.soundTowerTopFC = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_FullCombo.ogg"), ESoundGroup.SoundEffect); - this.soundTowerTopPerfect = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_Perfect.ogg"), ESoundGroup.SoundEffect); - } - else if (TJAPlayer3.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 = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Fail.ogg"), ESoundGroup.SoundEffect); - this.soundDanRedClear = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_Pass.ogg"), ESoundGroup.SoundEffect); - this.soundDanRedFC = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_FullCombo.ogg"), ESoundGroup.SoundEffect); - this.soundDanRedPerfect = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_Perfect.ogg"), ESoundGroup.SoundEffect); - this.soundDanGoldClear = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_Pass.ogg"), ESoundGroup.SoundEffect); - this.soundDanGoldFC = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_FullCombo.ogg"), ESoundGroup.SoundEffect); - this.soundDanGoldPerfect = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_Perfect.ogg"), ESoundGroup.SoundEffect); - - } - else if (TJAPlayer3.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 = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Lose.ogg"), ESoundGroup.SoundEffect); - this.soundAIWin = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win.ogg"), ESoundGroup.SoundEffect); - this.soundAIWinFullCombo = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win_FullCombo.ogg"), ESoundGroup.SoundEffect); - this.soundAIWinPerfectCombo = TJAPlayer3.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(); - } + var origindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.END}"); - base.Activate(); - } + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + Tower_DropoutScript = new EndAnimeScript($@"{origindir}Tower_Dropout{Path.DirectorySeparatorChar}Script.lua"); + Tower_DropoutScript.Init(); - public override void DeActivate() - { - this.ct進行メイン = null; - - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - { - Tower_DropoutScript.Dispose(); - Tower_TopReached_PassScript.Dispose(); - Tower_TopReached_FullComboScript.Dispose(); - Tower_TopReached_PerfectScript.Dispose(); - } - else if (TJAPlayer3.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 (TJAPlayer3.ConfigIni.bAIBattleMode) - { - AILoseScript.Dispose(); - AIWinScript.Dispose(); - AIWin_FullComboScript.Dispose(); - AIWin_PerfectScript.Dispose(); - } - else - { - FailedScript.Dispose(); - ClearScript.Dispose(); - FullComboScript.Dispose(); - PerfectComboScript.Dispose(); - } + Tower_TopReached_PassScript = new EndAnimeScript($@"{origindir}Tower_TopReached_Pass{Path.DirectorySeparatorChar}Script.lua"); + Tower_TopReached_PassScript.Init(); - base.DeActivate(); - } + Tower_TopReached_FullComboScript = new EndAnimeScript($@"{origindir}Tower_TopReached_FullCombo{Path.DirectorySeparatorChar}Script.lua"); + Tower_TopReached_FullComboScript.Init(); - 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 = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_Dropout.ogg"), ESoundGroup.SoundEffect); - this.soundTowerTopPass = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_Pass.ogg"), ESoundGroup.SoundEffect); - this.soundTowerTopFC = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_FullCombo.ogg"), ESoundGroup.SoundEffect); - this.soundTowerTopPerfect = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_Perfect.ogg"), ESoundGroup.SoundEffect); + this.soundTowerDropout = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_Dropout.ogg"), ESoundGroup.SoundEffect); + this.soundTowerTopPass = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_Pass.ogg"), ESoundGroup.SoundEffect); + this.soundTowerTopFC = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_FullCombo.ogg"), ESoundGroup.SoundEffect); + this.soundTowerTopPerfect = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_Perfect.ogg"), ESoundGroup.SoundEffect); + } else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + Dan_FailScript = new EndAnimeScript($@"{origindir}Dan_Fail{Path.DirectorySeparatorChar}Script.lua"); + Dan_FailScript.Init(); - this.soundDanFailed = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Fail.ogg"), ESoundGroup.SoundEffect); - this.soundDanRedClear = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_Pass.ogg"), ESoundGroup.SoundEffect); - this.soundDanRedFC = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_FullCombo.ogg"), ESoundGroup.SoundEffect); - this.soundDanRedPerfect = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_Perfect.ogg"), ESoundGroup.SoundEffect); - this.soundDanGoldClear = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_Pass.ogg"), ESoundGroup.SoundEffect); - this.soundDanGoldFC = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_FullCombo.ogg"), ESoundGroup.SoundEffect); - this.soundDanGoldPerfect = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_Perfect.ogg"), ESoundGroup.SoundEffect); - - this.soundAILose = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Lose.ogg"), ESoundGroup.SoundEffect); - this.soundAIWin = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win.ogg"), ESoundGroup.SoundEffect); - this.soundAIWinFullCombo = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win_FullCombo.ogg"), ESoundGroup.SoundEffect); - this.soundAIWinPerfectCombo = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win_AllPerfect.ogg"), ESoundGroup.SoundEffect); - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - this.soundClear[i] = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Clear.ogg"), ESoundGroup.SoundEffect); - this.soundFailed[i] = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Failed.ogg"), ESoundGroup.SoundEffect); - this.soundFullCombo[i] = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}FullCombo.ogg"), ESoundGroup.SoundEffect); - this.soundPerfectCombo[i] = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AllPerfect.ogg"), ESoundGroup.SoundEffect); - } + Dan_Red_PassScript = new EndAnimeScript($@"{origindir}Dan_Red_Pass{Path.DirectorySeparatorChar}Script.lua"); + Dan_Red_PassScript.Init(); - base.CreateManagedResource(); - } + Dan_Red_FullComboScript = new EndAnimeScript($@"{origindir}Dan_Red_FullCombo{Path.DirectorySeparatorChar}Script.lua"); + Dan_Red_FullComboScript.Init(); - public override void ReleaseManagedResource() - { - this.soundTowerDropout?.tDispose(); - this.soundTowerTopPass?.tDispose(); - this.soundTowerTopFC?.tDispose(); - this.soundTowerTopPerfect?.tDispose(); + Dan_Red_PerfectScript = new EndAnimeScript($@"{origindir}Dan_Red_Perfect{Path.DirectorySeparatorChar}Script.lua"); + Dan_Red_PerfectScript.Init(); - this.soundDanFailed?.tDispose(); - this.soundDanRedClear?.tDispose(); - this.soundDanRedFC?.tDispose(); - this.soundDanRedPerfect?.tDispose(); - this.soundDanGoldClear?.tDispose(); - this.soundDanGoldFC?.tDispose(); - this.soundDanGoldPerfect?.tDispose(); + Dan_Gold_PassScript = new EndAnimeScript($@"{origindir}Dan_Gold_Pass{Path.DirectorySeparatorChar}Script.lua"); + Dan_Gold_PassScript.Init(); - this.soundAILose?.tDispose(); - this.soundAIWin?.tDispose(); - this.soundAIWinFullCombo?.tDispose(); - this.soundAIWinPerfectCombo?.tDispose(); + Dan_Gold_FullComboScript = new EndAnimeScript($@"{origindir}Dan_Gold_FullCombo{Path.DirectorySeparatorChar}Script.lua"); + Dan_Gold_FullComboScript.Init(); - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - this.soundClear[i]?.tDispose(); - this.soundFailed[i]?.tDispose(); - this.soundFullCombo[i]?.tDispose(); - this.soundPerfectCombo[i]?.tDispose(); - } + Dan_Gold_PerfectScript = new EndAnimeScript($@"{origindir}Dan_Gold_Perfect{Path.DirectorySeparatorChar}Script.lua"); + Dan_Gold_PerfectScript.Init(); - base.ReleaseManagedResource(); - } + this.soundDanFailed = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Fail.ogg"), ESoundGroup.SoundEffect); + this.soundDanRedClear = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_Pass.ogg"), ESoundGroup.SoundEffect); + this.soundDanRedFC = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_FullCombo.ogg"), ESoundGroup.SoundEffect); + this.soundDanRedPerfect = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_Perfect.ogg"), ESoundGroup.SoundEffect); + this.soundDanGoldClear = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_Pass.ogg"), ESoundGroup.SoundEffect); + this.soundDanGoldFC = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_FullCombo.ogg"), ESoundGroup.SoundEffect); + this.soundDanGoldPerfect = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_Perfect.ogg"), ESoundGroup.SoundEffect); - #region [effects] - // ------------------------------------ - private void showEndEffect_Failed(int i) - { - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) FailedScript.Update(i); - FailedScript.Draw(i); + } else if (TJAPlayer3.ConfigIni.bAIBattleMode) { + AILoseScript = new EndAnimeScript($@"{origindir}AI_Lose{Path.DirectorySeparatorChar}Script.lua"); + AILoseScript.Init(); - int[] y = new int[] { 0, 176 }; + 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 = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Lose.ogg"), ESoundGroup.SoundEffect); + this.soundAIWin = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win.ogg"), ESoundGroup.SoundEffect); + this.soundAIWinFullCombo = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win_FullCombo.ogg"), ESoundGroup.SoundEffect); + this.soundAIWinPerfectCombo = TJAPlayer3.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 (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + Tower_DropoutScript.Dispose(); + Tower_TopReached_PassScript.Dispose(); + Tower_TopReached_FullComboScript.Dispose(); + Tower_TopReached_PerfectScript.Dispose(); + } else if (TJAPlayer3.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 (TJAPlayer3.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; + + this.soundTowerDropout = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_Dropout.ogg"), ESoundGroup.SoundEffect); + this.soundTowerTopPass = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_Pass.ogg"), ESoundGroup.SoundEffect); + this.soundTowerTopFC = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_FullCombo.ogg"), ESoundGroup.SoundEffect); + this.soundTowerTopPerfect = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_Perfect.ogg"), ESoundGroup.SoundEffect); + + this.soundDanFailed = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Fail.ogg"), ESoundGroup.SoundEffect); + this.soundDanRedClear = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_Pass.ogg"), ESoundGroup.SoundEffect); + this.soundDanRedFC = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_FullCombo.ogg"), ESoundGroup.SoundEffect); + this.soundDanRedPerfect = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_Perfect.ogg"), ESoundGroup.SoundEffect); + this.soundDanGoldClear = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_Pass.ogg"), ESoundGroup.SoundEffect); + this.soundDanGoldFC = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_FullCombo.ogg"), ESoundGroup.SoundEffect); + this.soundDanGoldPerfect = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_Perfect.ogg"), ESoundGroup.SoundEffect); + + this.soundAILose = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Lose.ogg"), ESoundGroup.SoundEffect); + this.soundAIWin = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win.ogg"), ESoundGroup.SoundEffect); + this.soundAIWinFullCombo = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win_FullCombo.ogg"), ESoundGroup.SoundEffect); + this.soundAIWinPerfectCombo = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win_AllPerfect.ogg"), ESoundGroup.SoundEffect); + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + this.soundClear[i] = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Clear.ogg"), ESoundGroup.SoundEffect); + this.soundFailed[i] = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Failed.ogg"), ESoundGroup.SoundEffect); + this.soundFullCombo[i] = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}FullCombo.ogg"), ESoundGroup.SoundEffect); + this.soundPerfectCombo[i] = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AllPerfect.ogg"), ESoundGroup.SoundEffect); + } + + base.CreateManagedResource(); + } + + 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 < TJAPlayer3.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 (!TJAPlayer3.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) @@ -367,13 +304,12 @@ namespace TJAPlayer3 TJAPlayer3.Tx.ClearFailed2?.t2D描画(502, y[i] + 192); } */ - } - private void showEndEffect_Clear(int i) - { - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) ClearScript.Update(i); - ClearScript.Draw(i); + } + private void showEndEffect_Clear(int i) { + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) ClearScript.Update(i); + ClearScript.Draw(i); - /* + /* int[] y = new int[] { 210, 386 }; #region[ 文字 ] //登場アニメは20フレーム。うち最初の5フレームは半透過状態。 @@ -543,14 +479,13 @@ namespace TJAPlayer3 #endregion */ - } + } - private void showEndEffect_FullCombo(int i) - { - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) FullComboScript.Update(i); - FullComboScript.Draw(i); + private void showEndEffect_FullCombo(int i) { + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) FullComboScript.Update(i); + FullComboScript.Draw(i); - /* + /* int[] y = new int[] { 0, 176 }; this.ctEnd_FullCombo.t進行(); @@ -562,14 +497,13 @@ namespace TJAPlayer3 TJAPlayer3.Tx.End_FullComboLoop[this.ctEnd_FullComboLoop.n現在の値]?.t2D描画(330, y[i] + 196); } */ - } + } - private void showEndEffect_PerfectCombo(int i) - { - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) PerfectComboScript.Update(i); - PerfectComboScript.Draw(i); + private void showEndEffect_PerfectCombo(int i) { + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) PerfectComboScript.Update(i); + PerfectComboScript.Draw(i); - /* + /* int[] y = new int[] { 0, 176 }; this.ctEnd_DondaFullCombo.t進行(); @@ -583,272 +517,263 @@ namespace TJAPlayer3 TJAPlayer3.Tx.End_DondaFullComboLoop[this.ctEnd_DondaFullComboLoop.n現在の値].t2D描画(330, 196); } */ - } - // ------------------------------------ - #endregion + } + // ------------------------------------ + #endregion - public override int Draw() - { - if (base.IsFirstDraw) - { - base.IsFirstDraw = false; - } - if (this.ct進行メイン != null && (TJAPlayer3.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_EndStage || TJAPlayer3.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_STAGE_FAILED || TJAPlayer3.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_STAGE_CLEAR_FadeOut)) - { - this.ct進行メイン.Tick(); + public override int Draw() { + if (base.IsFirstDraw) { + base.IsFirstDraw = false; + } + if (this.ct進行メイン != null && (TJAPlayer3.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_EndStage || TJAPlayer3.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_STAGE_FAILED || TJAPlayer3.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_STAGE_CLEAR_FadeOut)) { + this.ct進行メイン.Tick(); - //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.灰, this.ct進行メイン.n現在の値.ToString() ); - //仮置き + //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.灰, this.ct進行メイン.n現在の値.ToString() ); + //仮置き - if (!bSongsPlayed) - { - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (i == 1 && TJAPlayer3.ConfigIni.bAIBattleMode) break; + if (!bSongsPlayed) { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (i == 1 && TJAPlayer3.ConfigIni.bAIBattleMode) break; - switch (this.Mode[i]) - { - case EndMode.StageFailed: - FailedScript.PlayEndAnime(i); - this.soundFailed[i]?.PlayStart(); - TJAPlayer3.Skin.voiceClearFailed[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.StageCleared: - ClearScript.PlayEndAnime(i); - this.soundClear[i]?.PlayStart(); - TJAPlayer3.Skin.voiceClearClear[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.StageFullCombo: - FullComboScript.PlayEndAnime(i); - this.soundFullCombo[i]?.PlayStart(); - TJAPlayer3.Skin.voiceClearFullCombo[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.StagePerfectCombo: - PerfectComboScript.PlayEndAnime(i); - this.soundPerfectCombo[i]?.PlayStart(); - TJAPlayer3.Skin.voiceClearAllPerfect[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; + switch (this.Mode[i]) { + case EndMode.StageFailed: + FailedScript.PlayEndAnime(i); + this.soundFailed[i]?.PlayStart(); + TJAPlayer3.Skin.voiceClearFailed[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; + case EndMode.StageCleared: + ClearScript.PlayEndAnime(i); + this.soundClear[i]?.PlayStart(); + TJAPlayer3.Skin.voiceClearClear[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; + case EndMode.StageFullCombo: + FullComboScript.PlayEndAnime(i); + this.soundFullCombo[i]?.PlayStart(); + TJAPlayer3.Skin.voiceClearFullCombo[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; + case EndMode.StagePerfectCombo: + PerfectComboScript.PlayEndAnime(i); + this.soundPerfectCombo[i]?.PlayStart(); + TJAPlayer3.Skin.voiceClearAllPerfect[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; - case EndMode.AI_Lose: - AILoseScript.PlayEndAnime(i); - this.soundAILose?.PlayStart(); - TJAPlayer3.Skin.voiceAILose[TJAPlayer3.GetActualPlayer(1)]?.tPlay(); - break; - case EndMode.AI_Win: - AIWinScript.PlayEndAnime(i); - this.soundAIWin?.PlayStart(); - TJAPlayer3.Skin.voiceAIWin[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.AI_Win_FullCombo: - AIWin_FullComboScript.PlayEndAnime(i); - this.soundAIWinFullCombo?.PlayStart(); - TJAPlayer3.Skin.voiceAIWin[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.AI_Win_Perfect: - AIWin_PerfectScript.PlayEndAnime(i); - this.soundAIWinPerfectCombo?.PlayStart(); - TJAPlayer3.Skin.voiceAIWin[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; + case EndMode.AI_Lose: + AILoseScript.PlayEndAnime(i); + this.soundAILose?.PlayStart(); + TJAPlayer3.Skin.voiceAILose[TJAPlayer3.GetActualPlayer(1)]?.tPlay(); + break; + case EndMode.AI_Win: + AIWinScript.PlayEndAnime(i); + this.soundAIWin?.PlayStart(); + TJAPlayer3.Skin.voiceAIWin[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; + case EndMode.AI_Win_FullCombo: + AIWin_FullComboScript.PlayEndAnime(i); + this.soundAIWinFullCombo?.PlayStart(); + TJAPlayer3.Skin.voiceAIWin[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; + case EndMode.AI_Win_Perfect: + AIWin_PerfectScript.PlayEndAnime(i); + this.soundAIWinPerfectCombo?.PlayStart(); + TJAPlayer3.Skin.voiceAIWin[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; - case EndMode.Tower_Dropout: - Tower_DropoutScript.PlayEndAnime(i); - this.soundTowerDropout?.PlayStart(); - TJAPlayer3.Skin.voiceClearFailed[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Tower_TopReached_Pass: - Tower_TopReached_PassScript.PlayEndAnime(i); - this.soundTowerTopPass?.PlayStart(); - TJAPlayer3.Skin.voiceClearClear[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Tower_TopReached_FullCombo: - Tower_TopReached_FullComboScript.PlayEndAnime(i); - this.soundTowerTopFC?.PlayStart(); - TJAPlayer3.Skin.voiceClearFullCombo[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Tower_TopReached_Perfect: - Tower_TopReached_PerfectScript.PlayEndAnime(i); - this.soundTowerTopPerfect?.PlayStart(); - TJAPlayer3.Skin.voiceClearAllPerfect[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; + case EndMode.Tower_Dropout: + Tower_DropoutScript.PlayEndAnime(i); + this.soundTowerDropout?.PlayStart(); + TJAPlayer3.Skin.voiceClearFailed[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; + case EndMode.Tower_TopReached_Pass: + Tower_TopReached_PassScript.PlayEndAnime(i); + this.soundTowerTopPass?.PlayStart(); + TJAPlayer3.Skin.voiceClearClear[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; + case EndMode.Tower_TopReached_FullCombo: + Tower_TopReached_FullComboScript.PlayEndAnime(i); + this.soundTowerTopFC?.PlayStart(); + TJAPlayer3.Skin.voiceClearFullCombo[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; + case EndMode.Tower_TopReached_Perfect: + Tower_TopReached_PerfectScript.PlayEndAnime(i); + this.soundTowerTopPerfect?.PlayStart(); + TJAPlayer3.Skin.voiceClearAllPerfect[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; - case EndMode.Dan_Fail: - Dan_FailScript.PlayEndAnime(i); - this.soundDanFailed?.PlayStart(); - TJAPlayer3.Skin.voiceClearFailed[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Dan_Red_Pass: - Dan_Red_PassScript.PlayEndAnime(i); - this.soundDanRedClear?.PlayStart(); - TJAPlayer3.Skin.voiceClearClear[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Dan_Red_FullCombo: - Dan_Red_FullComboScript.PlayEndAnime(i); - this.soundDanRedFC?.PlayStart(); - TJAPlayer3.Skin.voiceClearFullCombo[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Dan_Red_Perfect: - Dan_Red_PerfectScript.PlayEndAnime(i); - this.soundDanRedPerfect?.PlayStart(); - TJAPlayer3.Skin.voiceClearAllPerfect[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Dan_Gold_Pass: - Dan_Gold_PassScript.PlayEndAnime(i); - this.soundDanGoldClear?.PlayStart(); - TJAPlayer3.Skin.voiceClearClear[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Dan_Gold_FullCombo: - Dan_Gold_FullComboScript.PlayEndAnime(i); - this.soundDanGoldFC?.PlayStart(); - TJAPlayer3.Skin.voiceClearFullCombo[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Dan_Gold_Perfect: - Dan_Gold_PerfectScript.PlayEndAnime(i); - this.soundDanGoldPerfect?.PlayStart(); - TJAPlayer3.Skin.voiceClearAllPerfect[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); - break; + case EndMode.Dan_Fail: + Dan_FailScript.PlayEndAnime(i); + this.soundDanFailed?.PlayStart(); + TJAPlayer3.Skin.voiceClearFailed[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; + case EndMode.Dan_Red_Pass: + Dan_Red_PassScript.PlayEndAnime(i); + this.soundDanRedClear?.PlayStart(); + TJAPlayer3.Skin.voiceClearClear[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; + case EndMode.Dan_Red_FullCombo: + Dan_Red_FullComboScript.PlayEndAnime(i); + this.soundDanRedFC?.PlayStart(); + TJAPlayer3.Skin.voiceClearFullCombo[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; + case EndMode.Dan_Red_Perfect: + Dan_Red_PerfectScript.PlayEndAnime(i); + this.soundDanRedPerfect?.PlayStart(); + TJAPlayer3.Skin.voiceClearAllPerfect[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; + case EndMode.Dan_Gold_Pass: + Dan_Gold_PassScript.PlayEndAnime(i); + this.soundDanGoldClear?.PlayStart(); + TJAPlayer3.Skin.voiceClearClear[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; + case EndMode.Dan_Gold_FullCombo: + Dan_Gold_FullComboScript.PlayEndAnime(i); + this.soundDanGoldFC?.PlayStart(); + TJAPlayer3.Skin.voiceClearFullCombo[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; + case EndMode.Dan_Gold_Perfect: + Dan_Gold_PerfectScript.PlayEndAnime(i); + this.soundDanGoldPerfect?.PlayStart(); + TJAPlayer3.Skin.voiceClearAllPerfect[TJAPlayer3.GetActualPlayer(i)]?.tPlay(); + break; - default: - break; - } - } + default: + break; + } + } - bSongsPlayed = true; - } + bSongsPlayed = true; + } - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (i == 1 && TJAPlayer3.ConfigIni.bAIBattleMode) break; + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (i == 1 && TJAPlayer3.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; + 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 (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) AIWinScript.Update(i); - AIWinScript.Draw(i); - break; - case EndMode.AI_Lose: - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) AILoseScript.Update(i); - AILoseScript.Draw(i); - break; - case EndMode.AI_Win_FullCombo: - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) AIWin_FullComboScript.Update(i); - AIWin_FullComboScript.Draw(i); - break; - case EndMode.AI_Win_Perfect: - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) AIWin_PerfectScript.Update(i); - AIWin_PerfectScript.Draw(i); - break; + case EndMode.AI_Win: + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) AIWinScript.Update(i); + AIWinScript.Draw(i); + break; + case EndMode.AI_Lose: + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) AILoseScript.Update(i); + AILoseScript.Draw(i); + break; + case EndMode.AI_Win_FullCombo: + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) AIWin_FullComboScript.Update(i); + AIWin_FullComboScript.Draw(i); + break; + case EndMode.AI_Win_Perfect: + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) AIWin_PerfectScript.Update(i); + AIWin_PerfectScript.Draw(i); + break; - case EndMode.Tower_Dropout: - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Tower_DropoutScript.Update(i); - Tower_DropoutScript.Draw(i); - break; - case EndMode.Tower_TopReached_Pass: - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Tower_TopReached_PassScript.Update(i); - Tower_TopReached_PassScript.Draw(i); - break; - case EndMode.Tower_TopReached_FullCombo: - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Tower_TopReached_FullComboScript.Update(i); - Tower_TopReached_FullComboScript.Draw(i); - break; - case EndMode.Tower_TopReached_Perfect: - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Tower_TopReached_PerfectScript.Update(i); - Tower_TopReached_PerfectScript.Draw(i); - break; + case EndMode.Tower_Dropout: + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Tower_DropoutScript.Update(i); + Tower_DropoutScript.Draw(i); + break; + case EndMode.Tower_TopReached_Pass: + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Tower_TopReached_PassScript.Update(i); + Tower_TopReached_PassScript.Draw(i); + break; + case EndMode.Tower_TopReached_FullCombo: + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Tower_TopReached_FullComboScript.Update(i); + Tower_TopReached_FullComboScript.Draw(i); + break; + case EndMode.Tower_TopReached_Perfect: + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Tower_TopReached_PerfectScript.Update(i); + Tower_TopReached_PerfectScript.Draw(i); + break; - case EndMode.Dan_Fail: - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Dan_FailScript.Update(i); - Dan_FailScript.Draw(i); - break; - case EndMode.Dan_Red_Pass: - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Dan_Red_PassScript.Update(i); - Dan_Red_PassScript.Draw(i); - break; - case EndMode.Dan_Red_FullCombo: - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Dan_Red_FullComboScript.Update(i); - Dan_Red_FullComboScript.Draw(i); - break; - case EndMode.Dan_Red_Perfect: - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Dan_Red_PerfectScript.Update(i); - Dan_Red_PerfectScript.Draw(i); - break; - case EndMode.Dan_Gold_Pass: - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Dan_Gold_PassScript.Update(i); - Dan_Gold_PassScript.Draw(i); - break; - case EndMode.Dan_Gold_FullCombo: - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Dan_Gold_FullComboScript.Update(i); - Dan_Gold_FullComboScript.Draw(i); - break; - case EndMode.Dan_Gold_Perfect: - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Dan_Gold_PerfectScript.Update(i); - Dan_Gold_PerfectScript.Draw(i); - break; - default: - break; - } + case EndMode.Dan_Fail: + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Dan_FailScript.Update(i); + Dan_FailScript.Draw(i); + break; + case EndMode.Dan_Red_Pass: + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Dan_Red_PassScript.Update(i); + Dan_Red_PassScript.Draw(i); + break; + case EndMode.Dan_Red_FullCombo: + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Dan_Red_FullComboScript.Update(i); + Dan_Red_FullComboScript.Draw(i); + break; + case EndMode.Dan_Red_Perfect: + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Dan_Red_PerfectScript.Update(i); + Dan_Red_PerfectScript.Draw(i); + break; + case EndMode.Dan_Gold_Pass: + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Dan_Gold_PassScript.Update(i); + Dan_Gold_PassScript.Draw(i); + break; + case EndMode.Dan_Gold_FullCombo: + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Dan_Gold_FullComboScript.Update(i); + Dan_Gold_FullComboScript.Draw(i); + break; + case EndMode.Dan_Gold_Perfect: + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) Dan_Gold_PerfectScript.Update(i); + Dan_Gold_PerfectScript.Draw(i); + break; + default: + break; + } - } + } - if (this.ct進行メイン.IsEnded) - { - return 1; - } - } + if (this.ct進行メイン.IsEnded) { + return 1; + } + } - return 0; - } + return 0; + } - #region[ private ] - //----------------- + #region[ private ] + //----------------- - private EndAnimeScript FailedScript; - private EndAnimeScript ClearScript; - private EndAnimeScript FullComboScript; - private EndAnimeScript PerfectComboScript; + private EndAnimeScript FailedScript; + private EndAnimeScript ClearScript; + private EndAnimeScript FullComboScript; + private EndAnimeScript PerfectComboScript; - private EndAnimeScript AILoseScript; - private EndAnimeScript AIWinScript; - private EndAnimeScript AIWin_FullComboScript; - private EndAnimeScript AIWin_PerfectScript; + private EndAnimeScript AILoseScript; + private EndAnimeScript AIWinScript; + private EndAnimeScript AIWin_FullComboScript; + private EndAnimeScript AIWin_PerfectScript; - private EndAnimeScript Tower_DropoutScript; - private EndAnimeScript Tower_TopReached_PassScript; - private EndAnimeScript Tower_TopReached_FullComboScript; - private EndAnimeScript Tower_TopReached_PerfectScript; + private EndAnimeScript Tower_DropoutScript; + private EndAnimeScript Tower_TopReached_PassScript; + private EndAnimeScript Tower_TopReached_FullComboScript; + private EndAnimeScript Tower_TopReached_PerfectScript; - private EndAnimeScript Dan_FailScript; - private EndAnimeScript Dan_Red_PassScript; - private EndAnimeScript Dan_Red_FullComboScript; - private EndAnimeScript Dan_Red_PerfectScript; + private EndAnimeScript Dan_FailScript; + private EndAnimeScript Dan_Red_PassScript; + private EndAnimeScript Dan_Red_FullComboScript; + private EndAnimeScript Dan_Red_PerfectScript; - private EndAnimeScript Dan_Gold_PassScript; - private EndAnimeScript Dan_Gold_FullComboScript; - private EndAnimeScript Dan_Gold_PerfectScript; + private EndAnimeScript Dan_Gold_PassScript; + private EndAnimeScript Dan_Gold_FullComboScript; + private EndAnimeScript Dan_Gold_PerfectScript; - - bool b再生済み; - bool bリザルトボイス再生済み; - bool bSongsPlayed = false; - CCounter ct進行メイン; - /* + bool b再生済み; + bool bリザルトボイス再生済み; + bool bSongsPlayed = false; + CCounter ct進行メイン; + + /* CCounter ctEnd_ClearFailed; CCounter ctEnd_FullCombo; CCounter ctEnd_FullComboLoop; @@ -856,57 +781,56 @@ namespace TJAPlayer3 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; + CCounter ct進行Loop; + CSound[] soundClear = new CSound[5]; + CSound[] soundFailed = new CSound[5]; + CSound[] soundFullCombo = new CSound[5]; + CSound[] soundPerfectCombo = new CSound[5]; - CSound soundAILose; - CSound soundAIWin; - CSound soundAIWinFullCombo; - CSound soundAIWinPerfectCombo; + CSound soundDanFailed; + CSound soundDanRedClear; + CSound soundDanRedFC; + CSound soundDanRedPerfect; + CSound soundDanGoldClear; + CSound soundDanGoldFC; + CSound soundDanGoldPerfect; + CSound soundTowerDropout; + CSound soundTowerTopPass; + CSound soundTowerTopFC; + CSound soundTowerTopPerfect; - EndMode[] Mode; - enum EndMode - { - StageFailed, - StageCleared, - StageFullCombo, - StagePerfectCombo, + CSound soundAILose; + CSound soundAIWin; + CSound soundAIWinFullCombo; + CSound soundAIWinPerfectCombo; - AI_Lose, - AI_Win, - AI_Win_FullCombo, - AI_Win_Perfect, + EndMode[] Mode; + enum EndMode { + StageFailed, + StageCleared, + StageFullCombo, + StagePerfectCombo, - Tower_Dropout, - Tower_TopReached_Pass, - Tower_TopReached_FullCombo, - Tower_TopReached_Perfect, + AI_Lose, + AI_Win, + AI_Win_FullCombo, + AI_Win_Perfect, - Dan_Fail, - Dan_Red_Pass, - Dan_Red_FullCombo, - Dan_Red_Perfect, - Dan_Gold_Pass, - Dan_Gold_FullCombo, - Dan_Gold_Perfect - } + Tower_Dropout, + Tower_TopReached_Pass, + Tower_TopReached_FullCombo, + Tower_TopReached_Perfect, - //----------------- - #endregion - } + 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 1596b141..bca44cfe 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplCombo.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplCombo.cs @@ -1,16 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace TJAPlayer3 -{ - internal class CActImplCombo : CAct演奏Combo共通 - { +namespace TJAPlayer3 { + internal class CActImplCombo : CAct演奏Combo共通 { // CAct演奏Combo共通 実装 - protected override void tコンボ表示_太鼓(int nCombo値, int nジャンプインデックス, int nPlayer) - { - base.tコンボ表示_太鼓( nCombo値, nジャンプインデックス, nPlayer ); - } + 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 c965a786..26e7cdaf 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplComboBalloon.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplComboBalloon.cs @@ -1,193 +1,155 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; +using System.Drawing; using System.Runtime.InteropServices; using FDK; -namespace TJAPlayer3 -{ - internal class CActImplComboBalloon : CActivity - { - // コンストラクタ +namespace TJAPlayer3 { + 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; + } + - /// - /// 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, TJAPlayer3.Timer ); - this.nCombo_渡[player] = nCombo; + public virtual void Start(int nCombo, int player) { + this.NowDrawBalloon = 0; + this.ct進行[player] = new CCounter(1, 42, 70, TJAPlayer3.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 override void Activate() { + for (int i = 0; i < 2; i++) { + this.nCombo_渡[i] = 0; + this.ct進行[i] = new CCounter(); + } - base.Activate(); + base.Activate(); } - public override void DeActivate() - { - for( int i = 0; i < 2; i++ ) - { - this.ct進行[ i ] = null; - } + public override void DeActivate() { + for (int i = 0; i < 2; i++) { + this.ct進行[i] = null; + } base.DeActivate(); } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { base.ReleaseManagedResource(); } - public override int Draw() - { - if( !base.IsDeActivated ) - { - if (TJAPlayer3.ConfigIni.nPlayerCount > 2 || TJAPlayer3.ConfigIni.SimpleMode) return 0; - for( int i = 0; i < 2; i++ ) - { - if (TJAPlayer3.ConfigIni.bAIBattleMode) break; + public override int Draw() { + if (!base.IsDeActivated) { + if (TJAPlayer3.ConfigIni.nPlayerCount > 2 || TJAPlayer3.ConfigIni.SimpleMode) return 0; + for (int i = 0; i < 2; i++) { + if (TJAPlayer3.ConfigIni.bAIBattleMode) break; - int j = i; - if (TJAPlayer3.PlayerSide == 1 && TJAPlayer3.ConfigIni.nPlayerCount == 1) - j = 1; + int j = i; + if (TJAPlayer3.PlayerSide == 1 && TJAPlayer3.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( TJAPlayer3.Tx.Balloon_Combo[ j ] != null && TJAPlayer3.Tx.Balloon_Number_Combo != null) - { - //半透明4f - if( this.ct進行[ i ].CurrentValue == 1 || this.ct進行[ i ].CurrentValue == 42 ) - { - TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 0; - TJAPlayer3.Tx.Balloon_Combo[j].Opacity = 64; - NowDrawBalloon = 0; - } - else if( this.ct進行[ i ].CurrentValue == 2 || this.ct進行[ i ].CurrentValue == 41 ) - { - TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 0; - TJAPlayer3.Tx.Balloon_Combo[j].Opacity = 128; - NowDrawBalloon = 0; - } - else if( this.ct進行[ i ].CurrentValue == 3 || this.ct進行[ i ].CurrentValue == 40 ) - { - NowDrawBalloon = 1; - TJAPlayer3.Tx.Balloon_Combo[j].Opacity = 255; - TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 128; - } - else if( this.ct進行[ i ].CurrentValue == 4 || this.ct進行[ i ].CurrentValue == 39 ) - { - NowDrawBalloon = 2; - TJAPlayer3.Tx.Balloon_Combo[j].Opacity = 255; - TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 255; - } - else if( this.ct進行[ i ].CurrentValue == 5 || this.ct進行[ i ].CurrentValue == 38 ) - { - NowDrawBalloon = 2; - TJAPlayer3.Tx.Balloon_Combo[j].Opacity = 255; - TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 255; - } - else if( this.ct進行[ i ].CurrentValue >= 6 || this.ct進行[ i ].CurrentValue <= 37 ) - { - NowDrawBalloon = 2; - TJAPlayer3.Tx.Balloon_Combo[j].Opacity = 255; - TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 255; - } + if (TJAPlayer3.Tx.Balloon_Combo[j] != null && TJAPlayer3.Tx.Balloon_Number_Combo != null) { + //半透明4f + if (this.ct進行[i].CurrentValue == 1 || this.ct進行[i].CurrentValue == 42) { + TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 0; + TJAPlayer3.Tx.Balloon_Combo[j].Opacity = 64; + NowDrawBalloon = 0; + } else if (this.ct進行[i].CurrentValue == 2 || this.ct進行[i].CurrentValue == 41) { + TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 0; + TJAPlayer3.Tx.Balloon_Combo[j].Opacity = 128; + NowDrawBalloon = 0; + } else if (this.ct進行[i].CurrentValue == 3 || this.ct進行[i].CurrentValue == 40) { + NowDrawBalloon = 1; + TJAPlayer3.Tx.Balloon_Combo[j].Opacity = 255; + TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 128; + } else if (this.ct進行[i].CurrentValue == 4 || this.ct進行[i].CurrentValue == 39) { + NowDrawBalloon = 2; + TJAPlayer3.Tx.Balloon_Combo[j].Opacity = 255; + TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 255; + } else if (this.ct進行[i].CurrentValue == 5 || this.ct進行[i].CurrentValue == 38) { + NowDrawBalloon = 2; + TJAPlayer3.Tx.Balloon_Combo[j].Opacity = 255; + TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 255; + } else if (this.ct進行[i].CurrentValue >= 6 || this.ct進行[i].CurrentValue <= 37) { + NowDrawBalloon = 2; + TJAPlayer3.Tx.Balloon_Combo[j].Opacity = 255; + TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 255; + } - if( this.ct進行[ i ].IsTicked ) - { - int plate_width = TJAPlayer3.Tx.Balloon_Combo[j].szTextureSize.Width / 3; - int plate_height = TJAPlayer3.Tx.Balloon_Combo[j].szTextureSize.Height; - TJAPlayer3.Tx.Balloon_Combo[ j ].t2D描画( TJAPlayer3.Skin.Game_Balloon_Combo_X[ i ], TJAPlayer3.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小文字表示( TJAPlayer3.Skin.Game_Balloon_Combo_Number_X[ i], TJAPlayer3.Skin.Game_Balloon_Combo_Number_Y[ i ], this.nCombo_渡[ i ], j); - TJAPlayer3.Tx.Balloon_Number_Combo.t2D描画( TJAPlayer3.Skin.Game_Balloon_Combo_Text_X[ i] + 6 - NowDrawBalloon * 3, TJAPlayer3.Skin.Game_Balloon_Combo_Text_Y[ i ], - new Rectangle(TJAPlayer3.Skin.Game_Balloon_Combo_Text_Rect[0], TJAPlayer3.Skin.Game_Balloon_Combo_Text_Rect[1], TJAPlayer3.Skin.Game_Balloon_Combo_Text_Rect[2], TJAPlayer3.Skin.Game_Balloon_Combo_Text_Rect[3])); - } - else - { - this.t小文字表示( TJAPlayer3.Skin.Game_Balloon_Combo_Number_Ex_X[ i], TJAPlayer3.Skin.Game_Balloon_Combo_Number_Ex_Y[ i ], this.nCombo_渡[ i ], j ); - TJAPlayer3.Tx.Balloon_Number_Combo.vcScaleRatio.X = 1.0f; - TJAPlayer3.Tx.Balloon_Number_Combo.t2D描画( TJAPlayer3.Skin.Game_Balloon_Combo_Text_Ex_X[ i] + 6 - NowDrawBalloon * 3, TJAPlayer3.Skin.Game_Balloon_Combo_Text_Ex_Y[ i ], - new Rectangle(TJAPlayer3.Skin.Game_Balloon_Combo_Text_Rect[0], TJAPlayer3.Skin.Game_Balloon_Combo_Text_Rect[1], TJAPlayer3.Skin.Game_Balloon_Combo_Text_Rect[2], TJAPlayer3.Skin.Game_Balloon_Combo_Text_Rect[3])); - } - } - } - } + if (this.ct進行[i].IsTicked) { + int plate_width = TJAPlayer3.Tx.Balloon_Combo[j].szTextureSize.Width / 3; + int plate_height = TJAPlayer3.Tx.Balloon_Combo[j].szTextureSize.Height; + TJAPlayer3.Tx.Balloon_Combo[j].t2D描画(TJAPlayer3.Skin.Game_Balloon_Combo_X[i], TJAPlayer3.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小文字表示(TJAPlayer3.Skin.Game_Balloon_Combo_Number_X[i], TJAPlayer3.Skin.Game_Balloon_Combo_Number_Y[i], this.nCombo_渡[i], j); + TJAPlayer3.Tx.Balloon_Number_Combo.t2D描画(TJAPlayer3.Skin.Game_Balloon_Combo_Text_X[i] + 6 - NowDrawBalloon * 3, TJAPlayer3.Skin.Game_Balloon_Combo_Text_Y[i], + new Rectangle(TJAPlayer3.Skin.Game_Balloon_Combo_Text_Rect[0], TJAPlayer3.Skin.Game_Balloon_Combo_Text_Rect[1], TJAPlayer3.Skin.Game_Balloon_Combo_Text_Rect[2], TJAPlayer3.Skin.Game_Balloon_Combo_Text_Rect[3])); + } else { + this.t小文字表示(TJAPlayer3.Skin.Game_Balloon_Combo_Number_Ex_X[i], TJAPlayer3.Skin.Game_Balloon_Combo_Number_Ex_Y[i], this.nCombo_渡[i], j); + TJAPlayer3.Tx.Balloon_Number_Combo.vcScaleRatio.X = 1.0f; + TJAPlayer3.Tx.Balloon_Number_Combo.t2D描画(TJAPlayer3.Skin.Game_Balloon_Combo_Text_Ex_X[i] + 6 - NowDrawBalloon * 3, TJAPlayer3.Skin.Game_Balloon_Combo_Text_Ex_Y[i], + new Rectangle(TJAPlayer3.Skin.Game_Balloon_Combo_Text_Rect[0], TJAPlayer3.Skin.Game_Balloon_Combo_Text_Rect[1], TJAPlayer3.Skin.Game_Balloon_Combo_Text_Rect[2], TJAPlayer3.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 CCounter[] ct進行 = new CCounter[5]; + //private CTexture[] tx吹き出し本体 = new CTexture[ 2 ]; + //private CTexture tx数字; + private int[] nCombo_渡 = new int[5]; - private int NowDrawBalloon; + 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]; + [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 - (TJAPlayer3.Skin.Game_Balloon_Combo_Number_Interval[0] * (j - nums.Length)); - float _y = y - (TJAPlayer3.Skin.Game_Balloon_Combo_Number_Interval[1] * (j - nums.Length)); + 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 - (TJAPlayer3.Skin.Game_Balloon_Combo_Number_Interval[0] * (j - nums.Length)); + float _y = y - (TJAPlayer3.Skin.Game_Balloon_Combo_Number_Interval[1] * (j - nums.Length)); - float width = TJAPlayer3.Skin.Game_Balloon_Combo_Number_Size[0]; - float height = TJAPlayer3.Skin.Game_Balloon_Combo_Number_Size[1]; + float width = TJAPlayer3.Skin.Game_Balloon_Combo_Number_Size[0]; + float height = TJAPlayer3.Skin.Game_Balloon_Combo_Number_Size[1]; - TJAPlayer3.Tx.Balloon_Number_Combo.t2D描画(_x, _y, new RectangleF(width * nums[j], height * player, width, height)); - } - } + TJAPlayer3.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 94b2aab5..c6117776 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplDancer.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplDancer.cs @@ -1,373 +1,295 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Runtime.InteropServices; +using System.Diagnostics; using FDK; -using System.Diagnostics; -namespace TJAPlayer3 -{ - internal class CActImplDancer : CActivity - { - /// - /// 踊り子 - /// - public CActImplDancer() - { - base.IsDeActivated = true; - } +namespace TJAPlayer3 { + internal class CActImplDancer : CActivity { + /// + /// 踊り子 + /// + public CActImplDancer() { + base.IsDeActivated = true; + } - public override void Activate() - { - //this.ct踊り子モーション = new CCounter(); + public override void Activate() { + //this.ct踊り子モーション = new CCounter(); - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower || TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - return; + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower || TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + return; - var preset = HScenePreset.GetBGPreset(); + var preset = HScenePreset.GetBGPreset(); - Random random = new Random(); + 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]; + 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 (System.IO.Directory.Exists($@"{dancerOrigindir}")) - { - var dirs = System.IO.Directory.GetDirectories($@"{dancerOrigindir}"); - if (dirs.Length > 0) - { - var _presetPath = (preset != null && preset.DancerSet != null) ? $@"{dancerOrigindir}" + preset.DancerSet[random.Next(0, preset.DancerSet.Length)] : ""; - var path = (preset != null && System.IO.Directory.Exists(_presetPath)) - ? _presetPath - : dirs[random.Next(0, dirs.Length)]; + var dancerOrigindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.DANCER}"); + if (System.IO.Directory.Exists($@"{dancerOrigindir}")) { + var dirs = System.IO.Directory.GetDirectories($@"{dancerOrigindir}"); + if (dirs.Length > 0) { + var _presetPath = (preset != null && preset.DancerSet != null) ? $@"{dancerOrigindir}" + preset.DancerSet[random.Next(0, preset.DancerSet.Length)] : ""; + var path = (preset != null && System.IO.Directory.Exists(_presetPath)) + ? _presetPath + : dirs[random.Next(0, dirs.Length)]; - LoadDancerConifg(path); + 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]; + 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 = TJAPlayer3.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] = TJAPlayer3.tテクスチャの生成($@"{path}{Path.DirectorySeparatorChar}{(i + 1)}_In{Path.DirectorySeparatorChar}{p}.png"); - } - } - } + nDancerInPtn = TJAPlayer3.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] = TJAPlayer3.tテクスチャの生成($@"{path}{Path.DirectorySeparatorChar}{(i + 1)}_In{Path.DirectorySeparatorChar}{p}.png"); + } + } + } - nDancerOutPtn = TJAPlayer3.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] = TJAPlayer3.tテクスチャの生成($@"{path}{Path.DirectorySeparatorChar}{(i + 1)}_Out{Path.DirectorySeparatorChar}{p}.png"); - } - } - } + nDancerOutPtn = TJAPlayer3.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] = TJAPlayer3.tテクスチャの生成($@"{path}{Path.DirectorySeparatorChar}{(i + 1)}_Out{Path.DirectorySeparatorChar}{p}.png"); + } + } + } - nDancerPtn = TJAPlayer3.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] = TJAPlayer3.tテクスチャの生成($@"{path}{Path.DirectorySeparatorChar}{(i + 1)}{Path.DirectorySeparatorChar}{p}.png"); - } - } - } - } - } + nDancerPtn = TJAPlayer3.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] = TJAPlayer3.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_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"); + arMotionArray_Out = CConversion.StringToIntArray(Game_Dancer_Out_Motion); + if (this.arMotionArray_Out == null) arMotionArray_Out = CConversion.StringToIntArray("0,0"); - this.ar踊り子モーション番号 = CConversion.StringToIntArray(TJAPlayer3.Skin.Game_Dancer_Motion); - if(this.ar踊り子モーション番号 == null) ar踊り子モーション番号 = CConversion.StringToIntArray("0,0"); + this.ar踊り子モーション番号 = CConversion.StringToIntArray(TJAPlayer3.Skin.Game_Dancer_Motion); + if (this.ar踊り子モーション番号 == null) ar踊り子モーション番号 = CConversion.StringToIntArray("0,0"); - nNowDancerCounter = 0; - nNowDancerFrame = 0; + nNowDancerCounter = 0; + nNowDancerFrame = 0; - base.Activate(); - } + base.Activate(); + } - public override void DeActivate() - { - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower || TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - return; - - //this.ct踊り子モーション = null; + public override void DeActivate() { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower || TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + return; - for (int i = 0; i < nDancerCount; i++) - { - TJAPlayer3.t安全にDisposeする(ref Dancer_In[i]); - TJAPlayer3.t安全にDisposeする(ref Dancer_Out[i]); - TJAPlayer3.t安全にDisposeする(ref Dancer[i]); - } + //this.ct踊り子モーション = null; - base.DeActivate(); - } + for (int i = 0; i < nDancerCount; i++) { + TJAPlayer3.t安全にDisposeする(ref Dancer_In[i]); + TJAPlayer3.t安全にDisposeする(ref Dancer_Out[i]); + TJAPlayer3.t安全にDisposeする(ref Dancer[i]); + } - public override void CreateManagedResource() - { - base.CreateManagedResource(); - } + base.DeActivate(); + } - public override void ReleaseManagedResource() - { - base.ReleaseManagedResource(); - } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } - public override int Draw() - { - if( this.IsFirstDraw ) - { - this.IsFirstDraw = true; - } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower && TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) - { - if (TJAPlayer3.ConfigIni.ShowDancer && (this.ar踊り子モーション番号.Length - 1) != 0) - { - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) nNowDancerCounter += Math.Abs((float)TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0] / 60.0f) * (float)TJAPlayer3.FPS.DeltaTime / nDancerBeat; - if (nNowDancerCounter >= 1) - { - nNowDancerCounter = 0; - } - nNowDancerFrame = (int)(nNowDancerCounter * (this.ar踊り子モーション番号.Length - 1)); + public override int Draw() { + if (this.IsFirstDraw) { + this.IsFirstDraw = true; + } - for (int i = 0; i < nDancerCount; i++) - { - if ((int)TJAPlayer3.stage演奏ドラム画面.actGauge.db現在のゲージ値[0] >= TJAPlayer3.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 (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) nNowDancerInCounter[i] += Math.Abs((float)TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0] / nDancerInInterval) * (float)TJAPlayer3.FPS.DeltaTime; + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower && TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { + if (TJAPlayer3.ConfigIni.ShowDancer && (this.ar踊り子モーション番号.Length - 1) != 0) { + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) nNowDancerCounter += Math.Abs((float)TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0] / 60.0f) * (float)TJAPlayer3.FPS.DeltaTime / nDancerBeat; + if (nNowDancerCounter >= 1) { + nNowDancerCounter = 0; + } + nNowDancerFrame = (int)(nNowDancerCounter * (this.ar踊り子モーション番号.Length - 1)); - 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中心基準描画(TJAPlayer3.Skin.Game_Dancer_X[i], TJAPlayer3.Skin.Game_Dancer_Y[i]); - } - } - - } - break; - case 2: - { - if (nDancerOutInterval == 0) - { - DancerStates[i] = 0; - } - else - { - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) nNowDancerOutCounter[i] += Math.Abs((float)TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0] / nDancerOutInterval) * (float)TJAPlayer3.FPS.DeltaTime; + for (int i = 0; i < nDancerCount; i++) { + if ((int)TJAPlayer3.stage演奏ドラム画面.actGauge.db現在のゲージ値[0] >= TJAPlayer3.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; + } + } - if (nNowDancerOutCounter[i] >= 1) - { - nNowDancerOutCounter[i] = 1; - DancerStates[i] = 0; - } + switch (DancerStates[i]) { + case 0: + break; + case 1: { + if (nDancerInInterval == 0) { + DancerStates[i] = 3; + } else { + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) nNowDancerInCounter[i] += Math.Abs((float)TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0] / nDancerInInterval) * (float)TJAPlayer3.FPS.DeltaTime; - 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中心基準描画(TJAPlayer3.Skin.Game_Dancer_X[i], TJAPlayer3.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中心基準描画(TJAPlayer3.Skin.Game_Dancer_X[i], TJAPlayer3.Skin.Game_Dancer_Y[i]); - } - break; - } - } - } - } + if (nNowDancerInCounter[i] >= 1) { + nNowDancerInCounter[i] = 1; + DancerStates[i] = 3; + } - return base.Draw(); - } + 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中心基準描画(TJAPlayer3.Skin.Game_Dancer_X[i], TJAPlayer3.Skin.Game_Dancer_Y[i]); + } + } - #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; + } + break; + case 2: { + if (nDancerOutInterval == 0) { + DancerStates[i] = 0; + } else { + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) nNowDancerOutCounter[i] += Math.Abs((float)TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0] / nDancerOutInterval) * (float)TJAPlayer3.FPS.DeltaTime; - private void LoadDancerConifg(string dancerPath) - { - var _str = ""; - TJAPlayer3.Skin.LoadSkinConfigFromFile(dancerPath + @$"{Path.DirectorySeparatorChar}DancerConfig.txt", ref _str); + if (nNowDancerOutCounter[i] >= 1) { + nNowDancerOutCounter[i] = 1; + DancerStates[i] = 0; + } - string[] delimiter = { "\n" }; - string[] strSingleLine = _str.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); + 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中心基準描画(TJAPlayer3.Skin.Game_Dancer_X[i], TJAPlayer3.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中心基準描画(TJAPlayer3.Skin.Game_Dancer_X[i], TJAPlayer3.Skin.Game_Dancer_Y[i]); + } + break; + } + } + } + } - TJAPlayer3.Skin.Game_Dancer_X = new int[] { 640, 430, 856, 215, 1070 }; - TJAPlayer3.Skin.Game_Dancer_Y = new int[] { 500, 500, 500, 500, 500 }; - nDancerCount = 5; - nDancerInInterval = 0; - nDancerOutInterval = 0; + return base.Draw(); + } - 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[] { '=' }); + #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; - if (strArray.Length == 2) - { - strCommand = strArray[0].Trim(); - strParam = strArray[1].Trim(); + private void LoadDancerConifg(string dancerPath) { + var _str = ""; + TJAPlayer3.Skin.LoadSkinConfigFromFile(dancerPath + @$"{Path.DirectorySeparatorChar}DancerConfig.txt", ref _str); - if (strCommand == "Game_Dancer_Count") - { - nDancerCount = int.Parse(strParam); - TJAPlayer3.Skin.Game_Dancer_X = new int[nDancerCount]; - TJAPlayer3.Skin.Game_Dancer_Y = new int[nDancerCount]; - } - else if (strCommand == "Game_Dancer_X") - { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < nDancerCount; i++) - { - TJAPlayer3.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++) - { - TJAPlayer3.Skin.Game_Dancer_Y[i] = int.Parse(strSplit[i]); - } - } - else if (strCommand == "Game_Dancer_Motion") - { - TJAPlayer3.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++) - { - TJAPlayer3.Skin.Game_Dancer_Gauge[i] = int.Parse(strSplit[i]); - } - } + string[] delimiter = { "\n" }; + string[] strSingleLine = _str.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); - } - continue; - } - catch (Exception exception) - { - Trace.TraceError(exception.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (6a32cc37-1527-412e-968a-512c1f0135cd)"); - continue; - } - } - } + TJAPlayer3.Skin.Game_Dancer_X = new int[] { 640, 430, 856, 215, 1070 }; + TJAPlayer3.Skin.Game_Dancer_Y = new int[] { 500, 500, 500, 500, 500 }; + nDancerCount = 5; + nDancerInInterval = 0; + nDancerOutInterval = 0; - } - //----------------- - #endregion - } + 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); + TJAPlayer3.Skin.Game_Dancer_X = new int[nDancerCount]; + TJAPlayer3.Skin.Game_Dancer_Y = new int[nDancerCount]; + } else if (strCommand == "Game_Dancer_X") { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < nDancerCount; i++) { + TJAPlayer3.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++) { + TJAPlayer3.Skin.Game_Dancer_Y[i] = int.Parse(strSplit[i]); + } + } else if (strCommand == "Game_Dancer_Motion") { + TJAPlayer3.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++) { + TJAPlayer3.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 4c0cbb8c..176e12e7 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplFireworks.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplFireworks.cs @@ -1,281 +1,234 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; using FDK; - using Rectangle = System.Drawing.Rectangle; -using Point = System.Drawing.Point; -using Color = System.Drawing.Color; -namespace TJAPlayer3 -{ - internal class CActImplFireworks : CActivity - { +namespace TJAPlayer3 { + internal class CActImplFireworks : CActivity { // コンストラクタ - public CActImplFireworks() - { + 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( TJAPlayer3.Tx.Effects_Hit_FireWorks != null && TJAPlayer3.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, TJAPlayer3.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 (TJAPlayer3.Tx.Effects_Hit_FireWorks != null && TJAPlayer3.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, TJAPlayer3.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 (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; - } + 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; - } - } - } - } - } + 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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.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, TJAPlayer3.Timer); + this.st状態_大[j].judge = judge; + this.st状態_大[j].nIsBig = 1; + break; + } + break; + } + } } // CActivity 実装 - 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(); + 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(); + 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(); + base.Activate(); } - public override void DeActivate() - { - for( int i = 0; i < 3 * 4; i++ ) - { - this.st状態[ i ].ct進行 = null; - this.st状態_大[ i ].ct進行 = null; + 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; + for (int i = 0; i < 256; i++) { + this.st紙吹雪[i].ct進行 = null; } base.DeActivate(); } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { base.ReleaseManagedResource(); } - public override int Draw() - { - if( !base.IsDeActivated ) - { - int nWidth = (TJAPlayer3.Tx.Effects_Hit_Explosion.szTextureSize.Width / 7); - int nHeight = (TJAPlayer3.Tx.Effects_Hit_Explosion.szTextureSize.Height / 4); - int nBombWidth = (TJAPlayer3.Tx.Effects_Hit_Bomb.szTextureSize.Width / 7); - int nBombHeight = (TJAPlayer3.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; - } + public override int Draw() { + if (!base.IsDeActivated) { + int nWidth = (TJAPlayer3.Tx.Effects_Hit_Explosion.szTextureSize.Width / 7); + int nHeight = (TJAPlayer3.Tx.Effects_Hit_Explosion.szTextureSize.Height / 4); + int nBombWidth = (TJAPlayer3.Tx.Effects_Hit_Bomb.szTextureSize.Width / 7); + int nBombHeight = (TJAPlayer3.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( TJAPlayer3.Tx.Effects_Hit_Explosion != null && !TJAPlayer3.IsPerformingCalibration ) - { - int n = this.st状態[ i ].nIsBig == 1 ? (nHeight * 2) : 0; + // (When performing calibration, reduce visual distraction + // and current judgment feedback near the judgment position.) + if (TJAPlayer3.Tx.Effects_Hit_Explosion != null && !TJAPlayer3.IsPerformingCalibration) { + int n = this.st状態[i].nIsBig == 1 ? (nHeight * 2) : 0; - int nX = 0; - int nY = 0; + int nX = 0; + int nY = 0; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - nX = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * this.st状態[i].nPlayer); - nY = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * this.st状態[i].nPlayer); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - nX = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * this.st状態[i].nPlayer); - nY = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * this.st状態[i].nPlayer); - } - else - { - nX = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_X[this.st状態[i].nPlayer]; - nY = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_Y[this.st状態[i].nPlayer]; - } - nX += TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(this.st状態[i].nPlayer); - nY += TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(this.st状態[i].nPlayer); + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + nX = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * this.st状態[i].nPlayer); + nY = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * this.st状態[i].nPlayer); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + nX = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * this.st状態[i].nPlayer); + nY = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * this.st状態[i].nPlayer); + } else { + nX = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_X[this.st状態[i].nPlayer]; + nY = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_Y[this.st状態[i].nPlayer]; + } + nX += TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(this.st状態[i].nPlayer); + nY += TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(this.st状態[i].nPlayer); - switch ( st状態[ i ].judge ) - { - case ENoteJudge.Perfect: - case ENoteJudge.Great: - case ENoteJudge.Auto: - if (!TJAPlayer3.ConfigIni.SimpleMode) TJAPlayer3.Tx.Effects_Hit_Explosion.t2D描画(nX, nY, new Rectangle(this.st状態[i].ct進行.CurrentValue * nWidth, n, nWidth, nHeight)); - break; - case ENoteJudge.Good: - TJAPlayer3.Tx.Effects_Hit_Explosion.t2D描画(nX, nY, new Rectangle(this.st状態[i].ct進行.CurrentValue * nWidth, n + nHeight, nWidth, nHeight)); - break; - case ENoteJudge.Mine: - TJAPlayer3.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; - } - } - } - } - } + switch (st状態[i].judge) { + case ENoteJudge.Perfect: + case ENoteJudge.Great: + case ENoteJudge.Auto: + if (!TJAPlayer3.ConfigIni.SimpleMode) TJAPlayer3.Tx.Effects_Hit_Explosion.t2D描画(nX, nY, new Rectangle(this.st状態[i].ct進行.CurrentValue * nWidth, n, nWidth, nHeight)); + break; + case ENoteJudge.Good: + TJAPlayer3.Tx.Effects_Hit_Explosion.t2D描画(nX, nY, new Rectangle(this.st状態[i].ct進行.CurrentValue * nWidth, n + nHeight, nWidth, nHeight)); + break; + case ENoteJudge.Mine: + TJAPlayer3.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; + } + } + } + } + } - 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(TJAPlayer3.Tx.Effects_Hit_Explosion_Big != null && this.st状態_大[ i ].nIsBig == 1 ) - { + 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 (TJAPlayer3.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 && !TJAPlayer3.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); + switch (st状態_大[i].judge) { + case ENoteJudge.Perfect: + case ENoteJudge.Great: + case ENoteJudge.Auto: + if (this.st状態_大[i].nIsBig == 1 && !TJAPlayer3.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 ); + ////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 ); @@ -287,115 +240,101 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Effects_Hit_Explosion_Big.t3D描画( mat ); */ - float x = 0; - float y = 0; + float x = 0; + float y = 0; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - x = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * this.st状態[i].nPlayer); - y = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * this.st状態[i].nPlayer); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - x = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * this.st状態[i].nPlayer); - y = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * this.st状態[i].nPlayer); - } - else - { - x = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_X[this.st状態[i].nPlayer]; - y = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_Y[this.st状態[i].nPlayer]; - } - x += TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(this.st状態[i].nPlayer); - y += TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(this.st状態[i].nPlayer); + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + x = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * this.st状態[i].nPlayer); + y = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * this.st状態[i].nPlayer); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + x = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * this.st状態[i].nPlayer); + y = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * this.st状態[i].nPlayer); + } else { + x = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_X[this.st状態[i].nPlayer]; + y = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_Y[this.st状態[i].nPlayer]; + } + x += TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(this.st状態[i].nPlayer); + y += TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(this.st状態[i].nPlayer); - x -= (TJAPlayer3.Tx.Effects_Hit_Explosion_Big.szTextureSize.Width * (f倍率 - 1.0f) / 2.0f); - y -= (TJAPlayer3.Tx.Effects_Hit_Explosion_Big.szTextureSize.Height * (f倍率 - 1.0f) / 2.0f); + x -= (TJAPlayer3.Tx.Effects_Hit_Explosion_Big.szTextureSize.Width * (f倍率 - 1.0f) / 2.0f); + y -= (TJAPlayer3.Tx.Effects_Hit_Explosion_Big.szTextureSize.Height * (f倍率 - 1.0f) / 2.0f); - TJAPlayer3.Tx.Effects_Hit_Explosion_Big.vcScaleRatio.X = f倍率; - TJAPlayer3.Tx.Effects_Hit_Explosion_Big.vcScaleRatio.Y = f倍率; - TJAPlayer3.Tx.Effects_Hit_Explosion_Big.t2D描画(x, y); - } - break; - - case ENoteJudge.Good: - break; + TJAPlayer3.Tx.Effects_Hit_Explosion_Big.vcScaleRatio.X = f倍率; + TJAPlayer3.Tx.Effects_Hit_Explosion_Big.vcScaleRatio.Y = f倍率; + TJAPlayer3.Tx.Effects_Hit_Explosion_Big.t2D描画(x, y); + } + break; - case ENoteJudge.Miss: - case ENoteJudge.Bad: - break; - } - } - } - } + case ENoteJudge.Good: + break; - for (int i = 0; i < 45; i++) - { - if( TJAPlayer3.Skin.nScrollFieldX[0] != 414 ) - break; + case ENoteJudge.Miss: + case ENoteJudge.Bad: + 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; - } - /* + for (int i = 0; i < 45; i++) { + if (TJAPlayer3.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 ); + 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 ) ); - // } - //} - } + //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重力加速度; - } - /* + 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; @@ -403,75 +342,71 @@ namespace TJAPlayer3 mat *= Matrix.Translation(this.st紙吹雪[i].fX - SampleFramework.GameWindowSize.Width / 2, -(this.st紙吹雪[i].fY - SampleFramework.GameWindowSize.Height / 2), 0f); */ - /*if (this.tx紙吹雪 != null) + /*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; } - + // その他 #region [ private ] //----------------- - //private CTextureAf txアタックエフェクトUpper; - //private CTexture txアタックエフェクトUpper_big; - //private CTextureAf[] tx大音符花火 = new CTextureAf[2]; - //private CTexture tx紙吹雪; + //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 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 }; + 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)] + 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終了フレーム; - } + [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; + 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; @@ -483,10 +418,10 @@ namespace TJAPlayer3 public float f加速度の加速度Y; public float f重力加速度; 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 4f8b4c76..203a8d0e 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplFooter.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplFooter.cs @@ -1,76 +1,60 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Runtime.InteropServices; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - internal class CActImplFooter : CActivity - { - /// - /// フッター - /// - public CActImplFooter() - { - base.IsDeActivated = true; - } +namespace TJAPlayer3 { + 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(); + public override void Activate() { + var footerDir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.FOOTER}"); + var preset = HScenePreset.GetBGPreset(); - if (System.IO.Directory.Exists(footerDir)) - { - Random random = new Random(); + if (System.IO.Directory.Exists(footerDir)) { + Random random = new Random(); - var upDirs = System.IO.Directory.GetFiles(footerDir); - if (upDirs.Length > 0) - { - var _presetPath = (preset != null && preset.FooterSet != null) ? $@"{footerDir}" + preset.FooterSet[random.Next(0, preset.FooterSet.Length)] + ".png" : ""; - var path = (preset != null && System.IO.File.Exists(_presetPath)) - ? _presetPath - : upDirs[random.Next(0, upDirs.Length)]; + var upDirs = System.IO.Directory.GetFiles(footerDir); + if (upDirs.Length > 0) { + var _presetPath = (preset != null && preset.FooterSet != null) ? $@"{footerDir}" + preset.FooterSet[random.Next(0, preset.FooterSet.Length)] + ".png" : ""; + var path = (preset != null && System.IO.File.Exists(_presetPath)) + ? _presetPath + : upDirs[random.Next(0, upDirs.Length)]; - Mob_Footer = TJAPlayer3.tテクスチャの生成(path); - } - } + Mob_Footer = TJAPlayer3.tテクスチャの生成(path); + } + } - base.Activate(); - } + base.Activate(); + } - public override void DeActivate() - { - TJAPlayer3.tDisposeSafely(ref Mob_Footer); + public override void DeActivate() { + TJAPlayer3.tDisposeSafely(ref Mob_Footer); - base.DeActivate(); - } + 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() - { - if (this.Mob_Footer != null) - { - this.Mob_Footer.t2D描画(0, TJAPlayer3.Skin.Resolution[1] - this.Mob_Footer.szTextureSize.Height); - } - return base.Draw(); - } + public override int Draw() { + if (this.Mob_Footer != null) { + this.Mob_Footer.t2D描画(0, TJAPlayer3.Skin.Resolution[1] - this.Mob_Footer.szTextureSize.Height); + } + return base.Draw(); + } - #region[ private ] - //----------------- - public CTexture Mob_Footer; - //----------------- - #endregion - } + #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 3963420f..671acbb5 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplGauge.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplGauge.cs @@ -1,154 +1,130 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Drawing; using System.Runtime.InteropServices; -using System.Drawing; -using System.Diagnostics; using FDK; -namespace TJAPlayer3 -{ - internal class CActImplGauge : CAct演奏ゲージ共通 - { +namespace TJAPlayer3 { + internal class CActImplGauge : CAct演奏ゲージ共通 { // プロパティ -// public double db現在のゲージ値 -// { -// get -// { -// return this.dbゲージ値; -// } -// set -// { -// this.dbゲージ値 = value; -// if( this.dbゲージ値 > 1.0 ) -// { -// this.dbゲージ値 = 1.0; -// } -// } -// } + // public double db現在のゲージ値 + // { + // get + // { + // return this.dbゲージ値; + // } + // set + // { + // this.dbゲージ値 = value; + // if( this.dbゲージ値 > 1.0 ) + // { + // this.dbゲージ値 = 1.0; + // } + // } + // } + - // コンストラクタ - /// - /// ゲージの描画クラス。ドラム側。 - /// - /// 課題 - /// _ゲージの実装。 - /// _Danger時にゲージの色が変わる演出の実装。 - /// _Danger、MAX時のアニメーション実装。 - /// - public CActImplGauge() - { + /// + /// ゲージの描画クラス。ドラム側。 + /// + /// 課題 + /// _ゲージの実装。 + /// _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, TJAPlayer3.Timer); - this.st花火状態[player][j].nPlayer = player; + 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, TJAPlayer3.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; + 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; - } - } - } - } + this.st花火状態[player][j].b使用中 = true; + break; + } + } + } + } // CActivity 実装 - public override void Activate() - { - this.ct炎 = new CCounter( 0, 6, 50, TJAPlayer3.Timer ); + public override void Activate() { + this.ct炎 = new CCounter(0, 6, 50, TJAPlayer3.Timer); - for (int player = 0; player < 5; player++) - { - for (int i = 0; i < 32; i++) - { - this.st花火状態[player][i].ct進行 = new CCounter(); - } - } + for (int player = 0; player < 5; player++) { + for (int i = 0; i < 32; i++) { + this.st花火状態[player][i].ct進行 = new CCounter(); + } + } + + if (TJAPlayer3.Skin.Game_Gauge_Rainbow_Timer <= 1) { + throw new DivideByZeroException("SkinConfigの設定\"Game_Gauge_Rainbow_Timer\"を1以下にすることは出来ません。"); + } + this.ct虹アニメ = new CCounter(0, TJAPlayer3.Skin.Game_Gauge_Rainbow_Ptn - 1, TJAPlayer3.Skin.Game_Gauge_Rainbow_Timer, TJAPlayer3.Timer); + this.ct虹透明度 = new CCounter(0, TJAPlayer3.Skin.Game_Gauge_Rainbow_Timer - 1, 1, TJAPlayer3.Timer); + this.ctGaugeFlash = new CCounter(0, 532, 1, TJAPlayer3.Timer); - if(TJAPlayer3.Skin.Game_Gauge_Rainbow_Timer <= 1) - { - throw new DivideByZeroException("SkinConfigの設定\"Game_Gauge_Rainbow_Timer\"を1以下にすることは出来ません。"); - } - this.ct虹アニメ = new CCounter( 0, TJAPlayer3.Skin.Game_Gauge_Rainbow_Ptn -1, TJAPlayer3.Skin.Game_Gauge_Rainbow_Timer, TJAPlayer3.Timer ); - this.ct虹透明度 = new CCounter(0, TJAPlayer3.Skin.Game_Gauge_Rainbow_Timer-1, 1, TJAPlayer3.Timer); - this.ctGaugeFlash = new CCounter(0, 532, 1, TJAPlayer3.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() ); + 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; - #region [ 初めての進行描画 ] - if ( base.IsFirstDraw ) - { + 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 + } + #endregion - this.ctGaugeFlash.TickLoop(); + this.ctGaugeFlash.TickLoop(); - int nWidth = (TJAPlayer3.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; - /* + int nWidth = (TJAPlayer3.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 ろみゅ~? @@ -161,343 +137,285 @@ namespace TJAPlayer3 */ - // No gauge if tower - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower || TJAPlayer3.ConfigIni.bTokkunMode) - return 0; + // No gauge if tower + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower || TJAPlayer3.ConfigIni.bTokkunMode) + return 0; - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) - { - #region [Regular gauges] + if (TJAPlayer3.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); + // 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; + // Rainbow gauge + this.ct虹アニメ.TickLoop(); + this.ct虹透明度.TickLoop(); + int rainbowFrame = this.ct虹アニメ.CurrentValue; - // Soul fire frame - this.ct炎.TickLoop(); - int soulFireFrame = this.ct炎.CurrentValue; + // Soul fire frame + this.ct炎.TickLoop(); + int soulFireFrame = this.ct炎.CurrentValue; - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) continue; - HGaugeMethods.UNSAFE_DrawGaugeFast(i, Opacity, rainbowFrame, soulFireFrame); - } + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) continue; + HGaugeMethods.UNSAFE_DrawGaugeFast(i, Opacity, rainbowFrame, soulFireFrame); + } - #endregion - } - else - { - float scale = 1.0f; - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - scale = 0.8f; - } + #endregion + } else { + float scale = 1.0f; + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + scale = 0.8f; + } - int[] gauge_x = new int[5]; - int[] gauge_y = new int[5]; + int[] gauge_x = new int[5]; + int[] gauge_y = new int[5]; - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - gauge_x[i] = TJAPlayer3.Skin.Game_Gauge_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - gauge_y[i] = TJAPlayer3.Skin.Game_Gauge_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - gauge_x[i] = TJAPlayer3.Skin.Game_Gauge_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - gauge_y[i] = TJAPlayer3.Skin.Game_Gauge_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - } - else - { - gauge_x[i] = TJAPlayer3.Skin.Game_Gauge_X[i]; - gauge_y[i] = TJAPlayer3.Skin.Game_Gauge_Y[i]; - } - } + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + gauge_x[i] = TJAPlayer3.Skin.Game_Gauge_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + gauge_y[i] = TJAPlayer3.Skin.Game_Gauge_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + gauge_x[i] = TJAPlayer3.Skin.Game_Gauge_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + gauge_y[i] = TJAPlayer3.Skin.Game_Gauge_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + } else { + gauge_x[i] = TJAPlayer3.Skin.Game_Gauge_X[i]; + gauge_y[i] = TJAPlayer3.Skin.Game_Gauge_Y[i]; + } + } - #region [Gauge base] + #region [Gauge base] - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - { - if (TJAPlayer3.P1IsBlue()) - { - TJAPlayer3.Tx.Gauge_Dan[4]?.t2D描画(gauge_x[0], gauge_y[0], - new Rectangle(TJAPlayer3.Skin.Game_Gauge_Rect[0], TJAPlayer3.Skin.Game_Gauge_Rect[1], TJAPlayer3.Skin.Game_Gauge_Rect[2], TJAPlayer3.Skin.Game_Gauge_Rect[3])); - } - else - { - TJAPlayer3.Tx.Gauge_Dan[0]?.t2D描画(gauge_x[0], gauge_y[0], - new Rectangle(TJAPlayer3.Skin.Game_Gauge_Rect[0], TJAPlayer3.Skin.Game_Gauge_Rect[1], TJAPlayer3.Skin.Game_Gauge_Rect[2], TJAPlayer3.Skin.Game_Gauge_Rect[3])); - } + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + if (TJAPlayer3.P1IsBlue()) { + TJAPlayer3.Tx.Gauge_Dan[4]?.t2D描画(gauge_x[0], gauge_y[0], + new Rectangle(TJAPlayer3.Skin.Game_Gauge_Rect[0], TJAPlayer3.Skin.Game_Gauge_Rect[1], TJAPlayer3.Skin.Game_Gauge_Rect[2], TJAPlayer3.Skin.Game_Gauge_Rect[3])); + } else { + TJAPlayer3.Tx.Gauge_Dan[0]?.t2D描画(gauge_x[0], gauge_y[0], + new Rectangle(TJAPlayer3.Skin.Game_Gauge_Rect[0], TJAPlayer3.Skin.Game_Gauge_Rect[1], TJAPlayer3.Skin.Game_Gauge_Rect[2], TJAPlayer3.Skin.Game_Gauge_Rect[3])); + } - if (TJAPlayer3.Tx.Gauge_Dan[2] != null) - { - for (int i = 0; i < TJAPlayer3.DTX.Dan_C.Length; i++) - { - if (TJAPlayer3.DTX.Dan_C[i] != null) - { - if (TJAPlayer3.DTX.Dan_C[i].GetExamType() == Exam.Type.Gauge) - { - TJAPlayer3.Tx.Gauge_Dan[2].t2D描画(gauge_x[0] + (TJAPlayer3.DTX.Dan_C[i].GetValue(false) / 2 * nWidth), gauge_y[0], - new Rectangle((TJAPlayer3.DTX.Dan_C[i].GetValue(false) / 2 * nWidth), 0, TJAPlayer3.Skin.Game_Gauge_Rect[2] - (TJAPlayer3.DTX.Dan_C[i].GetValue(false) / 2 * nWidth), TJAPlayer3.Skin.Game_Gauge_Rect[3])); - } - } - } - } - } + if (TJAPlayer3.Tx.Gauge_Dan[2] != null) { + for (int i = 0; i < TJAPlayer3.DTX.Dan_C.Length; i++) { + if (TJAPlayer3.DTX.Dan_C[i] != null) { + if (TJAPlayer3.DTX.Dan_C[i].GetExamType() == Exam.Type.Gauge) { + TJAPlayer3.Tx.Gauge_Dan[2].t2D描画(gauge_x[0] + (TJAPlayer3.DTX.Dan_C[i].GetValue(false) / 2 * nWidth), gauge_y[0], + new Rectangle((TJAPlayer3.DTX.Dan_C[i].GetValue(false) / 2 * nWidth), 0, TJAPlayer3.Skin.Game_Gauge_Rect[2] - (TJAPlayer3.DTX.Dan_C[i].GetValue(false) / 2 * nWidth), TJAPlayer3.Skin.Game_Gauge_Rect[3])); + } + } + } + } + } - #endregion + #endregion - #region [ Gauge 1P ] + #region [ Gauge 1P ] - if (TJAPlayer3.Tx.Gauge[0] != null) - { - int x; - int y; - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - x = TJAPlayer3.Skin.Game_Gauge_X_AI; - y = TJAPlayer3.Skin.Game_Gauge_Y_AI; - } - else - { - x = gauge_x[0]; - y = gauge_y[0]; - } + if (TJAPlayer3.Tx.Gauge[0] != null) { + int x; + int y; + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + x = TJAPlayer3.Skin.Game_Gauge_X_AI; + y = TJAPlayer3.Skin.Game_Gauge_Y_AI; + } else { + x = gauge_x[0]; + y = gauge_y[0]; + } - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - { - if (TJAPlayer3.P1IsBlue()) - TJAPlayer3.Tx.Gauge_Dan[5]?.t2D描画(x, y, new Rectangle(0, 0, nRectX[0], TJAPlayer3.Skin.Game_Gauge_Rect[3])); - else - TJAPlayer3.Tx.Gauge_Dan[1]?.t2D描画(x, y, new Rectangle(0, 0, nRectX[0], TJAPlayer3.Skin.Game_Gauge_Rect[3])); + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + if (TJAPlayer3.P1IsBlue()) + TJAPlayer3.Tx.Gauge_Dan[5]?.t2D描画(x, y, new Rectangle(0, 0, nRectX[0], TJAPlayer3.Skin.Game_Gauge_Rect[3])); + else + TJAPlayer3.Tx.Gauge_Dan[1]?.t2D描画(x, y, new Rectangle(0, 0, nRectX[0], TJAPlayer3.Skin.Game_Gauge_Rect[3])); - for (int i = 0; i < TJAPlayer3.DTX.Dan_C.Length; i++) - { - if (TJAPlayer3.DTX.Dan_C[i] != null && TJAPlayer3.DTX.Dan_C[i].GetExamType() == Exam.Type.Gauge && db現在のゲージ値[0] >= TJAPlayer3.DTX.Dan_C[i].GetValue(false)) - { - TJAPlayer3.Tx.Gauge_Dan[3].Opacity = 255; - TJAPlayer3.Tx.Gauge_Dan[3]?.t2D描画(x + (TJAPlayer3.DTX.Dan_C[i].GetValue(false) / 2 * nWidth), y, new Rectangle(TJAPlayer3.DTX.Dan_C[i].GetValue(false) / 2 * nWidth, 0, nRectX[0] - (TJAPlayer3.DTX.Dan_C[i].GetValue(false) / 2 * nWidth), TJAPlayer3.Skin.Game_Gauge_Rect[3])); + for (int i = 0; i < TJAPlayer3.DTX.Dan_C.Length; i++) { + if (TJAPlayer3.DTX.Dan_C[i] != null && TJAPlayer3.DTX.Dan_C[i].GetExamType() == Exam.Type.Gauge && db現在のゲージ値[0] >= TJAPlayer3.DTX.Dan_C[i].GetValue(false)) { + TJAPlayer3.Tx.Gauge_Dan[3].Opacity = 255; + TJAPlayer3.Tx.Gauge_Dan[3]?.t2D描画(x + (TJAPlayer3.DTX.Dan_C[i].GetValue(false) / 2 * nWidth), y, new Rectangle(TJAPlayer3.DTX.Dan_C[i].GetValue(false) / 2 * nWidth, 0, nRectX[0] - (TJAPlayer3.DTX.Dan_C[i].GetValue(false) / 2 * nWidth), TJAPlayer3.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); - TJAPlayer3.Tx.Gauge_Dan[3].Opacity = Opacity; - TJAPlayer3.Tx.Gauge_Dan[3]?.t2D描画(x, y, new Rectangle(0, 0, TJAPlayer3.DTX.Dan_C[i].GetValue(false) / 2 * nWidth, TJAPlayer3.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); + TJAPlayer3.Tx.Gauge_Dan[3].Opacity = Opacity; + TJAPlayer3.Tx.Gauge_Dan[3]?.t2D描画(x, y, new Rectangle(0, 0, TJAPlayer3.DTX.Dan_C[i].GetValue(false) / 2 * nWidth, TJAPlayer3.Skin.Game_Gauge_Rect[3])); - break; - } - } + break; + } + } - } - - - if (TJAPlayer3.Tx.Gauge_Line[0] != null) - { - #region [Rainbow] - - if (this.db現在のゲージ値[0] >= 100.0) - { - this.ct虹アニメ.TickLoop(); - this.ct虹透明度.TickLoop(); - if (TJAPlayer3.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue] != null) - { - TJAPlayer3.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].vcScaleRatio.X = scale; - TJAPlayer3.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].vcScaleRatio.Y = scale; - - TJAPlayer3.Tx.Gauge_Rainbow[虹ベース].vcScaleRatio.X = scale; - TJAPlayer3.Tx.Gauge_Rainbow[虹ベース].vcScaleRatio.Y = scale; - - bool smart = TJAPlayer3.ConfigIni.nPlayerCount > 2 || TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan; + } - TJAPlayer3.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].Opacity = 255; - TJAPlayer3.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].t2D描画(x, y + (smart ? (TJAPlayer3.Skin.Game_Gauge_Rect[3] / 2) : 0), - new RectangleF(0, - smart ? (TJAPlayer3.Skin.Game_Gauge_Rect[3] / 2) : 0, - TJAPlayer3.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].szTextureSize.Width, - smart ? TJAPlayer3.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].szTextureSize.Height - (TJAPlayer3.Skin.Game_Gauge_Rect[3] / 2) : TJAPlayer3.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].szTextureSize.Height)); + if (TJAPlayer3.Tx.Gauge_Line[0] != null) { + #region [Rainbow] + + if (this.db現在のゲージ値[0] >= 100.0) { + this.ct虹アニメ.TickLoop(); + this.ct虹透明度.TickLoop(); + if (TJAPlayer3.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue] != null) { + TJAPlayer3.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].vcScaleRatio.X = scale; + TJAPlayer3.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].vcScaleRatio.Y = scale; + + TJAPlayer3.Tx.Gauge_Rainbow[虹ベース].vcScaleRatio.X = scale; + TJAPlayer3.Tx.Gauge_Rainbow[虹ベース].vcScaleRatio.Y = scale; + + bool smart = TJAPlayer3.ConfigIni.nPlayerCount > 2 || TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan; - TJAPlayer3.Tx.Gauge_Rainbow[虹ベース].Opacity = (ct虹透明度.CurrentValue * 255 / (int)ct虹透明度.EndValue) / 1; - TJAPlayer3.Tx.Gauge_Rainbow[虹ベース].t2D描画(x, y + (smart ? (TJAPlayer3.Skin.Game_Gauge_Rect[3] / 2) : 0), - new RectangleF(0, - smart ? (TJAPlayer3.Skin.Game_Gauge_Rect[3] / 2) : 0, - TJAPlayer3.Tx.Gauge_Rainbow[虹ベース].szTextureSize.Width, - smart ? TJAPlayer3.Tx.Gauge_Rainbow[虹ベース].szTextureSize.Height - (TJAPlayer3.Skin.Game_Gauge_Rect[3] / 2) : TJAPlayer3.Tx.Gauge_Rainbow[虹ベース].szTextureSize.Height)); - } - } - - #endregion + TJAPlayer3.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].Opacity = 255; + TJAPlayer3.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].t2D描画(x, y + (smart ? (TJAPlayer3.Skin.Game_Gauge_Rect[3] / 2) : 0), + new RectangleF(0, + smart ? (TJAPlayer3.Skin.Game_Gauge_Rect[3] / 2) : 0, + TJAPlayer3.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].szTextureSize.Width, + smart ? TJAPlayer3.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].szTextureSize.Height - (TJAPlayer3.Skin.Game_Gauge_Rect[3] / 2) : TJAPlayer3.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].szTextureSize.Height)); - TJAPlayer3.Tx.Gauge_Line[0].vcScaleRatio.X = scale; - TJAPlayer3.Tx.Gauge_Line[0].vcScaleRatio.Y = scale; + TJAPlayer3.Tx.Gauge_Rainbow[虹ベース].Opacity = (ct虹透明度.CurrentValue * 255 / (int)ct虹透明度.EndValue) / 1; + TJAPlayer3.Tx.Gauge_Rainbow[虹ベース].t2D描画(x, y + (smart ? (TJAPlayer3.Skin.Game_Gauge_Rect[3] / 2) : 0), + new RectangleF(0, + smart ? (TJAPlayer3.Skin.Game_Gauge_Rect[3] / 2) : 0, + TJAPlayer3.Tx.Gauge_Rainbow[虹ベース].szTextureSize.Width, + smart ? TJAPlayer3.Tx.Gauge_Rainbow[虹ベース].szTextureSize.Height - (TJAPlayer3.Skin.Game_Gauge_Rect[3] / 2) : TJAPlayer3.Tx.Gauge_Rainbow[虹ベース].szTextureSize.Height)); + } + } - TJAPlayer3.Tx.Gauge_Line[0].t2D描画(x, y); - } + #endregion - } - #endregion + TJAPlayer3.Tx.Gauge_Line[0].vcScaleRatio.X = scale; + TJAPlayer3.Tx.Gauge_Line[0].vcScaleRatio.Y = scale; - // Soul fire here - if (TJAPlayer3.Tx.Gauge_Soul_Fire != null) - { - //仮置き - int soulfire_width = TJAPlayer3.Tx.Gauge_Soul_Fire.szTextureSize.Width / 8; - int soulfire_height = TJAPlayer3.Tx.Gauge_Soul_Fire.szTextureSize.Height; - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) break; + TJAPlayer3.Tx.Gauge_Line[0].t2D描画(x, y); + } - int x; - int y; - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - x = TJAPlayer3.Skin.Gauge_Soul_Fire_X_AI; - y = TJAPlayer3.Skin.Gauge_Soul_Fire_Y_AI; - } - else - { - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - x = TJAPlayer3.Skin.Gauge_Soul_Fire_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - y = TJAPlayer3.Skin.Gauge_Soul_Fire_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - x = TJAPlayer3.Skin.Gauge_Soul_Fire_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - y = TJAPlayer3.Skin.Gauge_Soul_Fire_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - } - else - { - x = TJAPlayer3.Skin.Gauge_Soul_Fire_X[i]; - y = TJAPlayer3.Skin.Gauge_Soul_Fire_Y[i]; - } - } + } - if (this.db現在のゲージ値[i] >= 100.0) - { - this.ct炎.TickLoop(); + #endregion - TJAPlayer3.Tx.Gauge_Soul_Fire.vcScaleRatio.X = scale; - TJAPlayer3.Tx.Gauge_Soul_Fire.vcScaleRatio.Y = scale; + // Soul fire here + if (TJAPlayer3.Tx.Gauge_Soul_Fire != null) { + //仮置き + int soulfire_width = TJAPlayer3.Tx.Gauge_Soul_Fire.szTextureSize.Width / 8; + int soulfire_height = TJAPlayer3.Tx.Gauge_Soul_Fire.szTextureSize.Height; + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) break; - TJAPlayer3.Tx.Gauge_Soul_Fire.t2D描画(x, y, new Rectangle(soulfire_width * (this.ct炎.CurrentValue), 0, soulfire_width, soulfire_height)); - } - } - } - if (TJAPlayer3.Tx.Gauge_Soul != null) - { - //仮置き - int soul_height = TJAPlayer3.Tx.Gauge_Soul.szTextureSize.Height / 2; - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) break; + int x; + int y; + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + x = TJAPlayer3.Skin.Gauge_Soul_Fire_X_AI; + y = TJAPlayer3.Skin.Gauge_Soul_Fire_Y_AI; + } else { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + x = TJAPlayer3.Skin.Gauge_Soul_Fire_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + y = TJAPlayer3.Skin.Gauge_Soul_Fire_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + x = TJAPlayer3.Skin.Gauge_Soul_Fire_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + y = TJAPlayer3.Skin.Gauge_Soul_Fire_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + } else { + x = TJAPlayer3.Skin.Gauge_Soul_Fire_X[i]; + y = TJAPlayer3.Skin.Gauge_Soul_Fire_Y[i]; + } + } - int x; - int y; - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - x = TJAPlayer3.Skin.Gauge_Soul_X_AI; - y = TJAPlayer3.Skin.Gauge_Soul_Y_AI; - } - else - { - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - x = TJAPlayer3.Skin.Gauge_Soul_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - y = TJAPlayer3.Skin.Gauge_Soul_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - x = TJAPlayer3.Skin.Gauge_Soul_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - y = TJAPlayer3.Skin.Gauge_Soul_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - } - else - { - x = TJAPlayer3.Skin.Gauge_Soul_X[i]; - y = TJAPlayer3.Skin.Gauge_Soul_Y[i]; - } - } + if (this.db現在のゲージ値[i] >= 100.0) { + this.ct炎.TickLoop(); - TJAPlayer3.Tx.Gauge_Soul.vcScaleRatio.X = scale; - TJAPlayer3.Tx.Gauge_Soul.vcScaleRatio.Y = scale; + TJAPlayer3.Tx.Gauge_Soul_Fire.vcScaleRatio.X = scale; + TJAPlayer3.Tx.Gauge_Soul_Fire.vcScaleRatio.Y = scale; - if (this.db現在のゲージ値[i] >= 80.0) - { - TJAPlayer3.Tx.Gauge_Soul.t2D描画(x, y, new Rectangle(0, 0, TJAPlayer3.Tx.Gauge_Soul.szTextureSize.Width, soul_height)); - } - else - { - TJAPlayer3.Tx.Gauge_Soul.t2D描画(x, y, new Rectangle(0, soul_height, TJAPlayer3.Tx.Gauge_Soul.szTextureSize.Width, soul_height)); - } - } - } - } + TJAPlayer3.Tx.Gauge_Soul_Fire.t2D描画(x, y, new Rectangle(soulfire_width * (this.ct炎.CurrentValue), 0, soulfire_width, soulfire_height)); + } + } + } + if (TJAPlayer3.Tx.Gauge_Soul != null) { + //仮置き + int soul_height = TJAPlayer3.Tx.Gauge_Soul.szTextureSize.Height / 2; + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) break; + + int x; + int y; + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + x = TJAPlayer3.Skin.Gauge_Soul_X_AI; + y = TJAPlayer3.Skin.Gauge_Soul_Y_AI; + } else { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + x = TJAPlayer3.Skin.Gauge_Soul_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + y = TJAPlayer3.Skin.Gauge_Soul_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + x = TJAPlayer3.Skin.Gauge_Soul_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + y = TJAPlayer3.Skin.Gauge_Soul_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + } else { + x = TJAPlayer3.Skin.Gauge_Soul_X[i]; + y = TJAPlayer3.Skin.Gauge_Soul_Y[i]; + } + } + + TJAPlayer3.Tx.Gauge_Soul.vcScaleRatio.X = scale; + TJAPlayer3.Tx.Gauge_Soul.vcScaleRatio.Y = scale; + + if (this.db現在のゲージ値[i] >= 80.0) { + TJAPlayer3.Tx.Gauge_Soul.t2D描画(x, y, new Rectangle(0, 0, TJAPlayer3.Tx.Gauge_Soul.szTextureSize.Width, soul_height)); + } else { + TJAPlayer3.Tx.Gauge_Soul.t2D描画(x, y, new Rectangle(0, soul_height, TJAPlayer3.Tx.Gauge_Soul.szTextureSize.Width, soul_height)); + } + } + } + } - - - //仮置き - int[] nSoulExplosion = new int[] { 73, 468, 0, 0 }; - for (int i = 0; i < TJAPlayer3.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; - } - } - } + //仮置き + int[] nSoulExplosion = new int[] { 73, 468, 0, 0 }; + for (int i = 0; i < TJAPlayer3.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; + } + } + } } return 0; } - // その他 + // その他 - #region [ private ] - //----------------- - private CCounter ctGaugeFlash; + #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; - } + 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 a7b3558e..f5f61fe3 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplJudgeText.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplJudgeText.cs @@ -1,80 +1,56 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using System.Runtime.InteropServices; +using System.Drawing; using FDK; -using System.Drawing; -namespace TJAPlayer3 -{ - internal class CActImplJudgeText : CActivity - { +namespace TJAPlayer3 { + internal class CActImplJudgeText : CActivity { // コンストラクタ - public CActImplJudgeText() - { + public CActImplJudgeText() { base.IsDeActivated = true; } - public override void Activate() - { + public override void Activate() { JudgeAnimes = new List[5]; - for (int i = 0; i < 5; i++) - { + for (int i = 0; i < 5; i++) { JudgeAnimes[i] = new List(); } - base.Activate(); - } + base.Activate(); + } - public override void DeActivate() - { - for (int i = 0; i < 5; i++) - { - for (int j = 0; j < JudgeAnimes[i].Count; j++) - { + 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(); - } + 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++) - { + // 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) - { + if (judgeC.counter.CurrentValue == judgeC.counter.EndValue) { JudgeAnimes[j].Remove(judgeC); continue; } judgeC.counter.Tick(); - if (TJAPlayer3.Tx.Judge != null) - { + if (TJAPlayer3.Tx.Judge != null) { float moveValue = CubicEaseOut(judgeC.counter.CurrentValue / 410.0f) - 1.0f; float x = 0; float y = 0; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { x = TJAPlayer3.Skin.Game_Judge_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * j); y = TJAPlayer3.Skin.Game_Judge_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * j); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { x = TJAPlayer3.Skin.Game_Judge_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * j); y = TJAPlayer3.Skin.Game_Judge_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * j); - } - else - { + } else { x = TJAPlayer3.Skin.Game_Judge_X[j]; y = TJAPlayer3.Skin.Game_Judge_Y[j]; } @@ -83,15 +59,14 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Judge.Opacity = (int)(255f - (judgeC.counter.CurrentValue >= 360 ? ((judgeC.counter.CurrentValue - 360) / 50.0f) * 255f : 0f)); TJAPlayer3.Tx.Judge.t2D描画(x, y, judgeC.rc); - } + } } } } - return 0; + return 0; } - public void Start(int player, ENoteJudge judge) - { + public void Start(int player, ENoteJudge judge) { JudgeAnime judgeAnime = new(); judgeAnime.counter.Start(0, 410, 1, TJAPlayer3.Timer); judgeAnime.Judge = judge; @@ -99,17 +74,15 @@ namespace TJAPlayer3 //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)) - { + if (JudgesDict.ContainsKey(judge)) { njudge = JudgesDict[judge]; - } + } - if (njudge == 0 && TJAPlayer3.ConfigIni.SimpleMode) - { - return; - } + if (njudge == 0 && TJAPlayer3.ConfigIni.SimpleMode) { + return; + } - int height = TJAPlayer3.Tx.Judge.szTextureSize.Height / 5; + int height = TJAPlayer3.Tx.Judge.szTextureSize.Height / 5; judgeAnime.rc = new Rectangle(0, (int)njudge * height, TJAPlayer3.Tx.Judge.szTextureSize.Width, height); JudgeAnimes[player].Add(judgeAnime); @@ -120,8 +93,7 @@ namespace TJAPlayer3 #region [ private ] //----------------- - private static Dictionary JudgesDict = new Dictionary - { + private static Dictionary JudgesDict = new Dictionary { [ENoteJudge.Perfect] = 0, [ENoteJudge.Auto] = 0, [ENoteJudge.Good] = 1, @@ -132,15 +104,13 @@ namespace TJAPlayer3 }; private List[] JudgeAnimes = new List[5]; - private class JudgeAnime - { + private class JudgeAnime { public ENoteJudge Judge; public Rectangle rc; public CCounter counter = new CCounter(); } - private float CubicEaseOut(float p) - { + private float CubicEaseOut(float p) { float f = (p - 1); return f * f * f + 1; } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplLane.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplLane.cs index 5433d2a0..30ad3ca5 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplLane.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplLane.cs @@ -1,225 +1,179 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - internal class CActImplLane : CActivity - { - public CActImplLane() - { - base.IsDeActivated = true; - } +namespace TJAPlayer3 { + 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 < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) - { - this.ct分岐アニメ進行[ i ] = new CCounter(); - this.nBefore = new CDTX.ECourse[ 5 ]; - this.nAfter = new CDTX.ECourse[ 5 ]; - this.bState[ i ] = false; - } - if (TJAPlayer3.Tx.Lane_Base[0] != null) - TJAPlayer3.Tx.Lane_Base[0].Opacity = 255; + 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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + this.ct分岐アニメ進行[i] = new CCounter(); + this.nBefore = new CDTX.ECourse[5]; + this.nAfter = new CDTX.ECourse[5]; + this.bState[i] = false; + } + if (TJAPlayer3.Tx.Lane_Base[0] != null) + TJAPlayer3.Tx.Lane_Base[0].Opacity = 255; - base.Activate(); - } + base.Activate(); + } - public override void DeActivate() - { - TJAPlayer3.tDisposeSafely( ref this.ct分岐アニメ進行 ); - base.DeActivate(); - } + public override void DeActivate() { + TJAPlayer3.tDisposeSafely(ref this.ct分岐アニメ進行); + base.DeActivate(); + } - public override void CreateManagedResource() - { - base.CreateManagedResource(); - } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } + base.ReleaseManagedResource(); + } - public override int Draw() - { - for( int i = 0; i < TJAPlayer3.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(); - } - } - } + public override int Draw() { + for (int i = 0; i < TJAPlayer3.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(); + } + } + } - int[] x = new int[5]; - int[] y = new int[5]; + int[] x = new int[5]; + int[] y = new int[5]; - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - x[i] = TJAPlayer3.Skin.Game_Lane_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - y[i] = TJAPlayer3.Skin.Game_Lane_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - x[i] = TJAPlayer3.Skin.Game_Lane_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - y[i] = TJAPlayer3.Skin.Game_Lane_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - } - else - { - x[i] = TJAPlayer3.Skin.Game_Lane_X[i]; - y[i] = TJAPlayer3.Skin.Game_Lane_Y[i]; - } - } + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + x[i] = TJAPlayer3.Skin.Game_Lane_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + y[i] = TJAPlayer3.Skin.Game_Lane_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + x[i] = TJAPlayer3.Skin.Game_Lane_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + y[i] = TJAPlayer3.Skin.Game_Lane_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + } else { + x[i] = TJAPlayer3.Skin.Game_Lane_X[i]; + y[i] = TJAPlayer3.Skin.Game_Lane_Y[i]; + } + } - //アニメーション中の分岐レイヤー(背景)の描画を行う。 - for ( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) - { - if (TJAPlayer3.stage演奏ドラム画面.bUseBranch[i] == true) - { + //アニメーション中の分岐レイヤー(背景)の描画を行う。 + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.stage演奏ドラム画面.bUseBranch[i] == true) { - #region NullCheck + #region NullCheck - bool _laneNull = false; + bool _laneNull = false; - for (int j = 0; j < TJAPlayer3.Tx.Lane_Base.Length; j++) - { - if (TJAPlayer3.Tx.Lane_Base[j] == null) - { - _laneNull = true; - break; - } - } + for (int j = 0; j < TJAPlayer3.Tx.Lane_Base.Length; j++) { + if (TJAPlayer3.Tx.Lane_Base[j] == null) { + _laneNull = true; + break; + } + } - #endregion + #endregion - if (TJAPlayer3.ConfigIni.SimpleMode) - { - TJAPlayer3.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) - { - TJAPlayer3.Tx.Lane_Base[1].Opacity = this.ct分岐アニメ進行[ i ].CurrentValue > 100 ? 255 : ( ( this.ct分岐アニメ進行[ i ].CurrentValue * 0xff ) / 100 ); - TJAPlayer3.Tx.Lane_Base[0].t2D描画( x[ i ], y[ i ] ); - TJAPlayer3.Tx.Lane_Base[1].t2D描画( x[ i ], y[ i ] ); - } - //普通→達人 - if (nBefore[i] == 0 && nAfter[i] == CDTX.ECourse.eMaster) - { - TJAPlayer3.Tx.Lane_Base[0].t2D描画( x[ i ], y[ i ] ); - if( this.ct分岐アニメ進行[ i ].CurrentValue < 100 ) - { - TJAPlayer3.Tx.Lane_Base[1].Opacity = this.ct分岐アニメ進行[ i ].CurrentValue > 100 ? 255 : ( ( this.ct分岐アニメ進行[ i ].CurrentValue * 0xff ) / 100 ); - TJAPlayer3.Tx.Lane_Base[1].t2D描画( x[ i ], y[ i ] ); - } - else if( this.ct分岐アニメ進行[ i ].CurrentValue >= 100 && this.ct分岐アニメ進行[ i ].CurrentValue < 150 ) - { - TJAPlayer3.Tx.Lane_Base[1].Opacity = 255; - TJAPlayer3.Tx.Lane_Base[1].t2D描画( x[ i ], y[ i ] ); - } - else if( this.ct分岐アニメ進行[ i ].CurrentValue >= 150 ) - { - TJAPlayer3.Tx.Lane_Base[1].t2D描画( x[ i ], y[ i ] ); - TJAPlayer3.Tx.Lane_Base[2].Opacity = this.ct分岐アニメ進行[ i ].CurrentValue > 250 ? 255 : ( ( (this.ct分岐アニメ進行[ i ].CurrentValue - 150) * 0xff ) / 100 ); - TJAPlayer3.Tx.Lane_Base[2].t2D描画( x[ i ], y[ i ] ); - } - } - #endregion + if (TJAPlayer3.ConfigIni.SimpleMode) { + TJAPlayer3.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) { + TJAPlayer3.Tx.Lane_Base[1].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); + TJAPlayer3.Tx.Lane_Base[0].t2D描画(x[i], y[i]); + TJAPlayer3.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + } + //普通→達人 + if (nBefore[i] == 0 && nAfter[i] == CDTX.ECourse.eMaster) { + TJAPlayer3.Tx.Lane_Base[0].t2D描画(x[i], y[i]); + if (this.ct分岐アニメ進行[i].CurrentValue < 100) { + TJAPlayer3.Tx.Lane_Base[1].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); + TJAPlayer3.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + } else if (this.ct分岐アニメ進行[i].CurrentValue >= 100 && this.ct分岐アニメ進行[i].CurrentValue < 150) { + TJAPlayer3.Tx.Lane_Base[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + } else if (this.ct分岐アニメ進行[i].CurrentValue >= 150) { + TJAPlayer3.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + TJAPlayer3.Tx.Lane_Base[2].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 250 ? 255 : (((this.ct分岐アニメ進行[i].CurrentValue - 150) * 0xff) / 100); + TJAPlayer3.Tx.Lane_Base[2].t2D描画(x[i], y[i]); + } + } + #endregion - #region[ 玄人譜面_レベルアップ ] - if (nBefore[i] == CDTX.ECourse.eExpert && nAfter[i] == CDTX.ECourse.eMaster) - { - TJAPlayer3.Tx.Lane_Base[1].t2D描画( x[ i ], y[ i ] ); - TJAPlayer3.Tx.Lane_Base[2].Opacity = this.ct分岐アニメ進行[ i ].CurrentValue > 100 ? 255 : ( ( this.ct分岐アニメ進行[ i ].CurrentValue * 0xff ) / 100 ); - TJAPlayer3.Tx.Lane_Base[2].t2D描画( x[ i ], y[ i ] ); - } - #endregion + #region[ 玄人譜面_レベルアップ ] + if (nBefore[i] == CDTX.ECourse.eExpert && nAfter[i] == CDTX.ECourse.eMaster) { + TJAPlayer3.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + TJAPlayer3.Tx.Lane_Base[2].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); + TJAPlayer3.Tx.Lane_Base[2].t2D描画(x[i], y[i]); + } + #endregion - #region[ 玄人譜面_レベルダウン ] - if (nBefore[i] == CDTX.ECourse.eExpert && nAfter[i] == CDTX.ECourse.eNormal) - { - TJAPlayer3.Tx.Lane_Base[1].t2D描画( x[ i ], y[ i ] ); - TJAPlayer3.Tx.Lane_Base[0].Opacity = this.ct分岐アニメ進行[ i ].CurrentValue > 100 ? 255 : ( ( this.ct分岐アニメ進行[ i ].CurrentValue * 0xff ) / 100 ); - TJAPlayer3.Tx.Lane_Base[0].t2D描画( x[ i ], y[ i ] ); - } - #endregion + #region[ 玄人譜面_レベルダウン ] + if (nBefore[i] == CDTX.ECourse.eExpert && nAfter[i] == CDTX.ECourse.eNormal) { + TJAPlayer3.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + TJAPlayer3.Tx.Lane_Base[0].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); + TJAPlayer3.Tx.Lane_Base[0].t2D描画(x[i], y[i]); + } + #endregion - #region[ 達人譜面_レベルダウン ] - if (nBefore[i] == CDTX.ECourse.eMaster && nAfter[i] == CDTX.ECourse.eNormal) - { - TJAPlayer3.Tx.Lane_Base[2].t2D描画( x[ i ], y[ i ] ); - if( this.ct分岐アニメ進行[ i ].CurrentValue < 100 ) - { - TJAPlayer3.Tx.Lane_Base[1].Opacity = this.ct分岐アニメ進行[ i ].CurrentValue > 100 ? 255 : ( ( this.ct分岐アニメ進行[ i ].CurrentValue * 0xff ) / 100 ); - TJAPlayer3.Tx.Lane_Base[1].t2D描画( x[ i ], y[ i ] ); - } - else if( this.ct分岐アニメ進行[ i ].CurrentValue >= 100 && this.ct分岐アニメ進行[ i ].CurrentValue < 150 ) - { - TJAPlayer3.Tx.Lane_Base[1].Opacity = 255; - TJAPlayer3.Tx.Lane_Base[1].t2D描画( x[ i ], y[ i ] ); - } - else if( this.ct分岐アニメ進行[ i ].CurrentValue >= 150 ) - { - TJAPlayer3.Tx.Lane_Base[1].t2D描画( x[ i ], y[ i ] ); - TJAPlayer3.Tx.Lane_Base[0].Opacity = this.ct分岐アニメ進行[ i ].CurrentValue > 250 ? 255 : ( ( ( this.ct分岐アニメ進行[ i ].CurrentValue - 150 ) * 0xff ) / 100 ); - TJAPlayer3.Tx.Lane_Base[0].t2D描画( x[ i ], y[ i ] ); - } - } - if (nBefore[i] == CDTX.ECourse.eMaster && nAfter[i] == CDTX.ECourse.eExpert) - { - TJAPlayer3.Tx.Lane_Base[2].t2D描画( x[ i ], y[ i ] ); - TJAPlayer3.Tx.Lane_Base[2].Opacity = this.ct分岐アニメ進行[ i ].CurrentValue > 100 ? 255 : ( ( this.ct分岐アニメ進行[ i ].CurrentValue * 0xff ) / 100 ); - TJAPlayer3.Tx.Lane_Base[2].t2D描画( x[ i ], y[ i ] ); - } - #endregion - } - } - } - return base.Draw(); - } + #region[ 達人譜面_レベルダウン ] + if (nBefore[i] == CDTX.ECourse.eMaster && nAfter[i] == CDTX.ECourse.eNormal) { + TJAPlayer3.Tx.Lane_Base[2].t2D描画(x[i], y[i]); + if (this.ct分岐アニメ進行[i].CurrentValue < 100) { + TJAPlayer3.Tx.Lane_Base[1].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); + TJAPlayer3.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + } else if (this.ct分岐アニメ進行[i].CurrentValue >= 100 && this.ct分岐アニメ進行[i].CurrentValue < 150) { + TJAPlayer3.Tx.Lane_Base[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + } else if (this.ct分岐アニメ進行[i].CurrentValue >= 150) { + TJAPlayer3.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + TJAPlayer3.Tx.Lane_Base[0].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 250 ? 255 : (((this.ct分岐アニメ進行[i].CurrentValue - 150) * 0xff) / 100); + TJAPlayer3.Tx.Lane_Base[0].t2D描画(x[i], y[i]); + } + } + if (nBefore[i] == CDTX.ECourse.eMaster && nAfter[i] == CDTX.ECourse.eExpert) { + TJAPlayer3.Tx.Lane_Base[2].t2D描画(x[i], y[i]); + TJAPlayer3.Tx.Lane_Base[2].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); + TJAPlayer3.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, TJAPlayer3.Timer ); - this.bState[ player ] = true; + public virtual void t分岐レイヤー_コース変化(CDTX.ECourse n現在, CDTX.ECourse n次回, int player) { + if (n現在 == n次回) { + return; + } + this.ct分岐アニメ進行[player] = new CCounter(0, 300, 2, TJAPlayer3.Timer); + this.bState[player] = true; - this.nBefore[ player ] = n現在; - this.nAfter[ player ] = n次回; + 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 - } + #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 d570fc96..f8782491 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplLaneTaiko.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplLaneTaiko.cs @@ -1,716 +1,567 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Runtime.InteropServices; -using System.Diagnostics; +using System.Runtime.InteropServices; using FDK; - using Rectangle = System.Drawing.Rectangle; -using Point = System.Drawing.Point; -using Color = System.Drawing.Color; -namespace TJAPlayer3 -{ - internal class CActImplLaneTaiko : CActivity - { - /// - /// レーンを描画するクラス。 - /// - /// - /// - public CActImplLaneTaiko() - { - base.IsDeActivated = true; - } +namespace TJAPlayer3 { + 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; + 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.n総移動時間[i] = -1; + } + this.ctゴーゴー = new CCounter(); - this.ctゴーゴー炎 = new CCounter(0, 6, 50, TJAPlayer3.Timer); - base.Activate(); - } + this.ctゴーゴー炎 = new CCounter(0, 6, 50, TJAPlayer3.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; + 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(); - } + 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() - { - if (base.IsFirstDraw) - { - for (int i = 0; i < 5; i++) - this.stBranch[i].nフラッシュ制御タイマ = (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - base.IsFirstDraw = false; - } + public override int Draw() { + if (base.IsFirstDraw) { + for (int i = 0; i < 5; i++) + this.stBranch[i].nフラッシュ制御タイマ = (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed); + base.IsFirstDraw = false; + } - //それぞれが独立したレイヤーでないといけないのでforループはパーツごとに分離すること。 + //それぞれが独立したレイヤーでないといけないのでforループはパーツごとに分離すること。 - if (TJAPlayer3.ConfigIni.nPlayerCount <= 2 && !TJAPlayer3.ConfigIni.bAIBattleMode) TJAPlayer3.stage演奏ドラム画面.actMtaiko.DrawBackSymbol(); + if (TJAPlayer3.ConfigIni.nPlayerCount <= 2 && !TJAPlayer3.ConfigIni.bAIBattleMode) TJAPlayer3.stage演奏ドラム画面.actMtaiko.DrawBackSymbol(); - #region[ レーン本体 ] + #region[ レーン本体 ] - int[] x = new int[5]; - int[] y = new int[5]; + int[] x = new int[5]; + int[] y = new int[5]; - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - x[i] = TJAPlayer3.Skin.Game_Lane_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - y[i] = TJAPlayer3.Skin.Game_Lane_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - x[i] = TJAPlayer3.Skin.Game_Lane_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - y[i] = TJAPlayer3.Skin.Game_Lane_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - } - else - { - x[i] = TJAPlayer3.Skin.Game_Lane_X[i]; - y[i] = TJAPlayer3.Skin.Game_Lane_Y[i]; - } - } + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + x[i] = TJAPlayer3.Skin.Game_Lane_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + y[i] = TJAPlayer3.Skin.Game_Lane_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + x[i] = TJAPlayer3.Skin.Game_Lane_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + y[i] = TJAPlayer3.Skin.Game_Lane_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + } else { + x[i] = TJAPlayer3.Skin.Game_Lane_X[i]; + y[i] = TJAPlayer3.Skin.Game_Lane_Y[i]; + } + } - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (i == 1 && TJAPlayer3.ConfigIni.bAIBattleMode && TJAPlayer3.Tx.Lane_Background_AI != null) - TJAPlayer3.Tx.Lane_Background_AI?.t2D描画(x[i], y[i]); - else - TJAPlayer3.Tx.Lane_Background_Main?.t2D描画(x[i], y[i]); - } + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (i == 1 && TJAPlayer3.ConfigIni.bAIBattleMode && TJAPlayer3.Tx.Lane_Background_AI != null) + TJAPlayer3.Tx.Lane_Background_AI?.t2D描画(x[i], y[i]); + else + TJAPlayer3.Tx.Lane_Background_Main?.t2D描画(x[i], y[i]); + } - #endregion + #endregion - if (TJAPlayer3.ConfigIni.nPlayerCount > 2 && !TJAPlayer3.ConfigIni.bAIBattleMode) TJAPlayer3.stage演奏ドラム画面.actMtaiko.DrawBackSymbol(); + if (TJAPlayer3.ConfigIni.nPlayerCount > 2 && !TJAPlayer3.ConfigIni.bAIBattleMode) TJAPlayer3.stage演奏ドラム画面.actMtaiko.DrawBackSymbol(); - for (int i = 0; i < TJAPlayer3.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; - } + for (int i = 0; i < TJAPlayer3.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].nBranch文字透明度 >= 0) { + this.stBranch[i].nBranch文字透明度 -= 10; + } - if (this.stBranch[i].nY座標 != 0 && this.stBranch[i].nY座標 <= 20) - { - this.stBranch[i].nY座標++; - } + if (this.stBranch[i].nY座標 != 0 && this.stBranch[i].nY座標 <= 20) { + this.stBranch[i].nY座標++; + } - this.stBranch[i].nフラッシュ制御タイマ += 8; - } + 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(); - } - } - #endregion - } - #region[ 分岐レイヤー ] - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (TJAPlayer3.stage演奏ドラム画面.bUseBranch[i] == true) - { - #region[ 動いていない ] - switch (TJAPlayer3.stage演奏ドラム画面.nレーン用表示コース[i]) - { - case CDTX.ECourse.eNormal: - if (TJAPlayer3.Tx.Lane_Base[0] != null) - { - TJAPlayer3.Tx.Lane_Base[0].Opacity = 255; - TJAPlayer3.Tx.Lane_Base[0].t2D描画(x[i], y[i]); - } - break; - case CDTX.ECourse.eExpert: - if (TJAPlayer3.Tx.Lane_Base[1] != null) - { - TJAPlayer3.Tx.Lane_Base[1].Opacity = 255; - TJAPlayer3.Tx.Lane_Base[1].t2D描画(x[i], y[i]); - } - break; - case CDTX.ECourse.eMaster: - if (TJAPlayer3.Tx.Lane_Base[2] != null) - { - TJAPlayer3.Tx.Lane_Base[2].Opacity = 255; - TJAPlayer3.Tx.Lane_Base[2].t2D描画(x[i], y[i]); - } - break; - } - #endregion + if (!this.stBranch[i].ct分岐アニメ進行.IsStoped) { + this.stBranch[i].ct分岐アニメ進行.Tick(); + if (this.stBranch[i].ct分岐アニメ進行.IsEnded) { + this.stBranch[i].ct分岐アニメ進行.Stop(); + } + } + #endregion + } + #region[ 分岐レイヤー ] + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.stage演奏ドラム画面.bUseBranch[i] == true) { + #region[ 動いていない ] + switch (TJAPlayer3.stage演奏ドラム画面.nレーン用表示コース[i]) { + case CDTX.ECourse.eNormal: + if (TJAPlayer3.Tx.Lane_Base[0] != null) { + TJAPlayer3.Tx.Lane_Base[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Base[0].t2D描画(x[i], y[i]); + } + break; + case CDTX.ECourse.eExpert: + if (TJAPlayer3.Tx.Lane_Base[1] != null) { + TJAPlayer3.Tx.Lane_Base[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + } + break; + case CDTX.ECourse.eMaster: + if (TJAPlayer3.Tx.Lane_Base[2] != null) { + TJAPlayer3.Tx.Lane_Base[2].Opacity = 255; + TJAPlayer3.Tx.Lane_Base[2].t2D描画(x[i], y[i]); + } + break; + } + #endregion - if (TJAPlayer3.ConfigIni.nBranchAnime == 1) - { - #region[ AC7~14風の背後レイヤー ] - if (this.stBranch[i].ct分岐アニメ進行.IsTicked) - { - int n透明度 = ((100 - this.stBranch[i].ct分岐アニメ進行.CurrentValue) * 0xff) / 100; + if (TJAPlayer3.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(); - } + 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 (TJAPlayer3.Tx.Lane_Base[0] != null && TJAPlayer3.Tx.Lane_Base[1] != null) - { - TJAPlayer3.Tx.Lane_Base[0].t2D描画(x[i], y[i]); - TJAPlayer3.Tx.Lane_Base[1].Opacity = this.stBranch[i].nBranchレイヤー透明度; - TJAPlayer3.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 (TJAPlayer3.Tx.Lane_Base[0] != null && TJAPlayer3.Tx.Lane_Base[2] != null) - { - TJAPlayer3.Tx.Lane_Base[0].t2D描画(x[i], y[i]); - TJAPlayer3.Tx.Lane_Base[2].t2D描画(x[i], y[i]); - TJAPlayer3.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 (TJAPlayer3.Tx.Lane_Base[1] != null && TJAPlayer3.Tx.Lane_Base[2] != null) - { - TJAPlayer3.Tx.Lane_Base[1].t2D描画(x[i], y[i]); - TJAPlayer3.Tx.Lane_Base[2].t2D描画(x[i], y[i]); - TJAPlayer3.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 (TJAPlayer3.Tx.Lane_Base[1] != null && TJAPlayer3.Tx.Lane_Base[0] != null) - { - TJAPlayer3.Tx.Lane_Base[1].t2D描画(x[i], y[i]); - TJAPlayer3.Tx.Lane_Base[0].t2D描画(x[i], y[i]); - TJAPlayer3.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 (TJAPlayer3.Tx.Lane_Base[2] != null && TJAPlayer3.Tx.Lane_Base[0] != null) - { - TJAPlayer3.Tx.Lane_Base[2].t2D描画(x[i], y[i]); - TJAPlayer3.Tx.Lane_Base[0].t2D描画(x[i], y[i]); - TJAPlayer3.Tx.Lane_Base[0].Opacity = this.stBranch[i].nBranchレイヤー透明度; - } - } - #endregion - } - #endregion - } - else if (TJAPlayer3.ConfigIni.nBranchAnime == 0) - { - TJAPlayer3.stage演奏ドラム画面.actLane.Draw(); - } - } - } - #endregion + #region[ 普通譜面_レベルアップ ] + //普通→玄人 + if (this.stBranch[i].nBefore == CDTX.ECourse.eNormal && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) { + if (TJAPlayer3.Tx.Lane_Base[0] != null && TJAPlayer3.Tx.Lane_Base[1] != null) { + TJAPlayer3.Tx.Lane_Base[0].t2D描画(x[i], y[i]); + TJAPlayer3.Tx.Lane_Base[1].Opacity = this.stBranch[i].nBranchレイヤー透明度; + TJAPlayer3.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 (TJAPlayer3.Tx.Lane_Base[0] != null && TJAPlayer3.Tx.Lane_Base[2] != null) { + TJAPlayer3.Tx.Lane_Base[0].t2D描画(x[i], y[i]); + TJAPlayer3.Tx.Lane_Base[2].t2D描画(x[i], y[i]); + TJAPlayer3.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 (TJAPlayer3.Tx.Lane_Base[1] != null && TJAPlayer3.Tx.Lane_Base[2] != null) { + TJAPlayer3.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + TJAPlayer3.Tx.Lane_Base[2].t2D描画(x[i], y[i]); + TJAPlayer3.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 (TJAPlayer3.Tx.Lane_Base[1] != null && TJAPlayer3.Tx.Lane_Base[0] != null) { + TJAPlayer3.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + TJAPlayer3.Tx.Lane_Base[0].t2D描画(x[i], y[i]); + TJAPlayer3.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 (TJAPlayer3.Tx.Lane_Base[2] != null && TJAPlayer3.Tx.Lane_Base[0] != null) { + TJAPlayer3.Tx.Lane_Base[2].t2D描画(x[i], y[i]); + TJAPlayer3.Tx.Lane_Base[0].t2D描画(x[i], y[i]); + TJAPlayer3.Tx.Lane_Base[0].Opacity = this.stBranch[i].nBranchレイヤー透明度; + } + } + #endregion + } + #endregion + } else if (TJAPlayer3.ConfigIni.nBranchAnime == 0) { + TJAPlayer3.stage演奏ドラム画面.actLane.Draw(); + } + } + } + #endregion - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - #region[ ゴーゴータイムレーン背景レイヤー ] - if (TJAPlayer3.Tx.Lane_Background_GoGo != null && TJAPlayer3.stage演奏ドラム画面.bIsGOGOTIME[i]) - { - if (!this.ctゴーゴー.IsStoped) - { - this.ctゴーゴー.Tick(); - } + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + #region[ ゴーゴータイムレーン背景レイヤー ] + if (TJAPlayer3.Tx.Lane_Background_GoGo != null && TJAPlayer3.stage演奏ドラム画面.bIsGOGOTIME[i]) { + if (!this.ctゴーゴー.IsStoped) { + this.ctゴーゴー.Tick(); + } - if (this.ctゴーゴー.CurrentValue <= 4) - { - TJAPlayer3.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 0.2f; - TJAPlayer3.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i] + 54); - } - else if (this.ctゴーゴー.CurrentValue <= 5) - { - TJAPlayer3.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 0.4f; - TJAPlayer3.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i] + 40); - } - else if (this.ctゴーゴー.CurrentValue <= 6) - { - TJAPlayer3.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 0.6f; - TJAPlayer3.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i] + 26); - } - else if (this.ctゴーゴー.CurrentValue <= 8) - { - TJAPlayer3.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 0.8f; - TJAPlayer3.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i] + 13); - } - else if (this.ctゴーゴー.CurrentValue >= 9) - { - TJAPlayer3.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 1.0f; - TJAPlayer3.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i]); - } - } - #endregion - } - - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (TJAPlayer3.stage演奏ドラム画面.bUseBranch[i] == true) - { - #region NullCheck + if (this.ctゴーゴー.CurrentValue <= 4) { + TJAPlayer3.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 0.2f; + TJAPlayer3.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i] + 54); + } else if (this.ctゴーゴー.CurrentValue <= 5) { + TJAPlayer3.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 0.4f; + TJAPlayer3.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i] + 40); + } else if (this.ctゴーゴー.CurrentValue <= 6) { + TJAPlayer3.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 0.6f; + TJAPlayer3.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i] + 26); + } else if (this.ctゴーゴー.CurrentValue <= 8) { + TJAPlayer3.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 0.8f; + TJAPlayer3.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i] + 13); + } else if (this.ctゴーゴー.CurrentValue >= 9) { + TJAPlayer3.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 1.0f; + TJAPlayer3.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i]); + } + } + #endregion + } - bool _laneNull = false; + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.stage演奏ドラム画面.bUseBranch[i] == true) { + #region NullCheck - for (int j = 0; j < TJAPlayer3.Tx.Lane_Text.Length; j++) - { - if (TJAPlayer3.Tx.Lane_Text[j] == null) - { - _laneNull = true; - break; - } - } + bool _laneNull = false; - #endregion + for (int j = 0; j < TJAPlayer3.Tx.Lane_Text.Length; j++) { + if (TJAPlayer3.Tx.Lane_Text[j] == null) { + _laneNull = true; + break; + } + } - if (TJAPlayer3.ConfigIni.SimpleMode) - { - switch (TJAPlayer3.stage演奏ドラム画面.nレーン用表示コース[i]) - { - case CDTX.ECourse.eNormal: - TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], y[i]); - break; - case CDTX.ECourse.eExpert: - TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i]); - break; - case CDTX.ECourse.eMaster: - TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], y[i]); - break; - } - } - else if (TJAPlayer3.ConfigIni.nBranchAnime == 0 && !_laneNull) - { - if (!this.stBranch[i].ct分岐アニメ進行.IsTicked) - { - switch (TJAPlayer3.stage演奏ドラム画面.nレーン用表示コース[i]) - { - case CDTX.ECourse.eNormal: - TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], y[i]); - break; - case CDTX.ECourse.eExpert: - TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i]); - break; - case CDTX.ECourse.eMaster: - TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; - TJAPlayer3.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) - { - TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + #endregion - TJAPlayer3.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; - TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], y[i] + this.stBranch[i].nY); - TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], (y[i] - 30) + this.stBranch[i].nY); - } - else - { - TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i]); - } + if (TJAPlayer3.ConfigIni.SimpleMode) { + switch (TJAPlayer3.stage演奏ドラム画面.nレーン用表示コース[i]) { + case CDTX.ECourse.eNormal: + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], y[i]); + break; + case CDTX.ECourse.eExpert: + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i]); + break; + case CDTX.ECourse.eMaster: + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], y[i]); + break; + } + } else if (TJAPlayer3.ConfigIni.nBranchAnime == 0 && !_laneNull) { + if (!this.stBranch[i].ct分岐アニメ進行.IsTicked) { + switch (TJAPlayer3.stage演奏ドラム画面.nレーン用表示コース[i]) { + case CDTX.ECourse.eNormal: + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], y[i]); + break; + case CDTX.ECourse.eExpert: + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i]); + break; + case CDTX.ECourse.eMaster: + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + TJAPlayer3.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) { + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; - } + TJAPlayer3.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; + TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], y[i] + this.stBranch[i].nY); + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], (y[i] - 30) + this.stBranch[i].nY); + } else { + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i]); + } - //普通→達人 - if (this.stBranch[i].nBefore == 0 && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) - { - TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; - if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 60) - { - this.stBranch[i].nY = this.stBranch[i].ct分岐アニメ進行.CurrentValue / 2; - TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], (y[i] - 12) + this.stBranch[i].nY); - TJAPlayer3.Tx.Lane_Text[0].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 100)); - TJAPlayer3.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; - TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i]); - TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; - TJAPlayer3.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); - TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i] + this.stBranch[i].nY); - TJAPlayer3.Tx.Lane_Text[1].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 100)); - TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], (y[i] - 20) + this.stBranch[i].nY); - } - else - { - TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; - TJAPlayer3.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.eMaster) - { - TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + } - TJAPlayer3.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; - TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i] + this.stBranch[i].nY); - TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], (y[i] - 20) + this.stBranch[i].nY); - } - else - { - TJAPlayer3.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) - { - TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + //普通→達人 + if (this.stBranch[i].nBefore == 0 && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) { + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 60) { + this.stBranch[i].nY = this.stBranch[i].ct分岐アニメ進行.CurrentValue / 2; + TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], (y[i] - 12) + this.stBranch[i].nY); + TJAPlayer3.Tx.Lane_Text[0].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 100)); + TJAPlayer3.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; + TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i]); + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.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); + TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i] + this.stBranch[i].nY); + TJAPlayer3.Tx.Lane_Text[1].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 100)); + TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], (y[i] - 20) + this.stBranch[i].nY); + } else { + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + TJAPlayer3.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.eMaster) { + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; - TJAPlayer3.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; - TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i] - this.stBranch[i].nY); - TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], (y[i] + 30) - this.stBranch[i].nY); - } - else - { - TJAPlayer3.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) - { - TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + TJAPlayer3.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; + TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i] + this.stBranch[i].nY); + TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], (y[i] - 20) + this.stBranch[i].nY); + } else { + TJAPlayer3.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) { + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; - if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 60) - { - this.stBranch[i].nY = this.stBranch[i].ct分岐アニメ進行.CurrentValue / 2; - TJAPlayer3.Tx.Lane_Text[2].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 60)); - TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], y[i] - this.stBranch[i].nY); - TJAPlayer3.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; - TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i]); - TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; - TJAPlayer3.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); - TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i] - this.stBranch[i].nY); - TJAPlayer3.Tx.Lane_Text[1].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 100)); - TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], (y[i] + 30) - this.stBranch[i].nY); - } - else if (this.stBranch[i].ct分岐アニメ進行.CurrentValue >= 210) - { - TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], y[i]); - } - } - if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) - { - TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + TJAPlayer3.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; + TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i] - this.stBranch[i].nY); + TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], (y[i] + 30) - this.stBranch[i].nY); + } else { + TJAPlayer3.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) { + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; - TJAPlayer3.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; - TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], y[i] - this.stBranch[i].nY); - TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], (y[i] + 30) - this.stBranch[i].nY); - } - else - { - TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i]); - } + if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 60) { + this.stBranch[i].nY = this.stBranch[i].ct分岐アニメ進行.CurrentValue / 2; + TJAPlayer3.Tx.Lane_Text[2].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 60)); + TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], y[i] - this.stBranch[i].nY); + TJAPlayer3.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; + TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i]); + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.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); + TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i] - this.stBranch[i].nY); + TJAPlayer3.Tx.Lane_Text[1].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 100)); + TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], (y[i] + 30) - this.stBranch[i].nY); + } else if (this.stBranch[i].ct分岐アニメ進行.CurrentValue >= 210) { + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], y[i]); + } + } + if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) { + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; - } - #endregion - } - } - else if (!_laneNull) - { - if (this.stBranch[i].nY座標 == 21) - { - this.stBranch[i].nY座標 = 0; - } + TJAPlayer3.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; + TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], y[i] - this.stBranch[i].nY); + TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], (y[i] + 30) - this.stBranch[i].nY); + } else { + TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i]); + } - if (this.stBranch[i].nY座標 == 0) - { - switch (TJAPlayer3.stage演奏ドラム画面.nレーン用表示コース[i]) - { - case CDTX.ECourse.eNormal: - TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], y[i]); - break; - case CDTX.ECourse.eExpert: - TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i]); - break; - case CDTX.ECourse.eMaster: - TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; - TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], y[i]); - break; - } - } + } + #endregion + } + } else if (!_laneNull) { + if (this.stBranch[i].nY座標 == 21) { + this.stBranch[i].nY座標 = 0; + } - if (this.stBranch[i].nY座標 != 0) - { - #region[ 普通譜面_レベルアップ ] - //普通→玄人 - if (this.stBranch[i].nBefore == CDTX.ECourse.eNormal && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) - { - TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], y[i] - this.stBranch[i].nY座標); - TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], (y[i] + 20) - this.stBranch[i].nY座標); - TJAPlayer3.Tx.Lane_Text[0].Opacity = this.stBranch[i].nBranchレイヤー透明度; - } - //普通→達人 - if (this.stBranch[i].nBefore == CDTX.ECourse.eNormal && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) - { - TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], y[i] - this.stBranch[i].nY座標); - TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], (y[i] + 20) - this.stBranch[i].nY座標); - TJAPlayer3.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) - { - TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i] - this.stBranch[i].nY座標); - TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], (y[i] + 20) - this.stBranch[i].nY座標); - TJAPlayer3.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) - { - TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i] + this.stBranch[i].nY座標); + if (this.stBranch[i].nY座標 == 0) { + switch (TJAPlayer3.stage演奏ドラム画面.nレーン用表示コース[i]) { + case CDTX.ECourse.eNormal: + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], y[i]); + break; + case CDTX.ECourse.eExpert: + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i]); + break; + case CDTX.ECourse.eMaster: + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + TJAPlayer3.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) { + TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], y[i] - this.stBranch[i].nY座標); + TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], (y[i] + 20) - this.stBranch[i].nY座標); + TJAPlayer3.Tx.Lane_Text[0].Opacity = this.stBranch[i].nBranchレイヤー透明度; + } + //普通→達人 + if (this.stBranch[i].nBefore == CDTX.ECourse.eNormal && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) { + TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], y[i] - this.stBranch[i].nY座標); + TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], (y[i] + 20) - this.stBranch[i].nY座標); + TJAPlayer3.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) { + TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i] - this.stBranch[i].nY座標); + TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], (y[i] + 20) - this.stBranch[i].nY座標); + TJAPlayer3.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) { + TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], y[i] + this.stBranch[i].nY座標); TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], (y[i] - 24) + this.stBranch[i].nY座標); - TJAPlayer3.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) - { - TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], y[i] + this.stBranch[i].nY座標); - TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], (y[i] - 24) + this.stBranch[i].nY座標); - TJAPlayer3.Tx.Lane_Text[2].Opacity = this.stBranch[i].nBranchレイヤー透明度; - } - if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) - { - TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], y[i] + this.stBranch[i].nY座標); - TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], (y[i] - 24) + this.stBranch[i].nY座標); - TJAPlayer3.Tx.Lane_Text[2].Opacity = this.stBranch[i].nBranchレイヤー透明度; - } - #endregion - } - } + TJAPlayer3.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) { + TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], y[i] + this.stBranch[i].nY座標); + TJAPlayer3.Tx.Lane_Text[0].t2D描画(x[i], (y[i] - 24) + this.stBranch[i].nY座標); + TJAPlayer3.Tx.Lane_Text[2].Opacity = this.stBranch[i].nBranchレイヤー透明度; + } + if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) { + TJAPlayer3.Tx.Lane_Text[2].t2D描画(x[i], y[i] + this.stBranch[i].nY座標); + TJAPlayer3.Tx.Lane_Text[1].t2D描画(x[i], (y[i] - 24) + this.stBranch[i].nY座標); + TJAPlayer3.Tx.Lane_Text[2].Opacity = this.stBranch[i].nBranchレイヤー透明度; + } + #endregion + } + } - } - } + } + } - if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) - { - if (TJAPlayer3.Tx.Lane_Background_Sub != null) - { - TJAPlayer3.Tx.Lane_Background_Sub.t2D描画(TJAPlayer3.Skin.Game_Lane_Sub_X[0], TJAPlayer3.Skin.Game_Lane_Sub_Y[0]); - if (TJAPlayer3.stage演奏ドラム画面.bDoublePlay) - { - TJAPlayer3.Tx.Lane_Background_Sub.t2D描画(TJAPlayer3.Skin.Game_Lane_Sub_X[1], TJAPlayer3.Skin.Game_Lane_Sub_Y[1]); - } - } - } + if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) { + if (TJAPlayer3.Tx.Lane_Background_Sub != null) { + TJAPlayer3.Tx.Lane_Background_Sub.t2D描画(TJAPlayer3.Skin.Game_Lane_Sub_X[0], TJAPlayer3.Skin.Game_Lane_Sub_Y[0]); + if (TJAPlayer3.stage演奏ドラム画面.bDoublePlay) { + TJAPlayer3.Tx.Lane_Background_Sub.t2D描画(TJAPlayer3.Skin.Game_Lane_Sub_X[1], TJAPlayer3.Skin.Game_Lane_Sub_Y[1]); + } + } + } - TJAPlayer3.stage演奏ドラム画面.actTaikoLaneFlash.Draw(); + TJAPlayer3.stage演奏ドラム画面.actTaikoLaneFlash.Draw(); - if (TJAPlayer3.Tx.Taiko_Frame[0] != null) - { - // Tower frame (without tamashii jauge) if playing a tower chart - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - int frame_x; - int frame_y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - frame_x = TJAPlayer3.Skin.Game_Taiko_Frame_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - frame_y = TJAPlayer3.Skin.Game_Taiko_Frame_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - frame_x = TJAPlayer3.Skin.Game_Taiko_Frame_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - frame_y = TJAPlayer3.Skin.Game_Taiko_Frame_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - } - else - { - frame_x = TJAPlayer3.Skin.Game_Taiko_Frame_X[i]; - frame_y = TJAPlayer3.Skin.Game_Taiko_Frame_Y[i]; - } + if (TJAPlayer3.Tx.Taiko_Frame[0] != null) { + // Tower frame (without tamashii jauge) if playing a tower chart + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + int frame_x; + int frame_y; + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + frame_x = TJAPlayer3.Skin.Game_Taiko_Frame_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + frame_y = TJAPlayer3.Skin.Game_Taiko_Frame_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + frame_x = TJAPlayer3.Skin.Game_Taiko_Frame_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + frame_y = TJAPlayer3.Skin.Game_Taiko_Frame_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + } else { + frame_x = TJAPlayer3.Skin.Game_Taiko_Frame_X[i]; + frame_y = TJAPlayer3.Skin.Game_Taiko_Frame_Y[i]; + } - CTexture tex = null; + CTexture tex = null; - switch (i) - { - case 0: - { - if (TJAPlayer3.ConfigIni.bTokkunMode) - { - tex = TJAPlayer3.Tx.Taiko_Frame[3]; - } - else if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - tex = TJAPlayer3.Tx.Taiko_Frame[5]; - } - else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - { - tex = TJAPlayer3.Tx.Taiko_Frame[2]; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount > 2) - { - tex = TJAPlayer3.Tx.Taiko_Frame[6]; - } - else - { - tex = TJAPlayer3.Tx.Taiko_Frame[0]; - } - } - break; - case 1: - { - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - tex = TJAPlayer3.Tx.Taiko_Frame[4]; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount > 2) - { - tex = TJAPlayer3.Tx.Taiko_Frame[6]; - } - else - { - tex = TJAPlayer3.Tx.Taiko_Frame[1]; - } - } - break; - case 2: - tex = TJAPlayer3.Tx.Taiko_Frame[6]; - break; - case 3: - tex = TJAPlayer3.Tx.Taiko_Frame[6]; - break; - case 4: - tex = TJAPlayer3.Tx.Taiko_Frame[6]; - break; - } + switch (i) { + case 0: { + if (TJAPlayer3.ConfigIni.bTokkunMode) { + tex = TJAPlayer3.Tx.Taiko_Frame[3]; + } else if (TJAPlayer3.ConfigIni.bAIBattleMode) { + tex = TJAPlayer3.Tx.Taiko_Frame[5]; + } else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + tex = TJAPlayer3.Tx.Taiko_Frame[2]; + } else if (TJAPlayer3.ConfigIni.nPlayerCount > 2) { + tex = TJAPlayer3.Tx.Taiko_Frame[6]; + } else { + tex = TJAPlayer3.Tx.Taiko_Frame[0]; + } + } + break; + case 1: { + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + tex = TJAPlayer3.Tx.Taiko_Frame[4]; + } else if (TJAPlayer3.ConfigIni.nPlayerCount > 2) { + tex = TJAPlayer3.Tx.Taiko_Frame[6]; + } else { + tex = TJAPlayer3.Tx.Taiko_Frame[1]; + } + } + break; + case 2: + tex = TJAPlayer3.Tx.Taiko_Frame[6]; + break; + case 3: + tex = TJAPlayer3.Tx.Taiko_Frame[6]; + break; + case 4: + tex = TJAPlayer3.Tx.Taiko_Frame[6]; + break; + } - tex?.t2D描画(frame_x, frame_y); - } + 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) @@ -728,341 +579,299 @@ namespace TJAPlayer3 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 * TJAPlayer3.ConfigIni.SongPlaybackSpeed); + } + var nTime = (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (this.n総移動時間[i] != -1) - { - if (n移動方向[i] == 1) - { - TJAPlayer3.stage演奏ドラム画面.JPOSCROLLX[i] = this.n移動開始X[i] + (int)((((int)nTime - this.n移動開始時刻[i]) / (double)(this.n総移動時間[i])) * this.n移動距離px[i]); - TJAPlayer3.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 - { - TJAPlayer3.stage演奏ドラム画面.JPOSCROLLX[i] = this.n移動開始X[i] - (int)((((int)nTime - this.n移動開始時刻[i]) / (double)(this.n総移動時間[i])) * this.n移動距離px[i]); - TJAPlayer3.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; - TJAPlayer3.stage演奏ドラム画面.JPOSCROLLX[i] = this.n移動目的場所X[i]; - TJAPlayer3.stage演奏ドラム画面.JPOSCROLLY[i] = this.n移動目的場所Y[i]; - //TJAPlayer3.stage演奏ドラム画面.FlyingNotes.StartPointX[i] = this.n移動目的場所X[i]; - } - } - } + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (this.n総移動時間[i] != -1) { + if (n移動方向[i] == 1) { + TJAPlayer3.stage演奏ドラム画面.JPOSCROLLX[i] = this.n移動開始X[i] + (int)((((int)nTime - this.n移動開始時刻[i]) / (double)(this.n総移動時間[i])) * this.n移動距離px[i]); + TJAPlayer3.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 { + TJAPlayer3.stage演奏ドラム画面.JPOSCROLLX[i] = this.n移動開始X[i] - (int)((((int)nTime - this.n移動開始時刻[i]) / (double)(this.n総移動時間[i])) * this.n移動距離px[i]); + TJAPlayer3.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; + TJAPlayer3.stage演奏ドラム画面.JPOSCROLLX[i] = this.n移動目的場所X[i]; + TJAPlayer3.stage演奏ドラム画面.JPOSCROLLY[i] = this.n移動目的場所Y[i]; + //TJAPlayer3.stage演奏ドラム画面.FlyingNotes.StartPointX[i] = this.n移動目的場所X[i]; + } + } + } - if (TJAPlayer3.ConfigIni.bEnableAVI && TJAPlayer3.DTX.listVD.Count > 0 && TJAPlayer3.stage演奏ドラム画面.ShowVideo) - { - if (TJAPlayer3.Tx.Lane_Background_Main != null) TJAPlayer3.Tx.Lane_Background_Main.Opacity = TJAPlayer3.ConfigIni.nBGAlpha; - if (TJAPlayer3.Tx.Lane_Background_AI != null) TJAPlayer3.Tx.Lane_Background_AI.Opacity = TJAPlayer3.ConfigIni.nBGAlpha; - if (TJAPlayer3.Tx.Lane_Background_Sub != null) TJAPlayer3.Tx.Lane_Background_Sub.Opacity = TJAPlayer3.ConfigIni.nBGAlpha; - if (TJAPlayer3.Tx.Lane_Background_GoGo != null) TJAPlayer3.Tx.Lane_Background_GoGo.Opacity = TJAPlayer3.ConfigIni.nBGAlpha; - } - else - { - if (TJAPlayer3.Tx.Lane_Background_Main != null) TJAPlayer3.Tx.Lane_Background_Main.Opacity = 255; - if (TJAPlayer3.Tx.Lane_Background_AI != null) TJAPlayer3.Tx.Lane_Background_AI.Opacity = 255; - if (TJAPlayer3.Tx.Lane_Background_Sub != null) TJAPlayer3.Tx.Lane_Background_Sub.Opacity = 255; - if (TJAPlayer3.Tx.Lane_Background_GoGo != null) TJAPlayer3.Tx.Lane_Background_GoGo.Opacity = 255; - } + if (TJAPlayer3.ConfigIni.bEnableAVI && TJAPlayer3.DTX.listVD.Count > 0 && TJAPlayer3.stage演奏ドラム画面.ShowVideo) { + if (TJAPlayer3.Tx.Lane_Background_Main != null) TJAPlayer3.Tx.Lane_Background_Main.Opacity = TJAPlayer3.ConfigIni.nBGAlpha; + if (TJAPlayer3.Tx.Lane_Background_AI != null) TJAPlayer3.Tx.Lane_Background_AI.Opacity = TJAPlayer3.ConfigIni.nBGAlpha; + if (TJAPlayer3.Tx.Lane_Background_Sub != null) TJAPlayer3.Tx.Lane_Background_Sub.Opacity = TJAPlayer3.ConfigIni.nBGAlpha; + if (TJAPlayer3.Tx.Lane_Background_GoGo != null) TJAPlayer3.Tx.Lane_Background_GoGo.Opacity = TJAPlayer3.ConfigIni.nBGAlpha; + } else { + if (TJAPlayer3.Tx.Lane_Background_Main != null) TJAPlayer3.Tx.Lane_Background_Main.Opacity = 255; + if (TJAPlayer3.Tx.Lane_Background_AI != null) TJAPlayer3.Tx.Lane_Background_AI.Opacity = 255; + if (TJAPlayer3.Tx.Lane_Background_Sub != null) TJAPlayer3.Tx.Lane_Background_Sub.Opacity = 255; + if (TJAPlayer3.Tx.Lane_Background_GoGo != null) TJAPlayer3.Tx.Lane_Background_GoGo.Opacity = 255; + } - return base.Draw(); - } + return base.Draw(); + } - public void ゴーゴー炎() - { - //判定枠 - if (TJAPlayer3.Tx.Judge_Frame != null) - { - TJAPlayer3.Tx.Judge_Frame.b加算合成 = TJAPlayer3.Skin.Game_JudgeFrame_AddBlend; - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - TJAPlayer3.Tx.Judge_Frame.t2D描画( - TJAPlayer3.stage演奏ドラム画面.NoteOriginX[i], - TJAPlayer3.stage演奏ドラム画面.NoteOriginY[i], new Rectangle(0, 0, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); - } - } + public void ゴーゴー炎() { + //判定枠 + if (TJAPlayer3.Tx.Judge_Frame != null) { + TJAPlayer3.Tx.Judge_Frame.b加算合成 = TJAPlayer3.Skin.Game_JudgeFrame_AddBlend; + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + TJAPlayer3.Tx.Judge_Frame.t2D描画( + TJAPlayer3.stage演奏ドラム画面.NoteOriginX[i], + TJAPlayer3.stage演奏ドラム画面.NoteOriginY[i], new Rectangle(0, 0, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); + } + } - #region[ ゴーゴー炎 ] - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (TJAPlayer3.stage演奏ドラム画面.bIsGOGOTIME[i] && !TJAPlayer3.ConfigIni.SimpleMode) - { - this.ctゴーゴー炎.TickLoop(); + #region[ ゴーゴー炎 ] + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.stage演奏ドラム画面.bIsGOGOTIME[i] && !TJAPlayer3.ConfigIni.SimpleMode) { + this.ctゴーゴー炎.TickLoop(); - if (TJAPlayer3.Tx.Effects_Fire != null) - { - float f倍率 = 1.0f; + if (TJAPlayer3.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 }; + 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]; + 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.txゴーゴー炎.b加算合成 = true; - //this.ctゴーゴー.n現在の値 = 6; + //this.ctゴーゴー.n現在の値 = 6; - int width = TJAPlayer3.Tx.Effects_Fire.szTextureSize.Width / 7; - int height = TJAPlayer3.Tx.Effects_Fire.szTextureSize.Height; + int width = TJAPlayer3.Tx.Effects_Fire.szTextureSize.Width / 7; + int height = TJAPlayer3.Tx.Effects_Fire.szTextureSize.Height; - float x = -(width * (f倍率 - 1.0f) / 2.0f); - float y = -(height * (f倍率 - 1.0f) / 2.0f); + float x = -(width * (f倍率 - 1.0f) / 2.0f); + float y = -(height * (f倍率 - 1.0f) / 2.0f); - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - x += TJAPlayer3.Skin.Game_Effect_Fire_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - y += TJAPlayer3.Skin.Game_Effect_Fire_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - x += TJAPlayer3.Skin.Game_Effect_Fire_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - y += TJAPlayer3.Skin.Game_Effect_Fire_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - } - else - { - x += TJAPlayer3.Skin.Game_Effect_Fire_X[i]; - y += TJAPlayer3.Skin.Game_Effect_Fire_Y[i]; - } + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + x += TJAPlayer3.Skin.Game_Effect_Fire_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + y += TJAPlayer3.Skin.Game_Effect_Fire_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + x += TJAPlayer3.Skin.Game_Effect_Fire_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + y += TJAPlayer3.Skin.Game_Effect_Fire_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + } else { + x += TJAPlayer3.Skin.Game_Effect_Fire_X[i]; + y += TJAPlayer3.Skin.Game_Effect_Fire_Y[i]; + } - TJAPlayer3.Tx.Effects_Fire.vcScaleRatio.X = f倍率; - TJAPlayer3.Tx.Effects_Fire.vcScaleRatio.Y = f倍率; + TJAPlayer3.Tx.Effects_Fire.vcScaleRatio.X = f倍率; + TJAPlayer3.Tx.Effects_Fire.vcScaleRatio.Y = f倍率; - TJAPlayer3.Tx.Effects_Fire.t2D描画(x, y, - new Rectangle(width * (this.ctゴーゴー炎.CurrentValue), 0, width, height)); - } - } - } - #endregion - for (int i = 0; i < TJAPlayer3.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; + TJAPlayer3.Tx.Effects_Fire.t2D描画(x, y, + new Rectangle(width * (this.ctゴーゴー炎.CurrentValue), 0, width, height)); + } + } + } + #endregion + for (int i = 0; i < TJAPlayer3.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; + float x = 0; + float y = 0; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - x = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - y = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - x = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - y = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - } - else - { - x = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_X[i]; - y = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_Y[i]; - } - x += TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(i); - y += TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(i); + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + x = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + y = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + x = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + y = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + } else { + x = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_X[i]; + y = TJAPlayer3.Skin.Game_Effects_Hit_Explosion_Y[i]; + } + x += TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(i); + y += TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(i); - switch (st状態[i].judge) - { - case ENoteJudge.Perfect: - case ENoteJudge.Great: - case ENoteJudge.Auto: - if (!TJAPlayer3.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 && TJAPlayer3.Tx.Effects_Hit_Great_Big[this.st状態[i].ct進行.CurrentValue] != null) - TJAPlayer3.Tx.Effects_Hit_Great_Big[this.st状態[i].ct進行.CurrentValue].t2D描画(x, y); - else if (TJAPlayer3.Tx.Effects_Hit_Great[this.st状態[i].ct進行.CurrentValue] != null) - TJAPlayer3.Tx.Effects_Hit_Great[this.st状態[i].ct進行.CurrentValue].t2D描画(x, y); - } - break; + switch (st状態[i].judge) { + case ENoteJudge.Perfect: + case ENoteJudge.Great: + case ENoteJudge.Auto: + if (!TJAPlayer3.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 && TJAPlayer3.Tx.Effects_Hit_Great_Big[this.st状態[i].ct進行.CurrentValue] != null) + TJAPlayer3.Tx.Effects_Hit_Great_Big[this.st状態[i].ct進行.CurrentValue].t2D描画(x, y); + else if (TJAPlayer3.Tx.Effects_Hit_Great[this.st状態[i].ct進行.CurrentValue] != null) + TJAPlayer3.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 && TJAPlayer3.Tx.Effects_Hit_Good_Big[this.st状態[i].ct進行.CurrentValue] != null) - TJAPlayer3.Tx.Effects_Hit_Good_Big[this.st状態[i].ct進行.CurrentValue].t2D描画(x, y); - else if (TJAPlayer3.Tx.Effects_Hit_Good[this.st状態[i].ct進行.CurrentValue] != null) - TJAPlayer3.Tx.Effects_Hit_Good[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 && TJAPlayer3.Tx.Effects_Hit_Good_Big[this.st状態[i].ct進行.CurrentValue] != null) + TJAPlayer3.Tx.Effects_Hit_Good_Big[this.st状態[i].ct進行.CurrentValue].t2D描画(x, y); + else if (TJAPlayer3.Tx.Effects_Hit_Good[this.st状態[i].ct進行.CurrentValue] != null) + TJAPlayer3.Tx.Effects_Hit_Good[this.st状態[i].ct進行.CurrentValue].t2D描画(x, y); + break; - case ENoteJudge.Miss: - case ENoteJudge.Bad: - break; - } - } - } - } + case ENoteJudge.Miss: + case ENoteJudge.Bad: + break; + } + } + } + } - } + } - public virtual void Start(int nLane, ENoteJudge judge, bool b両手入力, int nPlayer) - { - //2017.08.15 kairera0467 排他なので番地をそのまま各レーンの状態として扱う + 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, TJAPlayer3.Timer); - this.st状態[nPlayer].judge = judge; - this.st状態[nPlayer].nPlayer = nPlayer; + //for( int n = 0; n < 1; n++ ) + { + this.st状態[nPlayer].ct進行 = new CCounter(0, 14, 20, TJAPlayer3.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; - } - } - } + 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, TJAPlayer3.Timer); - if(TJAPlayer3.ConfigIni.nPlayerCount == 1 && TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) TJAPlayer3.stage演奏ドラム画面.GoGoSplash.StartSplash(); - } + public void GOGOSTART() { + this.ctゴーゴー = new CCounter(0, 17, 18, TJAPlayer3.Timer); + if (TJAPlayer3.ConfigIni.nPlayerCount == 1 && TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) TJAPlayer3.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, TJAPlayer3.Timer); + public void t分岐レイヤー_コース変化(CDTX.ECourse n現在, CDTX.ECourse n次回, int nPlayer) { + if (n現在 == n次回) { + return; + } + this.stBranch[nPlayer].ct分岐アニメ進行 = new CCounter(0, 300, 2, TJAPlayer3.Timer); - this.stBranch[nPlayer].nBranchレイヤー透明度 = 6; - this.stBranch[nPlayer].nY座標 = 1; + this.stBranch[nPlayer].nBranchレイヤー透明度 = 6; + this.stBranch[nPlayer].nY座標 = 1; - this.stBranch[nPlayer].nBefore = n現在; - this.stBranch[nPlayer].nAfter = n次回; + this.stBranch[nPlayer].nBefore = n現在; + this.stBranch[nPlayer].nAfter = n次回; - TJAPlayer3.stage演奏ドラム画面.actLane.t分岐レイヤー_コース変化(n現在, n次回, nPlayer); - } + TJAPlayer3.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 * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - this.n移動開始X[nPlayer] = TJAPlayer3.stage演奏ドラム画面.JPOSCROLLX[nPlayer]; - this.n移動開始Y[nPlayer] = TJAPlayer3.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] = TJAPlayer3.stage演奏ドラム画面.JPOSCROLLX[nPlayer] - n移動px; - this.n移動目的場所Y[nPlayer] = TJAPlayer3.stage演奏ドラム画面.JPOSCROLLY[nPlayer] - vJs; - } - else - { - this.n移動目的場所X[nPlayer] = TJAPlayer3.stage演奏ドラム画面.JPOSCROLLX[nPlayer] + n移動px; - this.n移動目的場所Y[nPlayer] = TJAPlayer3.stage演奏ドラム画面.JPOSCROLLY[nPlayer] + vJs; - } - } + public void t判定枠移動(double db移動時間, int n移動px, int n移動方向, int nPlayer, int vJs) { + this.n移動開始時刻[nPlayer] = (int)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed); + this.n移動開始X[nPlayer] = TJAPlayer3.stage演奏ドラム画面.JPOSCROLLX[nPlayer]; + this.n移動開始Y[nPlayer] = TJAPlayer3.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] = TJAPlayer3.stage演奏ドラム画面.JPOSCROLLX[nPlayer] - n移動px; + this.n移動目的場所Y[nPlayer] = TJAPlayer3.stage演奏ドラム画面.JPOSCROLLY[nPlayer] - vJs; + } else { + this.n移動目的場所X[nPlayer] = TJAPlayer3.stage演奏ドラム画面.JPOSCROLLX[nPlayer] + n移動px; + this.n移動目的場所Y[nPlayer] = TJAPlayer3.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; + #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[] txLaneFlush = new CTexture[3]; - //private CTexture[] tx普通譜面 = new CTexture[2]; - //private CTexture[] tx玄人譜面 = new CTexture[2]; - //private CTexture[] tx達人譜面 = new CTexture[2]; + //private CTexture[] tx普通譜面 = new CTexture[2]; + //private CTexture[] tx玄人譜面 = new CTexture[2]; + //private CTexture[] tx達人譜面 = new CTexture[2]; - //private CTextureAf txアタックエフェクトLower; + //private CTextureAf txアタックエフェクトLower; - protected STSTATUS[] st状態 = new STSTATUS[5]; + protected STSTATUS[] st状態 = new STSTATUS[5]; - //private CTexture[] txゴーゴースプラッシュ; + //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ゴーゴー炎; + [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 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; - } + 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]; + 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 - } + //----------------- + #endregion + } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMob.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMob.cs index a51eb3a7..2ddbf6a1 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMob.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMob.cs @@ -1,74 +1,57 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Runtime.InteropServices; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - internal class CActImplMob : CActivity - { - /// - /// 踊り子 - /// - public CActImplMob() - { - base.IsDeActivated = true; - } +namespace TJAPlayer3 { + 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(); + public override void Activate() { + var mobDir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.MOB}"); + var preset = HScenePreset.GetBGPreset(); - if (System.IO.Directory.Exists(mobDir)) - { - Random random = new Random(); + if (System.IO.Directory.Exists(mobDir)) { + Random random = new Random(); - var upDirs = System.IO.Directory.GetDirectories(mobDir); - if (upDirs.Length > 0) - { - var _presetPath = (preset != null && preset.MobSet != null) ? $@"{mobDir}" + preset.MobSet[random.Next(0, preset.MobSet.Length)] : ""; - var path = (preset != null && System.IO.Directory.Exists(_presetPath)) - ? _presetPath - : upDirs[random.Next(0, upDirs.Length)]; + var upDirs = System.IO.Directory.GetDirectories(mobDir); + if (upDirs.Length > 0) { + var _presetPath = (preset != null && preset.MobSet != null) ? $@"{mobDir}" + preset.MobSet[random.Next(0, preset.MobSet.Length)] : ""; + var path = (preset != null && System.IO.Directory.Exists(_presetPath)) + ? _presetPath + : upDirs[random.Next(0, upDirs.Length)]; - MobScript = new ScriptBG($@"{path}{Path.DirectorySeparatorChar}Script.lua"); - MobScript.Init(); - } - } - - base.Activate(); - } + MobScript = new ScriptBG($@"{path}{Path.DirectorySeparatorChar}Script.lua"); + MobScript.Init(); + } + } - public override void DeActivate() - { - MobScript?.Dispose(); - - base.DeActivate(); - } + base.Activate(); + } - public override void CreateManagedResource() - { - base.CreateManagedResource(); - } + public override void DeActivate() { + MobScript?.Dispose(); - public override void ReleaseManagedResource() - { - base.ReleaseManagedResource(); - } + base.DeActivate(); + } - public override int Draw() - { - if(!TJAPlayer3.stage演奏ドラム画面.bDoublePlay) - { - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower && TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) - { - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) MobScript?.Update(); - MobScript?.Draw(); + public override void CreateManagedResource() { + base.CreateManagedResource(); + } - /* + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + + public override int Draw() { + if (!TJAPlayer3.stage演奏ドラム画面.bDoublePlay) { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower && TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) MobScript?.Update(); + MobScript?.Draw(); + + /* if (HGaugeMethods.UNSAFE_IsRainbow(0)) { @@ -87,14 +70,14 @@ namespace TJAPlayer3 } */ - } - } - return base.Draw(); - } - #region[ private ] - //----------------- - private ScriptBG MobScript; - //----------------- - #endregion - } + } + } + return base.Draw(); + } + #region[ private ] + //----------------- + private ScriptBG MobScript; + //----------------- + #endregion + } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMtaiko.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMtaiko.cs index 2ce2a301..03f819b8 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMtaiko.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMtaiko.cs @@ -1,169 +1,132 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; using FDK; - using Rectangle = System.Drawing.Rectangle; -namespace TJAPlayer3 -{ - internal class CActImplMtaiko : CActivity - { - /// - /// mtaiko部分を描画するクラス。左側だけ。 - /// - /// - public CActImplMtaiko() - { - base.IsDeActivated = true; - } +namespace TJAPlayer3 { + internal class CActImplMtaiko : CActivity { + /// + /// mtaiko部分を描画するクラス。左側だけ。 + /// + /// + public CActImplMtaiko() { + base.IsDeActivated = true; + } - public override void Activate() - { - for( int i = 0; i < 25; i++ ) - { + public override void Activate() { + for (int i = 0; i < 25; i++) { STパッド状態 stパッド状態 = new STパッド状態(); stパッド状態.n明るさ = 0; - this.stパッド状態[ i ] = stパッド状態; + 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); - } + 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(); - } + base.Activate(); + } - public override void DeActivate() - { - this.ctレベルアップダウン = null; + public override void DeActivate() { + this.ctレベルアップダウン = null; - base.DeActivate(); - } + 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() - { - if( base.IsFirstDraw ) - { - this.nフラッシュ制御タイマ = (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - base.IsFirstDraw = false; - } + public override int Draw() { + if (base.IsFirstDraw) { + this.nフラッシュ制御タイマ = (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed); + base.IsFirstDraw = false; + } - long num = (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - if ( num < this.nフラッシュ制御タイマ ) - { + long num = (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.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.nHS = TJAPlayer3.ConfigIni.nScrollSpeed.Drums < 8 ? TJAPlayer3.ConfigIni.nScrollSpeed.Drums : 7; + //this.nHS = TJAPlayer3.ConfigIni.nScrollSpeed.Drums < 8 ? TJAPlayer3.ConfigIni.nScrollSpeed.Drums : 7; - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - int bg_x; - int bg_y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - bg_x = TJAPlayer3.Skin.Game_Taiko_Background_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - bg_y = TJAPlayer3.Skin.Game_Taiko_Background_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - bg_x = TJAPlayer3.Skin.Game_Taiko_Background_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - bg_y = TJAPlayer3.Skin.Game_Taiko_Background_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - } - else - { - bg_x = TJAPlayer3.Skin.Game_Taiko_Background_X[i]; - bg_y = TJAPlayer3.Skin.Game_Taiko_Background_Y[i]; - } + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + int bg_x; + int bg_y; + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + bg_x = TJAPlayer3.Skin.Game_Taiko_Background_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + bg_y = TJAPlayer3.Skin.Game_Taiko_Background_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + bg_x = TJAPlayer3.Skin.Game_Taiko_Background_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + bg_y = TJAPlayer3.Skin.Game_Taiko_Background_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + } else { + bg_x = TJAPlayer3.Skin.Game_Taiko_Background_X[i]; + bg_y = TJAPlayer3.Skin.Game_Taiko_Background_Y[i]; + } - CTexture tex = null; + CTexture tex = null; - switch (i) - { - case 0: - { - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - { - tex = TJAPlayer3.Tx.Taiko_Background[2]; - } - else if (TJAPlayer3.ConfigIni.bTokkunMode) - { - if (TJAPlayer3.P1IsBlue()) - tex = TJAPlayer3.Tx.Taiko_Background[6]; - else - tex = TJAPlayer3.Tx.Taiko_Background[5]; - } - else - { - if (TJAPlayer3.P1IsBlue()) - tex = TJAPlayer3.Tx.Taiko_Background[4]; - else - tex = TJAPlayer3.Tx.Taiko_Background[0]; - } - } - break; - case 1: - { - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - tex = TJAPlayer3.Tx.Taiko_Background[9]; - } - else - { - if (TJAPlayer3.ConfigIni.nPlayerCount == 2) - tex = TJAPlayer3.Tx.Taiko_Background[1]; - else - tex = TJAPlayer3.Tx.Taiko_Background[4]; - } - } - break; - case 2: - tex = TJAPlayer3.Tx.Taiko_Background[7]; - break; - case 3: - tex = TJAPlayer3.Tx.Taiko_Background[8]; - break; - case 4: - tex = TJAPlayer3.Tx.Taiko_Background[11]; - break; - } + switch (i) { + case 0: { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + tex = TJAPlayer3.Tx.Taiko_Background[2]; + } else if (TJAPlayer3.ConfigIni.bTokkunMode) { + if (TJAPlayer3.P1IsBlue()) + tex = TJAPlayer3.Tx.Taiko_Background[6]; + else + tex = TJAPlayer3.Tx.Taiko_Background[5]; + } else { + if (TJAPlayer3.P1IsBlue()) + tex = TJAPlayer3.Tx.Taiko_Background[4]; + else + tex = TJAPlayer3.Tx.Taiko_Background[0]; + } + } + break; + case 1: { + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + tex = TJAPlayer3.Tx.Taiko_Background[9]; + } else { + if (TJAPlayer3.ConfigIni.nPlayerCount == 2) + tex = TJAPlayer3.Tx.Taiko_Background[1]; + else + tex = TJAPlayer3.Tx.Taiko_Background[4]; + } + } + break; + case 2: + tex = TJAPlayer3.Tx.Taiko_Background[7]; + break; + case 3: + tex = TJAPlayer3.Tx.Taiko_Background[8]; + break; + case 4: + tex = TJAPlayer3.Tx.Taiko_Background[11]; + break; + } - tex?.t2D描画(bg_x, bg_y); - } - /* + 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 @@ -210,499 +173,407 @@ namespace TJAPlayer3 } */ - int getMTaikoOpacity(int brightness) - { - if (TJAPlayer3.ConfigIni.SimpleMode) - { - return brightness <= 0 ? 0 : 255; - } - else - { - return brightness * 73; - } - } + int getMTaikoOpacity(int brightness) { + if (TJAPlayer3.ConfigIni.SimpleMode) { + return brightness <= 0 ? 0 : 255; + } else { + return brightness * 73; + } + } - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - int taiko_x; - int taiko_y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - taiko_x = TJAPlayer3.Skin.Game_Taiko_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - taiko_y = TJAPlayer3.Skin.Game_Taiko_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - taiko_x = TJAPlayer3.Skin.Game_Taiko_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - taiko_y = TJAPlayer3.Skin.Game_Taiko_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - } - else - { - taiko_x = TJAPlayer3.Skin.Game_Taiko_X[i]; - taiko_y = TJAPlayer3.Skin.Game_Taiko_Y[i]; - } + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + int taiko_x; + int taiko_y; + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + taiko_x = TJAPlayer3.Skin.Game_Taiko_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + taiko_y = TJAPlayer3.Skin.Game_Taiko_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + taiko_x = TJAPlayer3.Skin.Game_Taiko_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + taiko_y = TJAPlayer3.Skin.Game_Taiko_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + } else { + taiko_x = TJAPlayer3.Skin.Game_Taiko_X[i]; + taiko_y = TJAPlayer3.Skin.Game_Taiko_Y[i]; + } - int _actual = TJAPlayer3.GetActualPlayer(i); - EGameType _gt = TJAPlayer3.ConfigIni.nGameType[_actual]; - int playerShift = i * 5; + int _actual = TJAPlayer3.GetActualPlayer(i); + EGameType _gt = TJAPlayer3.ConfigIni.nGameType[_actual]; + int playerShift = i * 5; - // Drum base - TJAPlayer3.Tx.Taiko_Base[(int)_gt]?.t2D描画(taiko_x, taiko_y); + // Drum base + TJAPlayer3.Tx.Taiko_Base[(int)_gt]?.t2D描画(taiko_x, taiko_y); - // Taiko hits - if (_gt == EGameType.TAIKO) - { - if (TJAPlayer3.Tx.Taiko_Don_Left != null && TJAPlayer3.Tx.Taiko_Don_Right != null && TJAPlayer3.Tx.Taiko_Ka_Left != null && TJAPlayer3.Tx.Taiko_Ka_Right != null) - { - TJAPlayer3.Tx.Taiko_Ka_Left.Opacity = getMTaikoOpacity(this.stパッド状態[playerShift].n明るさ); - TJAPlayer3.Tx.Taiko_Ka_Right.Opacity = getMTaikoOpacity(this.stパッド状態[1 + playerShift].n明るさ); - TJAPlayer3.Tx.Taiko_Don_Left.Opacity = getMTaikoOpacity(this.stパッド状態[2 + playerShift].n明るさ); - TJAPlayer3.Tx.Taiko_Don_Right.Opacity = getMTaikoOpacity(this.stパッド状態[3 + playerShift].n明るさ); + // Taiko hits + if (_gt == EGameType.TAIKO) { + if (TJAPlayer3.Tx.Taiko_Don_Left != null && TJAPlayer3.Tx.Taiko_Don_Right != null && TJAPlayer3.Tx.Taiko_Ka_Left != null && TJAPlayer3.Tx.Taiko_Ka_Right != null) { + TJAPlayer3.Tx.Taiko_Ka_Left.Opacity = getMTaikoOpacity(this.stパッド状態[playerShift].n明るさ); + TJAPlayer3.Tx.Taiko_Ka_Right.Opacity = getMTaikoOpacity(this.stパッド状態[1 + playerShift].n明るさ); + TJAPlayer3.Tx.Taiko_Don_Left.Opacity = getMTaikoOpacity(this.stパッド状態[2 + playerShift].n明るさ); + TJAPlayer3.Tx.Taiko_Don_Right.Opacity = getMTaikoOpacity(this.stパッド状態[3 + playerShift].n明るさ); - TJAPlayer3.Tx.Taiko_Ka_Left.t2D描画(taiko_x, taiko_y, new Rectangle(0, 0, TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Height)); - TJAPlayer3.Tx.Taiko_Ka_Right.t2D描画(taiko_x + TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, taiko_y, new Rectangle(TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, 0, TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Height)); - TJAPlayer3.Tx.Taiko_Don_Left.t2D描画(taiko_x, taiko_y, new Rectangle(0, 0, TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Height)); - TJAPlayer3.Tx.Taiko_Don_Right.t2D描画(taiko_x + TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, taiko_y, new Rectangle(TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, 0, TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Height)); - } - } - else if (_gt == EGameType.KONGA) - { - if (TJAPlayer3.Tx.Taiko_Konga_Clap != null && TJAPlayer3.Tx.Taiko_Konga_Don != null && TJAPlayer3.Tx.Taiko_Konga_Ka != null) - { - TJAPlayer3.Tx.Taiko_Konga_Clap.Opacity = getMTaikoOpacity(this.stパッド状態[4 + playerShift].n明るさ); - TJAPlayer3.Tx.Taiko_Konga_Don.Opacity = getMTaikoOpacity(Math.Max(this.stパッド状態[2 + playerShift].n明るさ, this.stパッド状態[3 + playerShift].n明るさ)); - TJAPlayer3.Tx.Taiko_Konga_Ka.Opacity = getMTaikoOpacity(Math.Max(this.stパッド状態[playerShift].n明るさ, this.stパッド状態[1 + playerShift].n明るさ)); + TJAPlayer3.Tx.Taiko_Ka_Left.t2D描画(taiko_x, taiko_y, new Rectangle(0, 0, TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Height)); + TJAPlayer3.Tx.Taiko_Ka_Right.t2D描画(taiko_x + TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, taiko_y, new Rectangle(TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, 0, TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Height)); + TJAPlayer3.Tx.Taiko_Don_Left.t2D描画(taiko_x, taiko_y, new Rectangle(0, 0, TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Height)); + TJAPlayer3.Tx.Taiko_Don_Right.t2D描画(taiko_x + TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, taiko_y, new Rectangle(TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, 0, TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.szTextureSize.Height)); + } + } else if (_gt == EGameType.KONGA) { + if (TJAPlayer3.Tx.Taiko_Konga_Clap != null && TJAPlayer3.Tx.Taiko_Konga_Don != null && TJAPlayer3.Tx.Taiko_Konga_Ka != null) { + TJAPlayer3.Tx.Taiko_Konga_Clap.Opacity = getMTaikoOpacity(this.stパッド状態[4 + playerShift].n明るさ); + TJAPlayer3.Tx.Taiko_Konga_Don.Opacity = getMTaikoOpacity(Math.Max(this.stパッド状態[2 + playerShift].n明るさ, this.stパッド状態[3 + playerShift].n明るさ)); + TJAPlayer3.Tx.Taiko_Konga_Ka.Opacity = getMTaikoOpacity(Math.Max(this.stパッド状態[playerShift].n明るさ, this.stパッド状態[1 + playerShift].n明るさ)); - TJAPlayer3.Tx.Taiko_Konga_Ka.t2D描画(taiko_x, taiko_y); - TJAPlayer3.Tx.Taiko_Konga_Don.t2D描画(taiko_x, taiko_y); - TJAPlayer3.Tx.Taiko_Konga_Clap.t2D描画(taiko_x, taiko_y); - } - } + TJAPlayer3.Tx.Taiko_Konga_Ka.t2D描画(taiko_x, taiko_y); + TJAPlayer3.Tx.Taiko_Konga_Don.t2D描画(taiko_x, taiko_y); + TJAPlayer3.Tx.Taiko_Konga_Clap.t2D描画(taiko_x, taiko_y); + } + } - } + } - int[] nLVUPY = new int[] { 127, 127, 0, 0 }; + int[] nLVUPY = new int[] { 127, 127, 0, 0 }; - for ( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) - { - if (TJAPlayer3.ConfigIni.nPlayerCount > 2 || TJAPlayer3.ConfigIni.SimpleMode) break; + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.ConfigIni.nPlayerCount > 2 || TJAPlayer3.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 && ( TJAPlayer3.Tx.Taiko_LevelUp != null && TJAPlayer3.Tx.Taiko_LevelDown != null ) ) && !TJAPlayer3.ConfigIni.bNoInfo ) - { - //this.ctレベルアップダウン[ i ].n現在の値 = 110; + if (!this.ctレベルアップダウン[i].IsStoped) { + this.ctレベルアップダウン[i].Tick(); + if (this.ctレベルアップダウン[i].IsEnded) { + this.ctレベルアップダウン[i].Stop(); + } + } + if ((this.ctレベルアップダウン[i].IsTicked && (TJAPlayer3.Tx.Taiko_LevelUp != null && TJAPlayer3.Tx.Taiko_LevelDown != null)) && !TJAPlayer3.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; - } + //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 (TJAPlayer3.ConfigIni.nPlayerCount > 2) continue; + if (TJAPlayer3.ConfigIni.nPlayerCount > 2) continue; - int levelChange_x = TJAPlayer3.Skin.Game_Taiko_LevelChange_X[i]; - int levelChange_y = TJAPlayer3.Skin.Game_Taiko_LevelChange_Y[i]; + int levelChange_x = TJAPlayer3.Skin.Game_Taiko_LevelChange_X[i]; + int levelChange_y = TJAPlayer3.Skin.Game_Taiko_LevelChange_Y[i]; - if ( this.After[ i ] - this.Before[ i ] >= 0 ) - { - //レベルアップ - TJAPlayer3.Tx.Taiko_LevelUp.vcScaleRatio.X = fScale; - TJAPlayer3.Tx.Taiko_LevelUp.vcScaleRatio.Y = fScale; - TJAPlayer3.Tx.Taiko_LevelUp.Opacity = nAlpha; - TJAPlayer3.Tx.Taiko_LevelUp.t2D拡大率考慮中央基準描画(levelChange_x, - levelChange_y); - } - else - { - TJAPlayer3.Tx.Taiko_LevelDown.vcScaleRatio.X = fScale; - TJAPlayer3.Tx.Taiko_LevelDown.vcScaleRatio.Y = fScale; - TJAPlayer3.Tx.Taiko_LevelDown.Opacity = nAlpha; - TJAPlayer3.Tx.Taiko_LevelDown.t2D拡大率考慮中央基準描画(levelChange_x, - levelChange_y); - } - } - } + if (this.After[i] - this.Before[i] >= 0) { + //レベルアップ + TJAPlayer3.Tx.Taiko_LevelUp.vcScaleRatio.X = fScale; + TJAPlayer3.Tx.Taiko_LevelUp.vcScaleRatio.Y = fScale; + TJAPlayer3.Tx.Taiko_LevelUp.Opacity = nAlpha; + TJAPlayer3.Tx.Taiko_LevelUp.t2D拡大率考慮中央基準描画(levelChange_x, + levelChange_y); + } else { + TJAPlayer3.Tx.Taiko_LevelDown.vcScaleRatio.X = fScale; + TJAPlayer3.Tx.Taiko_LevelDown.vcScaleRatio.Y = fScale; + TJAPlayer3.Tx.Taiko_LevelDown.Opacity = nAlpha; + TJAPlayer3.Tx.Taiko_LevelDown.t2D拡大率考慮中央基準描画(levelChange_x, + levelChange_y); + } + } + } - for( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) - { - if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) break; + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) break; - int modIcons_x; - int modIcons_y; - int couse_symbol_x; - int couse_symbol_y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - modIcons_x = TJAPlayer3.Skin.Game_Taiko_ModIcons_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - modIcons_y = TJAPlayer3.Skin.Game_Taiko_ModIcons_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + int modIcons_x; + int modIcons_y; + int couse_symbol_x; + int couse_symbol_y; + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + modIcons_x = TJAPlayer3.Skin.Game_Taiko_ModIcons_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + modIcons_y = TJAPlayer3.Skin.Game_Taiko_ModIcons_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - couse_symbol_x = TJAPlayer3.Skin.Game_CourseSymbol_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - couse_symbol_y = TJAPlayer3.Skin.Game_CourseSymbol_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - modIcons_x = TJAPlayer3.Skin.Game_Taiko_ModIcons_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - modIcons_y = TJAPlayer3.Skin.Game_Taiko_ModIcons_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + couse_symbol_x = TJAPlayer3.Skin.Game_CourseSymbol_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + couse_symbol_y = TJAPlayer3.Skin.Game_CourseSymbol_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + modIcons_x = TJAPlayer3.Skin.Game_Taiko_ModIcons_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + modIcons_y = TJAPlayer3.Skin.Game_Taiko_ModIcons_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - couse_symbol_x = TJAPlayer3.Skin.Game_CourseSymbol_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - couse_symbol_y = TJAPlayer3.Skin.Game_CourseSymbol_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - } - else - { - modIcons_x = TJAPlayer3.Skin.Game_Taiko_ModIcons_X[i]; - modIcons_y = TJAPlayer3.Skin.Game_Taiko_ModIcons_Y[i]; + couse_symbol_x = TJAPlayer3.Skin.Game_CourseSymbol_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + couse_symbol_y = TJAPlayer3.Skin.Game_CourseSymbol_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + } else { + modIcons_x = TJAPlayer3.Skin.Game_Taiko_ModIcons_X[i]; + modIcons_y = TJAPlayer3.Skin.Game_Taiko_ModIcons_Y[i]; - couse_symbol_x = TJAPlayer3.Skin.Game_CourseSymbol_X[i]; - couse_symbol_y = TJAPlayer3.Skin.Game_CourseSymbol_Y[i]; - } + couse_symbol_x = TJAPlayer3.Skin.Game_CourseSymbol_X[i]; + couse_symbol_y = TJAPlayer3.Skin.Game_CourseSymbol_Y[i]; + } - ModIcons.tDisplayMods(modIcons_x, modIcons_y, i); + ModIcons.tDisplayMods(modIcons_x, modIcons_y, i); - if (TJAPlayer3.Tx.Couse_Symbol[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]] != null) - { - TJAPlayer3.Tx.Couse_Symbol[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]].t2D描画( - couse_symbol_x, - couse_symbol_y - ); - } + if (TJAPlayer3.Tx.Couse_Symbol[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]] != null) { + TJAPlayer3.Tx.Couse_Symbol[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]].t2D描画( + couse_symbol_x, + couse_symbol_y + ); + } - if (TJAPlayer3.ConfigIni.ShinuchiMode) - { - if (TJAPlayer3.Tx.Couse_Symbol[(int)Difficulty.Total] != null) - { - TJAPlayer3.Tx.Couse_Symbol[(int)Difficulty.Total].t2D描画( - couse_symbol_x, - couse_symbol_y - ); - } + if (TJAPlayer3.ConfigIni.ShinuchiMode) { + if (TJAPlayer3.Tx.Couse_Symbol[(int)Difficulty.Total] != null) { + TJAPlayer3.Tx.Couse_Symbol[(int)Difficulty.Total].t2D描画( + couse_symbol_x, + couse_symbol_y + ); + } - } - } + } + } - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - int namePlate_x; - int namePlate_y; - int playerNumber_x; - int playerNumber_y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - namePlate_x = TJAPlayer3.Skin.Game_Taiko_NamePlate_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - namePlate_y = TJAPlayer3.Skin.Game_Taiko_NamePlate_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + int namePlate_x; + int namePlate_y; + int playerNumber_x; + int playerNumber_y; + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + namePlate_x = TJAPlayer3.Skin.Game_Taiko_NamePlate_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + namePlate_y = TJAPlayer3.Skin.Game_Taiko_NamePlate_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - playerNumber_x = TJAPlayer3.Skin.Game_Taiko_PlayerNumber_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - playerNumber_y = TJAPlayer3.Skin.Game_Taiko_PlayerNumber_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - namePlate_x = TJAPlayer3.Skin.Game_Taiko_NamePlate_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - namePlate_y = TJAPlayer3.Skin.Game_Taiko_NamePlate_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + playerNumber_x = TJAPlayer3.Skin.Game_Taiko_PlayerNumber_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + playerNumber_y = TJAPlayer3.Skin.Game_Taiko_PlayerNumber_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + namePlate_x = TJAPlayer3.Skin.Game_Taiko_NamePlate_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + namePlate_y = TJAPlayer3.Skin.Game_Taiko_NamePlate_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - playerNumber_x = TJAPlayer3.Skin.Game_Taiko_PlayerNumber_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - playerNumber_y = TJAPlayer3.Skin.Game_Taiko_PlayerNumber_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - } - else - { - namePlate_x = TJAPlayer3.Skin.Game_Taiko_NamePlate_X[i]; - namePlate_y = TJAPlayer3.Skin.Game_Taiko_NamePlate_Y[i]; + playerNumber_x = TJAPlayer3.Skin.Game_Taiko_PlayerNumber_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + playerNumber_y = TJAPlayer3.Skin.Game_Taiko_PlayerNumber_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + } else { + namePlate_x = TJAPlayer3.Skin.Game_Taiko_NamePlate_X[i]; + namePlate_y = TJAPlayer3.Skin.Game_Taiko_NamePlate_Y[i]; - playerNumber_x = TJAPlayer3.Skin.Game_Taiko_PlayerNumber_X[i]; - playerNumber_y = TJAPlayer3.Skin.Game_Taiko_PlayerNumber_Y[i]; - } + playerNumber_x = TJAPlayer3.Skin.Game_Taiko_PlayerNumber_X[i]; + playerNumber_y = TJAPlayer3.Skin.Game_Taiko_PlayerNumber_Y[i]; + } - TJAPlayer3.NamePlate.tNamePlateDraw(namePlate_x, namePlate_y, i); + TJAPlayer3.NamePlate.tNamePlateDraw(namePlate_x, namePlate_y, i); - if (TJAPlayer3.Tx.Taiko_PlayerNumber[i] != null) - { - TJAPlayer3.Tx.Taiko_PlayerNumber[i].t2D描画(playerNumber_x, playerNumber_y); - } - } - return base.Draw(); - } + if (TJAPlayer3.Tx.Taiko_PlayerNumber[i] != null) { + TJAPlayer3.Tx.Taiko_PlayerNumber[i].t2D描画(playerNumber_x, playerNumber_y); + } + } + return base.Draw(); + } - public void tMtaikoEvent( int nChannel, int nHand, int nPlayer ) - { - CConfigIni configIni = TJAPlayer3.ConfigIni; - bool bAutoPlay = configIni.bAutoPlay[nPlayer]; - int playerShift = 5 * nPlayer; - var _gt = configIni.nGameType[TJAPlayer3.GetActualPlayer(nPlayer)]; + public void tMtaikoEvent(int nChannel, int nHand, int nPlayer) { + CConfigIni configIni = TJAPlayer3.ConfigIni; + bool bAutoPlay = configIni.bAutoPlay[nPlayer]; + int playerShift = 5 * nPlayer; + var _gt = configIni.nGameType[TJAPlayer3.GetActualPlayer(nPlayer)]; - switch (nPlayer) - { - case 1: - bAutoPlay = configIni.bAutoPlay[nPlayer] || TJAPlayer3.ConfigIni.bAIBattleMode; - break; - } + switch (nPlayer) { + case 1: + bAutoPlay = configIni.bAutoPlay[nPlayer] || TJAPlayer3.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; + 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; + } + } else { + switch (nChannel) { + case 0x11: + case 0x15: + case 0x16: + case 0x17: + case 0x1F: { + this.stパッド状態[2 + nHand + playerShift].n明るさ = 8; + } + break; - case 0x12: - { - this.stパッド状態[ 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 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 0x12: { + this.stパッド状態[nHand + playerShift].n明るさ = 8; + } + break; - case 0x101: - { - this.stパッド状態[nHand + playerShift].n明るさ = 8; - this.stパッド状態[2 + (nHand == 0 ? 1 : 0) + 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; - public void tBranchEvent(CDTX.ECourse Before, CDTX.ECourse After, int player) - { - if ( After != Before ) - this.ctレベルアップダウン[ player ] = new CCounter( 0, 1000, 1, TJAPlayer3.Timer ); + case 0x101: { + this.stパッド状態[nHand + playerShift].n明るさ = 8; + this.stパッド状態[2 + (nHand == 0 ? 1 : 0) + playerShift].n明るさ = 8; + break; + } + } + } - this.After[ player ] = After; - this.Before[ player ] = Before; - } + } + + public void tBranchEvent(CDTX.ECourse Before, CDTX.ECourse After, int player) { + if (After != Before) + this.ctレベルアップダウン[player] = new CCounter(0, 1000, 1, TJAPlayer3.Timer); + + this.After[player] = After; + this.Before[player] = Before; + } - public void BackSymbolEvent(int player) - { - ctSymbolFlash[player] = new CCounter(0, 1000, 0.2f, TJAPlayer3.Timer); - } + public void BackSymbolEvent(int player) { + ctSymbolFlash[player] = new CCounter(0, 1000, 0.2f, TJAPlayer3.Timer); + } - public void DrawBackSymbol() - { - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - ctSymbolFlash[i].Tick(); + public void DrawBackSymbol() { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + ctSymbolFlash[i].Tick(); - int couse_symbol_x; - int couse_symbol_y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - couse_symbol_x = TJAPlayer3.Skin.Game_CourseSymbol_Back_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - couse_symbol_y = TJAPlayer3.Skin.Game_CourseSymbol_Back_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - couse_symbol_x = TJAPlayer3.Skin.Game_CourseSymbol_Back_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - couse_symbol_y = TJAPlayer3.Skin.Game_CourseSymbol_Back_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - } - else - { - couse_symbol_x = TJAPlayer3.Skin.Game_CourseSymbol_Back_X[i]; - couse_symbol_y = TJAPlayer3.Skin.Game_CourseSymbol_Back_Y[i]; - } + int couse_symbol_x; + int couse_symbol_y; + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + couse_symbol_x = TJAPlayer3.Skin.Game_CourseSymbol_Back_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + couse_symbol_y = TJAPlayer3.Skin.Game_CourseSymbol_Back_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + couse_symbol_x = TJAPlayer3.Skin.Game_CourseSymbol_Back_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + couse_symbol_y = TJAPlayer3.Skin.Game_CourseSymbol_Back_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + } else { + couse_symbol_x = TJAPlayer3.Skin.Game_CourseSymbol_Back_X[i]; + couse_symbol_y = TJAPlayer3.Skin.Game_CourseSymbol_Back_Y[i]; + } - if (TJAPlayer3.Tx.Couse_Symbol_Back[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]] != null) - { - int originX = 0; - int originY = 0; - int width = TJAPlayer3.Tx.Couse_Symbol_Back[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]].szTextureSize.Width; - int height = TJAPlayer3.Tx.Couse_Symbol_Back[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]].szTextureSize.Height; + if (TJAPlayer3.Tx.Couse_Symbol_Back[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]] != null) { + int originX = 0; + int originY = 0; + int width = TJAPlayer3.Tx.Couse_Symbol_Back[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]].szTextureSize.Width; + int height = TJAPlayer3.Tx.Couse_Symbol_Back[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]].szTextureSize.Height; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - originX = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_5P[0]; - originY = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_5P[1]; - width = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_5P[2]; - height = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_5P[3]; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount > 2) - { - originX = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_4P[0]; - originY = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_4P[1]; - width = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_4P[2]; - height = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_4P[3]; - } + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + originX = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_5P[0]; + originY = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_5P[1]; + width = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_5P[2]; + height = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_5P[3]; + } else if (TJAPlayer3.ConfigIni.nPlayerCount > 2) { + originX = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_4P[0]; + originY = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_4P[1]; + width = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_4P[2]; + height = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_4P[3]; + } - TJAPlayer3.Tx.Couse_Symbol_Back[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]].t2D描画( - couse_symbol_x, - couse_symbol_y, - new System.Drawing.RectangleF(originX, originY, width, height)); - } + TJAPlayer3.Tx.Couse_Symbol_Back[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]].t2D描画( + couse_symbol_x, + couse_symbol_y, + new System.Drawing.RectangleF(originX, originY, width, height)); + } - if (TJAPlayer3.Tx.Couse_Symbol_Back_Flash[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]] != null && !TJAPlayer3.ConfigIni.SimpleMode) - { - int originX = 0; - int originY = 0; - int width = TJAPlayer3.Tx.Couse_Symbol_Back[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]].szTextureSize.Width; - int height = TJAPlayer3.Tx.Couse_Symbol_Back[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]].szTextureSize.Height; + if (TJAPlayer3.Tx.Couse_Symbol_Back_Flash[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]] != null && !TJAPlayer3.ConfigIni.SimpleMode) { + int originX = 0; + int originY = 0; + int width = TJAPlayer3.Tx.Couse_Symbol_Back[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]].szTextureSize.Width; + int height = TJAPlayer3.Tx.Couse_Symbol_Back[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]].szTextureSize.Height; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - originX = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_5P[0]; - originY = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_5P[1]; - width = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_5P[2]; - height = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_5P[3]; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount > 2) - { - originX = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_4P[0]; - originY = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_4P[1]; - width = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_4P[2]; - height = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_4P[3]; - } + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + originX = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_5P[0]; + originY = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_5P[1]; + width = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_5P[2]; + height = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_5P[3]; + } else if (TJAPlayer3.ConfigIni.nPlayerCount > 2) { + originX = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_4P[0]; + originY = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_4P[1]; + width = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_4P[2]; + height = TJAPlayer3.Skin.Game_CourseSymbol_Back_Rect_4P[3]; + } - TJAPlayer3.Tx.Couse_Symbol_Back_Flash[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]].Opacity = 255 - (int)((ctSymbolFlash[i].CurrentValue / 1000.0) * 255); - TJAPlayer3.Tx.Couse_Symbol_Back_Flash[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]].t2D描画( - couse_symbol_x, - couse_symbol_y, - new System.Drawing.RectangleF(originX, originY, width, height)); - } - } - } + TJAPlayer3.Tx.Couse_Symbol_Back_Flash[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]].Opacity = 255 - (int)((ctSymbolFlash[i].CurrentValue / 1000.0) * 255); + TJAPlayer3.Tx.Couse_Symbol_Back_Flash[TJAPlayer3.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明るさ; - } + #region[ private ] + //----------------- + //構造体 + [StructLayout(LayoutKind.Sequential)] + private struct STパッド状態 { + public int n明るさ; + } - //太鼓 - private STパッド状態[] stパッド状態 = new STパッド状態[ 5 * 5 ]; - private long nフラッシュ制御タイマ; + //太鼓 + private STパッド状態[] stパッド状態 = new STパッド状態[5 * 5]; + private long nフラッシュ制御タイマ; - //private CTexture[] txコースシンボル = new CTexture[ 6 ]; - private string[] strCourseSymbolFileName; + //private CTexture[] txコースシンボル = new CTexture[ 6 ]; + private string[] strCourseSymbolFileName; - //オプション - private CTexture txオプションパネル_HS; - private CTexture txオプションパネル_RANMIR; - private CTexture txオプションパネル_特殊; - private int nHS; + //オプション + 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 + //譜面分岐 + 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 ac6662c9..a90b0d8f 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplPad.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplPad.cs @@ -1,101 +1,76 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; -using System.Drawing; +using System.Runtime.InteropServices; using FDK; -namespace TJAPlayer3 -{ - internal class CActImplPad : CActivity - { +namespace TJAPlayer3 { + internal class CActImplPad : CActivity { // コンストラクタ - public CActImplPad() - { + public CActImplPad() { base.IsDeActivated = true; } - - + + // メソッド - public void Hit( int nLane ) - { - this.stパッド状態[ nLane ].n明るさ = 6; - this.stパッド状態[ nLane ].nY座標加速度dot = 2; + public void Hit(int nLane) { + this.stパッド状態[nLane].n明るさ = 6; + this.stパッド状態[nLane].nY座標加速度dot = 2; } // CActivity 実装 - public override void Activate() - { + public override void Activate() { this.nフラッシュ制御タイマ = -1; this.nY座標制御タイマ = -1; - for( int i = 0; i < 9; i++ ) - { + 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パッド状態; + this.stパッド状態[i] = stパッド状態; } base.Activate(); } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { base.ReleaseManagedResource(); } - public override int Draw() - { - if( !base.IsDeActivated ) - { - if( base.IsFirstDraw ) - { + public override int Draw() { + if (!base.IsDeActivated) { + if (base.IsFirstDraw) { this.nフラッシュ制御タイマ = (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed); this.nY座標制御タイマ = (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed); base.IsFirstDraw = false; } long num = (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - if ( num < this.nフラッシュ制御タイマ ) - { + 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明るさ--; + 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座標制御タイマ ) - { + 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; + 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; @@ -111,9 +86,8 @@ namespace TJAPlayer3 #region [ private ] //----------------- - [StructLayout( LayoutKind.Sequential )] - private struct STパッド状態 - { + [StructLayout(LayoutKind.Sequential)] + private struct STパッド状態 { public int n明るさ; public int nY座標オフセットdot; public int nY座標加速度dot; @@ -121,7 +95,7 @@ namespace TJAPlayer3 private long nY座標制御タイマ; private long nフラッシュ制御タイマ; - private STパッド状態[] stパッド状態 = new STパッド状態[ 10 ]; + 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 5443b0a1..c36fedf6 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRoll.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRoll.cs @@ -1,181 +1,150 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Diagnostics; +using System.Drawing; using System.Runtime.InteropServices; using FDK; -namespace TJAPlayer3 -{ - internal class CActImplRoll : CActivity - { +namespace TJAPlayer3 { + 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 (TJAPlayer3.ConfigIni.nPlayerCount > 2) return base.Draw(); + public int On進行描画(int n連打数, int player) { + if (TJAPlayer3.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 < TJAPlayer3.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(); + 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 < TJAPlayer3.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; - TJAPlayer3.Tx.Balloon_Number_Roll.Opacity = 64; - } - else if (ct連打枠カウンター[player].CurrentValue == 1 || ct連打枠カウンター[player].CurrentValue == 59) - { - bNowRollAnime = 1; - TJAPlayer3.Tx.Balloon_Number_Roll.Opacity = 128; - } - else if (ct連打枠カウンター[player].CurrentValue == 2 || ct連打枠カウンター[player].CurrentValue == 58) - { - bNowRollAnime = 2; - TJAPlayer3.Tx.Balloon_Number_Roll.Opacity = 192; - } - else if (ct連打枠カウンター[player].CurrentValue == 3 || ct連打枠カウンター[player].CurrentValue == 57) - { - bNowRollAnime = 3; - TJAPlayer3.Tx.Balloon_Number_Roll.Opacity = 255; - } - else if (ct連打枠カウンター[player].CurrentValue >= 4 || ct連打枠カウンター[player].CurrentValue <= 56) - { - bNowRollAnime = 4; - TJAPlayer3.Tx.Balloon_Number_Roll.Opacity = 255; - } + if (ct連打枠カウンター[player].CurrentValue == 0 || ct連打枠カウンター[player].CurrentValue == 60) { + bNowRollAnime = 0; + TJAPlayer3.Tx.Balloon_Number_Roll.Opacity = 64; + } else if (ct連打枠カウンター[player].CurrentValue == 1 || ct連打枠カウンター[player].CurrentValue == 59) { + bNowRollAnime = 1; + TJAPlayer3.Tx.Balloon_Number_Roll.Opacity = 128; + } else if (ct連打枠カウンター[player].CurrentValue == 2 || ct連打枠カウンター[player].CurrentValue == 58) { + bNowRollAnime = 2; + TJAPlayer3.Tx.Balloon_Number_Roll.Opacity = 192; + } else if (ct連打枠カウンター[player].CurrentValue == 3 || ct連打枠カウンター[player].CurrentValue == 57) { + bNowRollAnime = 3; + TJAPlayer3.Tx.Balloon_Number_Roll.Opacity = 255; + } else if (ct連打枠カウンター[player].CurrentValue >= 4 || ct連打枠カウンター[player].CurrentValue <= 56) { + bNowRollAnime = 4; + TJAPlayer3.Tx.Balloon_Number_Roll.Opacity = 255; + } - float width = TJAPlayer3.Tx.Balloon_Roll.szTextureSize.Width / 5.0f; - float height = TJAPlayer3.Tx.Balloon_Roll.szTextureSize.Height; + float width = TJAPlayer3.Tx.Balloon_Roll.szTextureSize.Width / 5.0f; + float height = TJAPlayer3.Tx.Balloon_Roll.szTextureSize.Height; - TJAPlayer3.Tx.Balloon_Roll?.t2D描画(TJAPlayer3.Skin.Game_Balloon_Roll_Frame_X[player], TJAPlayer3.Skin.Game_Balloon_Roll_Frame_Y[player], new RectangleF(0 + bNowRollAnime * width, 0, width, height)); - this.t文字表示(TJAPlayer3.Skin.Game_Balloon_Roll_Number_X[player], TJAPlayer3.Skin.Game_Balloon_Roll_Number_Y[player], n連打数, player); - } - } + TJAPlayer3.Tx.Balloon_Roll?.t2D描画(TJAPlayer3.Skin.Game_Balloon_Roll_Frame_X[player], TJAPlayer3.Skin.Game_Balloon_Roll_Frame_Y[player], new RectangleF(0 + bNowRollAnime * width, 0, width, height)); + this.t文字表示(TJAPlayer3.Skin.Game_Balloon_Roll_Number_X[player], TJAPlayer3.Skin.Game_Balloon_Roll_Number_Y[player], n連打数, player); + } + } - return base.Draw(); - } + 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, TJAPlayer3.Timer); + public void t枠表示時間延長(int player, bool first) { + if ((this.ct連打枠カウンター[player].CurrentValue >= 6 && !first) || first) + this.ct連打枠カウンター[player] = new CCounter(0, 60, 40, TJAPlayer3.Timer); - if(!first) - this.ct連打枠カウンター[player].CurrentValue = 5; - else - this.ct連打枠カウンター[player].CurrentValue = 0; - } + if (!first) + this.ct連打枠カウンター[player].CurrentValue = 5; + else + this.ct連打枠カウンター[player].CurrentValue = 0; + } - public int bNowRollAnime; - public bool[] b表示; - public int[] n連打数; - public CCounter[] ct連打枠カウンター; + public int bNowRollAnime; + public bool[] b表示; + public int[] n連打数; + public CCounter[] ct連打枠カウンター; - public CCounter[] ct連打アニメ; - private float[] RollScale = new float[] - { - 0.000f, - 0.123f, // リピート + 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; + 0.164f, + 0.164f, + 0.137f, + 0.110f, + 0.082f, + 0.055f, + 0.000f + }; + private Animations.FadeOut[] FadeOut; - [StructLayout(LayoutKind.Sequential)] - private struct ST文字位置 - { - public char ch; - public Point pt; - } + [StructLayout(LayoutKind.Sequential)] + private struct ST文字位置 { + public char ch; + public Point pt; + } - private void t文字表示( int x, int y, int num, int nPlayer) - { - TJAPlayer3.Tx.Balloon_Number_Roll.vcScaleRatio.X = TJAPlayer3.Skin.Game_Balloon_Roll_Number_Scale; - TJAPlayer3.Tx.Balloon_Number_Roll.vcScaleRatio.Y = TJAPlayer3.Skin.Game_Balloon_Roll_Number_Scale + RollScale[this.ct連打アニメ[nPlayer].CurrentValue]; + private void t文字表示(int x, int y, int num, int nPlayer) { + TJAPlayer3.Tx.Balloon_Number_Roll.vcScaleRatio.X = TJAPlayer3.Skin.Game_Balloon_Roll_Number_Scale; + TJAPlayer3.Tx.Balloon_Number_Roll.vcScaleRatio.Y = TJAPlayer3.Skin.Game_Balloon_Roll_Number_Scale + RollScale[this.ct連打アニメ[nPlayer].CurrentValue]; - int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) - { - float offset = j - (nums.Length / 2.0f); - float _x = x - (TJAPlayer3.Skin.Game_Balloon_Number_Interval[0] * offset); - float _y = y - (TJAPlayer3.Skin.Game_Balloon_Number_Interval[1] * offset); + int[] nums = CConversion.SeparateDigits(num); + for (int j = 0; j < nums.Length; j++) { + float offset = j - (nums.Length / 2.0f); + float _x = x - (TJAPlayer3.Skin.Game_Balloon_Number_Interval[0] * offset); + float _y = y - (TJAPlayer3.Skin.Game_Balloon_Number_Interval[1] * offset); - float width = TJAPlayer3.Tx.Balloon_Number_Roll.sz画像サイズ.Width / 10.0f; - float height = TJAPlayer3.Tx.Balloon_Number_Roll.sz画像サイズ.Height; + float width = TJAPlayer3.Tx.Balloon_Number_Roll.sz画像サイズ.Width / 10.0f; + float height = TJAPlayer3.Tx.Balloon_Number_Roll.sz画像サイズ.Height; - TJAPlayer3.Tx.Balloon_Number_Roll.t2D拡大率考慮下基準描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - } - } - } + TJAPlayer3.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 b0eff380..6b953a69 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRollEffect.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRollEffect.cs @@ -1,201 +1,170 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; using FDK; -namespace TJAPlayer3 -{ - internal class CActImplRollEffect : CActivity - { +namespace TJAPlayer3 { + internal class CActImplRollEffect : CActivity { // コンストラクタ - public CActImplRollEffect() - { + public CActImplRollEffect() { base.IsDeActivated = true; } - - - // メソッド - public virtual void Start( int player ) - { - if (TJAPlayer3.ConfigIni.SimpleMode) return; - for (int i = 0; i < 128; i++) - { - if(!RollCharas[i].IsUsing) - { - RollCharas[i].IsUsing = true; - RollCharas[i].Type = random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Ptn); - RollCharas[i].OldValue = 0; - RollCharas[i].Counter = new CCounter(0, 5000, 1, TJAPlayer3.Timer); - if (TJAPlayer3.stage演奏ドラム画面.bDoublePlay) - { - switch (player) - { - case 0: - RollCharas[i].X = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_1P_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_1P_X.Length)]; - RollCharas[i].Y = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_1P_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_1P_Y.Length)]; - RollCharas[i].XAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_1P_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_1P_X.Length)]; - RollCharas[i].YAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_1P_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_1P_Y.Length)]; - break; - case 1: - RollCharas[i].X = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_2P_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_2P_X.Length)]; - RollCharas[i].Y = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_2P_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_2P_Y.Length)]; - RollCharas[i].XAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_2P_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_2P_X.Length)]; - RollCharas[i].YAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_2P_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_2P_Y.Length)]; - break; - default: - return; - } - } - else - { - RollCharas[i].X = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_X.Length)]; - RollCharas[i].Y = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_Y.Length)]; - RollCharas[i].XAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_X.Length)]; - RollCharas[i].YAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_Y.Length)]; - } - break; - } - } + + // メソッド + public virtual void Start(int player) { + if (TJAPlayer3.ConfigIni.SimpleMode) return; + + for (int i = 0; i < 128; i++) { + if (!RollCharas[i].IsUsing) { + RollCharas[i].IsUsing = true; + RollCharas[i].Type = random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Ptn); + RollCharas[i].OldValue = 0; + RollCharas[i].Counter = new CCounter(0, 5000, 1, TJAPlayer3.Timer); + if (TJAPlayer3.stage演奏ドラム画面.bDoublePlay) { + switch (player) { + case 0: + RollCharas[i].X = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_1P_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_1P_X.Length)]; + RollCharas[i].Y = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_1P_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_1P_Y.Length)]; + RollCharas[i].XAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_1P_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_1P_X.Length)]; + RollCharas[i].YAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_1P_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_1P_Y.Length)]; + break; + case 1: + RollCharas[i].X = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_2P_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_2P_X.Length)]; + RollCharas[i].Y = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_2P_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_2P_Y.Length)]; + RollCharas[i].XAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_2P_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_2P_X.Length)]; + RollCharas[i].YAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_2P_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_2P_Y.Length)]; + break; + default: + return; + } + } else { + RollCharas[i].X = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_X.Length)]; + RollCharas[i].Y = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_Y.Length)]; + RollCharas[i].XAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_X.Length)]; + RollCharas[i].YAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_Y.Length)]; + } + break; + } + } } // CActivity 実装 - public override void Activate() - { + 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で指定されたいくつかの変数からこのクラスに合ったものに変換していく + for (int i = 0; i < 128; i++) { + RollCharas[i] = new RollChara(); + RollCharas[i].IsUsing = false; + RollCharas[i].Counter = new CCounter(); + } + // SkinConfigで指定されたいくつかの変数からこのクラスに合ったものに変換していく - base.Activate(); + base.Activate(); } - public override void DeActivate() - { + public override void DeActivate() { - for (int i = 0; i < 128; i++) - { - RollCharas[i].Counter = null; - } + for (int i = 0; i < 128; i++) { + RollCharas[i].Counter = null; + } base.DeActivate(); } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { base.ReleaseManagedResource(); } - public override int Draw() - { - if ( !base.IsDeActivated && !TJAPlayer3.ConfigIni.SimpleMode) - { + public override int Draw() { + if (!base.IsDeActivated && !TJAPlayer3.ConfigIni.SimpleMode) { - if (TJAPlayer3.ConfigIni.nPlayerCount > 2) return 0; + if (TJAPlayer3.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) - { - 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; - } + 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) { + 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 (TJAPlayer3.Tx.Effects_Roll[RollCharas[i].Type] != null) - { - TJAPlayer3.Tx.Effects_Roll[RollCharas[i].Type]?.t2D描画(RollCharas[i].X, RollCharas[i].Y); - - // 画面外にいたら描画をやめさせる - if (RollCharas[i].X < 0 - TJAPlayer3.Tx.Effects_Roll[RollCharas[i].Type].szTextureSize.Width || RollCharas[i].X > TJAPlayer3.Skin.Resolution[0]) - { - RollCharas[i].Counter.Stop(); - RollCharas[i].IsUsing = false; - } - - if (RollCharas[i].Y < 0 - TJAPlayer3.Tx.Effects_Roll[RollCharas[i].Type].szTextureSize.Height || RollCharas[i].Y > TJAPlayer3.Skin.Resolution[1]) - { - RollCharas[i].Counter.Stop(); - RollCharas[i].IsUsing = false; - } - } + if (TJAPlayer3.Tx.Effects_Roll[RollCharas[i].Type] != null) { + TJAPlayer3.Tx.Effects_Roll[RollCharas[i].Type]?.t2D描画(RollCharas[i].X, RollCharas[i].Y); - - } - } + // 画面外にいたら描画をやめさせる + if (RollCharas[i].X < 0 - TJAPlayer3.Tx.Effects_Roll[RollCharas[i].Type].szTextureSize.Width || RollCharas[i].X > TJAPlayer3.Skin.Resolution[0]) { + RollCharas[i].Counter.Stop(); + RollCharas[i].IsUsing = false; + } + + if (RollCharas[i].Y < 0 - TJAPlayer3.Tx.Effects_Roll[RollCharas[i].Type].szTextureSize.Height || RollCharas[i].Y > TJAPlayer3.Skin.Resolution[1]) { + RollCharas[i].Counter.Stop(); + RollCharas[i].IsUsing = false; + } + } + + + } + } } return 0; } - + // その他 #region [ private ] //----------------- - //private CTexture[] txChara; - private int nTex枚数; + //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 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; - } + [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 RollChara[] RollCharas = new RollChara[128]; - private Random random = new Random(); + 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 - } + 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 f85315bc..160faa3c 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRunner.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRunner.cs @@ -1,281 +1,224 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Diagnostics; using System.Drawing; using System.Runtime.InteropServices; using FDK; -using System.Diagnostics; -namespace TJAPlayer3 -{ - internal class CActImplRunner : CActivity - { - /// - /// ランナー - /// - public CActImplRunner() - { - base.IsDeActivated = true; - } +namespace TJAPlayer3 { + internal class CActImplRunner : CActivity { + /// + /// ランナー + /// + public CActImplRunner() { + base.IsDeActivated = true; + } - public void Start(int Player, bool IsMiss, CDTX.CChip pChip) - { - if (Runner != null && !TJAPlayer3.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, TJAPlayer3.Skin.Resolution[0], Timer, TJAPlayer3.Timer); - stRunners[Index].nOldValue = 0; - stRunners[Index].nNowPtn = 0; - stRunners[Index].fX = 0; - } + public void Start(int Player, bool IsMiss, CDTX.CChip pChip) { + if (Runner != null && !TJAPlayer3.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, TJAPlayer3.Skin.Resolution[0], Timer, TJAPlayer3.Timer); + stRunners[Index].nOldValue = 0; + stRunners[Index].nNowPtn = 0; + stRunners[Index].fX = 0; + } - } - } - } + } + } + } - public override void Activate() - { - if (TJAPlayer3.ConfigIni.SimpleMode) - { - base.Activate(); - return; - } + public override void Activate() { + if (TJAPlayer3.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(); - - Random random = new Random(); + for (int i = 0; i < 128; i++) { + stRunners[i] = new STRunner(); + stRunners[i].b使用中 = false; + stRunners[i].ct進行 = new CCounter(); + } - var dancerOrigindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.RUNNER}"); - if (System.IO.Directory.Exists($@"{dancerOrigindir}")) - { - var dirs = System.IO.Directory.GetDirectories($@"{dancerOrigindir}"); - if (dirs.Length > 0) - { - var _presetPath = (preset != null && preset.RunnerSet != null) ? $@"{dancerOrigindir}" + preset.RunnerSet[random.Next(0, preset.RunnerSet.Length)] : ""; - var path = (preset != null && System.IO.Directory.Exists(_presetPath)) - ? _presetPath - : dirs[random.Next(0, dirs.Length)]; - LoadRunnerConifg(path); + var preset = HScenePreset.GetBGPreset(); - Runner = TJAPlayer3.tテクスチャの生成($@"{path}{Path.DirectorySeparatorChar}Runner.png"); - } - } + Random random = new Random(); - // フィールド上で代入してたためこちらへ移動。 - base.Activate(); - } + var dancerOrigindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.RUNNER}"); + if (System.IO.Directory.Exists($@"{dancerOrigindir}")) { + var dirs = System.IO.Directory.GetDirectories($@"{dancerOrigindir}"); + if (dirs.Length > 0) { + var _presetPath = (preset != null && preset.RunnerSet != null) ? $@"{dancerOrigindir}" + preset.RunnerSet[random.Next(0, preset.RunnerSet.Length)] : ""; + var path = (preset != null && System.IO.Directory.Exists(_presetPath)) + ? _presetPath + : dirs[random.Next(0, dirs.Length)]; + LoadRunnerConifg(path); - public override void DeActivate() - { - if (TJAPlayer3.ConfigIni.SimpleMode) - { - base.DeActivate(); - return; - } + Runner = TJAPlayer3.tテクスチャの生成($@"{path}{Path.DirectorySeparatorChar}Runner.png"); + } + } - for (int i = 0; i < 128; i++) - { - stRunners[i].ct進行 = null; - } - - TJAPlayer3.tDisposeSafely(ref Runner); - - base.DeActivate(); - } + // フィールド上で代入してたためこちらへ移動。 + base.Activate(); + } - public override void CreateManagedResource() - { - base.CreateManagedResource(); - } + public override void DeActivate() { + if (TJAPlayer3.ConfigIni.SimpleMode) { + base.DeActivate(); + return; + } - public override void ReleaseManagedResource() - { - base.ReleaseManagedResource(); - } + for (int i = 0; i < 128; i++) { + stRunners[i].ct進行 = null; + } - public override int Draw() - { - if (TJAPlayer3.ConfigIni.SimpleMode) - { - return base.Draw(); - } + TJAPlayer3.tDisposeSafely(ref Runner); - 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 > TJAPlayer3.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)TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[stRunners[i].nPlayer] / 18; - int Width = TJAPlayer3.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(); - } + base.DeActivate(); + } - #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; + public override void CreateManagedResource() { + base.CreateManagedResource(); + } - private CTexture Runner; + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } - private void LoadRunnerConifg(string dancerPath) - { - var _str = ""; - TJAPlayer3.Skin.LoadSkinConfigFromFile(dancerPath + @"\RunnerConfig.txt", ref _str); + public override int Draw() { + if (TJAPlayer3.ConfigIni.SimpleMode) { + return base.Draw(); + } - string[] delimiter = { "\n" }; - string[] strSingleLine = _str.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); + 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 > TJAPlayer3.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)TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[stRunners[i].nPlayer] / 18; + int Width = TJAPlayer3.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(); + } - 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; + #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; - 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[] { '=' }); + private CTexture Runner; - if (strArray.Length == 2) - { - strCommand = strArray[0].Trim(); - strParam = strArray[1].Trim(); + private void LoadRunnerConifg(string dancerPath) { + var _str = ""; + TJAPlayer3.Skin.LoadSkinConfigFromFile(dancerPath + @"\RunnerConfig.txt", ref _str); - 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]); - } - } + string[] delimiter = { "\n" }; + string[] strSingleLine = _str.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); - } - continue; - } - catch (Exception exception) - { - Trace.TraceError(exception.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (6a32cc37-1527-412e-968a-512c1f0135cd)"); - continue; - } - } - } + 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[] { '=' }); - // ランナー画像のサイズ。 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; + if (strArray.Length == 2) { + strCommand = strArray[0].Trim(); + strParam = strArray[1].Trim(); - //----------------- - #endregion - } -} \ No newline at end of file + 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 + } +} diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplScore.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplScore.cs index 3f83edfd..7f0da2dd 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplScore.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplScore.cs @@ -1,254 +1,201 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Runtime.InteropServices; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - internal class CActImplScore : CAct演奏スコア共通 - { +namespace TJAPlayer3 { + 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; + 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(); - } + 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 ) ); - } + //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) { + 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) - { - TJAPlayer3.stage演奏ドラム画面.actScore.BonusAdd(i); - 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) { + TJAPlayer3.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]; + 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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - x[i] = TJAPlayer3.Skin.Game_Score_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - y[i] = TJAPlayer3.Skin.Game_Score_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - add_x[i] = TJAPlayer3.Skin.Game_Score_Add_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - add_y[i] = TJAPlayer3.Skin.Game_Score_Add_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - addBonus_x[i] = TJAPlayer3.Skin.Game_Score_AddBonus_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); - addBonus_y[i] = TJAPlayer3.Skin.Game_Score_AddBonus_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - x[i] = TJAPlayer3.Skin.Game_Score_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - y[i] = TJAPlayer3.Skin.Game_Score_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - add_x[i] = TJAPlayer3.Skin.Game_Score_Add_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - add_y[i] = TJAPlayer3.Skin.Game_Score_Add_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - addBonus_x[i] = TJAPlayer3.Skin.Game_Score_AddBonus_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); - addBonus_y[i] = TJAPlayer3.Skin.Game_Score_AddBonus_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); - } - else - { - x[i] = TJAPlayer3.Skin.Game_Score_X[i]; - y[i] = TJAPlayer3.Skin.Game_Score_Y[i]; - add_x[i] = TJAPlayer3.Skin.Game_Score_Add_X[i]; - add_y[i] = TJAPlayer3.Skin.Game_Score_Add_Y[i]; - addBonus_x[i] = TJAPlayer3.Skin.Game_Score_AddBonus_X[i]; - addBonus_y[i] = TJAPlayer3.Skin.Game_Score_AddBonus_Y[i]; - } - } + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + x[i] = TJAPlayer3.Skin.Game_Score_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + y[i] = TJAPlayer3.Skin.Game_Score_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + add_x[i] = TJAPlayer3.Skin.Game_Score_Add_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + add_y[i] = TJAPlayer3.Skin.Game_Score_Add_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + addBonus_x[i] = TJAPlayer3.Skin.Game_Score_AddBonus_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * i); + addBonus_y[i] = TJAPlayer3.Skin.Game_Score_AddBonus_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * i); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + x[i] = TJAPlayer3.Skin.Game_Score_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + y[i] = TJAPlayer3.Skin.Game_Score_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + add_x[i] = TJAPlayer3.Skin.Game_Score_Add_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + add_y[i] = TJAPlayer3.Skin.Game_Score_Add_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + addBonus_x[i] = TJAPlayer3.Skin.Game_Score_AddBonus_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * i); + addBonus_y[i] = TJAPlayer3.Skin.Game_Score_AddBonus_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * i); + } else { + x[i] = TJAPlayer3.Skin.Game_Score_X[i]; + y[i] = TJAPlayer3.Skin.Game_Score_Y[i]; + add_x[i] = TJAPlayer3.Skin.Game_Score_Add_X[i]; + add_y[i] = TJAPlayer3.Skin.Game_Score_Add_Y[i]; + addBonus_x[i] = TJAPlayer3.Skin.Game_Score_AddBonus_X[i]; + addBonus_y[i] = TJAPlayer3.Skin.Game_Score_AddBonus_Y[i]; + } + } - //CDTXMania.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.白, this.ctボーナス加算タイマ[0].n現在の値.ToString()); + //CDTXMania.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.白, this.ctボーナス加算タイマ[0].n現在の値.ToString()); - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (i == 1 && TJAPlayer3.ConfigIni.bAIBattleMode) break; + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (i == 1 && TJAPlayer3.ConfigIni.bAIBattleMode) break; - base.t小文字表示(x[i], y[i], string.Format("{0,7:######0}", this.nCurrentlyDisplayedScore[i]), 0, 256, i); - } + 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; - TJAPlayer3.stage演奏ドラム画面.actDan.Update(); - } + 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; + TJAPlayer3.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, TJAPlayer3.Timer); - this.ct点数アニメタイマ[stScore[i].nPlayer].CurrentValue = 1; - } - else - { - this.ct点数アニメタイマ[stScore[i].nPlayer] = new CCounter(0, 11, 13, TJAPlayer3.Timer); - } - } + 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, TJAPlayer3.Timer); + this.ct点数アニメタイマ[stScore[i].nPlayer].CurrentValue = 1; + } else { + this.ct点数アニメタイマ[stScore[i].nPlayer] = new CCounter(0, 11, 13, TJAPlayer3.Timer); + } + } - int xAdd = 0; - int yAdd = 0; - int alpha = 0; + 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 < 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; - } + 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 (TJAPlayer3.PlayerSide == 1 && TJAPlayer3.ConfigIni.nPlayerCount == 1) - pl = 1; + int pl = stScore[i].nPlayer; + if (TJAPlayer3.PlayerSide == 1 && TJAPlayer3.ConfigIni.nPlayerCount == 1) + pl = 1; - if ( this.nNowDisplayedAddScore < 10 && this.stScore[ i ].bBonusScore == false && !TJAPlayer3.ConfigIni.SimpleMode) - base.t小文字表示(add_x[this.stScore[i].nPlayer] + xAdd, this.stScore[ i ].nPlayer == 0 && TJAPlayer3.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 && !TJAPlayer3.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()); - } + if (this.nNowDisplayedAddScore < 10 && this.stScore[i].bBonusScore == false && !TJAPlayer3.ConfigIni.SimpleMode) + base.t小文字表示(add_x[this.stScore[i].nPlayer] + xAdd, this.stScore[i].nPlayer == 0 && TJAPlayer3.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 && !TJAPlayer3.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; - } + } + return 0; + } } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplScoreRank.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplScoreRank.cs index 0b6df200..06bb7d84 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplScoreRank.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplScoreRank.cs @@ -1,19 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - class CActImplScoreRank : CActivity - { - public override void Activate() - { - double RollTimems = 0; +namespace TJAPlayer3 { + class CActImplScoreRank : CActivity { + public override void Activate() { + double RollTimems = 0; - /* + /* foreach (var chip in TJAPlayer3.DTX.listChip) { if (NotesManager.IsRoll(chip)) @@ -23,150 +15,127 @@ namespace TJAPlayer3 } */ - for (int player = 0; player < 5; player++) - { - this.ScoreRank[player] = new int[] { 500000, 600000, 700000, 800000, 900000, 950000, - Math.Max(1000000, (int)(TJAPlayer3.stage演奏ドラム画面.nAddScoreNiji[player] * TJAPlayer3.stage演奏ドラム画面.nNoteCount[player]) + (int)(TJAPlayer3.stage演奏ドラム画面.nBalloonCount[player] * 100) + (int)(Math.Ceiling(TJAPlayer3.stage演奏ドラム画面.nRollTimeMs[player] * 16.6 / 10) * 100 * 10)) }; + for (int player = 0; player < 5; player++) { + this.ScoreRank[player] = new int[] { 500000, 600000, 700000, 800000, 900000, 950000, + Math.Max(1000000, (int)(TJAPlayer3.stage演奏ドラム画面.nAddScoreNiji[player] * TJAPlayer3.stage演奏ドラム画面.nNoteCount[player]) + (int)(TJAPlayer3.stage演奏ドラム画面.nBalloonCount[player] * 100) + (int)(Math.Ceiling(TJAPlayer3.stage演奏ドラム画面.nRollTimeMs[player] * 16.6 / 10) * 100 * 10)) }; - for (int i = 0; i < 7; i++) - { - this.counter[player][i] = new CCounter(); - } - } - base.Activate(); - } + for (int i = 0; i < 7; i++) { + this.counter[player][i] = new CCounter(); + } + } + base.Activate(); + } - public override void DeActivate() - { - base.DeActivate(); - } + public override void DeActivate() { + base.DeActivate(); + } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { TowerResult_ScoreRankEffect = TJAPlayer3.tテクスチャの生成(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.TOWERRESULT}ScoreRankEffect.png")); - base.CreateManagedResource(); - } + base.CreateManagedResource(); + } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { TJAPlayer3.tDisposeSafely(ref TowerResult_ScoreRankEffect); - base.ReleaseManagedResource(); - } + base.ReleaseManagedResource(); + } - private void displayScoreRank(int i, int player, float x, float y, int mode = 0) - { - CCounter cct = this.counter[player][i]; + private void displayScoreRank(int i, int player, float x, float y, int mode = 0) { + CCounter cct = this.counter[player][i]; - CTexture tex = TJAPlayer3.Tx.ScoreRank; - if (mode == 1) // tower - tex = TowerResult_ScoreRankEffect; + CTexture tex = TJAPlayer3.Tx.ScoreRank; + if (mode == 1) // tower + tex = TowerResult_ScoreRankEffect; - if (tex == null) - return; + if (tex == null) + return; - if (!cct.IsTicked) - { - cct.Start(0, 3000, 1, TJAPlayer3.Timer); - } - if (cct.CurrentValue <= 255) - { - tex.Opacity = cct.CurrentValue; - x = ((cct.CurrentValue / 255.0f) - 1.0f) * (player == 0 ? -TJAPlayer3.Skin.Game_Judge_Move[0] : TJAPlayer3.Skin.Game_Judge_Move[0]); - y = ((cct.CurrentValue / 255.0f) - 1.0f) * (player == 0 ? -TJAPlayer3.Skin.Game_Judge_Move[1] : TJAPlayer3.Skin.Game_Judge_Move[1]); - } - if (cct.CurrentValue > 255 && cct.CurrentValue <= 255 + 180) - { - tex.Opacity = 255; + if (!cct.IsTicked) { + cct.Start(0, 3000, 1, TJAPlayer3.Timer); + } + if (cct.CurrentValue <= 255) { + tex.Opacity = cct.CurrentValue; + x = ((cct.CurrentValue / 255.0f) - 1.0f) * (player == 0 ? -TJAPlayer3.Skin.Game_Judge_Move[0] : TJAPlayer3.Skin.Game_Judge_Move[0]); + y = ((cct.CurrentValue / 255.0f) - 1.0f) * (player == 0 ? -TJAPlayer3.Skin.Game_Judge_Move[1] : TJAPlayer3.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 || TJAPlayer3.ConfigIni.nPlayerCount >= 2 ? -TJAPlayer3.Skin.Game_Judge_Move[0] : TJAPlayer3.Skin.Game_Judge_Move[0]); - y = ((cct.CurrentValue - 2745) / 255.0f) * (player == 0 || TJAPlayer3.ConfigIni.nPlayerCount >= 2 ? -TJAPlayer3.Skin.Game_Judge_Move[1] : TJAPlayer3.Skin.Game_Judge_Move[1]); - } + 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 || TJAPlayer3.ConfigIni.nPlayerCount >= 2 ? -TJAPlayer3.Skin.Game_Judge_Move[0] : TJAPlayer3.Skin.Game_Judge_Move[0]); + y = ((cct.CurrentValue - 2745) / 255.0f) * (player == 0 || TJAPlayer3.ConfigIni.nPlayerCount >= 2 ? -TJAPlayer3.Skin.Game_Judge_Move[1] : TJAPlayer3.Skin.Game_Judge_Move[1]); + } - var xpos = 0; - var ypos = 0; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - xpos = TJAPlayer3.Skin.Game_ScoreRank_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * player); - ypos = TJAPlayer3.Skin.Game_ScoreRank_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * player); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - xpos = TJAPlayer3.Skin.Game_ScoreRank_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * player); - ypos = TJAPlayer3.Skin.Game_ScoreRank_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * player); - } - else - { - xpos = TJAPlayer3.Skin.Game_ScoreRank_X[player]; - ypos = TJAPlayer3.Skin.Game_ScoreRank_Y[player]; - } - xpos += (int)x; - ypos += (int)y; + var xpos = 0; + var ypos = 0; + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + xpos = TJAPlayer3.Skin.Game_ScoreRank_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * player); + ypos = TJAPlayer3.Skin.Game_ScoreRank_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * player); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + xpos = TJAPlayer3.Skin.Game_ScoreRank_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * player); + ypos = TJAPlayer3.Skin.Game_ScoreRank_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * player); + } else { + xpos = TJAPlayer3.Skin.Game_ScoreRank_X[player]; + ypos = TJAPlayer3.Skin.Game_ScoreRank_Y[player]; + } + xpos += (int)x; + ypos += (int)y; - int width; - int height; + 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; - } + 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)); - } + 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 (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) - { - float x = 0; - float y = 0; + public override int Draw() { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { + float x = 0; + float y = 0; - for (int i = 0; i < 7; i++) - { - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) - { + for (int i = 0; i < 7; i++) { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) { - for (int player = 0; player < 5; player++) - { - #region [Ensou score ranks] + for (int player = 0; player < 5; player++) { + #region [Ensou score ranks] - counter[player][i].Tick(); - if (TJAPlayer3.stage演奏ドラム画面.actScore.GetScore(player) >= ScoreRank[player][i]) - { - displayScoreRank(i, player, x, y); + counter[player][i].Tick(); + if (TJAPlayer3.stage演奏ドラム画面.actScore.GetScore(player) >= ScoreRank[player][i]) { + displayScoreRank(i, player, x, y); - #region [Legacy] + #region [Legacy] - /* + /* if (!this.counter[i].b進行中) { this.counter[i].t開始(0, 3000, 1, TJAPlayer3.Timer); @@ -199,68 +168,64 @@ namespace TJAPlayer3 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 - } + #endregion + } - x = 0; - } - #endregion - } - else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - { - #region [Tower score ranks] + x = 0; + } + #endregion + } else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + #region [Tower score ranks] - double progress = CFloorManagement.LastRegisteredFloor / ((double)TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor); + double progress = CFloorManagement.LastRegisteredFloor / ((double)TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor); - bool[] conditions = - { - progress >= 0.1, - progress >= 0.25, - progress >= 0.5, - progress >= 0.75, - progress == 1 && CFloorManagement.CurrentNumberOfLives > 0, - TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMine == 0, - TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nGood == 0 - }; + bool[] conditions = + { + progress >= 0.1, + progress >= 0.25, + progress >= 0.5, + progress >= 0.75, + progress == 1 && CFloorManagement.CurrentNumberOfLives > 0, + TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMine == 0, + TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nGood == 0 + }; - counter[0][i].Tick(); + counter[0][i].Tick(); - bool satisfied = true; - for (int j = 0; j <= i; j++) - if (conditions[j] == false) - { - satisfied = false; - break; - } - + 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 - } - } - - - } + if (satisfied == true) { + displayScoreRank(i, 0, x, y, 1); + } - //TJAPlayer3.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.白, ScoreRank[6].ToString()); - //TJAPlayer3.act文字コンソール.tPrint(0, 10, C文字コンソール.Eフォント種別.白, ScoreRank2P[6].ToString()); + #endregion + } + } - 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] - }; - } + //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 7eabc9eb..1c7afa2c 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplTrainingMode.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplTrainingMode.cs @@ -1,23 +1,13 @@ -using FDK; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Diagnostics; -using System.Drawing; +using System.Drawing; +using FDK; -namespace TJAPlayer3 -{ - class CActImplTrainingMode : CActivity - { - public CActImplTrainingMode() - { +namespace TJAPlayer3 { + class CActImplTrainingMode : CActivity { + public CActImplTrainingMode() { base.IsDeActivated = true; } - public override void Activate() - { + public override void Activate() { this.nCurrentMeasure = 0; this.bTrainingPAUSE = false; this.n最終演奏位置ms = 0; @@ -32,18 +22,14 @@ namespace TJAPlayer3 int endtime = 1; int bgmlength = 1; - for (int index = 0; index < TJAPlayer3.DTX.listChip.Count; index++) - { - if (TJAPlayer3.DTX.listChip[index].nチャンネル番号 == 0xff) - { + for (int index = 0; index < TJAPlayer3.DTX.listChip.Count; index++) { + if (TJAPlayer3.DTX.listChip[index].nチャンネル番号 == 0xff) { endtime = TJAPlayer3.DTX.listChip[index].n発声時刻ms; break; } } - for (int index = 0; index < TJAPlayer3.DTX.listChip.Count; index++) - { - if (TJAPlayer3.DTX.listChip[index].nチャンネル番号 == 0x01) - { + for (int index = 0; index < TJAPlayer3.DTX.listChip.Count; index++) { + if (TJAPlayer3.DTX.listChip[index].nチャンネル番号 == 0x01) { bgmlength = TJAPlayer3.DTX.listChip[index].GetDuration() + TJAPlayer3.DTX.listChip[index].n発声時刻ms; break; } @@ -54,14 +40,12 @@ namespace TJAPlayer3 gogoXList = new List(); JumpPointList = new List(); - for (int i = 0; i < dTX.listChip.Count; i++) - { + 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) - { + if (pChip.nチャンネル番号 == 0x9E && !bIsInGoGo) { bIsInGoGo = true; var current = ((double)(pChip.db発声時刻ms * TJAPlayer3.ConfigIni.SongPlaybackSpeed)); @@ -70,19 +54,17 @@ namespace TJAPlayer3 this.gogoXList.Add((int)(width * (current / length))); } - if (pChip.nチャンネル番号 == 0x9F && bIsInGoGo) - { + if (pChip.nチャンネル番号 == 0x9F && bIsInGoGo) { bIsInGoGo = false; } } this.nMeasureCount = measureCount; - + if (TJAPlayer3.Tx.Tokkun_Background_Up != null) this.ctBackgroundScrollTimer = new CCounter(1, TJAPlayer3.Tx.Tokkun_Background_Up.szTextureSize.Width, 16, TJAPlayer3.Timer); } - public override void DeActivate() - { + public override void DeActivate() { length = 1; gogoXList = null; JumpPointList = null; @@ -92,44 +74,33 @@ namespace TJAPlayer3 base.DeActivate(); } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { base.ReleaseManagedResource(); } - public override int Draw() - { - if (!base.IsDeActivated) - { - if (base.IsFirstDraw) - { + public override int Draw() { + if (!base.IsDeActivated) { + if (base.IsFirstDraw) { base.IsFirstDraw = false; } TJAPlayer3.actTextConsole.tPrint(0, 0, CTextConsole.EFontType.White, "TRAINING MODE (BETA)"); - if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingPause)) - { - if (this.bTrainingPAUSE) - { + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingPause)) { + if (this.bTrainingPAUSE) { TJAPlayer3.Skin.sound特訓再生音.tPlay(); this.tResumePlay(); - } - else - { + } else { TJAPlayer3.Skin.sound特訓停止音.tPlay(); this.tPausePlay(); } } - if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingSkipForwardMeasure)) - { - if (this.bTrainingPAUSE) - { + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingSkipForwardMeasure)) { + if (this.bTrainingPAUSE) { this.nCurrentMeasure += TJAPlayer3.ConfigIni.TokkunSkipMeasures; if (this.nCurrentMeasure > this.nMeasureCount) this.nCurrentMeasure = this.nMeasureCount; @@ -140,10 +111,8 @@ namespace TJAPlayer3 TJAPlayer3.Skin.soundTrainingModeScrollSFX.tPlay(); } } - if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingSkipBackMeasure)) - { - if (this.bTrainingPAUSE) - { + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingSkipBackMeasure)) { + if (this.bTrainingPAUSE) { this.nCurrentMeasure -= TJAPlayer3.ConfigIni.TokkunSkipMeasures; if (this.nCurrentMeasure <= 0) this.nCurrentMeasure = 1; @@ -154,24 +123,18 @@ namespace TJAPlayer3 TJAPlayer3.Skin.soundTrainingModeScrollSFX.tPlay(); } } - if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingMoveForwardMeasure)) - { - if (this.bTrainingPAUSE) - { - if (this.nCurrentMeasure < this.nMeasureCount) - { + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingMoveForwardMeasure)) { + if (this.bTrainingPAUSE) { + if (this.nCurrentMeasure < this.nMeasureCount) { this.nCurrentMeasure++; TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; this.tMatchWithTheChartDisplayPosition(true); TJAPlayer3.Skin.soundTrainingModeScrollSFX.tPlay(); } - if (t配列の値interval以下か(ref this.RBlue, SoundManager.PlayTimer.SystemTimeMs, TJAPlayer3.ConfigIni.TokkunMashInterval)) - { - for (int index = 0; index < this.JumpPointList.Count; index++) - { - if (this.JumpPointList[index].Time >= SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed) - { + if (t配列の値interval以下か(ref this.RBlue, SoundManager.PlayTimer.SystemTimeMs, TJAPlayer3.ConfigIni.TokkunMashInterval)) { + for (int index = 0; index < this.JumpPointList.Count; index++) { + if (this.JumpPointList[index].Time >= SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed) { this.nCurrentMeasure = this.JumpPointList[index].Measure; TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; TJAPlayer3.Skin.soundSkip.tPlay(); @@ -183,24 +146,18 @@ namespace TJAPlayer3 } } - if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingMoveBackMeasure)) - { - if (this.bTrainingPAUSE) - { - if (this.nCurrentMeasure > 1) - { + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingMoveBackMeasure)) { + if (this.bTrainingPAUSE) { + if (this.nCurrentMeasure > 1) { this.nCurrentMeasure--; TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; this.tMatchWithTheChartDisplayPosition(true); TJAPlayer3.Skin.soundTrainingModeScrollSFX.tPlay(); } - if (t配列の値interval以下か(ref this.LBlue, SoundManager.PlayTimer.SystemTimeMs, TJAPlayer3.ConfigIni.TokkunMashInterval)) - { - for (int index = this.JumpPointList.Count - 1; index >= 0; index--) - { - if (this.JumpPointList[index].Time <= SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed) - { + if (t配列の値interval以下か(ref this.LBlue, SoundManager.PlayTimer.SystemTimeMs, TJAPlayer3.ConfigIni.TokkunMashInterval)) { + for (int index = this.JumpPointList.Count - 1; index >= 0; index--) { + if (this.JumpPointList[index].Time <= SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed) { this.nCurrentMeasure = this.JumpPointList[index].Measure; TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; TJAPlayer3.Skin.sound特訓スキップ音.tPlay(); @@ -211,34 +168,25 @@ namespace TJAPlayer3 } } } - if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingDecreaseSongSpeed)) - { - if (this.bTrainingPAUSE) - { - if (TJAPlayer3.ConfigIni.nSongSpeed > 6) - { + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingDecreaseSongSpeed)) { + if (this.bTrainingPAUSE) { + if (TJAPlayer3.ConfigIni.nSongSpeed > 6) { TJAPlayer3.ConfigIni.nSongSpeed = TJAPlayer3.ConfigIni.nSongSpeed - 2; this.tMatchWithTheChartDisplayPosition(false); } } } - if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingIncreaseSongSpeed)) - { - if (this.bTrainingPAUSE) - { - if (TJAPlayer3.ConfigIni.nSongSpeed < 399) - { + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingIncreaseSongSpeed)) { + if (this.bTrainingPAUSE) { + if (TJAPlayer3.ConfigIni.nSongSpeed < 399) { TJAPlayer3.ConfigIni.nSongSpeed = TJAPlayer3.ConfigIni.nSongSpeed + 2; this.tMatchWithTheChartDisplayPosition(false); } } } - if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingJumpToFirstMeasure)) - { - if (this.bTrainingPAUSE) - { - if (this.nCurrentMeasure > 1) - { + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingJumpToFirstMeasure)) { + if (this.bTrainingPAUSE) { + if (this.nCurrentMeasure > 1) { this.nCurrentMeasure = 1; TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; @@ -247,12 +195,9 @@ namespace TJAPlayer3 } } } - if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingJumpToLastMeasure)) - { - if (this.bTrainingPAUSE) - { - if (this.nCurrentMeasure < this.nMeasureCount) - { + if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingJumpToLastMeasure)) { + if (this.bTrainingPAUSE) { + if (this.nCurrentMeasure < this.nMeasureCount) { this.nCurrentMeasure = this.nMeasureCount; TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; @@ -264,27 +209,22 @@ namespace TJAPlayer3 if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.Drums.TrainingBookmark)) this.tToggleBookmarkAtTheCurrentPosition(); - if (this.bCurrentlyScrolling) - { + 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) - { + if ((int)SoundManager.PlayTimer.NowTimeMs == (int)this.nスクロール後ms) { this.bCurrentlyScrolling = false; SoundManager.PlayTimer.NowTimeMs = this.nスクロール後ms; } } - if (!this.bTrainingPAUSE) - { - if (this.nCurrentMeasure < TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0]) - { + if (!this.bTrainingPAUSE) { + if (this.nCurrentMeasure < TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0]) { this.nCurrentMeasure = TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0]; } - if (SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed > this.n最終演奏位置ms) - { + if (SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed > this.n最終演奏位置ms) { this.n最終演奏位置ms = (long)(SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed); } } @@ -299,18 +239,14 @@ namespace TJAPlayer3 if (TJAPlayer3.Tx.Tokkun_ProgressBarWhite != null) TJAPlayer3.Tx.Tokkun_ProgressBarWhite.t2D描画(TJAPlayer3.Skin.Game_Training_ProgressBar_XY[0], TJAPlayer3.Skin.Game_Training_ProgressBar_XY[1], new Rectangle(1, 1, (int)(TJAPlayer3.Tx.Tokkun_ProgressBarWhite.szTextureSize.Width * percentageWhite), TJAPlayer3.Tx.Tokkun_ProgressBarWhite.szTextureSize.Height)); if (TJAPlayer3.Tx.Tokkun_ProgressBar != null) TJAPlayer3.Tx.Tokkun_ProgressBar.t2D描画(TJAPlayer3.Skin.Game_Training_ProgressBar_XY[0], TJAPlayer3.Skin.Game_Training_ProgressBar_XY[1], new Rectangle(1, 1, (int)(TJAPlayer3.Tx.Tokkun_ProgressBar.szTextureSize.Width * percentage), TJAPlayer3.Tx.Tokkun_ProgressBar.szTextureSize.Height)); - if (TJAPlayer3.Tx.Tokkun_GoGoPoint != null) - { - foreach (int xpos in gogoXList) - { + if (TJAPlayer3.Tx.Tokkun_GoGoPoint != null) { + foreach (int xpos in gogoXList) { TJAPlayer3.Tx.Tokkun_GoGoPoint.t2D描画(xpos + TJAPlayer3.Skin.Game_Training_ProgressBar_XY[0] - (TJAPlayer3.Tx.Tokkun_GoGoPoint.szTextureSize.Width / 2), TJAPlayer3.Skin.Game_Training_GoGoPoint_Y); } } - if (TJAPlayer3.Tx.Tokkun_JumpPoint != null) - { - foreach (STJUMPP xpos in JumpPointList) - { + if (TJAPlayer3.Tx.Tokkun_JumpPoint != null) { + foreach (STJUMPP xpos in JumpPointList) { var width = 0; if (TJAPlayer3.Tx.Tokkun_ProgressBar != null) width = TJAPlayer3.Tx.Tokkun_ProgressBar.szTextureSize.Width; @@ -322,18 +258,15 @@ namespace TJAPlayer3 return base.Draw(); } - public int On進行描画_背景() - { - if (this.ctBackgroundScrollTimer != null) - { + public int On進行描画_背景() { + if (this.ctBackgroundScrollTimer != null) { this.ctBackgroundScrollTimer.TickLoop(); double TexSize = TJAPlayer3.Skin.Resolution[0] / TJAPlayer3.Tx.Tokkun_Background_Up.szTextureSize.Width; // 1280をテクスチャサイズで割ったものを切り上げて、プラス+1足す。 int ForLoop = (int)Math.Ceiling(TexSize) + 1; TJAPlayer3.Tx.Tokkun_Background_Up.t2D描画(0 - this.ctBackgroundScrollTimer.CurrentValue, TJAPlayer3.Skin.Background_Scroll_Y[0]); - for (int l = 1; l < ForLoop + 1; l++) - { + for (int l = 1; l < ForLoop + 1; l++) { TJAPlayer3.Tx.Tokkun_Background_Up.t2D描画(+(l * TJAPlayer3.Tx.Tokkun_Background_Up.szTextureSize.Width) - this.ctBackgroundScrollTimer.CurrentValue, TJAPlayer3.Skin.Background_Scroll_Y[0]); } } @@ -344,17 +277,14 @@ namespace TJAPlayer3 return base.Draw(); } - public void On進行描画_小節_速度() - { + public void On進行描画_小節_速度() { if (TJAPlayer3.Tx.Tokkun_Speed_Measure != null) TJAPlayer3.Tx.Tokkun_Speed_Measure.t2D描画(TJAPlayer3.Skin.Game_Training_Speed_Measure[0], TJAPlayer3.Skin.Game_Training_Speed_Measure[1]); var maxMeasureStr = this.nMeasureCount.ToString(); var measureStr = TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0].ToString(); - if (TJAPlayer3.Tx.Tokkun_SmallNumber != null) - { + if (TJAPlayer3.Tx.Tokkun_SmallNumber != null) { var x = TJAPlayer3.Skin.Game_Training_MaxMeasureCount_XY[0]; - foreach (char c in maxMeasureStr) - { + foreach (char c in maxMeasureStr) { var currentNum = int.Parse(c.ToString()); TJAPlayer3.Tx.Tokkun_SmallNumber.t2D描画(x, TJAPlayer3.Skin.Game_Training_MaxMeasureCount_XY[1], new Rectangle(TJAPlayer3.Skin.Game_Training_SmallNumber_Width * currentNum, 0, TJAPlayer3.Skin.Game_Training_SmallNumber_Width, TJAPlayer3.Tx.Tokkun_SmallNumber.szTextureSize.Height)); x += TJAPlayer3.Skin.Game_Training_SmallNumber_Width - 2; @@ -363,11 +293,9 @@ namespace TJAPlayer3 var subtractVal = (TJAPlayer3.Skin.Game_Training_BigNumber_Width - 2) * (measureStr.Length - 1); - if (TJAPlayer3.Tx.Tokkun_BigNumber != null) - { + if (TJAPlayer3.Tx.Tokkun_BigNumber != null) { var x = TJAPlayer3.Skin.Game_Training_CurrentMeasureCount_XY[0]; - foreach (char c in measureStr) - { + foreach (char c in measureStr) { var currentNum = int.Parse(c.ToString()); TJAPlayer3.Tx.Tokkun_BigNumber.t2D描画(x - subtractVal, TJAPlayer3.Skin.Game_Training_CurrentMeasureCount_XY[1], new Rectangle(TJAPlayer3.Skin.Game_Training_BigNumber_Width * currentNum, 0, TJAPlayer3.Skin.Game_Training_BigNumber_Width, TJAPlayer3.Tx.Tokkun_BigNumber.szTextureSize.Height)); x += TJAPlayer3.Skin.Game_Training_BigNumber_Width - 2; @@ -387,8 +315,7 @@ namespace TJAPlayer3 subtractVal = TJAPlayer3.Skin.Game_Training_BigNumber_Width * (((int)playSpd).ToString().Length - 1); - foreach (char c in ((int)playSpd).ToString()) - { + foreach (char c in ((int)playSpd).ToString()) { var currentNum = int.Parse(c.ToString()); TJAPlayer3.Tx.Tokkun_BigNumber.t2D描画(x - subtractVal, TJAPlayer3.Skin.Game_Training_SpeedDisplay_XY[1], new Rectangle(TJAPlayer3.Skin.Game_Training_BigNumber_Width * currentNum, 0, TJAPlayer3.Skin.Game_Training_BigNumber_Width, TJAPlayer3.Tx.Tokkun_BigNumber.szTextureSize.Height)); x += TJAPlayer3.Skin.Game_Training_BigNumber_Width - 2; @@ -396,8 +323,7 @@ namespace TJAPlayer3 } } - public void tPausePlay() - { + public void tPausePlay() { CDTX dTX = TJAPlayer3.DTX; this.nスクロール後ms = SoundManager.PlayTimer.NowTimeMs; @@ -405,12 +331,10 @@ namespace TJAPlayer3 TJAPlayer3.stage演奏ドラム画面.Activate(); SoundManager.PlayTimer.Pause(); - for (int i = 0; i < dTX.listChip.Count; i++) - { + for (int i = 0; i < dTX.listChip.Count; i++) { CDTX.CChip pChip = dTX.listChip[i]; pChip.bHit = false; - if (dTX.listChip[i].nチャンネル番号 != 0x50) - { + if (dTX.listChip[i].nチャンネル番号 != 0x50) { pChip.bShow = true; pChip.b可視 = true; } @@ -424,8 +348,7 @@ namespace TJAPlayer3 this.tMatchWithTheChartDisplayPosition(false); } - public void tResumePlay() - { + public void tResumePlay() { CDTX dTX = TJAPlayer3.DTX; this.bCurrentlyScrolling = false; @@ -446,90 +369,74 @@ namespace TJAPlayer3 TJAPlayer3.stage演奏ドラム画面.t数値の初期化(true, true); TJAPlayer3.stage演奏ドラム画面.Activate(); - for (int i = 0; i < dTX.listChip.Count; i++) - { - + 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])) - { + 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) - { + 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) - { + 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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { TJAPlayer3.stage演奏ドラム画面.chip現在処理中の連打チップ[i] = null; } this.bTrainingPAUSE = false; } - public void tMatchWithTheChartDisplayPosition(bool doScroll) - { + public void tMatchWithTheChartDisplayPosition(bool doScroll) { this.nスクロール前ms = SoundManager.PlayTimer.NowTimeMs; CDTX dTX = TJAPlayer3.DTX; bool bSuccessSeek = false; - for (int i = 0; i < dTX.listChip.Count; i++) - { + for (int i = 0; i < dTX.listChip.Count; i++) { CDTX.CChip pChip = dTX.listChip[i]; - if (pChip.nチャンネル番号 == 0x50 && pChip.n整数値_内部番号 > nCurrentMeasure - 1) - { + if (pChip.nチャンネル番号 == 0x50 && pChip.n整数値_内部番号 > nCurrentMeasure - 1) { bSuccessSeek = true; TJAPlayer3.stage演奏ドラム画面.n現在のトップChip = i; break; } } - if (!bSuccessSeek) - { + if (!bSuccessSeek) { TJAPlayer3.stage演奏ドラム画面.n現在のトップChip = 0; - } - else - { + } else { while (dTX.listChip[TJAPlayer3.stage演奏ドラム画面.n現在のトップChip].n発声時刻ms == dTX.listChip[TJAPlayer3.stage演奏ドラム画面.n現在のトップChip - 1].n発声時刻ms && TJAPlayer3.stage演奏ドラム画面.n現在のトップChip != 0) TJAPlayer3.stage演奏ドラム画面.n現在のトップChip--; } - if (doScroll) - { + if (doScroll) { this.nスクロール後ms = (long)(dTX.listChip[TJAPlayer3.stage演奏ドラム画面.n現在のトップChip].n発声時刻ms / TJAPlayer3.ConfigIni.SongPlaybackSpeed); this.bCurrentlyScrolling = true; this.ctScrollCounter = new CCounter(0, TJAPlayer3.Skin.Game_Training_ScrollTime, 1, TJAPlayer3.Timer); - } - else - { + } else { SoundManager.PlayTimer.NowTimeMs = (long)(dTX.listChip[TJAPlayer3.stage演奏ドラム画面.n現在のトップChip].n発声時刻ms / TJAPlayer3.ConfigIni.SongPlaybackSpeed); this.nスクロール後ms = SoundManager.PlayTimer.NowTimeMs; } } - public void tToggleBookmarkAtTheCurrentPosition() - { - if (!this.bCurrentlyScrolling && this.bTrainingPAUSE) - { + public void tToggleBookmarkAtTheCurrentPosition() { + if (!this.bCurrentlyScrolling && this.bTrainingPAUSE) { STJUMPP _JumpPoint = new STJUMPP() { Time = (long)(SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed), Measure = this.nCurrentMeasure }; - if (!JumpPointList.Contains(_JumpPoint)) - JumpPointList.Add(_JumpPoint); + if (!JumpPointList.Contains(_JumpPoint)) + JumpPointList.Add(_JumpPoint); else JumpPointList.Remove(_JumpPoint); TJAPlayer3.Skin.soundTrainingToggleBookmarkSFX.tPlay(); @@ -537,11 +444,9 @@ namespace TJAPlayer3 } } - private bool t配列の値interval以下か(ref long[] array, long num, int interval) - { + private bool t配列の値interval以下か(ref long[] array, long num, int interval) { long[] arraytmp = array; - for (int index = 0; index < (array.Length - 1); index++) - { + for (int index = 0; index < (array.Length - 1); index++) { array[index] = array[index + 1]; } array[array.Length - 1] = num; @@ -569,8 +474,7 @@ namespace TJAPlayer3 private long[] LBlue = new long[] { 0, 0, 0, 0, 0 }; private long[] RBlue = new long[] { 0, 0, 0, 0, 0 }; - private struct STJUMPP - { + private struct STJUMPP { public long Time; public int Measure; } @@ -583,15 +487,13 @@ namespace TJAPlayer3 /// 最終の値-最初の値 /// 全体の時間 /// - private int EasingCircular(int time, int begin, int change, int duration) - { + 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 - { + else { t = t - 2; return (int)(c / 2 * (Math.Sqrt(1 - t * t) + 1) + b); } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CAct演奏Drumsゲームモード.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CAct演奏Drumsゲームモード.cs index 04e5b95a..b31b939a 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CAct演奏Drumsゲームモード.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CAct演奏Drumsゲームモード.cs @@ -1,487 +1,454 @@ -using System; -using System.Drawing; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; using FDK; - -using Rectangle = System.Drawing.Rectangle; using Point = System.Drawing.Point; -using Color = System.Drawing.Color; +using Rectangle = System.Drawing.Rectangle; -namespace TJAPlayer3 -{ - internal class CAct演奏Drumsゲームモード : CActivity - { - /// - /// 現時点では「完走!叩ききりまショー!」のみ。 - /// - /// - public CAct演奏Drumsゲームモード() - { - this.IsDeActivated = true; - } - - //叩ききりまショー! - //<ルール> - //_某DAMのやつに似てるやつ。 - //_演奏可能な残り時間が減っていく。 - //_複数の項目に対して、一定の条件をクリアしていって延命させていく。 - //_タイマーが0になったらSTAGE FAILED。 - // - //判定要素 - //_精度 - //_ミス数 - //_ズレ時間 - //_最大コンボ数 - //その他諸々 +namespace TJAPlayer3 { + internal class CAct演奏Drumsゲームモード : CActivity { + /// + /// 現時点では「完走!叩ききりまショー!」のみ。 + /// + /// + public CAct演奏Drumsゲームモード() { + this.IsDeActivated = true; + } - 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タイマー針; + //叩ききりまショー! + //<ルール> + //_某DAMのやつに似てるやつ。 + //_演奏可能な残り時間が減っていく。 + //_複数の項目に対して、一定の条件をクリアしていって延命させていく。 + //_タイマーが0になったらSTAGE FAILED。 + // + //判定要素 + //_精度 + //_ミス数 + //_ズレ時間 + //_最大コンボ数 + //その他諸々 - [StructLayout(LayoutKind.Sequential)] - private struct STボーナス - { - public double ret; - public double point; - public STボーナス( double ret, double point ) - { - this.ret = ret; - this.point = point; - } - } + 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 STボーナス[] 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; + } + } - private STボーナス[] n全体精度ボーナス; - private STボーナス[] n全体最大ズレ時間ボーナス; - private STボーナス[] n全体コンボ率ボーナス; - private STボーナス[] n全体ミス率ボーナス; - private int n加算時間; + private STボーナス[] n精度ボーナス; + private STボーナス[] n最大ズレ時間ボーナス; + private STボーナス[] n最小ズレ時間ボーナス; + private STボーナス[] nコンボ率ボーナス; + private STボーナス[] nミス率ボーナス; - public void t叩ききりまショー_初期化() - { - this.st叩ききりまショー = new ST叩ききりまショー(); - this.n演奏時間 = ( TJAPlayer3.DTX.listChip.Count > 0 ) ? TJAPlayer3.DTX.listChip[ TJAPlayer3.DTX.listChip.Count - 1 ].n発声時刻ms : 0; - this.st叩ききりまショー.ct残り時間 = new CCounter( 0, 25000, 1, TJAPlayer3.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; + private STボーナス[] n全体精度ボーナス; + private STボーナス[] n全体最大ズレ時間ボーナス; + private STボーナス[] n全体コンボ率ボーナス; + private STボーナス[] n全体ミス率ボーナス; + private int n加算時間; - 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, TJAPlayer3.Timer ); + public void t叩ききりまショー_初期化() { + this.st叩ききりまショー = new ST叩ききりまショー(); + this.n演奏時間 = (TJAPlayer3.DTX.listChip.Count > 0) ? TJAPlayer3.DTX.listChip[TJAPlayer3.DTX.listChip.Count - 1].n発声時刻ms : 0; + this.st叩ききりまショー.ct残り時間 = new CCounter(0, 25000, 1, TJAPlayer3.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.t叩ききりまショー_判定項目と難易度を決める(); - } + 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; - public void t叩ききりまショー_判定項目と難易度を決める() - { - //まず通常、激辛時でわける。 - if( TJAPlayer3.ConfigIni.eGameMode == EGame.完走叩ききりまショー ) - { - #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.st叩ききりまショー.ct針アニメ = new CCounter(0, 1000, 1, TJAPlayer3.Timer); - 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( TJAPlayer3.ConfigIni.eGameMode == EGame.完走叩ききりまショー激辛 ) - { - #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.t叩ききりまショー_判定項目と難易度を決める(); + } - 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 ), - }; + public void t叩ききりまショー_判定項目と難易度を決める() { + //まず通常、激辛時でわける。 + if (TJAPlayer3.ConfigIni.eGameMode == EGame.完走叩ききりまショー) { + #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 ) + }; - //★10の場合超激辛モードになる。 - if( TJAPlayer3.DTX.LEVELtaiko[ TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]] >= 10 ) - { - #region[ 超激辛 ] - this.st叩ききりまショー.b超激辛 = true; + 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 (TJAPlayer3.ConfigIni.eGameMode == EGame.完走叩ききりまショー激辛) { + #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, 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ボーナス( 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 ), + }; - 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 ) - }; + //★10の場合超激辛モードになる。 + if (TJAPlayer3.DTX.LEVELtaiko[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]] >= 10) { + #region[ 超激辛 ] + this.st叩ききりまショー.b超激辛 = true; - 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 - } + 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 ) + }; - if( TJAPlayer3.ConfigIni.bSuperHard ) - { - #region[ 超激辛 ] - this.st叩ききりまショー.b超激辛 = true; + 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ボーナス( 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ボーナス( 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 + } - 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 ) - }; + if (TJAPlayer3.ConfigIni.bSuperHard) { + #region[ 超激辛 ] + this.st叩ききりまショー.b超激辛 = true; - 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精度ボーナス = 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 ) + }; - 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(); - } + 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 ) + }; - 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(); - } + 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 + } + } - public override int Draw() - { - if( TJAPlayer3.ConfigIni.eGameMode == EGame.完走叩ききりまショー || TJAPlayer3.ConfigIni.eGameMode == EGame.完走叩ききりまショー激辛 ) - { - //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現在の値; - //} + 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 (TJAPlayer3.ConfigIni.eGameMode == EGame.完走叩ききりまショー || TJAPlayer3.ConfigIni.eGameMode == EGame.完走叩ききりまショー激辛) { + //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 (!TJAPlayer3.stage演奏ドラム画面.r検索範囲内にチップがあるか調べる((long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed), 0, 5000, 0) || this.st叩ききりまショー.b加算アニメ中 == true) - { - this.st叩ききりまショー.bタイマー使用中 = false; - this.st叩ききりまショー.ct残り時間.Stop(); - } - } - } + //if( !this.st叩ききりまショー.ct残り時間.b停止中 ) + if (this.st叩ききりまショー.bタイマー使用中) { + if (!this.st叩ききりまショー.ct残り時間.IsStoped || this.st叩ききりまショー.b加算アニメ中 == true) { + this.st叩ききりまショー.ct残り時間.Tick(); + if (!TJAPlayer3.stage演奏ドラム画面.r検索範囲内にチップがあるか調べる((long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.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 && ( TJAPlayer3.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, TJAPlayer3.Timer ); - this.st叩ききりまショー.ct針アニメ = new CCounter( 0, 1000, 1, TJAPlayer3.Timer ); - this.st叩ききりまショー.ct残り時間.CurrentValue = nCount; - } + if (!this.st叩ききりまショー.bタイマー使用中 && this.st叩ききりまショー.b加算アニメ中 == false) { + if ((this.st叩ききりまショー.b最初のチップが叩かれた == true && (TJAPlayer3.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, TJAPlayer3.Timer); + this.st叩ききりまショー.ct針アニメ = new CCounter(0, 1000, 1, TJAPlayer3.Timer); + this.st叩ききりまショー.ct残り時間.CurrentValue = nCount; + } - } + } - if( ( this.st叩ききりまショー.ct残り時間.CurrentValue >= 20000 ) && this.st叩ききりまショー.ct残り時間.CurrentValue != 25000 ) - this.t叩ききりまショー_評価をして残り時間を延長する(); + if ((this.st叩ききりまショー.ct残り時間.CurrentValue >= 20000) && this.st叩ききりまショー.ct残り時間.CurrentValue != 25000) + this.t叩ききりまショー_評価をして残り時間を延長する(); - if( TJAPlayer3.Tx.Tile_Black != null ) - { - if( this.st叩ききりまショー.ct残り時間.CurrentValue >= 22000 && this.st叩ききりまショー.ct残り時間.CurrentValue < 23000 ) - TJAPlayer3.Tx.Tile_Black.Opacity = 64; - else if( this.st叩ききりまショー.ct残り時間.CurrentValue >= 23000 && this.st叩ききりまショー.ct残り時間.CurrentValue < 24000 ) - TJAPlayer3.Tx.Tile_Black.Opacity = 128; - else if( this.st叩ききりまショー.ct残り時間.CurrentValue >= 24000 ) - TJAPlayer3.Tx.Tile_Black.Opacity = 192; - else - TJAPlayer3.Tx.Tile_Black.Opacity = 0; + if (TJAPlayer3.Tx.Tile_Black != null) { + if (this.st叩ききりまショー.ct残り時間.CurrentValue >= 22000 && this.st叩ききりまショー.ct残り時間.CurrentValue < 23000) + TJAPlayer3.Tx.Tile_Black.Opacity = 64; + else if (this.st叩ききりまショー.ct残り時間.CurrentValue >= 23000 && this.st叩ききりまショー.ct残り時間.CurrentValue < 24000) + TJAPlayer3.Tx.Tile_Black.Opacity = 128; + else if (this.st叩ききりまショー.ct残り時間.CurrentValue >= 24000) + TJAPlayer3.Tx.Tile_Black.Opacity = 192; + else + TJAPlayer3.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++) - { - TJAPlayer3.Tx.Tile_Black.t2D描画(i * 64, j * 64); - } - } - } + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / 64); i++) { + for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / 64); j++) { + TJAPlayer3.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() ); + //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(TJAPlayer3.Tx.Taiko_Combo != null ) - { - if (TJAPlayer3.Tx.GameMode_Timer_Frame != null) - TJAPlayer3.Tx.GameMode_Timer_Frame.t2D描画( 230, 84 ); - this.st叩ききりまショー.ct針アニメ.TickLoop(); + #region[ 残り時間描画 ] + if (TJAPlayer3.Tx.Taiko_Combo != null) { + if (TJAPlayer3.Tx.GameMode_Timer_Frame != null) + TJAPlayer3.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延長アニメ速度 ) ); + 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最初のチップが叩かれた ) { @@ -496,383 +463,323 @@ namespace TJAPlayer3 TJAPlayer3.Tx.GameMode_Timer_Tick?.t3D描画( mat ); */ - string str表示する残り時間 = ( this.st叩ききりまショー.ct残り時間.CurrentValue < 1000 ) ? "25" : ( ( 26000 - this.st叩ききりまショー.ct残り時間.CurrentValue ) / 1000 ).ToString(); - - if (TJAPlayer3.Tx.GameMode_Timer_Frame != null) - this.t小文字表示( 230 + (str表示する残り時間.Length * TJAPlayer3.Skin.Game_Taiko_Combo_Size[0] / 4 ), 84 + TJAPlayer3.Tx.GameMode_Timer_Frame.szTextureSize.Height / 2 , string.Format("{0,2:#0}", str表示する残り時間 )); - } + string str表示する残り時間 = (this.st叩ききりまショー.ct残り時間.CurrentValue < 1000) ? "25" : ((26000 - this.st叩ききりまショー.ct残り時間.CurrentValue) / 1000).ToString(); - 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; - } + if (TJAPlayer3.Tx.GameMode_Timer_Frame != null) + this.t小文字表示(230 + (str表示する残り時間.Length * TJAPlayer3.Skin.Game_Taiko_Combo_Size[0] / 4), 84 + TJAPlayer3.Tx.GameMode_Timer_Frame.szTextureSize.Height / 2, string.Format("{0,2:#0}", str表示する残り時間)); + } - private void t叩ききりまショー_評価をして残り時間を延長する() - { - double n延長する時間 = 0; + 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; + } - //最後に延長した時刻から11秒経過していなければ延長を行わない。 - if (this.n最後に時間延長した時刻 + 11000 <= (SoundManager.PlayTimer.NowTime * TJAPlayer3.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; - } - } - } + private void t叩ききりまショー_評価をして残り時間を延長する() { + double n延長する時間 = 0; - //-ラグ時間 - #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; - } - } - } + //最後に延長した時刻から11秒経過していなければ延長を行わない。 + if (this.n最後に時間延長した時刻 + 11000 <= (SoundManager.PlayTimer.NowTime * TJAPlayer3.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; + } + } + } - 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; - } - } - } + //-ラグ時間 + #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; + } + } + } - 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( TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect != 0 || TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great != 0 ) - { - double db全体精度 = ( (double) ( TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect + TJAPlayer3.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; - } - } - } + 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; + } + } + } - //-ラグ時間 - #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( TJAPlayer3.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[0] != 0 ) - { - double db全体コンボ率 = ( (double)TJAPlayer3.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)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 (TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect != 0 || TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great != 0) { + double db全体精度 = ((double)(TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect + TJAPlayer3.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; + } + } + } - double db全体ミス率 = ( ( (double)TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Poor + TJAPlayer3.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 + //-ラグ時間 + #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 (TJAPlayer3.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[0] != 0) { + double db全体コンボ率 = ((double)TJAPlayer3.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)TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Poor + TJAPlayer3.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 * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - if ( n延長する時間 < 0 ) - n延長する時間 = 0; - if( this.st叩ききりまショー.n区間ノート数 == 0 ) - n延長する時間 = 15; + this.n最後に時間延長した時刻 = (int)(SoundManager.PlayTimer.NowTime * TJAPlayer3.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; - 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.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( TJAPlayer3.ConfigIni.bSuperHard ) - return; //スーパーハード時はボーナス加点無し。 + this.n前回の延長時間 = (int)n延長する時間; + n延長する時間 = n延長する時間 * 1000; + if (n延長する時間 > 0) { + this.t加算審査アニメ_Start(); + if (this.st叩ききりまショー.b加算アニメ中 == false) + this.t加算時間描画_Start(); + } + 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 (TJAPlayer3.ConfigIni.bSuperHard) + return; //スーパーハード時はボーナス加点無し。 - this.st叩ききりまショー.nおまけ加算が発生した回数++; + 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; - } - } - #region[ ラグ時間による判定 ] - if( this.st叩ききりまショー.n最小ズレ時間 != -1 ) - { - if( this.st叩ききりまショー.n最小ズレ時間 >= 0 ) - { - n延長する時間 += 6; - } - } + 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; + } + } + #region[ ラグ時間による判定 ] + if (this.st叩ききりまショー.n最小ズレ時間 != -1) { + if (this.st叩ききりまショー.n最小ズレ時間 >= 0) { + n延長する時間 += 6; + } + } - if( this.st叩ききりまショー.n最大ズレ時間 != -1 ) - { - if( this.st叩ききりまショー.n最大ズレ時間 <= 30 ) - { - n延長する時間 += 6; - } - } - #endregion - double db区間内ミス率 = ( ( (double)this.st叩ききりまショー.nヒット数_POOR + this.st叩ききりまショー.nヒット数_MISS ) / this.st叩ききりまショー.n区間ノート数 ) * 100.0; - if( db区間内ミス率 >= 5.0 ) - { - n延長する時間 -= 2; - } + if (this.st叩ききりまショー.n最大ズレ時間 != -1) { + if (this.st叩ききりまショー.n最大ズレ時間 <= 30) { + n延長する時間 += 6; + } + } + #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 * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - if ( n延長する時間 < 0 ) - n延長する時間 = 0; + this.n最後に時間延長した時刻 = (int)(SoundManager.PlayTimer.NowTime * TJAPlayer3.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(); - } - if( n延長する時間 > 5000 ) - this.st叩ききりまショー.ct残り時間.CurrentValue -= (int)n延長する時間; - } + 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延長する時間; + } - if (n延長する時間 >= 12000) - this.st叩ききりまショー.n延長アニメ速度 = 100; - else if (n延長する時間 < 12000 && n延長する時間 >= 5000) - this.st叩ききりまショー.n延長アニメ速度 = 250; - else - this.st叩ききりまショー.n延長アニメ速度 = 500; - } + if (n延長する時間 >= 12000) + this.st叩ききりまショー.n延長アニメ速度 = 100; + else if (n延長する時間 < 12000 && n延長する時間 >= 5000) + this.st叩ききりまショー.n延長アニメ速度 = 250; + else + this.st叩ききりまショー.n延長アニメ速度 = 500; + } - 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; - } - } + 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, TJAPlayer3.Timer ); - this.st叩ききりまショー.b加算アニメ中 = true; - } - private void t加算時間描画_Start() - { - this.st叩ききりまショー.ct加算時間表示 = new CCounter( 0, 1, 1000, TJAPlayer3.Timer ); - } + private void t加算審査アニメ_Start() { + this.st叩ききりまショー.ct加算審査中 = new CCounter(0, 2000, 1, TJAPlayer3.Timer); + this.st叩ききりまショー.b加算アニメ中 = true; + } + private void t加算時間描画_Start() { + this.st叩ききりまショー.ct加算時間表示 = new CCounter(0, 1, 1000, TJAPlayer3.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 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 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 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(TJAPlayer3.Skin.Game_Taiko_Combo_Size[0] * i, 0, TJAPlayer3.Skin.Game_Taiko_Combo_Size[0], TJAPlayer3.Skin.Game_Taiko_Combo_Size[1]); - if(TJAPlayer3.Tx.Taiko_Combo[0] != null ) - { - if( this.st叩ききりまショー.bタイマー使用中 ) - TJAPlayer3.Tx.Taiko_Combo[0].Opacity = 255; - else if( this.st叩ききりまショー.b最初のチップが叩かれた && !this.st叩ききりまショー.bタイマー使用中 ) - TJAPlayer3.Tx.Taiko_Combo[0].Opacity = 128; - if (this.st叩ききりまショー.b加算アニメ中) - TJAPlayer3.Tx.Taiko_Combo[0].Opacity = 0; - TJAPlayer3.Tx.Taiko_Combo[0].vcScaleRatio.Y = 1f; - TJAPlayer3.Tx.Taiko_Combo[0].vcScaleRatio.X = 1f; - TJAPlayer3.Tx.Taiko_Combo[0].t2D中心基準描画( x, y, rectangle ); + 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(TJAPlayer3.Skin.Game_Taiko_Combo_Size[0] * i, 0, TJAPlayer3.Skin.Game_Taiko_Combo_Size[0], TJAPlayer3.Skin.Game_Taiko_Combo_Size[1]); + if (TJAPlayer3.Tx.Taiko_Combo[0] != null) { + if (this.st叩ききりまショー.bタイマー使用中) + TJAPlayer3.Tx.Taiko_Combo[0].Opacity = 255; + else if (this.st叩ききりまショー.b最初のチップが叩かれた && !this.st叩ききりまショー.bタイマー使用中) + TJAPlayer3.Tx.Taiko_Combo[0].Opacity = 128; + if (this.st叩ききりまショー.b加算アニメ中) + TJAPlayer3.Tx.Taiko_Combo[0].Opacity = 0; + TJAPlayer3.Tx.Taiko_Combo[0].vcScaleRatio.Y = 1f; + TJAPlayer3.Tx.Taiko_Combo[0].vcScaleRatio.X = 1f; + TJAPlayer3.Tx.Taiko_Combo[0].t2D中心基準描画(x, y, rectangle); } break; } @@ -880,25 +787,20 @@ namespace TJAPlayer3 x += TJAPlayer3.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(TJAPlayer3.Skin.Game_Score_Size[0] * i, 0, TJAPlayer3.Skin.Game_Score_Size[0], TJAPlayer3.Skin.Game_Score_Size[1]); - if (TJAPlayer3.Tx.Taiko_Score[0] != null ) - { - TJAPlayer3.Tx.Taiko_Score[0].vcScaleRatio.Y = 1f; - TJAPlayer3.Tx.Taiko_Score[0].t2D描画( x, y, rectangle ); - } - } - } - x += 20; - } - } - } + 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(TJAPlayer3.Skin.Game_Score_Size[0] * i, 0, TJAPlayer3.Skin.Game_Score_Size[0], TJAPlayer3.Skin.Game_Score_Size[1]); + if (TJAPlayer3.Tx.Taiko_Score[0] != null) { + TJAPlayer3.Tx.Taiko_Score[0].vcScaleRatio.Y = 1f; + TJAPlayer3.Tx.Taiko_Score[0].t2D描画(x, y, rectangle); + } + } + } + x += 20; + } + } + } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CStage演奏ドラム画面.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CStage演奏ドラム画面.cs index 28d491c2..1ae83b75 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CStage演奏ドラム画面.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CStage演奏ドラム画面.cs @@ -1,252 +1,232 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Diagnostics; using System.Runtime.InteropServices; -using System.Drawing; -using System.Drawing.Imaging; -using System.IO; -using System.Diagnostics; -using System.Threading; -using FDK; +using System.Text; using DiscordRPC; - -using Rectangle = System.Drawing.Rectangle; +using FDK; using Point = System.Drawing.Point; -using Color = System.Drawing.Color; -using DiscordRPC.Helper; -namespace TJAPlayer3 -{ - internal class CStage演奏ドラム画面 : CStage演奏画面共通 - { - // コンストラクタ +using Rectangle = System.Drawing.Rectangle; +namespace TJAPlayer3 { + internal class CStage演奏ドラム画面 : CStage演奏画面共通 { + // コンストラクタ - public 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.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()); + 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()); - 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 ]; + 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文字位置.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文字位置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文字位置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文字位置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文字位置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文字位置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文字位置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文字位置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文字位置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文字位置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文字位置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; + st文字位置12.pt = new Point(0, 0); + st文字位置Array[11] = st文字位置12; this.st小文字位置 = st文字位置Array; - st文字位置Array = new ST文字位置[ 12 ]; - st文字位置 = new ST文字位置(); + st文字位置Array = new ST文字位置[12]; + st文字位置 = new ST文字位置(); st文字位置.ch = '0'; - st文字位置.pt = new Point( 0, 0 ); - st文字位置Array[ 0 ] = st文字位置; + 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文字位置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文字位置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文字位置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文字位置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文字位置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文字位置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文字位置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文字位置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文字位置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文字位置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; + st文字位置12.pt = new Point(0, 0); + st文字位置Array[11] = st文字位置12; this.st小文字位置 = st文字位置Array; - #endregion - } + #endregion + } // メソッド - public void t演奏結果を格納する( out CScoreIni.C演奏記録 Drums ) - { - base.t演奏結果を格納する_ドラム( out Drums ); + public void t演奏結果を格納する(out CScoreIni.C演奏記録 Drums) { + base.t演奏結果を格納する_ドラム(out Drums); } // CStage 実装 - public override void Activate() - { - LoudnessMetadataScanner.StopBackgroundScanning(joinImmediately: false); + public override void Activate() { + LoudnessMetadataScanner.StopBackgroundScanning(joinImmediately: false); this.bフィルイン中 = false; - this.n待機中の大音符の座標 = 0; - this.actGame.t叩ききりまショー_初期化(); - base.ReSetScore(TJAPlayer3.DTX.nScoreInit[0, TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]], TJAPlayer3.DTX.nScoreDiff[TJAPlayer3.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 ((TJAPlayer3.DTX.listVD.TryGetValue(1, out CVideoDecoder vd2))) - { - ShowVideo = true; - } - else - { - ShowVideo = false; - } + this.n待機中の大音符の座標 = 0; + this.actGame.t叩ききりまショー_初期化(); + base.ReSetScore(TJAPlayer3.DTX.nScoreInit[0, TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]], TJAPlayer3.DTX.nScoreDiff[TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]]); - base.Activate(); - base.ePhaseID = CStage.EPhase.Common_NORMAL;//初期化すれば、リザルト変遷は止まる。 + #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 - for (int i = 0; i < 5; i++) { - ifp[i] = false; - isDeniedPlaying[i] = false; + if ((TJAPlayer3.DTX.listVD.TryGetValue(1, out CVideoDecoder vd2))) { + ShowVideo = true; + } else { + ShowVideo = false; + } - if (bIsAlreadyCleared[i]) - { - actBackground.ClearIn(i); - } - } - - this.nStoredHit = new int[TJAPlayer3.ConfigIni.nPlayerCount]; + 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[TJAPlayer3.ConfigIni.nPlayerCount]; dtLastQueueOperation = DateTime.MinValue; - PuchiChara.ChangeBPM(60.0 / TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0]); + PuchiChara.ChangeBPM(60.0 / TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0]); - //dbUnit = Math.Ceiling( dbUnit * 1000.0 ); - //dbUnit = dbUnit / 1000.0; + //dbUnit = Math.Ceiling( dbUnit * 1000.0 ); + //dbUnit = dbUnit / 1000.0; - //if (this.actChara.ctキャラクターアクションタイマ != null) this.actChara.ctキャラクターアクションタイマ = new CCounter(); + //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.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, TJAPlayer3.Timer ); - this.ShownLyric2 = 0; + this.ct手つなぎ = new CCounter(0, 60, 20, TJAPlayer3.Timer); + this.ShownLyric2 = 0; - string diffToString(int diff) - { + string diffToString(int diff) { string[] diffArr = { " Easy ", @@ -270,28 +250,25 @@ namespace TJAPlayer3 return (diffArr[Math.Min(diff, 6)] + "Lv." + level + diffArrIcon[(int)levelIcon]); } - // Discord Presence の更新 + // Discord Presence の更新 string details = TJAPlayer3.ConfigIni.SendDiscordPlayingInformation ? TJAPlayer3.stageSongSelect.rChoosenSong.ldTitle.GetString("") - + diffToString(TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]) : ""; + + diffToString(TJAPlayer3.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); - } + // 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 = TJAPlayer3.DifficultyNumberToEnum(TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]).ToString(); + var difficultyName = TJAPlayer3.DifficultyNumberToEnum(TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]).ToString(); - TJAPlayer3.DiscordClient?.SetPresence(new RichPresence() - { + TJAPlayer3.DiscordClient?.SetPresence(new RichPresence() { Details = details, State = "Playing" + (TJAPlayer3.ConfigIni.bAutoPlay[0] == true ? " (Auto)" : ""), Timestamps = new Timestamps(DateTime.UtcNow, DateTime.UtcNow.AddMilliseconds(TJAPlayer3.DTX.listChip[TJAPlayer3.DTX.listChip.Count - 1].n発声時刻ms / TJAPlayer3.ConfigIni.SongPlaybackSpeed)), - Assets = new Assets() - { + Assets = new Assets() { SmallImageKey = TJAPlayer3.ConfigIni.SendDiscordPlayingInformation ? difficultyName.ToLower() : "", SmallImageText = TJAPlayer3.ConfigIni.SendDiscordPlayingInformation ? String.Format("COURSE:{0} ({1})", difficultyName, TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]) : "", LargeImageKey = TJAPlayer3.LargeImageKey, @@ -299,7 +276,7 @@ namespace TJAPlayer3 } }); - + // When performing calibration, reduce audio distraction from user input. // For users who play primarily by listening to the music, @@ -311,31 +288,29 @@ namespace TJAPlayer3 // 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. - if (!TJAPlayer3.IsPerformingCalibration) - { - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - int actual = TJAPlayer3.GetActualPlayer(i); + if (!TJAPlayer3.IsPerformingCalibration) { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + int actual = TJAPlayer3.GetActualPlayer(i); - var hs = TJAPlayer3.Skin.hsHitSoundsInformations; + var hs = TJAPlayer3.Skin.hsHitSoundsInformations; - //this.soundRed[i] = TJAPlayer3.Sound管理.tサウンドを生成する(CSkin.Path(hs.don[actual]), ESoundGroup.SoundEffect); - //this.soundBlue[i] = TJAPlayer3.Sound管理.tサウンドを生成する(CSkin.Path(hs.ka[actual]), ESoundGroup.SoundEffect); - //this.soundAdlib[i] = TJAPlayer3.Sound管理.tサウンドを生成する(CSkin.Path(hs.adlib[actual]), ESoundGroup.SoundEffect); - //this.soundClap[i] = TJAPlayer3.Sound管理.tサウンドを生成する(CSkin.Path(hs.clap[actual]), ESoundGroup.SoundEffect); + //this.soundRed[i] = TJAPlayer3.Sound管理.tサウンドを生成する(CSkin.Path(hs.don[actual]), ESoundGroup.SoundEffect); + //this.soundBlue[i] = TJAPlayer3.Sound管理.tサウンドを生成する(CSkin.Path(hs.ka[actual]), ESoundGroup.SoundEffect); + //this.soundAdlib[i] = TJAPlayer3.Sound管理.tサウンドを生成する(CSkin.Path(hs.adlib[actual]), ESoundGroup.SoundEffect); + //this.soundClap[i] = TJAPlayer3.Sound管理.tサウンドを生成する(CSkin.Path(hs.clap[actual]), ESoundGroup.SoundEffect); - this.soundRed[i] = TJAPlayer3.SoundManager.tCreateSound((@$"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + hs.don[actual]), ESoundGroup.SoundEffect); - this.soundBlue[i] = TJAPlayer3.SoundManager.tCreateSound((@$"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + hs.ka[actual]), ESoundGroup.SoundEffect); - this.soundAdlib[i] = TJAPlayer3.SoundManager.tCreateSound((@$"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + hs.adlib[actual]), ESoundGroup.SoundEffect); - this.soundClap[i] = TJAPlayer3.SoundManager.tCreateSound((@$"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + hs.clap[actual]), ESoundGroup.SoundEffect); + this.soundRed[i] = TJAPlayer3.SoundManager.tCreateSound((@$"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + hs.don[actual]), ESoundGroup.SoundEffect); + this.soundBlue[i] = TJAPlayer3.SoundManager.tCreateSound((@$"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + hs.ka[actual]), ESoundGroup.SoundEffect); + this.soundAdlib[i] = TJAPlayer3.SoundManager.tCreateSound((@$"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + hs.adlib[actual]), ESoundGroup.SoundEffect); + this.soundClap[i] = TJAPlayer3.SoundManager.tCreateSound((@$"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + hs.clap[actual]), ESoundGroup.SoundEffect); - int _panning = TJAPlayer3.ConfigIni.nPanning[TJAPlayer3.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; - } - /* + int _panning = TJAPlayer3.ConfigIni.nPanning[TJAPlayer3.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; + } + /* this.soundRed = TJAPlayer3.Sound管理.tサウンドを生成する( CSkin.Path( @"Sounds\Taiko\dong.ogg" ), ESoundGroup.SoundEffect ); this.soundBlue = TJAPlayer3.Sound管理.tサウンドを生成する( CSkin.Path( @"Sounds\Taiko\ka.ogg" ), ESoundGroup.SoundEffect ); this.soundAdlib = TJAPlayer3.Sound管理.tサウンドを生成する( CSkin.Path(@"Sounds\Taiko\Adlib.ogg"), ESoundGroup.SoundEffect ); @@ -345,7 +320,7 @@ namespace TJAPlayer3 this.soundAdlib2 = TJAPlayer3.Sound管理.tサウンドを生成する(CSkin.Path(@"Sounds\Taiko\Adlib.ogg"), ESoundGroup.SoundEffect); */ - /* + /* if (TJAPlayer3.ConfigIni.nPlayerCount == 2)//2020.05.06 Mr-Ojii左右に出したかったから、追加。 { this.soundRed[0].n位置 = -100; @@ -356,67 +331,60 @@ namespace TJAPlayer3 this.soundAdlib[1].n位置 = 100; } */ - } - } - public override void DeActivate() - { - this.ct手つなぎ = null; + } + } + public override void DeActivate() { + this.ct手つなぎ = null; - for (int i = 0; i < TJAPlayer3.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(); - } + for (int i = 0; i < TJAPlayer3.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(); + LoudnessMetadataScanner.StartBackgroundScanning(); } - public override void CreateManagedResource() - { - //this.t背景テクスチャの生成(); - //this.tx太鼓ノーツ = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_taiko_notes.png" ) ); - //this.txHand = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_taiko_notes_arm.png" ) ); - //this.txSenotes = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_senotes.png" ) ); - //this.tx小節線 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_bar_line.png" ) ); - //this.tx小節線_branch = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_bar_line_branch.png" ) ); - // this.tx判定数小文字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\8_Result_number_s.png" ) ); - // this.txNamePlate = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_NamePlate.png" ) ); - // if (CDTXMania.stage演奏ドラム画面.bDoublePlay) - // this.txNamePlate2P = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_NamePlate2P.png" ) ); - // this.txPlayerNumber = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\7_PlayerNumber.png")); + public override void CreateManagedResource() { + //this.t背景テクスチャの生成(); + //this.tx太鼓ノーツ = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_taiko_notes.png" ) ); + //this.txHand = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_taiko_notes_arm.png" ) ); + //this.txSenotes = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_senotes.png" ) ); + //this.tx小節線 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_bar_line.png" ) ); + //this.tx小節線_branch = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_bar_line_branch.png" ) ); + // this.tx判定数小文字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\8_Result_number_s.png" ) ); + // this.txNamePlate = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_NamePlate.png" ) ); + // if (CDTXMania.stage演奏ドラム画面.bDoublePlay) + // this.txNamePlate2P = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_NamePlate2P.png" ) ); + // this.txPlayerNumber = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\7_PlayerNumber.png")); - // this.tx判定数表示パネル = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_Paramater Panel.png" ) ); + // this.tx判定数表示パネル = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_Paramater Panel.png" ) ); base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { - base.ReleaseManagedResource(); + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); } - public override int Draw() - { + public override int Draw() { base.sw.Start(); - if( !base.IsDeActivated ) - { + if (!base.IsDeActivated) { bool bIsFinishedPlaying = false; - bool bIsFinishedEndAnime = false; + bool bIsFinishedEndAnime = false; bool bIsFinishedFadeout = false; #region [ 初めての進行描画 ] - if ( base.IsFirstDraw ) - { - SoundManager.PlayTimer.Reset(); + if (base.IsFirstDraw) { + SoundManager.PlayTimer.Reset(); TJAPlayer3.Timer.Reset(); - this.ctチップ模様アニメ.Drums = new CCounter( 0, 1, 500, TJAPlayer3.Timer ); - this.ctチップ模様アニメ.Guitar = new CCounter( 0, 0x17, 20, TJAPlayer3.Timer ); - this.ctチップ模様アニメ.Bass = new CCounter( 0, 0x17, 20, TJAPlayer3.Timer ); - this.ctチップ模様アニメ.Taiko = new CCounter( 0, 1, 500, TJAPlayer3.Timer ); + this.ctチップ模様アニメ.Drums = new CCounter(0, 1, 500, TJAPlayer3.Timer); + this.ctチップ模様アニメ.Guitar = new CCounter(0, 0x17, 20, TJAPlayer3.Timer); + this.ctチップ模様アニメ.Bass = new CCounter(0, 0x17, 20, TJAPlayer3.Timer); + this.ctチップ模様アニメ.Taiko = new CCounter(0, 1, 500, TJAPlayer3.Timer); // this.actChipFireD.Start( Eレーン.HH ); // #31554 2013.6.12 yyagi // 初チップヒット時のもたつき回避。最初にactChipFireD.Start()するときにJITが掛かって? @@ -425,272 +393,240 @@ namespace TJAPlayer3 base.ePhaseID = CStage.EPhase.Common_FADEIN; - this.actFI.tフェードイン開始(); + this.actFI.tフェードイン開始(); - if ( TJAPlayer3.DTXVmode.Enabled ) // DTXVモードなら + if (TJAPlayer3.DTXVmode.Enabled) // DTXVモードなら { #region [ DTXV用の再生設定にする(全AUTOなど) ] tDTXV用の設定(); #endregion - t演奏位置の変更( TJAPlayer3.DTXVmode.nStartBar, 0 ); + t演奏位置の変更(TJAPlayer3.DTXVmode.nStartBar, 0); } // TJAPlayer3.Sound管理.tDisableUpdateBufferAutomatically(); base.IsFirstDraw = false; } #endregion - if ( ( ( TJAPlayer3.ConfigIni.nRisky != 0 && this.actGauge.IsFailed( EInstrumentPad.TAIKO ) ) - || this.actGame.st叩ききりまショー.ct残り時間.IsEnded - || (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower && CFloorManagement.CurrentNumberOfLives <= 0)) - && ( base.ePhaseID == CStage.EPhase.Common_NORMAL )) - { + if (((TJAPlayer3.ConfigIni.nRisky != 0 && this.actGauge.IsFailed(EInstrumentPad.TAIKO)) + || this.actGame.st叩ききりまショー.ct残り時間.IsEnded + || (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower && CFloorManagement.CurrentNumberOfLives <= 0)) + && (base.ePhaseID == CStage.EPhase.Common_NORMAL)) { this.actStageFailed.Start(); - this.actEnd.Start(); - TJAPlayer3.DTX.t全チップの再生停止(); + this.actEnd.Start(); + TJAPlayer3.DTX.t全チップの再生停止(); base.ePhaseID = CStage.EPhase.Game_STAGE_FAILED; } - bool BGA_Hidden = TJAPlayer3.ConfigIni.bEnableAVI && TJAPlayer3.DTX.listVD.Count > 0 && ShowVideo; + bool BGA_Hidden = TJAPlayer3.ConfigIni.bEnableAVI && TJAPlayer3.DTX.listVD.Count > 0 && ShowVideo; - // (????) - if ( !String.IsNullOrEmpty( TJAPlayer3.DTX.strBGIMAGE_PATH ) || ( TJAPlayer3.DTX.listVD.Count == 0 ) || !ShowVideo || !TJAPlayer3.ConfigIni.bEnableAVI ) //背景動画があったら背景画像を描画しない。 - { - this.t進行描画_背景(); - } + // (????) + if (!String.IsNullOrEmpty(TJAPlayer3.DTX.strBGIMAGE_PATH) || (TJAPlayer3.DTX.listVD.Count == 0) || !ShowVideo || !TJAPlayer3.ConfigIni.bEnableAVI) //背景動画があったら背景画像を描画しない。 + { + this.t進行描画_背景(); + } - if (TJAPlayer3.ConfigIni.bEnableAVI && TJAPlayer3.DTX.listVD.Count > 0 && ShowVideo && !TJAPlayer3.ConfigIni.bTokkunMode) - { - this.t進行描画_AVI(); - } - else if (TJAPlayer3.ConfigIni.bEnableBGA) - { - if (TJAPlayer3.ConfigIni.bTokkunMode) actTokkun.On進行描画_背景(); - else actBackground.Draw(); - } + if (TJAPlayer3.ConfigIni.bEnableAVI && TJAPlayer3.DTX.listVD.Count > 0 && ShowVideo && !TJAPlayer3.ConfigIni.bTokkunMode) { + this.t進行描画_AVI(); + } else if (TJAPlayer3.ConfigIni.bEnableBGA) { + if (TJAPlayer3.ConfigIni.bTokkunMode) actTokkun.On進行描画_背景(); + else actBackground.Draw(); + } - if (!BGA_Hidden && !TJAPlayer3.ConfigIni.bTokkunMode) - { - actRollChara.Draw(); - } + if (!BGA_Hidden && !TJAPlayer3.ConfigIni.bTokkunMode) { + actRollChara.Draw(); + } - if (!BGA_Hidden && !bDoublePlay && TJAPlayer3.ConfigIni.ShowDancer && !TJAPlayer3.ConfigIni.bTokkunMode) - { - actDancer.Draw(); - } + if (!BGA_Hidden && !bDoublePlay && TJAPlayer3.ConfigIni.ShowDancer && !TJAPlayer3.ConfigIni.bTokkunMode) { + actDancer.Draw(); + } - if(!BGA_Hidden && !bDoublePlay && TJAPlayer3.ConfigIni.ShowFooter && !TJAPlayer3.ConfigIni.bTokkunMode) - this.actFooter.Draw(); + if (!BGA_Hidden && !bDoublePlay && TJAPlayer3.ConfigIni.ShowFooter && !TJAPlayer3.ConfigIni.bTokkunMode) + this.actFooter.Draw(); - //this.t進行描画_グラフ(); // #24074 2011.01.23 add ikanick + //this.t進行描画_グラフ(); // #24074 2011.01.23 add ikanick - //this.t進行描画_DANGER(); - //this.t進行描画_判定ライン(); + //this.t進行描画_DANGER(); + //this.t進行描画_判定ライン(); - if( TJAPlayer3.ConfigIni.ShowChara && TJAPlayer3.ConfigIni.nPlayerCount <= 2) - { - this.actChara.Draw(); - } + if (TJAPlayer3.ConfigIni.ShowChara && TJAPlayer3.ConfigIni.nPlayerCount <= 2) { + this.actChara.Draw(); + } - if(!BGA_Hidden && TJAPlayer3.ConfigIni.ShowMob && !TJAPlayer3.ConfigIni.bTokkunMode) - this.actMob.Draw(); + if (!BGA_Hidden && TJAPlayer3.ConfigIni.ShowMob && !TJAPlayer3.ConfigIni.bTokkunMode) + this.actMob.Draw(); - if ( TJAPlayer3.ConfigIni.eGameMode != EGame.OFF ) - this.actGame.Draw(); + if (TJAPlayer3.ConfigIni.eGameMode != EGame.OFF) + this.actGame.Draw(); this.t進行描画_譜面スクロール速度(); this.t進行描画_チップアニメ(); - this.actLaneTaiko.Draw(); + this.actLaneTaiko.Draw(); - if (TJAPlayer3.ConfigIni.ShowRunner && !TJAPlayer3.ConfigIni.bAIBattleMode && TJAPlayer3.ConfigIni.nPlayerCount <= 2) - this.actRunner.Draw(); + if (TJAPlayer3.ConfigIni.ShowRunner && !TJAPlayer3.ConfigIni.bAIBattleMode && TJAPlayer3.ConfigIni.nPlayerCount <= 2) + this.actRunner.Draw(); - //this.t進行描画_レーン(); - //this.t進行描画_レーンフラッシュD(); + //this.t進行描画_レーン(); + //this.t進行描画_レーンフラッシュD(); - if ( ( TJAPlayer3.ConfigIni.eClipDispType == EClipDispType.ウィンドウのみ || TJAPlayer3.ConfigIni.eClipDispType == EClipDispType.両方 ) && TJAPlayer3.ConfigIni.nPlayerCount == 1 ) - this.actAVI.t窓表示(); + if ((TJAPlayer3.ConfigIni.eClipDispType == EClipDispType.ウィンドウのみ || TJAPlayer3.ConfigIni.eClipDispType == EClipDispType.両方) && TJAPlayer3.ConfigIni.nPlayerCount == 1) + this.actAVI.t窓表示(); - if( !TJAPlayer3.ConfigIni.bNoInfo && !TJAPlayer3.ConfigIni.bTokkunMode) - this.t進行描画_ゲージ(); + if (!TJAPlayer3.ConfigIni.bNoInfo && !TJAPlayer3.ConfigIni.bTokkunMode) + this.t進行描画_ゲージ(); - this.actLaneTaiko.ゴーゴー炎(); + this.actLaneTaiko.ゴーゴー炎(); - // bIsFinishedPlaying was dependent on 2P in this case + // bIsFinishedPlaying was dependent on 2P in this case - this.actDan.Draw(); + this.actDan.Draw(); - for ( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) - { - // bIsFinishedPlaying = this.t進行描画_チップ(E楽器パート.DRUMS, i); - bool btmp = this.t進行描画_チップ(EInstrumentPad.DRUMS, i); - if (btmp == true) - ifp[i] = true; + for (int i = 0; i < TJAPlayer3.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 (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.D0)) - { - ifp[i] = true; - } + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.D0)) { + ifp[i] = true; + } #endif - this.t進行描画_チップ_連打( EInstrumentPad.DRUMS, i ); - } + this.t進行描画_チップ_連打(EInstrumentPad.DRUMS, i); + } - this.actMtaiko.Draw(); + this.actMtaiko.Draw(); - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - this.actAIBattle.Draw(); - } + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + this.actAIBattle.Draw(); + } - this.GoGoSplash.Draw(); - this.t進行描画_リアルタイム判定数表示(); - if (TJAPlayer3.ConfigIni.bTokkunMode) - this.actTokkun.On進行描画_小節_速度(); + this.GoGoSplash.Draw(); + this.t進行描画_リアルタイム判定数表示(); + if (TJAPlayer3.ConfigIni.bTokkunMode) + this.actTokkun.On進行描画_小節_速度(); - if ( !TJAPlayer3.ConfigIni.bNoInfo ) - this.t進行描画_コンボ(); - if( !TJAPlayer3.ConfigIni.bNoInfo && !TJAPlayer3.ConfigIni.bTokkunMode) - this.t進行描画_スコア(); + if (!TJAPlayer3.ConfigIni.bNoInfo) + this.t進行描画_コンボ(); + if (!TJAPlayer3.ConfigIni.bNoInfo && !TJAPlayer3.ConfigIni.bTokkunMode) + this.t進行描画_スコア(); - if (TJAPlayer3.ConfigIni.ShowChara && TJAPlayer3.ConfigIni.nPlayerCount > 2) - { - this.actChara.Draw(); - } + if (TJAPlayer3.ConfigIni.ShowChara && TJAPlayer3.ConfigIni.nPlayerCount > 2) { + this.actChara.Draw(); + } - this.Rainbow.Draw(); - this.FireWorks.Draw(); - this.actChipEffects.Draw(); - this.FlyingNotes.Draw(); - this.t進行描画_チップファイアD(); + this.Rainbow.Draw(); + this.FireWorks.Draw(); + this.actChipEffects.Draw(); + this.FlyingNotes.Draw(); + this.t進行描画_チップファイアD(); - if (!TJAPlayer3.ConfigIni.bNoInfo) - this.t進行描画_パネル文字列(); + if (!TJAPlayer3.ConfigIni.bNoInfo) + this.t進行描画_パネル文字列(); - this.actComboBalloon.Draw(); + this.actComboBalloon.Draw(); - for ( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) - { - this.actRoll.On進行描画( this.n現在の連打数[ i ], i ); - } + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + this.actRoll.On進行描画(this.n現在の連打数[i], i); + } - if( !TJAPlayer3.ConfigIni.bNoInfo ) - this.t進行描画_判定文字列1_通常位置指定の場合(); + if (!TJAPlayer3.ConfigIni.bNoInfo) + this.t進行描画_判定文字列1_通常位置指定の場合(); - this.t進行描画_演奏情報(); + this.t進行描画_演奏情報(); - if (TJAPlayer3.DTX.listLyric2.Count > ShownLyric2 && TJAPlayer3.DTX.listLyric2[ShownLyric2].Time < (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed)) - { - this.actPanel.t歌詞テクスチャを生成する(TJAPlayer3.DTX.listLyric2[ShownLyric2++].TextTex); - } + if (TJAPlayer3.DTX.listLyric2.Count > ShownLyric2 && TJAPlayer3.DTX.listLyric2[ShownLyric2].Time < (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed)) { + this.actPanel.t歌詞テクスチャを生成する(TJAPlayer3.DTX.listLyric2[ShownLyric2++].TextTex); + } - this.actPanel.t歌詞テクスチャを描画する(); + this.actPanel.t歌詞テクスチャを描画する(); - actChara.OnDraw_Balloon(); + actChara.OnDraw_Balloon(); - // Floor voice - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - this.actComboVoice.tPlayFloorSound(); + // Floor voice + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) + this.actComboVoice.tPlayFloorSound(); - this.t全体制御メソッド(); - - //this.actEnd.On進行描画(); + this.t全体制御メソッド(); + + //this.actEnd.On進行描画(); this.t進行描画_STAGEFAILED(); - this.ScoreRank.Draw(); + this.ScoreRank.Draw(); - if (TJAPlayer3.ConfigIni.bTokkunMode) - { - actTokkun.Draw(); - } + if (TJAPlayer3.ConfigIni.bTokkunMode) { + actTokkun.Draw(); + } - bIsFinishedEndAnime = this.actEnd.Draw() == 1 ? true : false; + bIsFinishedEndAnime = this.actEnd.Draw() == 1 ? true : false; bIsFinishedFadeout = this.t進行描画_フェードイン_アウト(); - bIsFinishedPlaying = true; - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (!ifp[i]) bIsFinishedPlaying = false; - } + bIsFinishedPlaying = true; + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (!ifp[i]) bIsFinishedPlaying = false; + } - this.actPauseMenu.t進行描画(); + this.actPauseMenu.t進行描画(); - //演奏終了→演出表示→フェードアウト - if ( bIsFinishedPlaying && base.ePhaseID == CStage.EPhase.Common_NORMAL ) - { - if (TJAPlayer3.ConfigIni.bTokkunMode) - { - bIsFinishedPlaying = false; - TJAPlayer3.Skin.sound特訓停止音.tPlay(); - actTokkun.tPausePlay(); + //演奏終了→演出表示→フェードアウト + if (bIsFinishedPlaying && base.ePhaseID == CStage.EPhase.Common_NORMAL) { + if (TJAPlayer3.ConfigIni.bTokkunMode) { + bIsFinishedPlaying = false; + TJAPlayer3.Skin.sound特訓停止音.tPlay(); + actTokkun.tPausePlay(); - actTokkun.tMatchWithTheChartDisplayPosition(true); - } - else - { - for(int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - base.ePhaseID = CStage.EPhase.Game_EndStage; + actTokkun.tMatchWithTheChartDisplayPosition(true); + } else { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + base.ePhaseID = CStage.EPhase.Game_EndStage; - this.actEnd.Start(); + this.actEnd.Start(); - int Character = this.actChara.iCurrentCharacter[i]; + int Character = this.actChara.iCurrentCharacter[i]; - if (HGaugeMethods.UNSAFE_IsRainbow(i)) - { - if (TJAPlayer3.Skin.Characters_10Combo_Maxed_Ptn[Character] != 0) - { - if (HGaugeMethods.UNSAFE_IsRainbow(i)) - { - double dbUnit = (((60.0 / (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[i])))); - this.actChara.ChangeAnime(i, CActImplCharacter.Anime.Combo10_Max, true); - } - } - } - else if (HGaugeMethods.UNSAFE_FastNormaCheck(i)) - { - if (TJAPlayer3.Skin.Characters_Become_Cleared_Ptn[Character] != 0) - { - this.actChara.ChangeAnime(i, CActImplCharacter.Anime.Cleared, true);; - } - } - else - { - if (TJAPlayer3.Skin.Characters_ClearOut_Ptn[Character] != 0) - { - this.actChara.ChangeAnime(i, CActImplCharacter.Anime.ClearOut, true); - } - } - } - } - } - else if( bIsFinishedEndAnime && base.ePhaseID == EPhase.Game_EndStage ) - { - this.eフェードアウト完了時の戻り値 = E演奏画面の戻り値.ステージクリア; - base.ePhaseID = CStage.EPhase.Game_STAGE_CLEAR_FadeOut; - this.actFOClear.tフェードアウト開始(); - } + if (HGaugeMethods.UNSAFE_IsRainbow(i)) { + if (TJAPlayer3.Skin.Characters_10Combo_Maxed_Ptn[Character] != 0) { + if (HGaugeMethods.UNSAFE_IsRainbow(i)) { + double dbUnit = (((60.0 / (TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[i])))); + this.actChara.ChangeAnime(i, CActImplCharacter.Anime.Combo10_Max, true); + } + } + } else if (HGaugeMethods.UNSAFE_FastNormaCheck(i)) { + if (TJAPlayer3.Skin.Characters_Become_Cleared_Ptn[Character] != 0) { + this.actChara.ChangeAnime(i, CActImplCharacter.Anime.Cleared, true); ; + } + } else { + if (TJAPlayer3.Skin.Characters_ClearOut_Ptn[Character] != 0) { + this.actChara.ChangeAnime(i, CActImplCharacter.Anime.ClearOut, true); + } + } + } + } + } else if (bIsFinishedEndAnime && base.ePhaseID == EPhase.Game_EndStage) { + this.eフェードアウト完了時の戻り値 = E演奏画面の戻り値.ステージクリア; + base.ePhaseID = CStage.EPhase.Game_STAGE_CLEAR_FadeOut; + this.actFOClear.tフェードアウト開始(); + } - if( bIsFinishedFadeout ) - { - Debug.WriteLine( "Total On進行描画=" + sw.ElapsedMilliseconds + "ms" ); - return (int) this.eフェードアウト完了時の戻り値; + if (bIsFinishedFadeout) { + Debug.WriteLine("Total On進行描画=" + sw.ElapsedMilliseconds + "ms"); + return (int)this.eフェードアウト完了時の戻り値; } ManageMixerQueue(); // キー入力 - if( TJAPlayer3.act現在入力を占有中のプラグイン == null ) + if (TJAPlayer3.act現在入力を占有中のプラグイン == null) this.tキー入力(); - } - base.sw.Stop(); + } + base.sw.Stop(); return 0; } @@ -698,845 +634,759 @@ namespace TJAPlayer3 #region [ private ] //----------------- - [StructLayout( LayoutKind.Sequential )] - private struct ST文字位置 - { + [StructLayout(LayoutKind.Sequential)] + private struct ST文字位置 { public char ch; public Point pt; } public CActImplFireworks actChipFireD; 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フィルイン中; + 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 + 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 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 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 ウィンドウ表示 + 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; + public float nGauge = 0.0f; + private int ShownLyric2 = 0; - private StreamWriter stream; + private StreamWriter stream; - private int n待機中の大音符の座標; - private readonly ST文字位置[] st小文字位置; - private readonly ST文字位置[] st大文字位置; + 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 ); + 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 ) ); + 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); - } + 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 = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(nPlayer)]; + private int ChannelNumToFlyNoteNum(CDTX.CChip pChip, int nPlayer, bool b両手入力 = false, int nInput = 0) { + var _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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; + 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; } - - 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; - } + return nFly; + } - ENoteJudge e判定 = this.e指定時刻からChipのJUDGEを返す( nHitTime, pChip, nPlayer ); + private bool tドラムヒット処理(long nHitTime, EPad type, CDTX.CChip pChip, bool b両手入力, int nPlayer) { + int nInput = 0; - e判定 = AlterJudgement(nPlayer, e判定, false); + 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; + } - this.actGame.t叩ききりまショー_判定から各数値を増加させる( e判定, (int)( nHitTime - pChip.n発声時刻ms ) ); - if( e判定 == ENoteJudge.Miss ) - { + if (pChip == null) { return false; } - this.tチップのヒット処理( nHitTime, pChip, EInstrumentPad.TAIKO, true, nInput, nPlayer ); - - if( ( e判定 != ENoteJudge.Poor ) && ( e判定 != ENoteJudge.Miss ) ) - { - TJAPlayer3.stage演奏ドラム画面.actLaneTaiko.Start( pChip.nチャンネル番号, e判定, b両手入力, nPlayer ); + 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; + } - int nFly = ChannelNumToFlyNoteNum(pChip, nPlayer, b両手入力, nInput); + ENoteJudge e判定 = this.e指定時刻からChipのJUDGEを返す(nHitTime, pChip, nPlayer); - this.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Hit); - this.FlyingNotes.Start(nFly, 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); + + if ((e判定 != ENoteJudge.Poor) && (e判定 != ENoteJudge.Miss)) { + TJAPlayer3.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; } - protected override void ドラムスクロール速度アップ() - { - TJAPlayer3.ConfigIni.nScrollSpeed[TJAPlayer3.SaveFile] = Math.Min( TJAPlayer3.ConfigIni.nScrollSpeed[TJAPlayer3.SaveFile] + 1, 1999 ); + protected override void ドラムスクロール速度アップ() { + TJAPlayer3.ConfigIni.nScrollSpeed[TJAPlayer3.SaveFile] = Math.Min(TJAPlayer3.ConfigIni.nScrollSpeed[TJAPlayer3.SaveFile] + 1, 1999); } - protected override void ドラムスクロール速度ダウン() - { - TJAPlayer3.ConfigIni.nScrollSpeed[TJAPlayer3.SaveFile] = Math.Max( TJAPlayer3.ConfigIni.nScrollSpeed[TJAPlayer3.SaveFile] - 1, 0 ); + protected override void ドラムスクロール速度ダウン() { + TJAPlayer3.ConfigIni.nScrollSpeed[TJAPlayer3.SaveFile] = Math.Max(TJAPlayer3.ConfigIni.nScrollSpeed[TJAPlayer3.SaveFile] - 1, 0); } - - protected override void t進行描画_AVI() - { - base.t進行描画_AVI( 0, 0 ); + + protected override void t進行描画_AVI() { + base.t進行描画_AVI(0, 0); } - private void t進行描画_チップファイアD() - { + private void t進行描画_チップファイアD() { this.actChipFireD.Draw(); } - protected override void t進行描画_パネル文字列() - { - base.t進行描画_パネル文字列( 336, 427 ); + protected override void t進行描画_パネル文字列() { + base.t進行描画_パネル文字列(336, 427); } - protected override void t進行描画_演奏情報() - { - base.t進行描画_演奏情報( 1000, 257 ); + 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入力処理_ドラム() - { - // 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パッドの要素数への依存を無くすため。 + protected override void t紙吹雪_開始() { + //if( this.actCombo.n現在のコンボ数.Drums % 10 == 0 && this.actCombo.n現在のコンボ数.Drums > 0 ) { - List listInputEvent = TJAPlayer3.Pad.GetEvents( EInstrumentPad.DRUMS, (EPad) nPad ); + //this.actChipFireD.Start紙吹雪(); + } + } - if( ( listInputEvent == null ) || ( listInputEvent.Count == 0 ) ) + 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 = TJAPlayer3.Pad.GetEvents(EInstrumentPad.DRUMS, (EPad)nPad); + + if ((listInputEvent == null) || (listInputEvent.Count == 0)) continue; - this.t入力メソッド記憶( EInstrumentPad.DRUMS ); + this.t入力メソッド記憶(EInstrumentPad.DRUMS); - foreach( STInputEvent inputEvent in listInputEvent ) - { - if( !inputEvent.Pressed ) + foreach (STInputEvent inputEvent in listInputEvent) { + if (!inputEvent.Pressed) continue; - long nTime = (long)(((SoundManager.PlayTimer.NowTimeMs + nInputAdjustTimeMs) * TJAPlayer3.ConfigIni.SongPlaybackSpeed)); - //int nPad09 = ( nPad == (int) Eパッド.HP ) ? (int) Eパッド.BD : nPad; // #27029 2012.1.5 yyagi + long nTime = (long)(((SoundManager.PlayTimer.NowTimeMs + nInputAdjustTimeMs) * TJAPlayer3.ConfigIni.SongPlaybackSpeed)); + //int nPad09 = ( nPad == (int) Eパッド.HP ) ? (int) Eパッド.BD : nPad; // #27029 2012.1.5 yyagi - bool bHitted = false; + 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つのレーン扱いにする。 + //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; + 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 (TJAPlayer3.ConfigIni.nPlayerCount < 2) //プレイ人数が2人以上でなければ入力をキャンセル - break; - } - else if (isPad3P) - { - nUsePlayer = 2; - if (TJAPlayer3.ConfigIni.nPlayerCount < 3) //プレイ人数が3人以上でなければ入力をキャンセル - break; - } - else if (isPad4P) - { - nUsePlayer = 3; - if (TJAPlayer3.ConfigIni.nPlayerCount < 4) //プレイ人数が4人以上でなければ入力をキャンセル - break; - } - else if (isPad5P) - { - nUsePlayer = 4; - if (TJAPlayer3.ConfigIni.nPlayerCount < 5) //プレイ人数が5人以上でなければ入力をキャンセル - break; - } + int nUsePlayer = 0; + if (isPad1P) { + nUsePlayer = 0; + } else if (isPad2P) { + nUsePlayer = 1; + if (TJAPlayer3.ConfigIni.nPlayerCount < 2) //プレイ人数が2人以上でなければ入力をキャンセル + break; + } else if (isPad3P) { + nUsePlayer = 2; + if (TJAPlayer3.ConfigIni.nPlayerCount < 3) //プレイ人数が3人以上でなければ入力をキャンセル + break; + } else if (isPad4P) { + nUsePlayer = 3; + if (TJAPlayer3.ConfigIni.nPlayerCount < 4) //プレイ人数が4人以上でなければ入力をキャンセル + break; + } else if (isPad5P) { + nUsePlayer = 4; + if (TJAPlayer3.ConfigIni.nPlayerCount < 5) //プレイ人数が5人以上でなければ入力をキャンセル + break; + } - if (TJAPlayer3.stage演奏ドラム画面.isDeniedPlaying[nUsePlayer]) break; + if (TJAPlayer3.stage演奏ドラム画面.isDeniedPlaying[nUsePlayer]) break; - if (!TJAPlayer3.ConfigIni.bTokkunMode && TJAPlayer3.ConfigIni.bAutoPlay[0] && isPad1P)//2020.05.18 Mr-Ojii オート時の入力キャンセル - break; - else if ((TJAPlayer3.ConfigIni.bAutoPlay[1] || TJAPlayer3.ConfigIni.bAIBattleMode) && isPad2P) - break; - else if (TJAPlayer3.ConfigIni.bAutoPlay[2] && isPad3P) - break; - else if (TJAPlayer3.ConfigIni.bAutoPlay[3] && isPad4P) - break; - else if (TJAPlayer3.ConfigIni.bAutoPlay[4] && isPad5P) - break; - //var padTo = nUsePlayer == 0 ? nPad - 12 : nPad - 12 - 4; - var padTo = nPad - 12; - padTo -= 4 * nUsePlayer; + if (!TJAPlayer3.ConfigIni.bTokkunMode && TJAPlayer3.ConfigIni.bAutoPlay[0] && isPad1P)//2020.05.18 Mr-Ojii オート時の入力キャンセル + break; + else if ((TJAPlayer3.ConfigIni.bAutoPlay[1] || TJAPlayer3.ConfigIni.bAIBattleMode) && isPad2P) + break; + else if (TJAPlayer3.ConfigIni.bAutoPlay[2] && isPad3P) + break; + else if (TJAPlayer3.ConfigIni.bAutoPlay[3] && isPad4P) + break; + else if (TJAPlayer3.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; + var isDon = padTo < 2 ? true : false; - CDTX.CChip chipNoHit = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する(nTime, nUsePlayer); - ENoteJudge e判定 = (chipNoHit != null) ? this.e指定時刻からChipのJUDGEを返す(nTime, chipNoHit, nUsePlayer) : ENoteJudge.Miss; + 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); + e判定 = AlterJudgement(nUsePlayer, e判定, false); - #region [ADLIB] + #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(); - } + 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 + #endregion - #region [Visual effects] + #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 (TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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 (TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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 (TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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 (TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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 (TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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 (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 (TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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 (TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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 (TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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 (TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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 (TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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; + } - TJAPlayer3.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nUsePlayer].Start((PlayerLane.FlashType)nLane); - TJAPlayer3.stage演奏ドラム画面.actMtaiko.tMtaikoEvent(nChannel, nHand, nUsePlayer); + TJAPlayer3.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nUsePlayer].Start((PlayerLane.FlashType)nLane); + TJAPlayer3.stage演奏ドラム画面.actMtaiko.tMtaikoEvent(nChannel, nHand, nUsePlayer); - #endregion + #endregion - // Chip bools - EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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 (this.b連打中[nUsePlayer]) - { - chipNoHit = this.chip現在処理中の連打チップ[nUsePlayer]; - e判定 = ENoteJudge.Perfect; - } - - if (chipNoHit == null) - { - 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; - - 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 - TJAPlayer3.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 && !TJAPlayer3.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 && TJAPlayer3.ConfigIni.bJudgeBigNotes) || _isPinkKonga)) - { - double divided_songspeed = TJAPlayer3.ConfigIni.SongPlaybackSpeed; - float time = chipNoHit.n発声時刻ms - (float)(SoundManager.PlayTimer.NowTimeMs * divided_songspeed); - int nWaitTime = TJAPlayer3.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; - } - } - else if (chipNoHit.eNoteState == ENoteState.wait) - { - - 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; - } - } - } - - // 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); - } - - 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); - } + // Chip bools + EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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 (!bHitted) - break; - continue; - } + if (this.b連打中[nUsePlayer]) { + chipNoHit = this.chip現在処理中の連打チップ[nUsePlayer]; + e判定 = ENoteJudge.Perfect; + } - } + if (chipNoHit == null) { + 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; + + 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 + TJAPlayer3.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 && !TJAPlayer3.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 && TJAPlayer3.ConfigIni.bJudgeBigNotes) || _isPinkKonga)) { + double divided_songspeed = TJAPlayer3.ConfigIni.SongPlaybackSpeed; + float time = chipNoHit.n発声時刻ms - (float)(SoundManager.PlayTimer.NowTimeMs * divided_songspeed); + int nWaitTime = TJAPlayer3.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; + } + } else if (chipNoHit.eNoteState == ENoteState.wait) { + + 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; + } + } + } + + // 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); + } + + 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; - } + } + + + 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 [ (A) ヒットしていればヒット処理して次の inputEvent へ ] + //----------------------------- - #region [Legacy] + #region [Legacy] - /* + /* switch (((Eパッド)nPad)) { case Eパッド.LRed: @@ -1784,912 +1634,771 @@ namespace TJAPlayer3 } */ - #endregion + #endregion - //2016.07.14 kairera0467 Adlibの場合、一括して処理を行う。 + //2016.07.14 kairera0467 Adlibの場合、一括して処理を行う。 - //----------------------------- - #endregion + //----------------------------- + #endregion - #region [ (B) ヒットしてなかった場合は、レーンフラッシュ、パッドアニメ、空打ち音再生を実行 ] - //----------------------------- - int pad = nPad; // 以下、nPad の代わりに pad を用いる。(成りすまし用) - // BAD or TIGHT 時の処理。 - if (TJAPlayer3.ConfigIni.bTight && !b連打中[nUsePlayer]) // 18/8/13 - 連打時にこれが発動すると困る!!! (AioiLight) - this.tチップのヒット処理_BadならびにTight時のMiss(chipNoHit.nコース, EInstrumentPad.DRUMS, 0, EInstrumentPad.TAIKO); - //----------------------------- - #endregion - } - } + #region [ (B) ヒットしてなかった場合は、レーンフラッシュ、パッドアニメ、空打ち音再生を実行 ] + //----------------------------- + int pad = nPad; // 以下、nPad の代わりに pad を用いる。(成りすまし用) + // BAD or TIGHT 時の処理。 + if (TJAPlayer3.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 ); + 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( TJAPlayer3.DTX.strBGIMAGE_PATH ) ) - BgFilename = TJAPlayer3.DTX.strBGIMAGE_PATH; - base.t背景テクスチャの生成( DefaultBgFilename, bgrect, BgFilename ); + if (!String.IsNullOrEmpty(TJAPlayer3.DTX.strBGIMAGE_PATH)) + BgFilename = TJAPlayer3.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 = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(nPlayer)]; + protected override void t進行描画_チップ_Taiko(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer) { + int nLane = (int)PlayerLane.FlashType.Red; + EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(nPlayer)]; - #region[ 作り直したもの ] + #region[ 作り直したもの ] - if (pChip.b可視) - { - if (!pChip.bHit) - { - long nPlayTime = (long)(SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - if ((!pChip.bHit) && (pChip.n発声時刻ms <= nPlayTime)) - { - bool bAutoPlay = TJAPlayer3.ConfigIni.bAutoPlay[nPlayer]; - switch (nPlayer) - { - case 1: - bAutoPlay = TJAPlayer3.ConfigIni.bAutoPlay[nPlayer] || TJAPlayer3.ConfigIni.bAIBattleMode; - break; - } + if (pChip.b可視) { + if (!pChip.bHit) { + long nPlayTime = (long)(SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed); + if ((!pChip.bHit) && (pChip.n発声時刻ms <= nPlayTime)) { + bool bAutoPlay = TJAPlayer3.ConfigIni.bAutoPlay[nPlayer]; + switch (nPlayer) { + case 1: + bAutoPlay = TJAPlayer3.ConfigIni.bAutoPlay[nPlayer] || TJAPlayer3.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); + 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; + //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; + if (pChip.nチャンネル番号 == 0x14 && _gt == EGameType.KONGA) nLane = (int)PlayerLane.FlashType.Clap; - TJAPlayer3.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start((PlayerLane.FlashType)nLane); - TJAPlayer3.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Hit); + TJAPlayer3.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start((PlayerLane.FlashType)nLane); + TJAPlayer3.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Hit); - this.actMtaiko.tMtaikoEvent(pChip.nチャンネル番号, this.nHand[nPlayer], nPlayer); + this.actMtaiko.tMtaikoEvent(pChip.nチャンネル番号, this.nHand[nPlayer], nPlayer); - int n大音符 = (pChip.nチャンネル番号 == 0x11 || pChip.nチャンネル番号 == 0x12 ? 2 : 0); + 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; - } - } + this.tチップのヒット処理(pChip.n発声時刻ms, pChip, EInstrumentPad.TAIKO, true, nLane + n大音符, nPlayer, false); + this.tサウンド再生(pChip, nPlayer); + return; + } + } - if ( pChip.nノーツ出現時刻ms != 0 && ( nPlayTime < pChip.n発声時刻ms - pChip.nノーツ出現時刻ms ) ) - pChip.bShow = false; - else - pChip.bShow = true; + 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; - } + 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 x = pChip.nバーからの距離dot.Taiko; + int y = NoteOriginY[nPlayer];// + ((int)(pChip.nコース) * 100) - int xTemp = 0; - int yTemp = 0; + 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 ] ); - 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.nスクロール方向 != 0) { + xTemp = x; + yTemp = y; + } + 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 ) - { - x = (NoteOriginX[nPlayer]); - } - #endregion + #region[ 両手待ち時 ] + if (pChip.eNoteState == ENoteState.wait) { + x = (NoteOriginX[nPlayer]); + } + #endregion - #region[ HIDSUD & STEALTH ] - if( TJAPlayer3.ConfigIni.eSTEALTH[TJAPlayer3.GetActualPlayer(nPlayer)] == EStealthMode.STEALTH || TJAPlayer3.stage演奏ドラム画面.bCustomDoron) - { - pChip.bShow = false; - } - #endregion + #region[ HIDSUD & STEALTH ] + if (TJAPlayer3.ConfigIni.eSTEALTH[TJAPlayer3.GetActualPlayer(nPlayer)] == EStealthMode.STEALTH || TJAPlayer3.stage演奏ドラム画面.bCustomDoron) { + pChip.bShow = false; + } + #endregion - long __dbt = (long)(SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - long time = pChip.n発声時刻ms - __dbt; - - if( pChip.dbSCROLL_Y != 0.0 ) - { - var dbSCROLL = pChip.eScrollMode == EScrollMode.BMSCROLL ? 1.0 : pChip.dbSCROLL; + long __dbt = (long)(SoundManager.PlayTimer.NowTimeMs * TJAPlayer3.ConfigIni.SongPlaybackSpeed); + long time = pChip.n発声時刻ms - __dbt; - y = NoteOriginY[nPlayer]; + 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); + 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, TJAPlayer3.Skin.Game_Notes_Interval, play_bpm_time, pChip.eScrollMode, false); - } + y += NotesManager.GetNoteY(pChip, time * pChip.dbBPM, _scrollSpeed, TJAPlayer3.Skin.Game_Notes_Interval, play_bpm_time, pChip.eScrollMode, false); + } - if (bSplitLane[nPlayer] || TJAPlayer3.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(TJAPlayer3.GetActualPlayer(nPlayer))].effect.SplitLane) - { - if (NotesManager.IsDonNote(pChip)) - { - y -= TJAPlayer3.Skin.Game_Notes_Size[1] / 3; - } - else if (NotesManager.IsKaNote(pChip)) - { - y += TJAPlayer3.Skin.Game_Notes_Size[1] / 3; - } - } + if (bSplitLane[nPlayer] || TJAPlayer3.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(TJAPlayer3.GetActualPlayer(nPlayer))].effect.SplitLane) { + if (NotesManager.IsDonNote(pChip)) { + y -= TJAPlayer3.Skin.Game_Notes_Size[1] / 3; + } else if (NotesManager.IsKaNote(pChip)) { + y += TJAPlayer3.Skin.Game_Notes_Size[1] / 3; + } + } - if ( time < 0 ) - { - this.actGame.st叩ききりまショー.b最初のチップが叩かれた = true; - } + if (time < 0) { + this.actGame.st叩ききりまショー.b最初のチップが叩かれた = true; + } - if(x > 0 - TJAPlayer3.Skin.Game_Notes_Size[0] && x < TJAPlayer3.Skin.Resolution[0]) - { - if( TJAPlayer3.Tx.Notes[(int)_gt] != null ) - { - //int num9 = this.actCombo.n現在のコンボ数.Drums >= 50 ? this.ctチップ模様アニメ.Drums.n現在の値 * 130 : 0; - int num9 = 0; - if (TJAPlayer3.Skin.Game_Notes_Anime && !TJAPlayer3.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 = TJAPlayer3.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 = TJAPlayer3.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 = TJAPlayer3.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 = TJAPlayer3.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; - } - } + if (x > 0 - TJAPlayer3.Skin.Game_Notes_Size[0] && x < TJAPlayer3.Skin.Resolution[0]) { + if (TJAPlayer3.Tx.Notes[(int)_gt] != null) { + //int num9 = this.actCombo.n現在のコンボ数.Drums >= 50 ? this.ctチップ模様アニメ.Drums.n現在の値 * 130 : 0; + int num9 = 0; + if (TJAPlayer3.Skin.Game_Notes_Anime && !TJAPlayer3.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 = TJAPlayer3.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 = TJAPlayer3.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 = TJAPlayer3.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 = TJAPlayer3.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; + int nSenotesX = 0; + int nSenotesY = 0; - switch (TJAPlayer3.ConfigIni.nPlayerCount) - { - case 1: - case 2: - nSenotesX = TJAPlayer3.Skin.nSENotesX[nPlayer]; - nSenotesY = TJAPlayer3.Skin.nSENotesY[nPlayer]; - break; - case 3: - case 4: - nSenotesX = TJAPlayer3.Skin.nSENotes_4P[0]; - nSenotesY = TJAPlayer3.Skin.nSENotes_4P[1]; - break; - case 5: - nSenotesX = TJAPlayer3.Skin.nSENotes_5P[0]; - nSenotesY = TJAPlayer3.Skin.nSENotes_5P[1]; - break; - } + switch (TJAPlayer3.ConfigIni.nPlayerCount) { + case 1: + case 2: + nSenotesX = TJAPlayer3.Skin.nSENotesX[nPlayer]; + nSenotesY = TJAPlayer3.Skin.nSENotesY[nPlayer]; + break; + case 3: + case 4: + nSenotesX = TJAPlayer3.Skin.nSENotes_4P[0]; + nSenotesY = TJAPlayer3.Skin.nSENotes_4P[1]; + break; + case 5: + nSenotesX = TJAPlayer3.Skin.nSENotes_5P[0]; + nSenotesY = TJAPlayer3.Skin.nSENotes_5P[1]; + break; + } - this.ct手つなぎ.TickLoop(); - float fHand = (this.ct手つなぎ.CurrentValue < 30 ? this.ct手つなぎ.CurrentValue : 60 - this.ct手つなぎ.CurrentValue) / 30.0f; + 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 ) ); + //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; - } + //TJAPlayer3.Tx.Notes[(int)_gt].b加算合成 = false; + //TJAPlayer3.Tx.SENotes.b加算合成 = false; - case 0x1A: - case 0x1B: - { - int moveX = (int)(fHand * TJAPlayer3.Skin.Game_Notes_Arm_Move[0]); - int moveY = (int)(fHand * TJAPlayer3.Skin.Game_Notes_Arm_Move[1]); - if (TJAPlayer3.ConfigIni.eSTEALTH[TJAPlayer3.GetActualPlayer(nPlayer)] == EStealthMode.OFF && pChip.bShow) - { - if (nPlayer != TJAPlayer3.ConfigIni.nPlayerCount - 1) - { - //上から下 - TJAPlayer3.Tx.Notes_Arm?.t2D上下反転描画( - x + TJAPlayer3.Skin.Game_Notes_Arm_Offset_Left_X[0] + moveX, - y + TJAPlayer3.Skin.Game_Notes_Arm_Offset_Left_Y[0] + moveY); - TJAPlayer3.Tx.Notes_Arm?.t2D上下反転描画( - x + TJAPlayer3.Skin.Game_Notes_Arm_Offset_Right_X[0] - moveX, - y + TJAPlayer3.Skin.Game_Notes_Arm_Offset_Right_Y[0] - moveY); - } - if (nPlayer != 0) - { - //下から上 - TJAPlayer3.Tx.Notes_Arm?.t2D描画( - x + TJAPlayer3.Skin.Game_Notes_Arm_Offset_Left_X[1] + moveX, - y + TJAPlayer3.Skin.Game_Notes_Arm_Offset_Left_Y[1] + moveY); - TJAPlayer3.Tx.Notes_Arm?.t2D描画( - x + TJAPlayer3.Skin.Game_Notes_Arm_Offset_Right_X[1] - moveX, - y + TJAPlayer3.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; - } + 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); - case 0x1F: - { - NotesManager.DisplayNote(nPlayer, x, y, pChip, num9); - } - break; - default: - { - } - break; + //TJAPlayer3.Tx.SENotes[(int)_gt]?.t2D描画(device, x - 2, y + nSenotesY, new Rectangle(0, 30 * pChip.nSenote, 136, 30)); + 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 * TJAPlayer3.ConfigIni.SongPlaybackSpeed); + case 0x1A: + case 0x1B: { + int moveX = (int)(fHand * TJAPlayer3.Skin.Game_Notes_Arm_Move[0]); + int moveY = (int)(fHand * TJAPlayer3.Skin.Game_Notes_Arm_Move[1]); + if (TJAPlayer3.ConfigIni.eSTEALTH[TJAPlayer3.GetActualPlayer(nPlayer)] == EStealthMode.OFF && pChip.bShow) { + if (nPlayer != TJAPlayer3.ConfigIni.nPlayerCount - 1) { + //上から下 + TJAPlayer3.Tx.Notes_Arm?.t2D上下反転描画( + x + TJAPlayer3.Skin.Game_Notes_Arm_Offset_Left_X[0] + moveX, + y + TJAPlayer3.Skin.Game_Notes_Arm_Offset_Left_Y[0] + moveY); + TJAPlayer3.Tx.Notes_Arm?.t2D上下反転描画( + x + TJAPlayer3.Skin.Game_Notes_Arm_Offset_Right_X[0] - moveX, + y + TJAPlayer3.Skin.Game_Notes_Arm_Offset_Right_Y[0] - moveY); + } + if (nPlayer != 0) { + //下から上 + TJAPlayer3.Tx.Notes_Arm?.t2D描画( + x + TJAPlayer3.Skin.Game_Notes_Arm_Offset_Left_X[1] + moveX, + y + TJAPlayer3.Skin.Game_Notes_Arm_Offset_Left_Y[1] + moveY); + TJAPlayer3.Tx.Notes_Arm?.t2D描画( + x + TJAPlayer3.Skin.Game_Notes_Arm_Offset_Right_X[1] - moveX, + y + TJAPlayer3.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; + } - switch (TJAPlayer3.ConfigIni.nPlayerCount) - { - case 1: - case 2: - nSenotesX = TJAPlayer3.Skin.nSENotesX[nPlayer]; - nSenotesY = TJAPlayer3.Skin.nSENotesY[nPlayer]; - break; - case 3: - case 4: - nSenotesX = TJAPlayer3.Skin.nSENotes_4P[0]; - nSenotesY = TJAPlayer3.Skin.nSENotes_4P[1]; - break; - case 5: - nSenotesX = TJAPlayer3.Skin.nSENotes_5P[0]; - nSenotesY = TJAPlayer3.Skin.nSENotes_5P[1]; - break; - } + case 0x1F: { + NotesManager.DisplayNote(nPlayer, x, y, pChip, num9); + } + break; + default: { + } + break; - int nノート座標 = pChip.nバーからの距離dot.Taiko; - int nノート末端座標 = pChip.nバーからのノーツ末端距離dot; - int nノート末端座標_Y = pChip.nバーからのノーツ末端距離dot_Y; - int n先頭発声位置 = 0; + } + //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 * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(nPlayer)]; + switch (TJAPlayer3.ConfigIni.nPlayerCount) { + case 1: + case 2: + nSenotesX = TJAPlayer3.Skin.nSENotesX[nPlayer]; + nSenotesY = TJAPlayer3.Skin.nSENotesY[nPlayer]; + break; + case 3: + case 4: + nSenotesX = TJAPlayer3.Skin.nSENotes_4P[0]; + nSenotesY = TJAPlayer3.Skin.nSENotes_4P[1]; + break; + case 5: + nSenotesX = TJAPlayer3.Skin.nSENotes_5P[0]; + nSenotesY = TJAPlayer3.Skin.nSENotes_5P[1]; + break; + } - // 2016.11.2 kairera0467 - // 黄連打音符を赤くするやつの実装方法メモ - //前面を黄色、背面を変色後にしたものを重ねて、打数に応じて前面の透明度を操作すれば、色を操作できるはず。 - //ただしテクスチャのαチャンネル部分が太くなるなどのデメリットが出る。備えよう。 + int nノート座標 = pChip.nバーからの距離dot.Taiko; + int nノート末端座標 = pChip.nバーからのノーツ末端距離dot; + int nノート末端座標_Y = pChip.nバーからのノーツ末端距離dot_Y; + int n先頭発声位置 = 0; - #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; + EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(nPlayer)]; - CDTX.CChip cChip = null; - if (pChip.nノーツ移動開始時刻ms != 0) // n先頭発声位置 value is only used when this condition is met - { - cChip = TJAPlayer3.stage演奏ドラム画面.r指定時刻に一番近い連打Chip_ヒット未済問わず不可視考慮(pChip.n発声時刻ms, 0x10 + pChip.n連打音符State, 0, nPlayer); - if (cChip != null) - { - n先頭発声位置 = cChip.n発声時刻ms; - } - } - } + // 2016.11.2 kairera0467 + // 黄連打音符を赤くするやつの実装方法メモ + //前面を黄色、背面を変色後にしたものを重ねて、打数に応じて前面の透明度を操作すれば、色を操作できるはず。 + //ただしテクスチャのαチャンネル部分が太くなるなどのデメリットが出る。備えよう。 - int x = NoteOriginX[nPlayer] + nノート座標; - int x末端 = NoteOriginX[nPlayer] + nノート末端座標; - int y末端 = NoteOriginY[nPlayer] + nノート末端座標_Y; - int y = NoteOriginY[nPlayer]; + #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; - if (pChip.dbSCROLL_Y != 0.0) - { - 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, TJAPlayer3.Skin.Game_Notes_Interval, play_bpm_time, pChip.eScrollMode, false); - } + CDTX.CChip cChip = null; + if (pChip.nノーツ移動開始時刻ms != 0) // n先頭発声位置 value is only used when this condition is met + { + cChip = TJAPlayer3.stage演奏ドラム画面.r指定時刻に一番近い連打Chip_ヒット未済問わず不可視考慮(pChip.n発声時刻ms, 0x10 + pChip.n連打音符State, 0, nPlayer); + if (cChip != null) { + n先頭発声位置 = cChip.n発声時刻ms; + } + } + } - if (bSplitLane[nPlayer] || TJAPlayer3.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(TJAPlayer3.GetActualPlayer(nPlayer))].effect.SplitLane) - { - if (TJAPlayer3.ConfigIni.nGameType[nPlayer] == EGameType.KONGA) - { - if (NotesManager.IsClapRoll(pChip)) - { - } - else if (NotesManager.IsYellowRoll(pChip)) - { - y += TJAPlayer3.Skin.Game_Notes_Size[1] / 2; - y末端 += TJAPlayer3.Skin.Game_Notes_Size[1] / 2; - } - else if (NotesManager.IsRoll(pChip)) - { - y -= TJAPlayer3.Skin.Game_Notes_Size[1] / 2; - y末端 -= TJAPlayer3.Skin.Game_Notes_Size[1] / 2; - } - } - } + int x = NoteOriginX[nPlayer] + nノート座標; + int x末端 = NoteOriginX[nPlayer] + nノート末端座標; + int y末端 = NoteOriginY[nPlayer] + nノート末端座標_Y; + int y = NoteOriginY[nPlayer]; - #region[ HIDSUD & STEALTH ] + if (pChip.dbSCROLL_Y != 0.0) { + 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, TJAPlayer3.Skin.Game_Notes_Interval, play_bpm_time, pChip.eScrollMode, false); + } - if (TJAPlayer3.ConfigIni.eSTEALTH[TJAPlayer3.GetActualPlayer(nPlayer)] == EStealthMode.STEALTH || TJAPlayer3.stage演奏ドラム画面.bCustomDoron) - { - pChip.bShow = false; - } + if (bSplitLane[nPlayer] || TJAPlayer3.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(TJAPlayer3.GetActualPlayer(nPlayer))].effect.SplitLane) { + if (TJAPlayer3.ConfigIni.nGameType[nPlayer] == EGameType.KONGA) { + if (NotesManager.IsClapRoll(pChip)) { + } else if (NotesManager.IsYellowRoll(pChip)) { + y += TJAPlayer3.Skin.Game_Notes_Size[1] / 2; + y末端 += TJAPlayer3.Skin.Game_Notes_Size[1] / 2; + } else if (NotesManager.IsRoll(pChip)) { + y -= TJAPlayer3.Skin.Game_Notes_Size[1] / 2; + y末端 -= TJAPlayer3.Skin.Game_Notes_Size[1] / 2; + } + } + } - #endregion + #region[ HIDSUD & STEALTH ] - //if( CDTXMania.ConfigIni.eScrollMode != EScrollMode.Normal ) - //x -= 10; + if (TJAPlayer3.ConfigIni.eSTEALTH[TJAPlayer3.GetActualPlayer(nPlayer)] == EStealthMode.STEALTH || TJAPlayer3.stage演奏ドラム画面.bCustomDoron) { + pChip.bShow = false; + } - //if(x末端 > 0 - TJAPlayer3.Skin.Game_Notes_Size[0] && x < TJAPlayer3.Skin.Resolution[0]) - if((Math.Min(x, x末端) < TJAPlayer3.Skin.Resolution[0] && Math.Max(x, x末端) > 0 - TJAPlayer3.Skin.Game_Notes_Size[0])) - { - if (TJAPlayer3.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 (TJAPlayer3.Skin.Game_Notes_Anime && !TJAPlayer3.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 = TJAPlayer3.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 = TJAPlayer3.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 = TJAPlayer3.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 = TJAPlayer3.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; - } - } + #endregion - //kairera0467氏 の TJAPlayer2forPC のコードを参考にし、打数に応じて色を変える(打数の変更以外はほとんどそのまんま) ろみゅ~? 2018/8/20 - pChip.RollInputTime?.Tick(); - pChip.RollDelay?.Tick(); + //if( CDTXMania.ConfigIni.eScrollMode != EScrollMode.Normal ) + //x -= 10; - if (pChip.RollInputTime != null && pChip.RollInputTime.IsEnded) - { - pChip.RollInputTime.Stop(); - pChip.RollInputTime.CurrentValue = 0; - pChip.RollDelay = new CCounter(0, 1, 1, TJAPlayer3.Timer); - } + //if(x末端 > 0 - TJAPlayer3.Skin.Game_Notes_Size[0] && x < TJAPlayer3.Skin.Resolution[0]) + if ((Math.Min(x, x末端) < TJAPlayer3.Skin.Resolution[0] && Math.Max(x, x末端) > 0 - TJAPlayer3.Skin.Game_Notes_Size[0])) { + if (TJAPlayer3.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 (TJAPlayer3.Skin.Game_Notes_Anime && !TJAPlayer3.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 = TJAPlayer3.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 = TJAPlayer3.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 = TJAPlayer3.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 = TJAPlayer3.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; + } + } - if (pChip.RollDelay != null && pChip.RollDelay.IsEnded && pChip.RollEffectLevel > 0) - { - pChip.RollEffectLevel--; - pChip.RollDelay = new CCounter(0, 1, 1, TJAPlayer3.Timer); - pChip.RollDelay.CurrentValue = 0; - } + //kairera0467氏 の TJAPlayer2forPC のコードを参考にし、打数に応じて色を変える(打数の変更以外はほとんどそのまんま) ろみゅ~? 2018/8/20 + pChip.RollInputTime?.Tick(); + pChip.RollDelay?.Tick(); - 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; + if (pChip.RollInputTime != null && pChip.RollInputTime.IsEnded) { + pChip.RollInputTime.Stop(); + pChip.RollInputTime.CurrentValue = 0; + pChip.RollDelay = new CCounter(0, 1, 1, TJAPlayer3.Timer); + } - //136, 30 - var _size = TJAPlayer3.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 (pChip.RollDelay != null && pChip.RollDelay.IsEnded && pChip.RollEffectLevel > 0) { + pChip.RollEffectLevel--; + pChip.RollDelay = new CCounter(0, 1, 1, TJAPlayer3.Timer); + pChip.RollDelay.CurrentValue = 0; + } - 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]; - } - + 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; - NotesManager.DisplayRoll(nPlayer, x, y, pChip, num9, normalColor, effectedColor, x末端, y末端); + //136, 30 + var _size = TJAPlayer3.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 (TJAPlayer3.Tx.SENotes[(int)_gt] != null) - { - int _shift = NotesManager.IsBigRoll(pChip) ? 26 : 0; + 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]; + } - if (!NotesManager.IsFuzeRoll(pChip)) - { - TJAPlayer3.Tx.SENotes[(int)_gt].vcScaleRatio.X = x末端 - x - 44 - _shift; - TJAPlayer3.Tx.SENotes[(int)_gt].t2D描画(x + 90 + _shift, y + nSenotesY, new Rectangle(_60_cut, 8 * _size[1], 1, _size[1])); - TJAPlayer3.Tx.SENotes[(int)_gt].vcScaleRatio.X = 1.0f; - TJAPlayer3.Tx.SENotes[(int)_gt].t2D描画(x + 30 + _shift, y + nSenotesY, new Rectangle(0, 8 * _size[1], _60_cut, _size[1])); - TJAPlayer3.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.DisplayRoll(nPlayer, x, y, pChip, num9, normalColor, effectedColor, x末端, y末端); - NotesManager.DisplayNote(nPlayer, x, y, pChip, num9, TJAPlayer3.Skin.Game_Notes_Size[0] * 2); - NotesManager.DisplaySENotes(nPlayer, x + nSenotesX, y + nSenotesY, pChip); + if (TJAPlayer3.Tx.SENotes[(int)_gt] != null) { + int _shift = NotesManager.IsBigRoll(pChip) ? 26 : 0; - /* + if (!NotesManager.IsFuzeRoll(pChip)) { + TJAPlayer3.Tx.SENotes[(int)_gt].vcScaleRatio.X = x末端 - x - 44 - _shift; + TJAPlayer3.Tx.SENotes[(int)_gt].t2D描画(x + 90 + _shift, y + nSenotesY, new Rectangle(_60_cut, 8 * _size[1], 1, _size[1])); + TJAPlayer3.Tx.SENotes[(int)_gt].vcScaleRatio.X = 1.0f; + TJAPlayer3.Tx.SENotes[(int)_gt].t2D描画(x + 30 + _shift, y + nSenotesY, new Rectangle(0, 8 * _size[1], _60_cut, _size[1])); + TJAPlayer3.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, TJAPlayer3.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 (TJAPlayer3.Tx.Notes[(int)_gt] != null) - TJAPlayer3.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 - TJAPlayer3.Tx.SENotes[(int)_gt]?.t2D描画(x + 56, y + nSenotesY, new Rectangle(_58_cut, 9 * _size[1], _78_cut, _size[1])); - } + //TJAPlayer3.Tx.SENotes.t2D描画(x - 2, y + nSenotesY, new Rectangle(0, 30 * pChip.nSenote, 136, 30)); + } + } + if (NotesManager.IsRollEnd(pChip)) { + //大きい連打か小さい連打かの区別方法を考えてなかったよちくしょう + if (TJAPlayer3.Tx.Notes[(int)_gt] != null) + TJAPlayer3.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 + TJAPlayer3.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 = TJAPlayer3.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(TJAPlayer3.GetActualPlayer(nPlayer))]; + if (pChip.n発声時刻ms < nowTime && pChip.nノーツ終了時刻ms > nowTime) { + var puchichara = TJAPlayer3.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(TJAPlayer3.GetActualPlayer(nPlayer))]; - //時間内でかつ0x9Aじゃないならならヒット処理 - if (!NotesManager.IsRollEnd(pChip) && - ((nPlayer != 1 ? TJAPlayer3.ConfigIni.bAutoPlay[nPlayer] : - (TJAPlayer3.ConfigIni.bAutoPlay[nPlayer] || TJAPlayer3.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 ) - { + //時間内でかつ0x9Aじゃないならならヒット処理 + if (!NotesManager.IsRollEnd(pChip) && + ((nPlayer != 1 ? TJAPlayer3.ConfigIni.bAutoPlay[nPlayer] : + (TJAPlayer3.ConfigIni.bAutoPlay[nPlayer] || TJAPlayer3.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) { + } + 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; + 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 ]; + //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 * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - long time = pChip.n発声時刻ms - __dbt; - float play_bpm_time = this.GetNowPBMTime(dTX, 0); - y += NotesManager.GetNoteY(pChip, time * pChip.dbBPM, _scrollSpeed, TJAPlayer3.Skin.Game_Notes_Interval, play_bpm_time, pChip.eScrollMode, false); + 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 * TJAPlayer3.ConfigIni.SongPlaybackSpeed); + long time = pChip.n発声時刻ms - __dbt; + float play_bpm_time = this.GetNowPBMTime(dTX, 0); + y += NotesManager.GetNoteY(pChip, time * pChip.dbBPM, _scrollSpeed, TJAPlayer3.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 += (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) && (TJAPlayer3.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 ) ); - TJAPlayer3.Tx.Bar_Branch?.t2D描画( x + ((TJAPlayer3.Skin.Game_Notes_Size[0] - TJAPlayer3.Tx.Bar_Branch.szTextureSize.Width) / 2), y, new Rectangle( 0, 0, TJAPlayer3.Tx.Bar_Branch.szTextureSize.Width, TJAPlayer3.Skin.Game_Notes_Size[1]) ); - } - else - { - //this.tx小節線.t2D描画( CDTXMania.app.Device, x - 3, y, new Rectangle( 0, 0, 3, 130 ) ); - TJAPlayer3.Tx.Bar?.t2D描画( x + ((TJAPlayer3.Skin.Game_Notes_Size[0] - TJAPlayer3.Tx.Bar.szTextureSize.Width) / 2), y, new Rectangle( 0, 0, TJAPlayer3.Tx.Bar.szTextureSize.Width, TJAPlayer3.Skin.Game_Notes_Size[1]) ); - } - } + if ((pChip.b可視 && !pChip.bHideBarLine) && (TJAPlayer3.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 ) ); + TJAPlayer3.Tx.Bar_Branch?.t2D描画(x + ((TJAPlayer3.Skin.Game_Notes_Size[0] - TJAPlayer3.Tx.Bar_Branch.szTextureSize.Width) / 2), y, new Rectangle(0, 0, TJAPlayer3.Tx.Bar_Branch.szTextureSize.Width, TJAPlayer3.Skin.Game_Notes_Size[1])); + } else { + //this.tx小節線.t2D描画( CDTXMania.app.Device, x - 3, y, new Rectangle( 0, 0, 3, 130 ) ); + TJAPlayer3.Tx.Bar?.t2D描画(x + ((TJAPlayer3.Skin.Game_Notes_Size[0] - TJAPlayer3.Tx.Bar.szTextureSize.Width) / 2), y, new Rectangle(0, 0, TJAPlayer3.Tx.Bar.szTextureSize.Width, TJAPlayer3.Skin.Game_Notes_Size[1])); + } + } } } - /// - /// 全体にわたる制御をする。 - /// - public void t全体制御メソッド() - { - int t = (int)SoundManager.PlayTimer.NowTimeMs; - //CDTXMania.act文字コンソール.tPrint( 0, 16, C文字コンソール.Eフォント種別.白, t.ToString() ); + /// + /// 全体にわたる制御をする。 + /// + public void t全体制御メソッド() { + int t = (int)SoundManager.PlayTimer.NowTimeMs; + //CDTXMania.act文字コンソール.tPrint( 0, 16, C文字コンソール.Eフォント種別.白, t.ToString() ); - this.actBalloon.tDrawKusudama(); + this.actBalloon.tDrawKusudama(); - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - var chkChip = this.chip現在処理中の連打チップ[i]; - if (chkChip != null) - { - long nowTime = (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.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; - } + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + var chkChip = this.chip現在処理中の連打チップ[i]; + if (chkChip != null) { + long nowTime = (long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.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; + } - } - } - } - #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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - CDTX.CChip chipNoHit = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + CDTX.CChip chipNoHit = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed), i); - EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(i)]; - bool _isBigKaTaiko = NotesManager.IsBigKaTaiko(chipNoHit, _gt); - bool _isBigDonTaiko = NotesManager.IsBigDonTaiko(chipNoHit, _gt); - bool _isSwapNote = NotesManager.IsSwapNote(chipNoHit, _gt); + EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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 * TJAPlayer3.ConfigIni.SongPlaybackSpeed); - int nWaitTime = TJAPlayer3.ConfigIni.nBigNoteWaitTimems; - if (chipNoHit.eNoteState == ENoteState.wait && timeC <= 110 - && chipNoHit.nProcessTime + nWaitTime <= (int)(SoundManager.PlayTimer.NowTime * TJAPlayer3.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; - } - + if (chipNoHit != null && (_isBigDonTaiko || _isBigKaTaiko)) { + float timeC = chipNoHit.n発声時刻ms - (float)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed); + int nWaitTime = TJAPlayer3.ConfigIni.nBigNoteWaitTimems; + if (chipNoHit.eNoteState == ENoteState.wait && timeC <= 110 + && chipNoHit.nProcessTime + nWaitTime <= (int)(SoundManager.PlayTimer.NowTime * TJAPlayer3.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 + chipNoHit.eNoteState = ENoteState.none; + } + } + } - //string strNull = "Found"; + #endregion - if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F1)) - { - if (!this.actPauseMenu.bIsActivePopupMenu && this.bPAUSE == false) - { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); + //string strNull = "Found"; - SoundManager.PlayTimer.Pause(); - TJAPlayer3.Timer.Pause(); - TJAPlayer3.DTX.t全チップの再生一時停止(); - this.actAVI.tPauseControl(); + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F1)) { + if (!this.actPauseMenu.bIsActivePopupMenu && this.bPAUSE == false) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); - this.bPAUSE = true; - this.actPauseMenu.tActivatePopupMenu(0); - } + SoundManager.PlayTimer.Pause(); + TJAPlayer3.Timer.Pause(); + TJAPlayer3.DTX.t全チップの再生一時停止(); + this.actAVI.tPauseControl(); - } + this.bPAUSE = true; + this.actPauseMenu.tActivatePopupMenu(0); + } - } + } - private void t進行描画_リアルタイム判定数表示() - { - var showJudgeInfo = false; + } - if (TJAPlayer3.ConfigIni.nPlayerCount == 1 ? (TJAPlayer3.ConfigIni.bJudgeCountDisplay && !TJAPlayer3.ConfigIni.bAutoPlay[0]) : false) showJudgeInfo = true; - if (TJAPlayer3.ConfigIni.bTokkunMode) showJudgeInfo = true; + private void t進行描画_リアルタイム判定数表示() { + var showJudgeInfo = false; - if (showJudgeInfo) - { - //ボードの横幅は333px - //数字フォントの小さいほうはリザルトのものと同じ。 - if( TJAPlayer3.Tx.Judge_Meter != null ) - TJAPlayer3.Tx.Judge_Meter.t2D描画( TJAPlayer3.Skin.Game_Judge_Meter[0], TJAPlayer3.Skin.Game_Judge_Meter[1]); + if (TJAPlayer3.ConfigIni.nPlayerCount == 1 ? (TJAPlayer3.ConfigIni.bJudgeCountDisplay && !TJAPlayer3.ConfigIni.bAutoPlay[0]) : false) showJudgeInfo = true; + if (TJAPlayer3.ConfigIni.bTokkunMode) showJudgeInfo = true; - this.t小文字表示(TJAPlayer3.Skin.Game_Judge_Meter_Perfect[0], TJAPlayer3.Skin.Game_Judge_Meter_Perfect[1], this.nヒット数_Auto含まない.Drums.Perfect, false, false); - this.t小文字表示(TJAPlayer3.Skin.Game_Judge_Meter_Good[0], TJAPlayer3.Skin.Game_Judge_Meter_Good[1], this.nヒット数_Auto含まない.Drums.Great, false, false); - this.t小文字表示(TJAPlayer3.Skin.Game_Judge_Meter_Miss[0], TJAPlayer3.Skin.Game_Judge_Meter_Miss[1], this.nヒット数_Auto含まない.Drums.Miss, false, false); - this.t小文字表示(TJAPlayer3.Skin.Game_Judge_Meter_Roll[0], TJAPlayer3.Skin.Game_Judge_Meter_Roll[1], GetRoll(0), false, false); + if (showJudgeInfo) { + //ボードの横幅は333px + //数字フォントの小さいほうはリザルトのものと同じ。 + if (TJAPlayer3.Tx.Judge_Meter != null) + TJAPlayer3.Tx.Judge_Meter.t2D描画(TJAPlayer3.Skin.Game_Judge_Meter[0], TJAPlayer3.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 * ( TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect + TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great)) / (double)nNowTotal); - double dbPERFECT率 = Math.Round((100.0 * TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect) / (double)nNowTotal); - double dbGREAT率 = Math.Round((100.0 * TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great / (double)nNowTotal)); - double dbMISS率 = Math.Round((100.0 * TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Miss / (double)nNowTotal)); + this.t小文字表示(TJAPlayer3.Skin.Game_Judge_Meter_Perfect[0], TJAPlayer3.Skin.Game_Judge_Meter_Perfect[1], this.nヒット数_Auto含まない.Drums.Perfect, false, false); + this.t小文字表示(TJAPlayer3.Skin.Game_Judge_Meter_Good[0], TJAPlayer3.Skin.Game_Judge_Meter_Good[1], this.nヒット数_Auto含まない.Drums.Great, false, false); + this.t小文字表示(TJAPlayer3.Skin.Game_Judge_Meter_Miss[0], TJAPlayer3.Skin.Game_Judge_Meter_Miss[1], this.nヒット数_Auto含まない.Drums.Miss, false, false); + this.t小文字表示(TJAPlayer3.Skin.Game_Judge_Meter_Roll[0], TJAPlayer3.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 * (TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect + TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great)) / (double)nNowTotal); + double dbPERFECT率 = Math.Round((100.0 * TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect) / (double)nNowTotal); + double dbGREAT率 = Math.Round((100.0 * TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great / (double)nNowTotal)); + double dbMISS率 = Math.Round((100.0 * TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Miss / (double)nNowTotal)); - this.t大文字表示(TJAPlayer3.Skin.Game_Judge_Meter_HitRate[0], TJAPlayer3.Skin.Game_Judge_Meter_HitRate[1], (int)dbたたけた率); - this.t小文字表示(TJAPlayer3.Skin.Game_Judge_Meter_PerfectRate[0], TJAPlayer3.Skin.Game_Judge_Meter_PerfectRate[1], (int)dbPERFECT率, false, true); - this.t小文字表示(TJAPlayer3.Skin.Game_Judge_Meter_GoodRate[0], TJAPlayer3.Skin.Game_Judge_Meter_GoodRate[1], (int)dbGREAT率, false, true); - this.t小文字表示(TJAPlayer3.Skin.Game_Judge_Meter_MissRate[0], TJAPlayer3.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; - private void t小文字表示( int x, int y, int num, bool bOrange, bool drawPercent ) - { - float width = TJAPlayer3.Tx.Result_Number.sz画像サイズ.Width / 11.0f; - float height = TJAPlayer3.Tx.Result_Number.sz画像サイズ.Height / 2.0f; + this.t大文字表示(TJAPlayer3.Skin.Game_Judge_Meter_HitRate[0], TJAPlayer3.Skin.Game_Judge_Meter_HitRate[1], (int)dbたたけた率); + this.t小文字表示(TJAPlayer3.Skin.Game_Judge_Meter_PerfectRate[0], TJAPlayer3.Skin.Game_Judge_Meter_PerfectRate[1], (int)dbPERFECT率, false, true); + this.t小文字表示(TJAPlayer3.Skin.Game_Judge_Meter_GoodRate[0], TJAPlayer3.Skin.Game_Judge_Meter_GoodRate[1], (int)dbGREAT率, false, true); + this.t小文字表示(TJAPlayer3.Skin.Game_Judge_Meter_MissRate[0], TJAPlayer3.Skin.Game_Judge_Meter_MissRate[1], (int)dbMISS率, false, true); + } + } - int[] nums = CConversion.SeparateDigits(num); + private void t小文字表示(int x, int y, int num, bool bOrange, bool drawPercent) { + float width = TJAPlayer3.Tx.Result_Number.sz画像サイズ.Width / 11.0f; + float height = TJAPlayer3.Tx.Result_Number.sz画像サイズ.Height / 2.0f; - if (drawPercent) - { - TJAPlayer3.Tx.Result_Number.t2D拡大率考慮中央基準描画(x + (TJAPlayer3.Skin.Result_Number_Interval[0] * 3.0f) + (width / 2), - y + (TJAPlayer3.Skin.Result_Number_Interval[1] * 3.0f) + (height / 2), - new System.Drawing.RectangleF(width * 10, 0, width, height)); - } + int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) - { - float offset = j - 1.5f; - float _x = x - (TJAPlayer3.Skin.Result_Number_Interval[0] * offset); - float _y = y - (TJAPlayer3.Skin.Result_Number_Interval[1] * offset); + if (drawPercent) { + TJAPlayer3.Tx.Result_Number.t2D拡大率考慮中央基準描画(x + (TJAPlayer3.Skin.Result_Number_Interval[0] * 3.0f) + (width / 2), + y + (TJAPlayer3.Skin.Result_Number_Interval[1] * 3.0f) + (height / 2), + new System.Drawing.RectangleF(width * 10, 0, width, height)); + } - TJAPlayer3.Tx.Result_Number.t2D拡大率考慮中央基準描画(_x + (width / 2), _y + (height / 2), - new System.Drawing.RectangleF(width * nums[j], 0, width, height)); - } - } + for (int j = 0; j < nums.Length; j++) { + float offset = j - 1.5f; + float _x = x - (TJAPlayer3.Skin.Result_Number_Interval[0] * offset); + float _y = y - (TJAPlayer3.Skin.Result_Number_Interval[1] * offset); - 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 - ((TJAPlayer3.Skin.Result_Number_Interval[0] * 1.27f) * offset); - float _y = y - ((TJAPlayer3.Skin.Result_Number_Interval[1] * 1.27f) * offset); + TJAPlayer3.Tx.Result_Number.t2D拡大率考慮中央基準描画(_x + (width / 2), _y + (height / 2), + new System.Drawing.RectangleF(width * nums[j], 0, width, height)); + } + } - float width = TJAPlayer3.Tx.Result_Number.sz画像サイズ.Width / 11.0f; - float height = TJAPlayer3.Tx.Result_Number.sz画像サイズ.Height / 2.0f; + 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 - ((TJAPlayer3.Skin.Result_Number_Interval[0] * 1.27f) * offset); + float _y = y - ((TJAPlayer3.Skin.Result_Number_Interval[1] * 1.27f) * offset); - TJAPlayer3.Tx.Result_Number.t2D拡大率考慮中央基準描画(_x + (width / 2), _y + (height / 2), - new System.Drawing.RectangleF(width * nums[j], height, width, height)); - } - } + float width = TJAPlayer3.Tx.Result_Number.sz画像サイズ.Width / 11.0f; + float height = TJAPlayer3.Tx.Result_Number.sz画像サイズ.Height / 2.0f; + + TJAPlayer3.Tx.Result_Number.t2D拡大率考慮中央基準描画(_x + (width / 2), _y + (height / 2), + new System.Drawing.RectangleF(width * nums[j], height, width, height)); + } + } #endregion } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/Dan_Cert.cs b/OpenTaiko/src/Stages/07.Game/Taiko/Dan_Cert.cs index 1e7c93f4..180cc4a5 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/Dan_Cert.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/Dan_Cert.cs @@ -1,252 +1,215 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; using FDK; -using System.IO; -using System.Linq; using static TJAPlayer3.CActSelect曲リスト; - +using Color = System.Drawing.Color; using Rectangle = System.Drawing.Rectangle; using RectangleF = System.Drawing.RectangleF; -using Color = System.Drawing.Color; -namespace TJAPlayer3 -{ - static internal class CExamInfo - { - // Includes the gauge exam, DanCert max number of exams is 6 - public static readonly int cMaxExam = 7; +namespace TJAPlayer3 { + 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; - } + // 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; - } + internal class Dan_Cert : CActivity { + /// + /// 段位認定 + /// + public Dan_Cert() { + base.IsDeActivated = true; + } - // - Dan_C[] Challenge = new Dan_C[CExamInfo.cMaxExam]; - // + // + Dan_C[] Challenge = new Dan_C[CExamInfo.cMaxExam]; + // - public void Start(int number) - { - NowShowingNumber = number; - if (number == 0) - { - Counter_Wait = new CCounter(0, 2299, 1, TJAPlayer3.Timer); - } - else - { - Counter_In = new CCounter(0, 999, 1, TJAPlayer3.Timer); - } - bExamChangeCheck = false; + public void Start(int number) { + NowShowingNumber = number; + if (number == 0) { + Counter_Wait = new CCounter(0, 2299, 1, TJAPlayer3.Timer); + } else { + Counter_In = new CCounter(0, 999, 1, TJAPlayer3.Timer); + } + bExamChangeCheck = false; - if (number == 0) - { - for (int i = 1; i < CExamInfo.cMaxExam; i++) - ExamChange[i] = false; + if (number == 0) { + for (int i = 1; i < CExamInfo.cMaxExam; i++) + ExamChange[i] = false; - for (int j = 0; j < CExamInfo.cMaxExam; j++) - { - if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[0].Dan_C[j] != null) - { - Challenge[j] = TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j]; - if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count - 1].Dan_C[j] != null - && TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count > 1) // Individual exams, not counted if dan is only a single song - { - if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j].GetExamRange() == Exam.Range.Less) - { - TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j].Amount = TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j].Value[0]; - } - else - { - TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j].Amount = 0; - } + for (int j = 0; j < CExamInfo.cMaxExam; j++) { + if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[0].Dan_C[j] != null) { + Challenge[j] = TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j]; + if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count - 1].Dan_C[j] != null + && TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count > 1) // Individual exams, not counted if dan is only a single song + { + if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j].GetExamRange() == Exam.Range.Less) { + TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j].Amount = TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j].Value[0]; + } else { + TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j].Amount = 0; + } - ExamChange[j] = true; - } - } - } - } + ExamChange[j] = true; + } + } + } + } - ScreenPoint = new double[] { TJAPlayer3.Skin.Game_Lane_X[0] - TJAPlayer3.Tx.DanC_Screen.szTextureSize.Width / 2, TJAPlayer3.Skin.Resolution[0] }; + ScreenPoint = new double[] { TJAPlayer3.Skin.Game_Lane_X[0] - TJAPlayer3.Tx.DanC_Screen.szTextureSize.Width / 2, TJAPlayer3.Skin.Resolution[0] }; - TJAPlayer3.stage演奏ドラム画面.ReSetScore(TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].ScoreInit, TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].ScoreDiff); + TJAPlayer3.stage演奏ドラム画面.ReSetScore(TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].ScoreInit, TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].ScoreDiff); - TJAPlayer3.stage演奏ドラム画面.ftDanReSetScoreNiji(TJAPlayer3.DTX.nDan_NotesCount[NowShowingNumber], TJAPlayer3.DTX.nDan_BalloonCount[NowShowingNumber]); - TJAPlayer3.stage演奏ドラム画面.ftDanReSetBranches(TJAPlayer3.DTX.bHasBranchDan[NowShowingNumber]); + TJAPlayer3.stage演奏ドラム画面.ftDanReSetScoreNiji(TJAPlayer3.DTX.nDan_NotesCount[NowShowingNumber], TJAPlayer3.DTX.nDan_BalloonCount[NowShowingNumber]); + TJAPlayer3.stage演奏ドラム画面.ftDanReSetBranches(TJAPlayer3.DTX.bHasBranchDan[NowShowingNumber]); - IsAnimating = true; + IsAnimating = true; - //段位道場 - //TJAPlayer3.stage演奏ドラム画面.actPanel.SetPanelString(TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].Title, TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].Genre, 1 + NowShowingNumber + "曲目"); - TJAPlayer3.stage演奏ドラム画面.actPanel.SetPanelString(TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].Title, - CLangManager.LangInstance.GetString("TITLE_MODE_DAN"), - 1 + NowShowingNumber + "曲目"); - - if (number == 0) Sound_Section_First?.PlayStart(); - else Sound_Section?.PlayStart(); - } + //段位道場 + //TJAPlayer3.stage演奏ドラム画面.actPanel.SetPanelString(TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].Title, TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].Genre, 1 + NowShowingNumber + "曲目"); + TJAPlayer3.stage演奏ドラム画面.actPanel.SetPanelString(TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].Title, + CLangManager.LangInstance.GetString("TITLE_MODE_DAN"), + 1 + NowShowingNumber + "曲目"); - public override void Activate() - { - for (int i = 0; i < CExamInfo.cMaxExam; i++) - { - if(TJAPlayer3.DTX.Dan_C[i] != null) Challenge[i] = new Dan_C(TJAPlayer3.DTX.Dan_C[i]); + if (number == 0) Sound_Section_First?.PlayStart(); + else Sound_Section?.PlayStart(); + } - for (int j = 0; j < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count; j++) - { - if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i] != null) - { - TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i] = new Dan_C(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i]); - } - } - } + public override void Activate() { + for (int i = 0; i < CExamInfo.cMaxExam; i++) { + if (TJAPlayer3.DTX.Dan_C[i] != null) Challenge[i] = new Dan_C(TJAPlayer3.DTX.Dan_C[i]); - if(TJAPlayer3.stage演奏ドラム画面.ListDan_Number >= 1 && FirstSectionAnime) - TJAPlayer3.stage演奏ドラム画面.ListDan_Number = 0; + for (int j = 0; j < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count; j++) { + if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i] != null) { + TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i] = new Dan_C(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i]); + } + } + } - FirstSectionAnime = false; - // 始点を決定する。 - // ExamCount = 0; + if (TJAPlayer3.stage演奏ドラム画面.ListDan_Number >= 1 && FirstSectionAnime) + TJAPlayer3.stage演奏ドラム画面.ListDan_Number = 0; - songsnotesremain = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; - this.ct虹アニメ = new CCounter(0, TJAPlayer3.Skin.Game_Gauge_Dan_Rainbow_Ptn - 1, 30, TJAPlayer3.Timer); - this.ct虹透明度 = new CCounter(0, TJAPlayer3.Skin.Game_Gauge_Rainbow_Timer - 1, 1, TJAPlayer3.Timer); + FirstSectionAnime = false; + // 始点を決定する。 + // ExamCount = 0; - this.pfExamFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Game_DanC_ExamFont_Size); + songsnotesremain = new int[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; + this.ct虹アニメ = new CCounter(0, TJAPlayer3.Skin.Game_Gauge_Dan_Rainbow_Ptn - 1, 30, TJAPlayer3.Timer); + this.ct虹透明度 = new CCounter(0, TJAPlayer3.Skin.Game_Gauge_Rainbow_Timer - 1, 1, TJAPlayer3.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); - } + this.pfExamFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Game_DanC_ExamFont_Size); - NowCymbolShowingNumber = 0; - bExamChangeCheck = false; + 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); + } - 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[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; + NowCymbolShowingNumber = 0; + bExamChangeCheck = false; - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) IsAnimating = true; - - Dan_Plate = TJAPlayer3.tテクスチャの生成(Path.GetDirectoryName(TJAPlayer3.DTX.strファイル名の絶対パス) + @$"{Path.DirectorySeparatorChar}Dan_Plate.png"); - - base.Activate(); - } + 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(); + } - public void Update() - { - for (int i = 0; i < CExamInfo.cMaxExam; i++) - { - if (Challenge[i] == null || !Challenge[i].GetEnable()) continue; - if (ExamChange[i] && Challenge[i] != TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[i]) continue; + IsEnded = new bool[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; - var oldReached = Challenge[i].GetReached(); - var isChangedAmount = false; + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) IsAnimating = true; - int totalGoods = (int)TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Perfect + TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect; - int totalOks = (int)TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Great + TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great; - int totalBads = (int)TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Miss; - int totalCombo = (int)TJAPlayer3.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[0]; + Dan_Plate = TJAPlayer3.tテクスチャの生成(Path.GetDirectoryName(TJAPlayer3.DTX.strファイル名の絶対パス) + @$"{Path.DirectorySeparatorChar}Dan_Plate.png"); - int individualGoods = TJAPlayer3.stage演奏ドラム画面.n良[NowShowingNumber]; - int individualOks = TJAPlayer3.stage演奏ドラム画面.n可[NowShowingNumber]; - int individualBads = TJAPlayer3.stage演奏ドラム画面.n不可[NowShowingNumber]; - int individualCombo = TJAPlayer3.stage演奏ドラム画面.nHighestCombo[NowShowingNumber]; + base.Activate(); + } - int totalADLIBs = TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nADLIB; - int totalMines = TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMine; + public void Update() { + for (int i = 0; i < CExamInfo.cMaxExam; i++) { + if (Challenge[i] == null || !Challenge[i].GetEnable()) continue; + if (ExamChange[i] && Challenge[i] != TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[i]) continue; - int individualADLIBs = TJAPlayer3.stage演奏ドラム画面.nADLIB[NowShowingNumber]; - int individualMines = TJAPlayer3.stage演奏ドラム画面.nMine[NowShowingNumber]; + var oldReached = Challenge[i].GetReached(); + var isChangedAmount = false; - double accuracy = (totalGoods * 100 + totalOks * 50) / (double)(totalGoods + totalOks + totalBads); - double individualAccuracy = (individualGoods * 100 + individualOks * 50) / (double)(individualGoods + individualOks + individualBads); + int totalGoods = (int)TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Perfect + TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect; + int totalOks = (int)TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Great + TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great; + int totalBads = (int)TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Miss; + int totalCombo = (int)TJAPlayer3.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[0]; - switch (Challenge[i].GetExamType()) - { - case Exam.Type.Gauge: - isChangedAmount = Challenge[i].Update((int)TJAPlayer3.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)TJAPlayer3.stage演奏ドラム画面.actScore.GetScore(0)); - break; - case Exam.Type.Roll: - isChangedAmount = Challenge[i].Update(ExamChange[i] ? TJAPlayer3.stage演奏ドラム画面.n連打[NowShowingNumber] : (int)(TJAPlayer3.stage演奏ドラム画面.GetRoll(0))); - break; - case Exam.Type.Hit: - isChangedAmount = Challenge[i].Update(ExamChange[i] ? TJAPlayer3.stage演奏ドラム画面.n良[NowShowingNumber] + TJAPlayer3.stage演奏ドラム画面.n可[NowShowingNumber] + TJAPlayer3.stage演奏ドラム画面.n連打[NowShowingNumber] : (int)(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演奏ドラム画面.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; - } + int individualGoods = TJAPlayer3.stage演奏ドラム画面.n良[NowShowingNumber]; + int individualOks = TJAPlayer3.stage演奏ドラム画面.n可[NowShowingNumber]; + int individualBads = TJAPlayer3.stage演奏ドラム画面.n不可[NowShowingNumber]; + int individualCombo = TJAPlayer3.stage演奏ドラム画面.nHighestCombo[NowShowingNumber]; - // 値が変更されていたらアニメーションを行う。 - if (isChangedAmount) - { - if(Status[i].Timer_Amount != null && Status[i].Timer_Amount.IsUnEnded) - { - Status[i].Timer_Amount = new CCounter(0, 11, 12, TJAPlayer3.Timer); - Status[i].Timer_Amount.CurrentValue = 1; - } - else - { - Status[i].Timer_Amount = new CCounter(0, 11, 12, TJAPlayer3.Timer); - } - } + int totalADLIBs = TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nADLIB; + int totalMines = TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMine; - // 条件の達成見込みがあるかどうか判断する。 - if (Challenge[i].GetExamRange() == Exam.Range.Less) - { - Challenge[i].SetReached(!Challenge[i].IsCleared[0]); - } - else - { - songsnotesremain[NowShowingNumber] = TJAPlayer3.DTX.nDan_NotesCount[NowShowingNumber] - - (TJAPlayer3.stage演奏ドラム画面.n良[NowShowingNumber] - + TJAPlayer3.stage演奏ドラム画面.n可[NowShowingNumber] - + TJAPlayer3.stage演奏ドラム画面.n不可[NowShowingNumber]); + int individualADLIBs = TJAPlayer3.stage演奏ドラム画面.nADLIB[NowShowingNumber]; + int individualMines = TJAPlayer3.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)TJAPlayer3.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)TJAPlayer3.stage演奏ドラム画面.actScore.GetScore(0)); + break; + case Exam.Type.Roll: + isChangedAmount = Challenge[i].Update(ExamChange[i] ? TJAPlayer3.stage演奏ドラム画面.n連打[NowShowingNumber] : (int)(TJAPlayer3.stage演奏ドラム画面.GetRoll(0))); + break; + case Exam.Type.Hit: + isChangedAmount = Challenge[i].Update(ExamChange[i] ? TJAPlayer3.stage演奏ドラム画面.n良[NowShowingNumber] + TJAPlayer3.stage演奏ドラム画面.n可[NowShowingNumber] + TJAPlayer3.stage演奏ドラム画面.n連打[NowShowingNumber] : (int)(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演奏ドラム画面.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, TJAPlayer3.Timer); + Status[i].Timer_Amount.CurrentValue = 1; + } else { + Status[i].Timer_Amount = new CCounter(0, 11, 12, TJAPlayer3.Timer); + } + } + + // 条件の達成見込みがあるかどうか判断する。 + if (Challenge[i].GetExamRange() == Exam.Range.Less) { + Challenge[i].SetReached(!Challenge[i].IsCleared[0]); + } else { + songsnotesremain[NowShowingNumber] = TJAPlayer3.DTX.nDan_NotesCount[NowShowingNumber] + - (TJAPlayer3.stage演奏ドラム画面.n良[NowShowingNumber] + + TJAPlayer3.stage演奏ドラム画面.n可[NowShowingNumber] + + TJAPlayer3.stage演奏ドラム画面.n不可[NowShowingNumber]); + + /* notesremain = TJAPlayer3.DTX.nノーツ数[3] - (TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Perfect + TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect) @@ -256,78 +219,73 @@ namespace TJAPlayer3 + TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Miss); */ - notesremain = TJAPlayer3.DTX.nノーツ数[3] - - (TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nGood - + TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nGreat - + TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMiss); + notesremain = TJAPlayer3.DTX.nノーツ数[3] + - (TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nGood + + TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nGreat + + TJAPlayer3.stage演奏ドラム画面.CChartScore[0].nMiss); - // 残り音符数が0になったときに判断されるやつ + // 残り音符数が0になったときに判断されるやつ - // 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.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 + TJAPlayer3.stage演奏ドラム画面.actCombo.n現在のコンボ数.P1 < ((Challenge[i].Value[0])) - && TJAPlayer3.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[0] < (Challenge[i].Value[0])) Challenge[i].SetReached(true); - break; - default: - break; - } + // 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; + } + } - // 音源が終了したやつの分岐。 - // ( CDTXMania.DTX.listChip.Count > 0 ) ? CDTXMania.DTX.listChip[ CDTXMania.DTX.listChip.Count - 1 ].n発声時刻ms : 0; + // 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 + TJAPlayer3.stage演奏ドラム画面.actCombo.n現在のコンボ数.P1 < ((Challenge[i].Value[0])) + && TJAPlayer3.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[0] < (Challenge[i].Value[0])) Challenge[i].SetReached(true); + break; + default: + break; + } - // Check challenge fails at the end of each songs + // 音源が終了したやつの分岐。 + // ( CDTXMania.DTX.listChip.Count > 0 ) ? CDTXMania.DTX.listChip[ CDTXMania.DTX.listChip.Count - 1 ].n発声時刻ms : 0; - if (TJAPlayer3.DTX.listChip.Count > 0) - { - if (ExamChange[i] - ? TJAPlayer3.DTX.pDan_LastChip[NowShowingNumber].n発声時刻ms <= SoundManager.PlayTimer.NowTime//TJAPlayer3.Timer.n現在時刻 - : TJAPlayer3.DTX.listChip[TJAPlayer3.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; - } - } - } + // Check challenge fails at the end of each songs - /* + if (TJAPlayer3.DTX.listChip.Count > 0) { + if (ExamChange[i] + ? TJAPlayer3.DTX.pDan_LastChip[NowShowingNumber].n発声時刻ms <= SoundManager.PlayTimer.NowTime//TJAPlayer3.Timer.n現在時刻 + : TJAPlayer3.DTX.listChip[TJAPlayer3.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 (TJAPlayer3.DTX.listChip.Count <= 0) continue; @@ -339,212 +297,175 @@ namespace TJAPlayer3 } } */ - } - 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; - } + 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; + 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; - TJAPlayer3.tDisposeSafely(ref this.pfExamFont); - - Dan_Plate?.Dispose(); + TJAPlayer3.tDisposeSafely(ref this.pfExamFont); - base.DeActivate(); - } + Dan_Plate?.Dispose(); - public override void CreateManagedResource() - { - Sound_Section = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Section.ogg"), ESoundGroup.SoundEffect); - Sound_Section_First = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Section_First.wav"), ESoundGroup.SoundEffect); - Sound_Failed = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Failed.ogg"), ESoundGroup.SoundEffect); - base.CreateManagedResource(); - } + base.DeActivate(); + } - public override void ReleaseManagedResource() - { - Sound_Section_First?.Dispose(); - Sound_Section?.tDispose(); - Sound_Failed?.tDispose(); - base.ReleaseManagedResource(); - } + public override void CreateManagedResource() { + Sound_Section = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Section.ogg"), ESoundGroup.SoundEffect); + Sound_Section_First = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Section_First.wav"), ESoundGroup.SoundEffect); + Sound_Failed = TJAPlayer3.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Failed.ogg"), ESoundGroup.SoundEffect); + base.CreateManagedResource(); + } - public override int Draw() - { - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) return base.Draw(); - Counter_In?.Tick(); - Counter_Wait?.Tick(); - Counter_Out?.Tick(); - Counter_Text?.Tick(); + public override void ReleaseManagedResource() { + Sound_Section_First?.Dispose(); + Sound_Section?.tDispose(); + Sound_Failed?.tDispose(); + base.ReleaseManagedResource(); + } - 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 (TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].TitleTex != null) - { - TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].TitleTex.Opacity--; - } - if (TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].SubTitleTex != null) - { - TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].SubTitleTex.Opacity--; - } - } - } - } - else - { - if (TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].TitleTex != null) - { - TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].TitleTex.Opacity = 255; - } - if (TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].SubTitleTex != null) - { - TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].SubTitleTex.Opacity = 255; - } - } - Counter_Text_Old = Counter_Text.CurrentValue; - } + public override int Draw() { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) return base.Draw(); + Counter_In?.Tick(); + Counter_Wait?.Tick(); + Counter_Out?.Tick(); + Counter_Text?.Tick(); - for (int i = 0; i < CExamInfo.cMaxExam; i++) - { - Status[i].Timer_Amount?.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 (TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].TitleTex != null) { + TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].TitleTex.Opacity--; + } + if (TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].SubTitleTex != null) { + TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].SubTitleTex.Opacity--; + } + } + } + } else { + if (TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].TitleTex != null) { + TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].TitleTex.Opacity = 255; + } + if (TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].SubTitleTex != null) { + TJAPlayer3.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(); + } - TJAPlayer3.Tx.DanC_Background?.t2D描画(0, 0); + // 背景を描画する。 - DrawExam(Challenge); + TJAPlayer3.Tx.DanC_Background?.t2D描画(0, 0); - // 幕のアニメーション - if (Counter_In != null) - { - if (Counter_In.IsUnEnded) - { - for (int i = Counter_In_Old; i < Counter_In.CurrentValue; i++) - { - ScreenPoint[0] += (TJAPlayer3.Skin.Game_Lane_X[0] - ScreenPoint[0]) / 180.0; - ScreenPoint[1] += ((TJAPlayer3.Skin.Resolution[0] / 2 + TJAPlayer3.Skin.Game_Lane_X[0] / 2) - ScreenPoint[1]) / 180.0; - } - Counter_In_Old = Counter_In.CurrentValue; - TJAPlayer3.Tx.DanC_Screen?.t2D描画((int)ScreenPoint[0], TJAPlayer3.Skin.Game_Lane_Y[0], new Rectangle(0, 0, TJAPlayer3.Tx.DanC_Screen.szTextureSize.Width / 2, TJAPlayer3.Tx.DanC_Screen.szTextureSize.Height)); - TJAPlayer3.Tx.DanC_Screen?.t2D描画((int)ScreenPoint[1], TJAPlayer3.Skin.Game_Lane_Y[0], new Rectangle(TJAPlayer3.Tx.DanC_Screen.szTextureSize.Width / 2, 0, TJAPlayer3.Tx.DanC_Screen.szTextureSize.Width / 2, TJAPlayer3.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, TJAPlayer3.Timer); - } - } + DrawExam(Challenge); - if (Counter_Wait != null) - { - if (Counter_Wait.IsUnEnded) - { - TJAPlayer3.Tx.DanC_Screen?.t2D描画(TJAPlayer3.Skin.Game_Lane_X[0], TJAPlayer3.Skin.Game_Lane_Y[0]); + // 幕のアニメーション + if (Counter_In != null) { + if (Counter_In.IsUnEnded) { + for (int i = Counter_In_Old; i < Counter_In.CurrentValue; i++) { + ScreenPoint[0] += (TJAPlayer3.Skin.Game_Lane_X[0] - ScreenPoint[0]) / 180.0; + ScreenPoint[1] += ((TJAPlayer3.Skin.Resolution[0] / 2 + TJAPlayer3.Skin.Game_Lane_X[0] / 2) - ScreenPoint[1]) / 180.0; + } + Counter_In_Old = Counter_In.CurrentValue; + TJAPlayer3.Tx.DanC_Screen?.t2D描画((int)ScreenPoint[0], TJAPlayer3.Skin.Game_Lane_Y[0], new Rectangle(0, 0, TJAPlayer3.Tx.DanC_Screen.szTextureSize.Width / 2, TJAPlayer3.Tx.DanC_Screen.szTextureSize.Height)); + TJAPlayer3.Tx.DanC_Screen?.t2D描画((int)ScreenPoint[1], TJAPlayer3.Skin.Game_Lane_Y[0], new Rectangle(TJAPlayer3.Tx.DanC_Screen.szTextureSize.Width / 2, 0, TJAPlayer3.Tx.DanC_Screen.szTextureSize.Width / 2, TJAPlayer3.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, TJAPlayer3.Timer); + } + } - if (NowShowingNumber != 0) - { - if (Counter_Wait.CurrentValue >= 800) - { - if (!bExamChangeCheck) - { - for (int i = 0; i < CExamInfo.cMaxExam; i++) - ExamChange[i] = false; + if (Counter_Wait != null) { + if (Counter_Wait.IsUnEnded) { + TJAPlayer3.Tx.DanC_Screen?.t2D描画(TJAPlayer3.Skin.Game_Lane_X[0], TJAPlayer3.Skin.Game_Lane_Y[0]); - for (int j = 0; j < CExamInfo.cMaxExam; j++) - { - if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[0].Dan_C[j] != null) - { - if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count - 1].Dan_C[j] != null) //個別の条件がありますよー - { - Challenge[j] = TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j]; - ExamChange[j] = true; - } - } - } - NowCymbolShowingNumber = NowShowingNumber; - bExamChangeCheck = true; - } - } - } - } - if (Counter_Wait.IsEnded) - { - Counter_Wait = null; - Counter_Out = new CCounter(0, 90, 3, TJAPlayer3.Timer); - Counter_Text = new CCounter(0, 2899, 1, TJAPlayer3.Timer); - } - } - if (Counter_Text != null) - { - if (Counter_Text.IsUnEnded) - { - var title = TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].TitleTex; - var subTitle = TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].SubTitleTex; - if (subTitle == null) - title?.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Game_DanC_Title_X[0], TJAPlayer3.Skin.Game_DanC_Title_Y[0]); - else - { - title?.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Game_DanC_Title_X[1], TJAPlayer3.Skin.Game_DanC_Title_Y[1]); - subTitle?.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Game_DanC_SubTitle[0], TJAPlayer3.Skin.Game_DanC_SubTitle[1]); - } - } - if (Counter_Text.IsEnded) - { - Counter_Text = null; - IsAnimating = false; - } - } - if (Counter_Out != null) - { - if (Counter_Out.IsUnEnded) - { - ScreenPoint[0] = TJAPlayer3.Skin.Game_Lane_X[0] - Math.Sin(Counter_Out.CurrentValue * (Math.PI / 180)) * 500; - ScreenPoint[1] = TJAPlayer3.Skin.Game_Lane_X[0] + TJAPlayer3.Tx.DanC_Screen.szTextureSize.Width / 2 + Math.Sin(Counter_Out.CurrentValue * (Math.PI / 180)) * 500; - TJAPlayer3.Tx.DanC_Screen?.t2D描画((int)ScreenPoint[0], TJAPlayer3.Skin.Game_Lane_Y[0], new Rectangle(0, 0, TJAPlayer3.Tx.DanC_Screen.szTextureSize.Width / 2, TJAPlayer3.Tx.DanC_Screen.szTextureSize.Height)); - TJAPlayer3.Tx.DanC_Screen?.t2D描画((int)ScreenPoint[1], TJAPlayer3.Skin.Game_Lane_Y[0], new Rectangle(TJAPlayer3.Tx.DanC_Screen.szTextureSize.Width / 2, 0, TJAPlayer3.Tx.DanC_Screen.szTextureSize.Width / 2, TJAPlayer3.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 (NowShowingNumber != 0) { + if (Counter_Wait.CurrentValue >= 800) { + if (!bExamChangeCheck) { + for (int i = 0; i < CExamInfo.cMaxExam; i++) + ExamChange[i] = false; - #region [Dan Plate] + for (int j = 0; j < CExamInfo.cMaxExam; j++) { + if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[0].Dan_C[j] != null) { + if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count - 1].Dan_C[j] != null) //個別の条件がありますよー + { + Challenge[j] = TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j]; + ExamChange[j] = true; + } + } + } + NowCymbolShowingNumber = NowShowingNumber; + bExamChangeCheck = true; + } + } + } + } + if (Counter_Wait.IsEnded) { + Counter_Wait = null; + Counter_Out = new CCounter(0, 90, 3, TJAPlayer3.Timer); + Counter_Text = new CCounter(0, 2899, 1, TJAPlayer3.Timer); + } + } + if (Counter_Text != null) { + if (Counter_Text.IsUnEnded) { + var title = TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].TitleTex; + var subTitle = TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].SubTitleTex; + if (subTitle == null) + title?.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Game_DanC_Title_X[0], TJAPlayer3.Skin.Game_DanC_Title_Y[0]); + else { + title?.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Game_DanC_Title_X[1], TJAPlayer3.Skin.Game_DanC_Title_Y[1]); + subTitle?.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Game_DanC_SubTitle[0], TJAPlayer3.Skin.Game_DanC_SubTitle[1]); + } + } + if (Counter_Text.IsEnded) { + Counter_Text = null; + IsAnimating = false; + } + } + if (Counter_Out != null) { + if (Counter_Out.IsUnEnded) { + ScreenPoint[0] = TJAPlayer3.Skin.Game_Lane_X[0] - Math.Sin(Counter_Out.CurrentValue * (Math.PI / 180)) * 500; + ScreenPoint[1] = TJAPlayer3.Skin.Game_Lane_X[0] + TJAPlayer3.Tx.DanC_Screen.szTextureSize.Width / 2 + Math.Sin(Counter_Out.CurrentValue * (Math.PI / 180)) * 500; + TJAPlayer3.Tx.DanC_Screen?.t2D描画((int)ScreenPoint[0], TJAPlayer3.Skin.Game_Lane_Y[0], new Rectangle(0, 0, TJAPlayer3.Tx.DanC_Screen.szTextureSize.Width / 2, TJAPlayer3.Tx.DanC_Screen.szTextureSize.Height)); + TJAPlayer3.Tx.DanC_Screen?.t2D描画((int)ScreenPoint[1], TJAPlayer3.Skin.Game_Lane_Y[0], new Rectangle(TJAPlayer3.Tx.DanC_Screen.szTextureSize.Width / 2, 0, TJAPlayer3.Tx.DanC_Screen.szTextureSize.Width / 2, TJAPlayer3.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; + } + } - CActSelect段位リスト.tDisplayDanPlate(Dan_Plate, - null, - TJAPlayer3.Skin.Game_DanC_Dan_Plate[0], - TJAPlayer3.Skin.Game_DanC_Dan_Plate[1]); + #region [Dan Plate] - #endregion + CActSelect段位リスト.tDisplayDanPlate(Dan_Plate, + null, + TJAPlayer3.Skin.Game_DanC_Dan_Plate[0], + TJAPlayer3.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()); @@ -552,762 +473,699 @@ namespace TJAPlayer3 TJAPlayer3.act文字コンソール.tPrint(100, 60, C文字コンソール.Eフォント種別.白, TJAPlayer3.Timer.n現在時刻.ToString()); */ - // Challenges that are judged when the song stops + // Challenges that are judged when the song stops - return base.Draw(); - } + 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; + // 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++; - } - - } + // 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; - // Panel origin - int xOrigin = (isResult) ? TJAPlayer3.Skin.DanResult_Exam[0] + offX : TJAPlayer3.Skin.Game_DanC_X[1]; - int yOrigin = (isResult) ? TJAPlayer3.Skin.DanResult_Exam[1] : TJAPlayer3.Skin.Game_DanC_Y[1]; + // Specific case for gauge + if (dan_C[i].GetExamType() == Exam.Type.Gauge) { + yIndex = 0; + isSmallGauge = false; + } - // Origin position which will be used as a reference for bar elements - int barXOffset = xOrigin + (currentPosition >= 3 ? TJAPlayer3.Skin.Game_DanC_Base_Offset_X[1] : TJAPlayer3.Skin.Game_DanC_Base_Offset_X[0]); - int barYOffset = yOrigin + (currentPosition >= 3 ? TJAPlayer3.Skin.Game_DanC_Base_Offset_Y[1] : TJAPlayer3.Skin.Game_DanC_Base_Offset_Y[0]) + TJAPlayer3.Skin.Game_DanC_Size[1] * yIndex + (yIndex * TJAPlayer3.Skin.Game_DanC_Padding); - - // Small bar - int lowerBarYOffset = barYOffset + TJAPlayer3.Skin.Game_DanC_Size[1] + TJAPlayer3.Skin.Game_DanC_Padding; - // Skin X : 70 - // Skin Y : 292 + // Panel origin + int xOrigin = (isResult) ? TJAPlayer3.Skin.DanResult_Exam[0] + offX : TJAPlayer3.Skin.Game_DanC_X[1]; + int yOrigin = (isResult) ? TJAPlayer3.Skin.DanResult_Exam[1] : TJAPlayer3.Skin.Game_DanC_Y[1]; + // Origin position which will be used as a reference for bar elements + int barXOffset = xOrigin + (currentPosition >= 3 ? TJAPlayer3.Skin.Game_DanC_Base_Offset_X[1] : TJAPlayer3.Skin.Game_DanC_Base_Offset_X[0]); + int barYOffset = yOrigin + (currentPosition >= 3 ? TJAPlayer3.Skin.Game_DanC_Base_Offset_Y[1] : TJAPlayer3.Skin.Game_DanC_Base_Offset_Y[0]) + TJAPlayer3.Skin.Game_DanC_Size[1] * yIndex + (yIndex * TJAPlayer3.Skin.Game_DanC_Padding); - #region [Gauge base] + // Small bar + int lowerBarYOffset = barYOffset + TJAPlayer3.Skin.Game_DanC_Size[1] + TJAPlayer3.Skin.Game_DanC_Padding; - if (!isSmallGauge) - TJAPlayer3.Tx.DanC_Base?.t2D描画(barXOffset, barYOffset, new RectangleF(0, ExamChange[i] ? TJAPlayer3.Tx.DanC_Base.szTextureSize.Height / 2 : 0, TJAPlayer3.Tx.DanC_Base.szTextureSize.Width, TJAPlayer3.Tx.DanC_Base.szTextureSize.Height / 2)); - else - TJAPlayer3.Tx.DanC_Base_Small?.t2D描画(barXOffset, barYOffset, new RectangleF(0, ExamChange[i] ? TJAPlayer3.Tx.DanC_Base_Small.szTextureSize.Height / 2 : 0, TJAPlayer3.Tx.DanC_Base_Small.szTextureSize.Width, TJAPlayer3.Tx.DanC_Base_Small.szTextureSize.Height / 2)); + // Skin X : 70 + // Skin Y : 292 - #endregion - #region [Counter wait variables] + #region [Gauge base] - int counter800 = (Counter_Wait != null ? Counter_Wait.CurrentValue - 800 : 0); - int counter255M255 = (Counter_Wait != null ? 255 - (Counter_Wait.CurrentValue - (800 - 255)) : 0); + if (!isSmallGauge) + TJAPlayer3.Tx.DanC_Base?.t2D描画(barXOffset, barYOffset, new RectangleF(0, ExamChange[i] ? TJAPlayer3.Tx.DanC_Base.szTextureSize.Height / 2 : 0, TJAPlayer3.Tx.DanC_Base.szTextureSize.Width, TJAPlayer3.Tx.DanC_Base.szTextureSize.Height / 2)); + else + TJAPlayer3.Tx.DanC_Base_Small?.t2D描画(barXOffset, barYOffset, new RectangleF(0, ExamChange[i] ? TJAPlayer3.Tx.DanC_Base_Small.szTextureSize.Height / 2 : 0, TJAPlayer3.Tx.DanC_Base_Small.szTextureSize.Width, TJAPlayer3.Tx.DanC_Base_Small.szTextureSize.Height / 2)); - #endregion + #endregion - #region [Small bars] + #region [Counter wait variables] - if (ExamChange[i] == true) - { - for (int j = 1; j < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count; j++) - { + int counter800 = (Counter_Wait != null ? Counter_Wait.CurrentValue - 800 : 0); + int counter255M255 = (Counter_Wait != null ? 255 - (Counter_Wait.CurrentValue - (800 - 255)) : 0); - if (!(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i] != null && TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[i] != null)) - continue; + #endregion - // rainbowBetterSuccess (bool) : is current minibar better success ? | drawGaugeTypetwo (int) : Gauge style [0,2] - #region [Success type variables] - - bool rainbowBetterSuccess = GetExamStatus(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i]) == Exam.Status.Better_Success - && GetExamConfirmStatus(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i]); + #region [Small bars] - int amountToPercent; - int drawGaugeTypetwo = 0; + if (ExamChange[i] == true) { + for (int j = 1; j < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count; j++) { - if (!rainbowBetterSuccess) - { - amountToPercent = TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetAmountToPercent(); + if (!(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i] != null && TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[i] != null)) + continue; - if (amountToPercent >= 100) - drawGaugeTypetwo = 2; - else if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetExamRange() == Exam.Range.More && amountToPercent >= 70 || amountToPercent > 70) - drawGaugeTypetwo = 1; - } + // rainbowBetterSuccess (bool) : is current minibar better success ? | drawGaugeTypetwo (int) : Gauge style [0,2] + #region [Success type variables] - #endregion + bool rainbowBetterSuccess = GetExamStatus(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i]) == Exam.Status.Better_Success + && GetExamConfirmStatus(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i]); - // Small bar elements base opacity - #region [Default opacity] + int amountToPercent; + int drawGaugeTypetwo = 0; - TJAPlayer3.Tx.DanC_SmallBase.Opacity = 255; - TJAPlayer3.Tx.DanC_Small_ExamCymbol.Opacity = 255; + if (!rainbowBetterSuccess) { + amountToPercent = TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetAmountToPercent(); - TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].Opacity = 255; - TJAPlayer3.Tx.DanC_MiniNumber.Opacity = 255; + if (amountToPercent >= 100) + drawGaugeTypetwo = 2; + else if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetExamRange() == Exam.Range.More && amountToPercent >= 70 || amountToPercent > 70) + drawGaugeTypetwo = 1; + } - TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].Opacity = 255; + #endregion - int miniIconOpacity = 255; + // Small bar elements base opacity + #region [Default opacity] - #endregion + TJAPlayer3.Tx.DanC_SmallBase.Opacity = 255; + TJAPlayer3.Tx.DanC_Small_ExamCymbol.Opacity = 255; - // Currently showing song parameters - if (NowShowingNumber == j) - { - if (Counter_Wait != null && Counter_Wait.CurrentValue >= 800) - { - #region [counter800 opacity] + TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].Opacity = 255; + TJAPlayer3.Tx.DanC_MiniNumber.Opacity = 255; - TJAPlayer3.Tx.DanC_SmallBase.Opacity = counter800; - TJAPlayer3.Tx.DanC_Small_ExamCymbol.Opacity = counter800; + TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].Opacity = 255; - TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].Opacity = counter800; - TJAPlayer3.Tx.DanC_MiniNumber.Opacity = counter800; + int miniIconOpacity = 255; - TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].Opacity = counter800; + #endregion - miniIconOpacity = counter800; + // Currently showing song parameters + if (NowShowingNumber == j) { + if (Counter_Wait != null && Counter_Wait.CurrentValue >= 800) { + #region [counter800 opacity] - #endregion - } - else if (Counter_In != null || (Counter_Wait != null && Counter_Wait.CurrentValue < 800)) - { - #region [0 opacity] + TJAPlayer3.Tx.DanC_SmallBase.Opacity = counter800; + TJAPlayer3.Tx.DanC_Small_ExamCymbol.Opacity = counter800; - TJAPlayer3.Tx.DanC_SmallBase.Opacity = 0; - TJAPlayer3.Tx.DanC_Small_ExamCymbol.Opacity = 0; + TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].Opacity = counter800; + TJAPlayer3.Tx.DanC_MiniNumber.Opacity = counter800; - TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].Opacity = 0; - TJAPlayer3.Tx.DanC_MiniNumber.Opacity = 0; + TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].Opacity = counter800; - TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].Opacity = 0; + miniIconOpacity = counter800; - miniIconOpacity = 0; + #endregion + } else if (Counter_In != null || (Counter_Wait != null && Counter_Wait.CurrentValue < 800)) { + #region [0 opacity] - #endregion - } - } + TJAPlayer3.Tx.DanC_SmallBase.Opacity = 0; + TJAPlayer3.Tx.DanC_Small_ExamCymbol.Opacity = 0; - // Bars starting from the song N - if (NowShowingNumber >= j && (j - NowShowingNumber) > -2) - { - // Determine bars width - TJAPlayer3.Tx.DanC_SmallBase.vcScaleRatio.X = isSmallGauge ? 0.34f : 1f; + TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].Opacity = 0; + TJAPlayer3.Tx.DanC_MiniNumber.Opacity = 0; - int smallBarGap = (int)(33f * TJAPlayer3.Skin.Resolution[1] / 720f); + TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].Opacity = 0; - // 815 : Small base (70 + 745) - int miniBarPositionX = barXOffset + (isSmallGauge ? TJAPlayer3.Skin.Game_DanC_SmallBase_Offset_X[1] : TJAPlayer3.Skin.Game_DanC_SmallBase_Offset_X[0]); + miniIconOpacity = 0; - // 613 + (j - 1) * 33 : Small base (barYoffset for 3rd exam : 494 + 119 + Local song offset (j - 1) * 33) - int miniBarPositionY = (barYOffset + (isSmallGauge ? TJAPlayer3.Skin.Game_DanC_SmallBase_Offset_Y[1] : TJAPlayer3.Skin.Game_DanC_SmallBase_Offset_Y[0])) + ((j - 1) % 2) * smallBarGap - (TJAPlayer3.Skin.Game_DanC_Size[1] + (TJAPlayer3.Skin.Game_DanC_Padding)); + #endregion + } + } - // Display bars - #region [Displayables] + // Bars starting from the song N + if (NowShowingNumber >= j && (j - NowShowingNumber) > -2) { + // Determine bars width + TJAPlayer3.Tx.DanC_SmallBase.vcScaleRatio.X = isSmallGauge ? 0.34f : 1f; - // Display mini-bar base and small symbol - TJAPlayer3.Tx.DanC_SmallBase?.t2D描画(miniBarPositionX, miniBarPositionY); - TJAPlayer3.Tx.DanC_Small_ExamCymbol?.t2D描画(miniBarPositionX - 30, miniBarPositionY - 3, new RectangleF(0, (j - 1) * 28, 30, 28)); + int smallBarGap = (int)(33f * TJAPlayer3.Skin.Resolution[1] / 720f); - // Display bar content - if (rainbowBetterSuccess) - { - TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].vcScaleRatio.X = 0.23875f * TJAPlayer3.Tx.DanC_SmallBase.vcScaleRatio.X * (isSmallGauge ? 0.94f : 1f); - TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].vcScaleRatio.Y = 0.35185f; + // 815 : Small base (70 + 745) + int miniBarPositionX = barXOffset + (isSmallGauge ? TJAPlayer3.Skin.Game_DanC_SmallBase_Offset_X[1] : TJAPlayer3.Skin.Game_DanC_SmallBase_Offset_X[0]); - TJAPlayer3.Tx.Gauge_Dan_Rainbow[0]?.t2D描画(miniBarPositionX + 3, miniBarPositionY + 2, - new Rectangle(0, 0, (int)(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetAmountToPercent() * (TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].szTextureSize.Width / 100.0)), TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].szTextureSize.Height)); - } - else - { - TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].vcScaleRatio.X = 0.23875f * TJAPlayer3.Tx.DanC_SmallBase.vcScaleRatio.X * (isSmallGauge ? 0.94f : 1f); - TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].vcScaleRatio.Y = 0.35185f; + // 613 + (j - 1) * 33 : Small base (barYoffset for 3rd exam : 494 + 119 + Local song offset (j - 1) * 33) + int miniBarPositionY = (barYOffset + (isSmallGauge ? TJAPlayer3.Skin.Game_DanC_SmallBase_Offset_Y[1] : TJAPlayer3.Skin.Game_DanC_SmallBase_Offset_Y[0])) + ((j - 1) % 2) * smallBarGap - (TJAPlayer3.Skin.Game_DanC_Size[1] + (TJAPlayer3.Skin.Game_DanC_Padding)); - TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo]?.t2D描画(miniBarPositionX + 3, miniBarPositionY + 2, - new Rectangle(0, 0, (int)(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetAmountToPercent() * (TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].szTextureSize.Width / 100.0)), TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].szTextureSize.Height)); - } + // Display bars + #region [Displayables] - int _tmpMiniPadding = (int)(14f * TJAPlayer3.Skin.Resolution[0] / 1280f); + // Display mini-bar base and small symbol + TJAPlayer3.Tx.DanC_SmallBase?.t2D描画(miniBarPositionX, miniBarPositionY); + TJAPlayer3.Tx.DanC_Small_ExamCymbol?.t2D描画(miniBarPositionX - 30, miniBarPositionY - 3, new RectangleF(0, (j - 1) * 28, 30, 28)); - // Usually +23 for gold and +17 for white, to test - DrawMiniNumber( - TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetAmount(), - miniBarPositionX + 11, - miniBarPositionY + 20, - _tmpMiniPadding, - TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i]); + // Display bar content + if (rainbowBetterSuccess) { + TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].vcScaleRatio.X = 0.23875f * TJAPlayer3.Tx.DanC_SmallBase.vcScaleRatio.X * (isSmallGauge ? 0.94f : 1f); + TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].vcScaleRatio.Y = 0.35185f; - CActSelect段位リスト.tDisplayDanIcon(j, miniBarPositionX + TJAPlayer3.Skin.Game_DanC_DanIcon_Offset_Mini[0], miniBarPositionY + TJAPlayer3.Skin.Game_DanC_DanIcon_Offset_Mini[1], miniIconOpacity, 0.5f, false); + TJAPlayer3.Tx.Gauge_Dan_Rainbow[0]?.t2D描画(miniBarPositionX + 3, miniBarPositionY + 2, + new Rectangle(0, 0, (int)(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetAmountToPercent() * (TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].szTextureSize.Width / 100.0)), TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].szTextureSize.Height)); + } else { + TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].vcScaleRatio.X = 0.23875f * TJAPlayer3.Tx.DanC_SmallBase.vcScaleRatio.X * (isSmallGauge ? 0.94f : 1f); + TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].vcScaleRatio.Y = 0.35185f; - #endregion - } - } - } + TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo]?.t2D描画(miniBarPositionX + 3, miniBarPositionY + 2, + new Rectangle(0, 0, (int)(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetAmountToPercent() * (TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].szTextureSize.Width / 100.0)), TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].szTextureSize.Height)); + } - #endregion + int _tmpMiniPadding = (int)(14f * TJAPlayer3.Skin.Resolution[0] / 1280f); - #region [Currently playing song icons] + // Usually +23 for gold and +17 for white, to test + DrawMiniNumber( + TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetAmount(), + miniBarPositionX + 11, + miniBarPositionY + 20, + _tmpMiniPadding, + TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i]); - TJAPlayer3.Tx.DanC_ExamCymbol.Opacity = 255; + CActSelect段位リスト.tDisplayDanIcon(j, miniBarPositionX + TJAPlayer3.Skin.Game_DanC_DanIcon_Offset_Mini[0], miniBarPositionY + TJAPlayer3.Skin.Game_DanC_DanIcon_Offset_Mini[1], miniIconOpacity, 0.5f, false); - if (ExamChange[i] && NowShowingNumber != 0) - { - if (Counter_Wait != null) - { - if (Counter_Wait.CurrentValue >= 800) - TJAPlayer3.Tx.DanC_ExamCymbol.Opacity = counter800; - else if (Counter_Wait.CurrentValue >= 800 - 255) - TJAPlayer3.Tx.DanC_ExamCymbol.Opacity = counter255M255; - } - } + #endregion + } + } + } - //75, 418 - // 292 - 228 = 64 - if (ExamChange[i]) - { - TJAPlayer3.Tx.DanC_ExamCymbol.t2D描画(barXOffset + 5, lowerBarYOffset - 64, new RectangleF(0, 41 * NowCymbolShowingNumber, 197, 41)); - } + #endregion - #endregion + #region [Currently playing song icons] - #region [Large bars] + TJAPlayer3.Tx.DanC_ExamCymbol.Opacity = 255; - // LrainbowBetterSuccess (bool) : is current minibar better success ? | LdrawGaugeTypetwo (int) : Gauge style [0,2] - #region [Success type variables] + if (ExamChange[i] && NowShowingNumber != 0) { + if (Counter_Wait != null) { + if (Counter_Wait.CurrentValue >= 800) + TJAPlayer3.Tx.DanC_ExamCymbol.Opacity = counter800; + else if (Counter_Wait.CurrentValue >= 800 - 255) + TJAPlayer3.Tx.DanC_ExamCymbol.Opacity = counter255M255; + } + } - bool LrainbowBetterSuccess = GetExamStatus(dan_C[i]) == Exam.Status.Better_Success && GetExamConfirmStatus(dan_C[i]); + //75, 418 + // 292 - 228 = 64 + if (ExamChange[i]) { + TJAPlayer3.Tx.DanC_ExamCymbol.t2D描画(barXOffset + 5, lowerBarYOffset - 64, new RectangleF(0, 41 * NowCymbolShowingNumber, 197, 41)); + } - int LamountToPercent; - int LdrawGaugeTypetwo = 0; + #endregion - if (!LrainbowBetterSuccess) - { - LamountToPercent = dan_C[i].GetAmountToPercent(); + #region [Large bars] - if (LamountToPercent >= 100) - LdrawGaugeTypetwo = 2; - else if (dan_C[i].GetExamRange() == Exam.Range.More && LamountToPercent >= 70 || LamountToPercent > 70) - LdrawGaugeTypetwo = 1; - } + // LrainbowBetterSuccess (bool) : is current minibar better success ? | LdrawGaugeTypetwo (int) : Gauge style [0,2] + #region [Success type variables] + bool LrainbowBetterSuccess = GetExamStatus(dan_C[i]) == Exam.Status.Better_Success && GetExamConfirmStatus(dan_C[i]); + int LamountToPercent; + int LdrawGaugeTypetwo = 0; - #endregion + if (!LrainbowBetterSuccess) { + LamountToPercent = dan_C[i].GetAmountToPercent(); - // rainbowIndex : Rainbow bar texture to display (int), rainbowBase : same as rainbowIndex, but 0 if the counter is maxed - #region [Rainbow gauge counter] + if (LamountToPercent >= 100) + LdrawGaugeTypetwo = 2; + else if (dan_C[i].GetExamRange() == Exam.Range.More && LamountToPercent >= 70 || LamountToPercent > 70) + LdrawGaugeTypetwo = 1; + } - 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 - #endregion + // rainbowIndex : Rainbow bar texture to display (int), rainbowBase : same as rainbowIndex, but 0 if the counter is maxed + #region [Rainbow gauge counter] - #region [Default opacity] + int rainbowIndex = 0; + int rainbowBase = 0; + if (LrainbowBetterSuccess) { + this.ct虹アニメ.TickLoop(); + this.ct虹透明度.TickLoop(); - TJAPlayer3.Tx.DanC_Gauge[LdrawGaugeTypetwo].Opacity = 255; + rainbowIndex = this.ct虹アニメ.CurrentValue; - TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex].Opacity = 255; + rainbowBase = rainbowIndex; + if (rainbowBase == ct虹アニメ.EndValue) rainbowBase = 0; + } - TJAPlayer3.Tx.DanC_Number.Opacity = 255; - TJAPlayer3.Tx.DanC_ExamRange.Opacity = 255; - TJAPlayer3.Tx.DanC_Small_Number.Opacity = 255; + #endregion - #endregion + #region [Default opacity] - int iconOpacity = 255; + TJAPlayer3.Tx.DanC_Gauge[LdrawGaugeTypetwo].Opacity = 255; - if (ExamChange[i] && NowShowingNumber != 0 && Counter_Wait != null) - { - if (Counter_Wait.CurrentValue >= 800) - { - #region [counter800 opacity] + TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex].Opacity = 255; - TJAPlayer3.Tx.DanC_Gauge[LdrawGaugeTypetwo].Opacity = counter800; + TJAPlayer3.Tx.DanC_Number.Opacity = 255; + TJAPlayer3.Tx.DanC_ExamRange.Opacity = 255; + TJAPlayer3.Tx.DanC_Small_Number.Opacity = 255; - TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex].Opacity = counter800; + #endregion - TJAPlayer3.Tx.DanC_Number.Opacity = counter800; - TJAPlayer3.Tx.DanC_ExamRange.Opacity = counter800; - TJAPlayer3.Tx.DanC_Small_Number.Opacity = counter800; + int iconOpacity = 255; - iconOpacity = counter800; + if (ExamChange[i] && NowShowingNumber != 0 && Counter_Wait != null) { + if (Counter_Wait.CurrentValue >= 800) { + #region [counter800 opacity] - #endregion - } - else if (Counter_Wait.CurrentValue >= 800 - 255) - { - #region [counter255M255 opacity] + TJAPlayer3.Tx.DanC_Gauge[LdrawGaugeTypetwo].Opacity = counter800; - TJAPlayer3.Tx.DanC_Gauge[LdrawGaugeTypetwo].Opacity = counter255M255; + TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex].Opacity = counter800; - TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex].Opacity = counter255M255; + TJAPlayer3.Tx.DanC_Number.Opacity = counter800; + TJAPlayer3.Tx.DanC_ExamRange.Opacity = counter800; + TJAPlayer3.Tx.DanC_Small_Number.Opacity = counter800; - TJAPlayer3.Tx.DanC_Number.Opacity = counter255M255; - TJAPlayer3.Tx.DanC_ExamRange.Opacity = counter255M255; - TJAPlayer3.Tx.DanC_Small_Number.Opacity = counter255M255; + iconOpacity = counter800; - iconOpacity = counter255M255; + #endregion + } else if (Counter_Wait.CurrentValue >= 800 - 255) { + #region [counter255M255 opacity] - #endregion - } - } + TJAPlayer3.Tx.DanC_Gauge[LdrawGaugeTypetwo].Opacity = counter255M255; - #region [Displayables] + TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex].Opacity = counter255M255; - // Non individual : 209 / 650 : 0.32154f - // Individual : 97 / 432 : 0.22454f + TJAPlayer3.Tx.DanC_Number.Opacity = counter255M255; + TJAPlayer3.Tx.DanC_ExamRange.Opacity = counter255M255; + TJAPlayer3.Tx.DanC_Small_Number.Opacity = counter255M255; - float xExtend = ExamChange[i] ? (isSmallGauge ? 0.215f * 0.663333333f : 0.663333333f) : (isSmallGauge ? 0.32154f : 1.0f); + iconOpacity = counter255M255; - if (LrainbowBetterSuccess) - { - #region [Rainbow gauge display] + #endregion + } + } - TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex].vcScaleRatio.X = xExtend; + #region [Displayables] - // Reset base since it was used for minibars - TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].vcScaleRatio.X = xExtend; - TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].vcScaleRatio.Y = 1.0f; + // Non individual : 209 / 650 : 0.32154f + // Individual : 97 / 432 : 0.22454f - if (Counter_Wait != null && !(Counter_Wait.CurrentValue <= 1055 && Counter_Wait.CurrentValue >= 800 - 255)) - { - TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex].Opacity = 255; - } + float xExtend = ExamChange[i] ? (isSmallGauge ? 0.215f * 0.663333333f : 0.663333333f) : (isSmallGauge ? 0.32154f : 1.0f); - TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex]?.t2D拡大率考慮下基準描画( - barXOffset + TJAPlayer3.Skin.Game_DanC_Offset[0], lowerBarYOffset - TJAPlayer3.Skin.Game_DanC_Offset[1], - new Rectangle(0, 0, (int)(dan_C[i].GetAmountToPercent() * (TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex].szTextureSize.Width / 100.0)), TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex].szTextureSize.Height)); + if (LrainbowBetterSuccess) { + #region [Rainbow gauge display] - if (Counter_Wait != null && !(Counter_Wait.CurrentValue <= 1055 && Counter_Wait.CurrentValue >= 800 - 255)) - { - TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowBase].Opacity = (ct虹透明度.CurrentValue * 255 / (int)ct虹透明度.EndValue) / 1; - } + TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex].vcScaleRatio.X = xExtend; - TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowBase]?.t2D拡大率考慮下基準描画( - barXOffset + TJAPlayer3.Skin.Game_DanC_Offset[0], lowerBarYOffset - TJAPlayer3.Skin.Game_DanC_Offset[1], - new Rectangle(0, 0, (int)(dan_C[i].GetAmountToPercent() * (TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowBase].szTextureSize.Width / 100.0)), TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex].szTextureSize.Height)); + // Reset base since it was used for minibars + TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].vcScaleRatio.X = xExtend; + TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].vcScaleRatio.Y = 1.0f; - #endregion - } - else - { - #region [Regular gauge display] + if (Counter_Wait != null && !(Counter_Wait.CurrentValue <= 1055 && Counter_Wait.CurrentValue >= 800 - 255)) { + TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex].Opacity = 255; + } - TJAPlayer3.Tx.DanC_Gauge[LdrawGaugeTypetwo].vcScaleRatio.X = xExtend; - TJAPlayer3.Tx.DanC_Gauge[LdrawGaugeTypetwo].vcScaleRatio.Y = 1.0f; - TJAPlayer3.Tx.DanC_Gauge[LdrawGaugeTypetwo]?.t2D拡大率考慮下基準描画( - barXOffset + TJAPlayer3.Skin.Game_DanC_Offset[0], lowerBarYOffset - TJAPlayer3.Skin.Game_DanC_Offset[1], - new Rectangle(0, 0, (int)(dan_C[i].GetAmountToPercent() * (TJAPlayer3.Tx.DanC_Gauge[LdrawGaugeTypetwo].szTextureSize.Width / 100.0)), TJAPlayer3.Tx.DanC_Gauge[LdrawGaugeTypetwo].szTextureSize.Height)); + TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex]?.t2D拡大率考慮下基準描画( + barXOffset + TJAPlayer3.Skin.Game_DanC_Offset[0], lowerBarYOffset - TJAPlayer3.Skin.Game_DanC_Offset[1], + new Rectangle(0, 0, (int)(dan_C[i].GetAmountToPercent() * (TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex].szTextureSize.Width / 100.0)), TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex].szTextureSize.Height)); - #endregion - } + if (Counter_Wait != null && !(Counter_Wait.CurrentValue <= 1055 && Counter_Wait.CurrentValue >= 800 - 255)) { + TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowBase].Opacity = (ct虹透明度.CurrentValue * 255 / (int)ct虹透明度.EndValue) / 1; + } - #endregion + TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowBase]?.t2D拡大率考慮下基準描画( + barXOffset + TJAPlayer3.Skin.Game_DanC_Offset[0], lowerBarYOffset - TJAPlayer3.Skin.Game_DanC_Offset[1], + new Rectangle(0, 0, (int)(dan_C[i].GetAmountToPercent() * (TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowBase].szTextureSize.Width / 100.0)), TJAPlayer3.Tx.Gauge_Dan_Rainbow[rainbowIndex].szTextureSize.Height)); + #endregion + } else { + #region [Regular gauge display] - #endregion + TJAPlayer3.Tx.DanC_Gauge[LdrawGaugeTypetwo].vcScaleRatio.X = xExtend; + TJAPlayer3.Tx.DanC_Gauge[LdrawGaugeTypetwo].vcScaleRatio.Y = 1.0f; + TJAPlayer3.Tx.DanC_Gauge[LdrawGaugeTypetwo]?.t2D拡大率考慮下基準描画( + barXOffset + TJAPlayer3.Skin.Game_DanC_Offset[0], lowerBarYOffset - TJAPlayer3.Skin.Game_DanC_Offset[1], + new Rectangle(0, 0, (int)(dan_C[i].GetAmountToPercent() * (TJAPlayer3.Tx.DanC_Gauge[LdrawGaugeTypetwo].szTextureSize.Width / 100.0)), TJAPlayer3.Tx.DanC_Gauge[LdrawGaugeTypetwo].szTextureSize.Height)); - #region [Print the current value number] + #endregion + } - int nowAmount = dan_C[i].Amount; + #endregion - if (dan_C[i].GetExamRange() == Exam.Range.Less) - nowAmount = dan_C[i].Value[0] - dan_C[i].Amount; - if (nowAmount < 0) nowAmount = 0; + #endregion - float numberXScale = isSmallGauge ? TJAPlayer3.Skin.Game_DanC_Number_Small_Scale * 0.6f : TJAPlayer3.Skin.Game_DanC_Number_Small_Scale; - float numberYScale = isSmallGauge ? TJAPlayer3.Skin.Game_DanC_Number_Small_Scale * 0.8f : TJAPlayer3.Skin.Game_DanC_Number_Small_Scale; - int numberPadding = (int)(TJAPlayer3.Skin.Game_DanC_Number_Padding * (isSmallGauge ? 0.6f : 1f)); + #region [Print the current value number] - DrawNumber(nowAmount, - barXOffset + TJAPlayer3.Skin.Game_DanC_Number_Small_Number_Offset[0], - lowerBarYOffset - TJAPlayer3.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)); + int nowAmount = dan_C[i].Amount; - #endregion + if (dan_C[i].GetExamRange() == Exam.Range.Less) + nowAmount = dan_C[i].Value[0] - dan_C[i].Amount; - if (ExamChange[i]) - { - CActSelect段位リスト.tDisplayDanIcon(NowShowingNumber + 1, barXOffset + TJAPlayer3.Skin.Game_DanC_DanIcon_Offset[0], barYOffset + TJAPlayer3.Skin.Game_DanC_DanIcon_Offset[1], iconOpacity, 0.6f, true); - } + if (nowAmount < 0) nowAmount = 0; + float numberXScale = isSmallGauge ? TJAPlayer3.Skin.Game_DanC_Number_Small_Scale * 0.6f : TJAPlayer3.Skin.Game_DanC_Number_Small_Scale; + float numberYScale = isSmallGauge ? TJAPlayer3.Skin.Game_DanC_Number_Small_Scale * 0.8f : TJAPlayer3.Skin.Game_DanC_Number_Small_Scale; + int numberPadding = (int)(TJAPlayer3.Skin.Game_DanC_Number_Padding * (isSmallGauge ? 0.6f : 1f)); - #region [Dan conditions display] + DrawNumber(nowAmount, + barXOffset + TJAPlayer3.Skin.Game_DanC_Number_Small_Number_Offset[0], + lowerBarYOffset - TJAPlayer3.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)); - int offset = TJAPlayer3.Skin.Game_DanC_Exam_Offset[0]; + #endregion - TJAPlayer3.Tx.DanC_ExamType.vcScaleRatio.X = 1.0f; - TJAPlayer3.Tx.DanC_ExamType.vcScaleRatio.Y = 1.0f; + if (ExamChange[i]) { + CActSelect段位リスト.tDisplayDanIcon(NowShowingNumber + 1, barXOffset + TJAPlayer3.Skin.Game_DanC_DanIcon_Offset[0], barYOffset + TJAPlayer3.Skin.Game_DanC_DanIcon_Offset[1], iconOpacity, 0.6f, true); + } - // Exam range (Less than/More) - TJAPlayer3.Tx.DanC_ExamRange?.t2D拡大率考慮下基準描画( - barXOffset + offset - TJAPlayer3.Tx.DanC_ExamRange.szTextureSize.Width, - lowerBarYOffset - TJAPlayer3.Skin.Game_DanC_Exam_Offset[1], - new Rectangle(0, TJAPlayer3.Skin.Game_DanC_ExamRange_Size[1] * (int)dan_C[i].GetExamRange(), TJAPlayer3.Skin.Game_DanC_ExamRange_Size[0], TJAPlayer3.Skin.Game_DanC_ExamRange_Size[1])); - - offset -= TJAPlayer3.Skin.Game_DanC_ExamRange_Padding; - // Condition number - DrawNumber( - dan_C[i].Value[0], - barXOffset + offset - dan_C[i].Value[0].ToString().Length * (int)(TJAPlayer3.Skin.Game_DanC_Number_Small_Padding * TJAPlayer3.Skin.Game_DanC_Exam_Number_Scale), - lowerBarYOffset - TJAPlayer3.Skin.Game_DanC_Exam_Offset[1] - 1, - (int)(TJAPlayer3.Skin.Game_DanC_Number_Small_Padding * TJAPlayer3.Skin.Game_DanC_Exam_Number_Scale), - false, - dan_C[i]); + #region [Dan conditions display] - int _offexX = (int)(22f * TJAPlayer3.Skin.Resolution[0] / 1280f); - int _offexY = (int)(48f * TJAPlayer3.Skin.Resolution[1] / 720f); - int _examX = barXOffset + TJAPlayer3.Skin.Game_DanC_Exam_Offset[0] - TJAPlayer3.Tx.DanC_ExamType.szTextureSize.Width + _offexX; - int _examY = lowerBarYOffset - TJAPlayer3.Skin.Game_DanC_Exam_Offset[1] - _offexY; + int offset = TJAPlayer3.Skin.Game_DanC_Exam_Offset[0]; - // Exam type flag - TJAPlayer3.Tx.DanC_ExamType?.t2D拡大率考慮下基準描画( - _examX, - _examY, - new Rectangle(0, 0, TJAPlayer3.Skin.Game_DanC_ExamType_Size[0], TJAPlayer3.Skin.Game_DanC_ExamType_Size[1])); + TJAPlayer3.Tx.DanC_ExamType.vcScaleRatio.X = 1.0f; + TJAPlayer3.Tx.DanC_ExamType.vcScaleRatio.Y = 1.0f; - if ((int)dan_C[i].GetExamType() < this.ttkExams.Length) - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkExams[(int)dan_C[i].GetExamType()]).t2D拡大率考慮中央基準描画( - _examX + TJAPlayer3.Skin.Game_DanC_ExamType_Size[0] / 2, - _examY - TJAPlayer3.Skin.Game_DanC_ExamType_Size[1] / 2); + // Exam range (Less than/More) + TJAPlayer3.Tx.DanC_ExamRange?.t2D拡大率考慮下基準描画( + barXOffset + offset - TJAPlayer3.Tx.DanC_ExamRange.szTextureSize.Width, + lowerBarYOffset - TJAPlayer3.Skin.Game_DanC_Exam_Offset[1], + new Rectangle(0, TJAPlayer3.Skin.Game_DanC_ExamRange_Size[1] * (int)dan_C[i].GetExamRange(), TJAPlayer3.Skin.Game_DanC_ExamRange_Size[0], TJAPlayer3.Skin.Game_DanC_ExamRange_Size[1])); + offset -= TJAPlayer3.Skin.Game_DanC_ExamRange_Padding; - /* + // Condition number + DrawNumber( + dan_C[i].Value[0], + barXOffset + offset - dan_C[i].Value[0].ToString().Length * (int)(TJAPlayer3.Skin.Game_DanC_Number_Small_Padding * TJAPlayer3.Skin.Game_DanC_Exam_Number_Scale), + lowerBarYOffset - TJAPlayer3.Skin.Game_DanC_Exam_Offset[1] - 1, + (int)(TJAPlayer3.Skin.Game_DanC_Number_Small_Padding * TJAPlayer3.Skin.Game_DanC_Exam_Number_Scale), + false, + dan_C[i]); + + int _offexX = (int)(22f * TJAPlayer3.Skin.Resolution[0] / 1280f); + int _offexY = (int)(48f * TJAPlayer3.Skin.Resolution[1] / 720f); + int _examX = barXOffset + TJAPlayer3.Skin.Game_DanC_Exam_Offset[0] - TJAPlayer3.Tx.DanC_ExamType.szTextureSize.Width + _offexX; + int _examY = lowerBarYOffset - TJAPlayer3.Skin.Game_DanC_Exam_Offset[1] - _offexY; + + // Exam type flag + TJAPlayer3.Tx.DanC_ExamType?.t2D拡大率考慮下基準描画( + _examX, + _examY, + new Rectangle(0, 0, TJAPlayer3.Skin.Game_DanC_ExamType_Size[0], TJAPlayer3.Skin.Game_DanC_ExamType_Size[1])); + + if ((int)dan_C[i].GetExamType() < this.ttkExams.Length) + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkExams[(int)dan_C[i].GetExamType()]).t2D拡大率考慮中央基準描画( + _examX + TJAPlayer3.Skin.Game_DanC_ExamType_Size[0] / 2, + _examY - TJAPlayer3.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 + #endregion - #region [Failed condition box] + #region [Failed condition box] - TJAPlayer3.Tx.DanC_Failed.vcScaleRatio.X = isSmallGauge ? 0.33f : 1f; + TJAPlayer3.Tx.DanC_Failed.vcScaleRatio.X = isSmallGauge ? 0.33f : 1f; - if (dan_C[i].GetReached()) - { - TJAPlayer3.Tx.DanC_Failed.t2D拡大率考慮下基準描画( - barXOffset + TJAPlayer3.Skin.Game_DanC_Offset[0], - lowerBarYOffset - TJAPlayer3.Skin.Game_DanC_Offset[1]); - } + if (dan_C[i].GetReached()) { + TJAPlayer3.Tx.DanC_Failed.t2D拡大率考慮下基準描画( + barXOffset + TJAPlayer3.Skin.Game_DanC_Offset[0], + lowerBarYOffset - TJAPlayer3.Skin.Game_DanC_Offset[1]); + } - #endregion - - } - else - { - #region [Gauge dan condition] + #endregion - int _scale = (int)(14f * TJAPlayer3.Skin.Resolution[0] / 1280f); - int _nbX = (int)(292f * TJAPlayer3.Skin.Resolution[0] / 1280f); - int _nbY = (int)(64f * TJAPlayer3.Skin.Resolution[0] / 1280f); - int _offexX = (int)(104f * TJAPlayer3.Skin.Resolution[0] / 1280f); - int _offexY = (int)(21f * TJAPlayer3.Skin.Resolution[1] / 720f); + } else { + #region [Gauge dan condition] - TJAPlayer3.Tx.DanC_Gauge_Base?.t2D描画( - TJAPlayer3.Skin.Game_DanC_X[0] - ((50 - dan_C[i].GetValue(false) / 2) * _scale) + 4, - TJAPlayer3.Skin.Game_DanC_Y[0]); + int _scale = (int)(14f * TJAPlayer3.Skin.Resolution[0] / 1280f); + int _nbX = (int)(292f * TJAPlayer3.Skin.Resolution[0] / 1280f); + int _nbY = (int)(64f * TJAPlayer3.Skin.Resolution[0] / 1280f); + int _offexX = (int)(104f * TJAPlayer3.Skin.Resolution[0] / 1280f); + int _offexY = (int)(21f * TJAPlayer3.Skin.Resolution[1] / 720f); - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkExams[(int)Exam.Type.Gauge]).t2D拡大率考慮中央基準描画( - TJAPlayer3.Skin.Game_DanC_X[0] - ((50 - dan_C[i].GetValue(false) / 2) * _scale) + _offexX, - TJAPlayer3.Skin.Game_DanC_Y[0] + _offexY); + TJAPlayer3.Tx.DanC_Gauge_Base?.t2D描画( + TJAPlayer3.Skin.Game_DanC_X[0] - ((50 - dan_C[i].GetValue(false) / 2) * _scale) + 4, + TJAPlayer3.Skin.Game_DanC_Y[0]); - // Display percentage here - DrawNumber( - dan_C[i].Value[0], - TJAPlayer3.Skin.Game_DanC_X[0] - ((50 - dan_C[i].GetValue(false) / 2) * _scale) + _nbX - dan_C[i].Value[0].ToString().Length * (int)(TJAPlayer3.Skin.Game_DanC_Number_Small_Padding * TJAPlayer3.Skin.Game_DanC_Exam_Number_Scale), - TJAPlayer3.Skin.Game_DanC_Y[0] - TJAPlayer3.Skin.Game_DanC_Exam_Offset[1] + _nbY, - (int)(TJAPlayer3.Skin.Game_DanC_Number_Small_Padding * TJAPlayer3.Skin.Game_DanC_Exam_Number_Scale), - false, - dan_C[i]); + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkExams[(int)Exam.Type.Gauge]).t2D拡大率考慮中央基準描画( + TJAPlayer3.Skin.Game_DanC_X[0] - ((50 - dan_C[i].GetValue(false) / 2) * _scale) + _offexX, + TJAPlayer3.Skin.Game_DanC_Y[0] + _offexY); - #endregion - } - } - } + // Display percentage here + DrawNumber( + dan_C[i].Value[0], + TJAPlayer3.Skin.Game_DanC_X[0] - ((50 - dan_C[i].GetValue(false) / 2) * _scale) + _nbX - dan_C[i].Value[0].ToString().Length * (int)(TJAPlayer3.Skin.Game_DanC_Number_Small_Padding * TJAPlayer3.Skin.Game_DanC_Exam_Number_Scale), + TJAPlayer3.Skin.Game_DanC_Y[0] - TJAPlayer3.Skin.Game_DanC_Exam_Offset[1] + _nbY, + (int)(TJAPlayer3.Skin.Game_DanC_Number_Small_Padding * TJAPlayer3.Skin.Game_DanC_Exam_Number_Scale), + false, + dan_C[i]); - /// - /// 段位チャレンジの数字フォントで数字を描画します。 - /// - /// 値。 - /// 一桁目の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) - { + #endregion + } + } + } - if (TJAPlayer3.Tx.DanC_Number == null || TJAPlayer3.Tx.DanC_Small_Number == null || value < 0) - return; + /// + /// 段位チャレンジの数字フォントで数字を描画します。 + /// + /// 値。 + /// 一桁目の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 (value == 0) - { - TJAPlayer3.Tx.DanC_Number.color4 = CConversion.ColorToColor4(Color.Gray); - TJAPlayer3.Tx.DanC_Small_Number.color4 = CConversion.ColorToColor4(Color.Gray); - } - else - { - TJAPlayer3.Tx.DanC_Number.color4 = CConversion.ColorToColor4(Color.White); - TJAPlayer3.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(TJAPlayer3.Skin.Game_DanC_Number_Size[0] * number - 1, GetExamConfirmStatus(dan_c) ? TJAPlayer3.Skin.Game_DanC_Number_Size[1] : 0, TJAPlayer3.Skin.Game_DanC_Number_Size[0], TJAPlayer3.Skin.Game_DanC_Number_Size[1]); - if (TJAPlayer3.Tx.DanC_Number != null) - { - TJAPlayer3.Tx.DanC_Number.vcScaleRatio.X = scaleX; - TJAPlayer3.Tx.DanC_Number.vcScaleRatio.Y = scaleY + scaleJump; - } - TJAPlayer3.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(TJAPlayer3.Skin.Game_DanC_Small_Number_Size[0] * number - 1, 0, TJAPlayer3.Skin.Game_DanC_Small_Number_Size[0], TJAPlayer3.Skin.Game_DanC_Small_Number_Size[1]); - if (TJAPlayer3.Tx.DanC_Small_Number != null) - { - TJAPlayer3.Tx.DanC_Small_Number.vcScaleRatio.X = scaleX; - TJAPlayer3.Tx.DanC_Small_Number.vcScaleRatio.Y = scaleY + scaleJump; - } - TJAPlayer3.Tx.DanC_Small_Number?.t2D拡大率考慮下中心基準描画(x - (notesRemainDigit * padding), y, rectangle); - notesRemainDigit--; - } - } - } + if (TJAPlayer3.Tx.DanC_Number == null || TJAPlayer3.Tx.DanC_Small_Number == null || value < 0) + return; - public void DrawMiniNumber(int value, int x, int y, int padding, Dan_C dan_c) - { - if (TJAPlayer3.Tx.DanC_MiniNumber == null || value < 0) - return; + if (value == 0) { + TJAPlayer3.Tx.DanC_Number.color4 = CConversion.ColorToColor4(Color.Gray); + TJAPlayer3.Tx.DanC_Small_Number.color4 = CConversion.ColorToColor4(Color.Gray); + } else { + TJAPlayer3.Tx.DanC_Number.color4 = CConversion.ColorToColor4(Color.White); + TJAPlayer3.Tx.DanC_Small_Number.color4 = CConversion.ColorToColor4(Color.White); + } - 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(TJAPlayer3.Skin.Game_DanC_MiniNumber_Size[0] * number - 1, GetExamConfirmStatus(dan_c) ? TJAPlayer3.Skin.Game_DanC_MiniNumber_Size[1] : 0, TJAPlayer3.Skin.Game_DanC_MiniNumber_Size[0], TJAPlayer3.Skin.Game_DanC_MiniNumber_Size[1]); - TJAPlayer3.Tx.DanC_MiniNumber.t2D拡大率考慮下中心基準描画(x - (notesRemainDigit * padding), y, rectangle); - notesRemainDigit--; - } - } + 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(TJAPlayer3.Skin.Game_DanC_Number_Size[0] * number - 1, GetExamConfirmStatus(dan_c) ? TJAPlayer3.Skin.Game_DanC_Number_Size[1] : 0, TJAPlayer3.Skin.Game_DanC_Number_Size[0], TJAPlayer3.Skin.Game_DanC_Number_Size[1]); + if (TJAPlayer3.Tx.DanC_Number != null) { + TJAPlayer3.Tx.DanC_Number.vcScaleRatio.X = scaleX; + TJAPlayer3.Tx.DanC_Number.vcScaleRatio.Y = scaleY + scaleJump; + } + TJAPlayer3.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(TJAPlayer3.Skin.Game_DanC_Small_Number_Size[0] * number - 1, 0, TJAPlayer3.Skin.Game_DanC_Small_Number_Size[0], TJAPlayer3.Skin.Game_DanC_Small_Number_Size[1]); + if (TJAPlayer3.Tx.DanC_Small_Number != null) { + TJAPlayer3.Tx.DanC_Small_Number.vcScaleRatio.X = scaleX; + TJAPlayer3.Tx.DanC_Small_Number.vcScaleRatio.Y = scaleY + scaleJump; + } + TJAPlayer3.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 < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count; j++ ) - { - if(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i] != null) - { - if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i].GetReached()) isFailed = true; - } - } - if (Challenge[i].GetReached()) isFailed = true; - } - return isFailed; - } + public void DrawMiniNumber(int value, int x, int y, int padding, Dan_C dan_c) { + if (TJAPlayer3.Tx.DanC_MiniNumber == null || value < 0) + return; - /// - /// n個の条件で段位認定モードのステータスを返します。 - /// - /// 条件。 - /// ExamStatus。 - public Exam.Status GetExamStatus(Dan_C[] dan_C) - { - var status = Exam.Status.Better_Success; - - for (int i = 0; i < CExamInfo.cMaxExam; i++) - { + 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(TJAPlayer3.Skin.Game_DanC_MiniNumber_Size[0] * number - 1, GetExamConfirmStatus(dan_c) ? TJAPlayer3.Skin.Game_DanC_MiniNumber_Size[1] : 0, TJAPlayer3.Skin.Game_DanC_MiniNumber_Size[0], TJAPlayer3.Skin.Game_DanC_MiniNumber_Size[1]); + TJAPlayer3.Tx.DanC_MiniNumber.t2D拡大率考慮下中心基準描画(x - (notesRemainDigit * padding), y, rectangle); + notesRemainDigit--; + } + } - - if (ExamChange[i] == true) - { - for (int j = 1; j < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count; j++) - { - if (!(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i] != null)) - continue; + /// + /// n個の条件がひとつ以上達成失敗しているかどうかを返します。 + /// + /// n個の条件がひとつ以上達成失敗しているか。 + public bool GetFailedAllChallenges() { + var isFailed = false; + for (int i = 0; i < CExamInfo.cMaxExam; i++) { + if (Challenge[i] == null) continue; - bool rainbowBetterSuccess = GetExamStatus(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i]) == Exam.Status.Better_Success; + for (int j = 0; j < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count; j++) { + if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i] != null) { + if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i].GetReached()) isFailed = true; + } + } + if (Challenge[i].GetReached()) isFailed = true; + } + return isFailed; + } - if (!rainbowBetterSuccess) status = Exam.Status.Success; - } - } - + /// + /// n個の条件で段位認定モードのステータスを返します。 + /// + /// 条件。 + /// ExamStatus。 + public Exam.Status GetExamStatus(Dan_C[] dan_C) { + var status = Exam.Status.Better_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; - } + for (int i = 0; i < CExamInfo.cMaxExam; i++) { - private readonly float[] ScoreScale = new float[] - { - 0.000f, - 0.111f, // リピート + if (ExamChange[i] == true) { + for (int j = 1; j < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count; j++) { + if (!(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i] != null)) + continue; + + bool rainbowBetterSuccess = GetExamStatus(TJAPlayer3.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 - }; + 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; - } + [StructLayout(LayoutKind.Sequential)] + struct ChallengeStatus { + public Color4 Color; + public CCounter Timer_Gauge; + public CCounter Timer_Amount; + public CCounter Timer_Failed; + } - #region[ private ] - //----------------- + #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; + 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; + // アニメ関連 + 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 CSound Sound_Section; + private CSound Sound_Section_First; + private CSound Sound_Failed; - private CCounter ct虹アニメ; - private CCounter ct虹透明度; + private CCounter ct虹アニメ; + private CCounter ct虹透明度; - private CCachedFontRenderer pfExamFont; - private TitleTextureKey[] ttkExams; + private CCachedFontRenderer pfExamFont; + private TitleTextureKey[] ttkExams; - //----------------- - #endregion - } + //----------------- + #endregion + } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/EndAnimeScript.cs b/OpenTaiko/src/Stages/07.Game/Taiko/EndAnimeScript.cs index 3fe7cb0d..3c853a16 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/EndAnimeScript.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/EndAnimeScript.cs @@ -1,83 +1,59 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NLua; -using FDK; +using NLua; -namespace TJAPlayer3 -{ - class EndAnimeScript : ScriptBG - { - private LuaFunction LuaPlayEndAnime; +namespace TJAPlayer3 { + class EndAnimeScript : ScriptBG { + private LuaFunction LuaPlayEndAnime; - public EndAnimeScript(string filePath) : base(filePath) - { - if (LuaScript != null) - { - LuaPlayEndAnime = LuaScript.GetFunction("playEndAnime"); - } - } + 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; + public new void Update(int player) { + if (LuaScript == null) return; + try { + float currentFloorPositionMax140 = 0; - if (TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[5] != null) - { - int maxFloor = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor; - int nightTime = Math.Max(140, maxFloor / 2); + if (TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[5] != null) { + int maxFloor = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor; + int nightTime = Math.Max(140, maxFloor / 2); - currentFloorPositionMax140 = Math.Min(TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] / (float)nightTime, 1f); - } + currentFloorPositionMax140 = Math.Min(TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] / (float)nightTime, 1f); + } - LuaUpdateValues.Call(TJAPlayer3.FPS.DeltaTime, TJAPlayer3.FPS.NowFPS, TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared, (double)currentFloorPositionMax140); - /*LuaScript.SetObjectToPath("fps", TJAPlayer3.FPS.n現在のFPS); + LuaUpdateValues.Call(TJAPlayer3.FPS.DeltaTime, TJAPlayer3.FPS.NowFPS, TJAPlayer3.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 (!TJAPlayer3.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; - } - } - } + if (!TJAPlayer3.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; + } + } + } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/FireWorks.cs b/OpenTaiko/src/Stages/07.Game/Taiko/FireWorks.cs index 3e26625d..5fc87394 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/FireWorks.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/FireWorks.cs @@ -1,115 +1,94 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; +using System.Drawing; using System.Runtime.InteropServices; using FDK; -namespace TJAPlayer3 -{ - internal class FireWorks : CActivity - { - // コンストラクタ +namespace TJAPlayer3 { + internal class FireWorks : CActivity { + // コンストラクタ - public FireWorks() - { - base.IsDeActivated = true; - } + public FireWorks() { + base.IsDeActivated = true; + } - // メソッド + // メソッド - /// - /// 大音符の花火エフェクト - /// - /// - public virtual void Start(int nLane, int nPlayer, double x, double y) - { - if (TJAPlayer3.ConfigIni.SimpleMode) return; + /// + /// 大音符の花火エフェクト + /// + /// + public virtual void Start(int nLane, int nPlayer, double x, double y) { + if (TJAPlayer3.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, TJAPlayer3.Skin.Game_Effect_FireWorks[2] - 1, TJAPlayer3.Skin.Game_Effect_FireWorks_Timer, TJAPlayer3.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, TJAPlayer3.Skin.Game_Effect_FireWorks[2] - 1, TJAPlayer3.Skin.Game_Effect_FireWorks_Timer, TJAPlayer3.Timer); + break; + } + } + } - // CActivity 実装 + // CActivity 実装 - 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 && !TJAPlayer3.ConfigIni.SimpleMode) - { - for (int i = 0; i < 32; i++) - { - if(FireWork[i].IsUsing) - { - FireWork[i].Counter.Tick(); - TJAPlayer3.Tx.Effects_Hit_FireWorks?.t2D中心基準描画((float)FireWork[i].X, (float)FireWork[i].Y, 1, new Rectangle(FireWork[i].Counter.CurrentValue * TJAPlayer3.Skin.Game_Effect_FireWorks[0], 0, TJAPlayer3.Skin.Game_Effect_FireWorks[0], TJAPlayer3.Skin.Game_Effect_FireWorks[1])); - if (FireWork[i].Counter.IsEnded) - { - FireWork[i].Counter.Stop(); - FireWork[i].IsUsing = false; - } - } - } - } - return 0; - } + 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 && !TJAPlayer3.ConfigIni.SimpleMode) { + for (int i = 0; i < 32; i++) { + if (FireWork[i].IsUsing) { + FireWork[i].Counter.Tick(); + TJAPlayer3.Tx.Effects_Hit_FireWorks?.t2D中心基準描画((float)FireWork[i].X, (float)FireWork[i].Y, 1, new Rectangle(FireWork[i].Counter.CurrentValue * TJAPlayer3.Skin.Game_Effect_FireWorks[0], 0, TJAPlayer3.Skin.Game_Effect_FireWorks[0], TJAPlayer3.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]; + #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 - } + //----------------- + #endregion + } } -  + diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/FlyingNotes.cs b/OpenTaiko/src/Stages/07.Game/Taiko/FlyingNotes.cs index 2fda1cff..e350c69a 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/FlyingNotes.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/FlyingNotes.cs @@ -1,129 +1,102 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; using FDK; -namespace TJAPlayer3 -{ - internal class FlyingNotes : CActivity - { - // コンストラクタ +namespace TJAPlayer3 { + internal class FlyingNotes : CActivity { + // コンストラクタ - public FlyingNotes() - { - base.IsDeActivated = true; - } + public FlyingNotes() { + base.IsDeActivated = true; + } - // メソッド - public virtual void Start(int nLane, int nPlayer, bool isRoll = false) - { - if (TJAPlayer3.ConfigIni.nPlayerCount > 2 || TJAPlayer3.ConfigIni.SimpleMode) return; - EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(nPlayer)]; + // メソッド + public virtual void Start(int nLane, int nPlayer, bool isRoll = false) { + if (TJAPlayer3.ConfigIni.nPlayerCount > 2 || TJAPlayer3.ConfigIni.SimpleMode) return; + EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(nPlayer)]; - if (TJAPlayer3.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 = TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]; - Flying[i].OldValue = 0; - Flying[i].IsRoll = isRoll; - // 角度の決定 - Flying[i].Height = Math.Abs(TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[nPlayer] - TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]); - Flying[i].Width = (Math.Abs((TJAPlayer3.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, TJAPlayer3.Skin.Game_Effect_FlyingNotes_Timer, TJAPlayer3.Timer); - //Flying[i].Counter = new CCounter(0, 200000, CDTXMania.Skin.Game_Effect_FlyingNotes_Timer, CDTXMania.Timer); + if (TJAPlayer3.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 = TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]; + Flying[i].OldValue = 0; + Flying[i].IsRoll = isRoll; + // 角度の決定 + Flying[i].Height = Math.Abs(TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[nPlayer] - TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]); + Flying[i].Width = (Math.Abs((TJAPlayer3.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, TJAPlayer3.Skin.Game_Effect_FlyingNotes_Timer, TJAPlayer3.Timer); + //Flying[i].Counter = new CCounter(0, 200000, CDTXMania.Skin.Game_Effect_FlyingNotes_Timer, CDTXMania.Timer); - Flying[i].IncreaseX = (1.00 * Math.Abs((TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[nPlayer] - StartPointX[nPlayer]))) / (180); - Flying[i].IncreaseY = (1.00 * Math.Abs((TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[nPlayer] - TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]))) / (180); - break; - } - } - } - } + Flying[i].IncreaseX = (1.00 * Math.Abs((TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[nPlayer] - StartPointX[nPlayer]))) / (180); + Flying[i].IncreaseY = (1.00 * Math.Abs((TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[nPlayer] - TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]))) / (180); + break; + } + } + } + } - // CActivity 実装 + // CActivity 実装 - 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] = TJAPlayer3.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 && !TJAPlayer3.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; - TJAPlayer3.stage演奏ドラム画面.actGauge.Start(Flying[i].Lane, ENoteJudge.Perfect, Flying[i].Player); - TJAPlayer3.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; + 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] = TJAPlayer3.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 && !TJAPlayer3.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; + TJAPlayer3.stage演奏ドラム画面.actGauge.Start(Flying[i].Lane, ENoteJudge.Perfect, Flying[i].Player); + TJAPlayer3.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 (TJAPlayer3.ConfigIni.bAIBattleMode) - { - endX = TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X_AI[Flying[i].Player]; - endY = TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y_AI[Flying[i].Player]; - } - else - { - endX = TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[Flying[i].Player]; - endY = TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[Flying[i].Player]; - } + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + endX = TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X_AI[Flying[i].Player]; + endY = TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y_AI[Flying[i].Player]; + } else { + endX = TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[Flying[i].Player]; + endY = TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[Flying[i].Player]; + } - int movingDistanceX = endX - StartPointX[Flying[i].Player]; - int movingDistanceY = endY - TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[Flying[i].Player]; + int movingDistanceX = endX - StartPointX[Flying[i].Player]; + int movingDistanceY = endY - TJAPlayer3.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; @@ -135,36 +108,28 @@ namespace TJAPlayer3 } */ - double value = (Flying[i].Counter.CurrentValue / 140.0); + double value = (Flying[i].Counter.CurrentValue / 140.0); - Flying[i].X = StartPointX[Flying[i].Player] + TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(Flying[i].Player) + (movingDistanceX * value); - Flying[i].Y = TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[Flying[i].Player] + TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(Flying[i].Player) + (int)(movingDistanceY * value); - - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - Flying[i].Y += Math.Sin(value * Math.PI) * ((Flying[i].Player == 0 ? -TJAPlayer3.Skin.Game_Effect_FlyingNotes_Sine : TJAPlayer3.Skin.Game_Effect_FlyingNotes_Sine) / 3.0); - } - else - { - Flying[i].Y += Math.Sin(value * Math.PI) * (Flying[i].Player == 0 ? -TJAPlayer3.Skin.Game_Effect_FlyingNotes_Sine : TJAPlayer3.Skin.Game_Effect_FlyingNotes_Sine); - } + Flying[i].X = StartPointX[Flying[i].Player] + TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLX(Flying[i].Player) + (movingDistanceX * value); + Flying[i].Y = TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[Flying[i].Player] + TJAPlayer3.stage演奏ドラム画面.GetJPOSCROLLY(Flying[i].Player) + (int)(movingDistanceY * value); - if (TJAPlayer3.Skin.Game_Effect_FlyingNotes_IsUsingEasing) - { - } - else - { - } + if (TJAPlayer3.ConfigIni.bAIBattleMode) { + Flying[i].Y += Math.Sin(value * Math.PI) * ((Flying[i].Player == 0 ? -TJAPlayer3.Skin.Game_Effect_FlyingNotes_Sine : TJAPlayer3.Skin.Game_Effect_FlyingNotes_Sine) / 3.0); + } else { + Flying[i].Y += Math.Sin(value * Math.PI) * (Flying[i].Player == 0 ? -TJAPlayer3.Skin.Game_Effect_FlyingNotes_Sine : TJAPlayer3.Skin.Game_Effect_FlyingNotes_Sine); + } - if (n % TJAPlayer3.Skin.Game_Effect_FireWorks_Timing == 0 && !Flying[i].IsRoll && Flying[i].Counter.CurrentValue > 18) - { - if (Flying[i].Lane == 3 || Flying[i].Lane == 4) - { - TJAPlayer3.stage演奏ドラム画面.FireWorks.Start(Flying[i].Lane, Flying[i].Player, Flying[i].X, Flying[i].Y); - } - } + if (TJAPlayer3.Skin.Game_Effect_FlyingNotes_IsUsingEasing) { + } else { + } - /* + if (n % TJAPlayer3.Skin.Game_Effect_FireWorks_Timing == 0 && !Flying[i].IsRoll && Flying[i].Counter.CurrentValue > 18) { + if (Flying[i].Lane == 3 || Flying[i].Lane == 4) { + TJAPlayer3.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; @@ -176,18 +141,18 @@ namespace TJAPlayer3 Flying[i].Y += Flying[i].IncreaseY * Flying[i].Counter.n現在の値; } */ - } - //Flying[i].OldValue = 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); + 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) { @@ -198,41 +163,40 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Notes?.t2D中心基準描画((int)Flying[i].X, (int)Flying[i].Y, new Rectangle(Flying[i].Lane * 130, 0, 130, 130)); } */ - } - } - } - return base.Draw(); - } + } + } + } + return base.Draw(); + } - #region [ private ] - //----------------- + #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; - } + [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]; + private Status[] Flying = new Status[128]; - public readonly int[] StartPointX = new int[2]; + public readonly int[] StartPointX = new int[2]; - //----------------- - #endregion - } -} \ No newline at end of file + //----------------- + #endregion + } +} diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/GoGoSplash.cs b/OpenTaiko/src/Stages/07.Game/Taiko/GoGoSplash.cs index 7f6dd7eb..8b23be7a 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/GoGoSplash.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/GoGoSplash.cs @@ -1,85 +1,61 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Drawing; using FDK; -using System.Drawing; -namespace TJAPlayer3 -{ - class GoGoSplash : CActivity - { - public GoGoSplash() - { - this.IsDeActivated = true; - } +namespace TJAPlayer3 { + class GoGoSplash : CActivity { + public GoGoSplash() { + this.IsDeActivated = true; + } - public override void Activate() - { - Splash = new CCounter(); - base.Activate(); - } + public override void Activate() { + Splash = new CCounter(); + base.Activate(); + } - public override void DeActivate() - { - base.DeActivate(); - } + public override void DeActivate() { + base.DeActivate(); + } - /// - /// ゴーゴースプラッシュの描画処理です。 - /// SkinCofigで本数を変更することができます。 - /// - /// - public override int Draw() - { - if (Splash == null || TJAPlayer3.ConfigIni.SimpleMode) return base.Draw(); - Splash.Tick(); - if (Splash.IsEnded) - { - Splash.CurrentValue = 0; - Splash.Stop(); - } - if (Splash.IsTicked) - { - for (int i = 0; i < TJAPlayer3.Skin.Game_Effect_GoGoSplash_X.Length; i++) - { - if (i > TJAPlayer3.Skin.Game_Effect_GoGoSplash_Y.Length) break; - // Yの配列がiよりも小さかったらそこでキャンセルする。 - if(TJAPlayer3.Skin.Game_Effect_GoGoSplash_Rotate && TJAPlayer3.Tx.Effects_GoGoSplash != null) - { - // Switch文を使いたかったが、定数じゃないから使えねぇ!!!! - if (i == 0) - { - TJAPlayer3.Tx.Effects_GoGoSplash.fZ軸中心回転 = -0.2792526803190927f; - } - else if (i == 1) - { - TJAPlayer3.Tx.Effects_GoGoSplash.fZ軸中心回転 = -0.13962634015954636f; - } - else if (i == TJAPlayer3.Skin.Game_Effect_GoGoSplash_X.Length - 2) - { - TJAPlayer3.Tx.Effects_GoGoSplash.fZ軸中心回転 = 0.13962634015954636f; - } - else if (i == TJAPlayer3.Skin.Game_Effect_GoGoSplash_X.Length - 1) - { - TJAPlayer3.Tx.Effects_GoGoSplash.fZ軸中心回転 = 0.2792526803190927f; - } - else - { - TJAPlayer3.Tx.Effects_GoGoSplash.fZ軸中心回転 = 0.0f; - } - } - TJAPlayer3.Tx.Effects_GoGoSplash?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Effect_GoGoSplash_X[i], TJAPlayer3.Skin.Game_Effect_GoGoSplash_Y[i], new Rectangle(TJAPlayer3.Skin.Game_Effect_GoGoSplash[0] * Splash.CurrentValue, 0, TJAPlayer3.Skin.Game_Effect_GoGoSplash[0], TJAPlayer3.Skin.Game_Effect_GoGoSplash[1])); - } - } - return base.Draw(); - } + /// + /// ゴーゴースプラッシュの描画処理です。 + /// SkinCofigで本数を変更することができます。 + /// + /// + public override int Draw() { + if (Splash == null || TJAPlayer3.ConfigIni.SimpleMode) return base.Draw(); + Splash.Tick(); + if (Splash.IsEnded) { + Splash.CurrentValue = 0; + Splash.Stop(); + } + if (Splash.IsTicked) { + for (int i = 0; i < TJAPlayer3.Skin.Game_Effect_GoGoSplash_X.Length; i++) { + if (i > TJAPlayer3.Skin.Game_Effect_GoGoSplash_Y.Length) break; + // Yの配列がiよりも小さかったらそこでキャンセルする。 + if (TJAPlayer3.Skin.Game_Effect_GoGoSplash_Rotate && TJAPlayer3.Tx.Effects_GoGoSplash != null) { + // Switch文を使いたかったが、定数じゃないから使えねぇ!!!! + if (i == 0) { + TJAPlayer3.Tx.Effects_GoGoSplash.fZ軸中心回転 = -0.2792526803190927f; + } else if (i == 1) { + TJAPlayer3.Tx.Effects_GoGoSplash.fZ軸中心回転 = -0.13962634015954636f; + } else if (i == TJAPlayer3.Skin.Game_Effect_GoGoSplash_X.Length - 2) { + TJAPlayer3.Tx.Effects_GoGoSplash.fZ軸中心回転 = 0.13962634015954636f; + } else if (i == TJAPlayer3.Skin.Game_Effect_GoGoSplash_X.Length - 1) { + TJAPlayer3.Tx.Effects_GoGoSplash.fZ軸中心回転 = 0.2792526803190927f; + } else { + TJAPlayer3.Tx.Effects_GoGoSplash.fZ軸中心回転 = 0.0f; + } + } + TJAPlayer3.Tx.Effects_GoGoSplash?.t2D拡大率考慮下中心基準描画(TJAPlayer3.Skin.Game_Effect_GoGoSplash_X[i], TJAPlayer3.Skin.Game_Effect_GoGoSplash_Y[i], new Rectangle(TJAPlayer3.Skin.Game_Effect_GoGoSplash[0] * Splash.CurrentValue, 0, TJAPlayer3.Skin.Game_Effect_GoGoSplash[0], TJAPlayer3.Skin.Game_Effect_GoGoSplash[1])); + } + } + return base.Draw(); + } - public void StartSplash() - { - Splash = new CCounter(0, TJAPlayer3.Skin.Game_Effect_GoGoSplash[2] - 1, TJAPlayer3.Skin.Game_Effect_GoGoSplash_Timer, TJAPlayer3.Timer); - } + public void StartSplash() { + Splash = new CCounter(0, TJAPlayer3.Skin.Game_Effect_GoGoSplash[2] - 1, TJAPlayer3.Skin.Game_Effect_GoGoSplash_Timer, TJAPlayer3.Timer); + } - private CCounter Splash; - } + private CCounter Splash; + } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/KusudamaScript.cs b/OpenTaiko/src/Stages/07.Game/Taiko/KusudamaScript.cs index 9387a38a..4aa83a5f 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/KusudamaScript.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/KusudamaScript.cs @@ -1,70 +1,48 @@ using NLua; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -namespace TJAPlayer3 -{ - internal class KusudamaScript : ScriptBG - { - private LuaFunction LuaKusuIn; - private LuaFunction LuaKusuBroke; - private LuaFunction LuaKusuMiss; +namespace TJAPlayer3 { + 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 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 14b9a193..4af31068 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/LaneFlash.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/LaneFlash.cs @@ -1,77 +1,59 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using TJAPlayer3; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - /// - /// レーンフラッシュのクラス。 - /// - public class LaneFlash : CActivity - { +namespace TJAPlayer3 { + /// + /// レーンフラッシュのクラス。 + /// + public class LaneFlash : CActivity { - public LaneFlash(ref CTexture texture, int player) - { - Texture = texture; - Player = player; - base.IsDeActivated = true; - } + public LaneFlash(ref CTexture texture, int player) { + Texture = texture; + Player = player; + base.IsDeActivated = true; + } - public void Start() - { - Counter = new CCounter(0, 100, 1, TJAPlayer3.Timer); - } + public void Start() { + Counter = new CCounter(0, 100, 1, TJAPlayer3.Timer); + } - public override void Activate() - { - Counter = new CCounter(); - base.Activate(); - } + public override void Activate() { + Counter = new CCounter(); + base.Activate(); + } - public override void DeActivate() - { - Counter = null; - base.DeActivate(); - } + 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; + public override int Draw() { + if (Texture == null || Counter == null) return base.Draw(); + if (!Counter.IsStoped) { + int x; + int y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { - x = TJAPlayer3.Skin.Game_Lane_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * Player); - y = TJAPlayer3.Skin.Game_Lane_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * Player); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { - x = TJAPlayer3.Skin.Game_Lane_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * Player); - y = TJAPlayer3.Skin.Game_Lane_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * Player); - } - else - { - x = TJAPlayer3.Skin.Game_Lane_X[Player]; - y = TJAPlayer3.Skin.Game_Lane_Y[Player]; - } + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { + x = TJAPlayer3.Skin.Game_Lane_5P[0] + (TJAPlayer3.Skin.Game_UIMove_5P[0] * Player); + y = TJAPlayer3.Skin.Game_Lane_5P[1] + (TJAPlayer3.Skin.Game_UIMove_5P[1] * Player); + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { + x = TJAPlayer3.Skin.Game_Lane_4P[0] + (TJAPlayer3.Skin.Game_UIMove_4P[0] * Player); + y = TJAPlayer3.Skin.Game_Lane_4P[1] + (TJAPlayer3.Skin.Game_UIMove_4P[1] * Player); + } else { + x = TJAPlayer3.Skin.Game_Lane_X[Player]; + y = TJAPlayer3.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(); - } + 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; - } + 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 c6bcfe52..6f9ab310 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/ModIcons.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/ModIcons.cs @@ -1,198 +1,173 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +namespace TJAPlayer3 { + 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 TJAPlayer3 -{ - 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) }, - }; + static public void tDisplayMods(int x, int y, int player) { + // +30 x/y + int actual = TJAPlayer3.GetActualPlayer(player); - static public void tDisplayMods(int x, int y, int player) - { - // +30 x/y - int actual = TJAPlayer3.GetActualPlayer(player); + for (int i = 0; i < 8; i++) { + __methods[i](x + TJAPlayer3.Skin.ModIcons_OffsetX[i], y + TJAPlayer3.Skin.ModIcons_OffsetY[i], actual, player); + } + } - for (int i = 0; i < 8; i++) - { - __methods[i](x + TJAPlayer3.Skin.ModIcons_OffsetX[i], y + TJAPlayer3.Skin.ModIcons_OffsetY[i], actual, player); - } - } + static public void tDisplayModsMenu(int x, int y, int player) { + if (TJAPlayer3.Tx.Mod_None != null) + TJAPlayer3.Tx.Mod_None.Opacity = 0; - static public void tDisplayModsMenu(int x, int y, int player) - { - if (TJAPlayer3.Tx.Mod_None != null) - TJAPlayer3.Tx.Mod_None.Opacity = 0; + int actual = TJAPlayer3.GetActualPlayer(player); - int actual = TJAPlayer3.GetActualPlayer(player); + for (int i = 0; i < 8; i++) { + __methods[i](x + TJAPlayer3.Skin.ModIcons_OffsetX_Menu[i], y + TJAPlayer3.Skin.ModIcons_OffsetY_Menu[i], actual, player); + } - for (int i = 0; i < 8; i++) - { - __methods[i](x + TJAPlayer3.Skin.ModIcons_OffsetX_Menu[i], y + TJAPlayer3.Skin.ModIcons_OffsetY_Menu[i], actual, player); - } + if (TJAPlayer3.Tx.Mod_None != null) + TJAPlayer3.Tx.Mod_None.Opacity = 255; + } - if (TJAPlayer3.Tx.Mod_None != null) - TJAPlayer3.Tx.Mod_None.Opacity = 255; - } + #region [Displayables] - #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; - 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 (TJAPlayer3.ConfigIni.nScrollSpeed[player] >= _vals[j] && j < TJAPlayer3.Tx.HiSp.Length) + _i = j; + else + break; + } - for (int j = 0; j < _vals.Length; j++) - { - if (TJAPlayer3.ConfigIni.nScrollSpeed[player] >= _vals[j] && j < TJAPlayer3.Tx.HiSp.Length) - _i = j; - else - break; - } + if (_i >= 0) + TJAPlayer3.Tx.HiSp[_i]?.t2D描画(x, y); + else + TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); + } - if (_i >= 0) - TJAPlayer3.Tx.HiSp[_i]?.t2D描画(x, y); - else - TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); - } + static private void tDisplayAutoIcon(int x, int y, int player) { + bool _displayed = false; - static private void tDisplayAutoIcon(int x, int y, int player) - { - bool _displayed = false; + if (TJAPlayer3.ConfigIni.bAutoPlay[player]) + _displayed = true; - if (TJAPlayer3.ConfigIni.bAutoPlay[player]) - _displayed = true; + if (_displayed == true) + TJAPlayer3.Tx.Mod_Auto?.t2D描画(x, y); + else + TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); + } - if (_displayed == true) - TJAPlayer3.Tx.Mod_Auto?.t2D描画(x, y); - else - TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); - } - - static private void tDisplayDoronIcon(int x, int y, int player) - { - var conf_ = TJAPlayer3.ConfigIni.eSTEALTH[player]; + static private void tDisplayDoronIcon(int x, int y, int player) { + var conf_ = TJAPlayer3.ConfigIni.eSTEALTH[player]; - if (conf_ == EStealthMode.DORON) - TJAPlayer3.Tx.Mod_Doron?.t2D描画(x, y); - else if (conf_ == EStealthMode.STEALTH) - TJAPlayer3.Tx.Mod_Stealth?.t2D描画(x, y); - else - TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); - } + if (conf_ == EStealthMode.DORON) + TJAPlayer3.Tx.Mod_Doron?.t2D描画(x, y); + else if (conf_ == EStealthMode.STEALTH) + TJAPlayer3.Tx.Mod_Stealth?.t2D描画(x, y); + else + TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); + } - static private void tDisplayJustIcon(int x, int y, int player) - { - var conf_ = TJAPlayer3.ConfigIni.bJust[player]; + static private void tDisplayJustIcon(int x, int y, int player) { + var conf_ = TJAPlayer3.ConfigIni.bJust[player]; - if (conf_ == 1) - TJAPlayer3.Tx.Mod_Just?.t2D描画(x, y); - else if (conf_ == 2) - TJAPlayer3.Tx.Mod_Safe?.t2D描画(x, y); - else - TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); - } + if (conf_ == 1) + TJAPlayer3.Tx.Mod_Just?.t2D描画(x, y); + else if (conf_ == 2) + TJAPlayer3.Tx.Mod_Safe?.t2D描画(x, y); + else + TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); + } - static private void tDisplayRandomIcon(int x, int y, int player) - { - var rand_ = TJAPlayer3.ConfigIni.eRandom[player]; + static private void tDisplayRandomIcon(int x, int y, int player) { + var rand_ = TJAPlayer3.ConfigIni.eRandom[player]; - if (rand_ == ERandomMode.MIRROR) - TJAPlayer3.Tx.Mod_Mirror?.t2D描画(x, y); - else if (rand_ == ERandomMode.RANDOM) - TJAPlayer3.Tx.Mod_Random?.t2D描画(x, y); - else if (rand_ == ERandomMode.SUPERRANDOM) - TJAPlayer3.Tx.Mod_Super?.t2D描画(x, y); - else if (rand_ == ERandomMode.MIRRORRANDOM) - TJAPlayer3.Tx.Mod_Hyper?.t2D描画(x, y); - else - TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); - } - - static private void tDisplaySongSpeedIcon(int x, int y, int player) - { - if (TJAPlayer3.ConfigIni.nSongSpeed > 20) - TJAPlayer3.Tx.Mod_SongSpeed[1]?.t2D描画(x, y); - else if (TJAPlayer3.ConfigIni.nSongSpeed < 20) - TJAPlayer3.Tx.Mod_SongSpeed[0]?.t2D描画(x, y); - else - TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); - } + if (rand_ == ERandomMode.MIRROR) + TJAPlayer3.Tx.Mod_Mirror?.t2D描画(x, y); + else if (rand_ == ERandomMode.RANDOM) + TJAPlayer3.Tx.Mod_Random?.t2D描画(x, y); + else if (rand_ == ERandomMode.SUPERRANDOM) + TJAPlayer3.Tx.Mod_Super?.t2D描画(x, y); + else if (rand_ == ERandomMode.MIRRORRANDOM) + TJAPlayer3.Tx.Mod_Hyper?.t2D描画(x, y); + else + TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); + } - static private void tDisplayFunModIcon(int x, int y, int player) - { - int nFun = (int)TJAPlayer3.ConfigIni.nFunMods[player]; + static private void tDisplaySongSpeedIcon(int x, int y, int player) { + if (TJAPlayer3.ConfigIni.nSongSpeed > 20) + TJAPlayer3.Tx.Mod_SongSpeed[1]?.t2D描画(x, y); + else if (TJAPlayer3.ConfigIni.nSongSpeed < 20) + TJAPlayer3.Tx.Mod_SongSpeed[0]?.t2D描画(x, y); + else + TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); + } - if (nFun > 0) - TJAPlayer3.Tx.Mod_Fun[nFun]?.t2D描画(x, y); - else - TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); - } + static private void tDisplayFunModIcon(int x, int y, int player) { + int nFun = (int)TJAPlayer3.ConfigIni.nFunMods[player]; - static private void tDisplayTimingIcon(int x, int y, int player) - { - int zones = TJAPlayer3.ConfigIni.nTimingZones[player]; + if (nFun > 0) + TJAPlayer3.Tx.Mod_Fun[nFun]?.t2D描画(x, y); + else + TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); + } - if (zones != 2) - TJAPlayer3.Tx.Mod_Timing[zones]?.t2D描画(x, y); - else - TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); - } + static private void tDisplayTimingIcon(int x, int y, int player) { + int zones = TJAPlayer3.ConfigIni.nTimingZones[player]; - static private void PLACEHOLDER_tDisplayNoneIcon(int x, int y, int player) - { - TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); - } + if (zones != 2) + TJAPlayer3.Tx.Mod_Timing[zones]?.t2D描画(x, y); + else + TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); + } - #endregion + static private void PLACEHOLDER_tDisplayNoneIcon(int x, int y, int player) { + TJAPlayer3.Tx.Mod_None?.t2D描画(x, y); + } - #region [Mod flags] + #endregion - static public bool tPlayIsStock(int player) - { - int actual = TJAPlayer3.GetActualPlayer(player); + #region [Mod flags] - if (TJAPlayer3.ConfigIni.nFunMods[actual] != EFunMods.NONE) return false; - if (TJAPlayer3.ConfigIni.bJust[actual] != 0) return false; - if (TJAPlayer3.ConfigIni.nTimingZones[actual] != 2) return false; - if (TJAPlayer3.ConfigIni.nSongSpeed != 20) return false; - if (TJAPlayer3.ConfigIni.eRandom[actual] != ERandomMode.OFF) return false; - if (TJAPlayer3.ConfigIni.eSTEALTH[actual] != EStealthMode.OFF) return false; - if (TJAPlayer3.ConfigIni.nScrollSpeed[actual] != 9) return false; + static public bool tPlayIsStock(int player) { + int actual = TJAPlayer3.GetActualPlayer(player); - return true; - } - static public Int64 tModsToPlayModsFlags(int player) - { - byte[] _flags = new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; - int actual = TJAPlayer3.GetActualPlayer(player); + if (TJAPlayer3.ConfigIni.nFunMods[actual] != EFunMods.NONE) return false; + if (TJAPlayer3.ConfigIni.bJust[actual] != 0) return false; + if (TJAPlayer3.ConfigIni.nTimingZones[actual] != 2) return false; + if (TJAPlayer3.ConfigIni.nSongSpeed != 20) return false; + if (TJAPlayer3.ConfigIni.eRandom[actual] != ERandomMode.OFF) return false; + if (TJAPlayer3.ConfigIni.eSTEALTH[actual] != EStealthMode.OFF) return false; + if (TJAPlayer3.ConfigIni.nScrollSpeed[actual] != 9) return false; - _flags[0] = (byte)Math.Min(255, TJAPlayer3.ConfigIni.nScrollSpeed[actual]); - _flags[1] = (byte)TJAPlayer3.ConfigIni.eSTEALTH[actual]; - _flags[2] = (byte)TJAPlayer3.ConfigIni.eRandom[actual]; - _flags[3] = (byte)Math.Min(255, TJAPlayer3.ConfigIni.nSongSpeed); - _flags[4] = (byte)TJAPlayer3.ConfigIni.nTimingZones[actual]; - _flags[5] = (byte)TJAPlayer3.ConfigIni.bJust[actual]; - _flags[7] = (byte)TJAPlayer3.ConfigIni.nFunMods[actual]; - - return BitConverter.ToInt64(_flags, 0); - } + return true; + } + static public Int64 tModsToPlayModsFlags(int player) { + byte[] _flags = new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; + int actual = TJAPlayer3.GetActualPlayer(player); + + _flags[0] = (byte)Math.Min(255, TJAPlayer3.ConfigIni.nScrollSpeed[actual]); + _flags[1] = (byte)TJAPlayer3.ConfigIni.eSTEALTH[actual]; + _flags[2] = (byte)TJAPlayer3.ConfigIni.eRandom[actual]; + _flags[3] = (byte)Math.Min(255, TJAPlayer3.ConfigIni.nSongSpeed); + _flags[4] = (byte)TJAPlayer3.ConfigIni.nTimingZones[actual]; + _flags[5] = (byte)TJAPlayer3.ConfigIni.bJust[actual]; + _flags[7] = (byte)TJAPlayer3.ConfigIni.nFunMods[actual]; + + return BitConverter.ToInt64(_flags, 0); + } - #endregion - } + #endregion + } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/NotesManager.cs b/OpenTaiko/src/Stages/07.Game/Taiko/NotesManager.cs index 33174fee..2d182121 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/NotesManager.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/NotesManager.cs @@ -1,525 +1,443 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Drawing; +using System.Drawing; using FDK; -namespace TJAPlayer3 -{ - - // Simple class containing functions to simplify readability of CChip elements - class NotesManager - { - - #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; - } - - 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 = TJAPlayer3.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 = TJAPlayer3.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 = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(player)]; - - switch (Lane) - { - case 1: - case 2: - case 3: - case 4: - TJAPlayer3.Tx.Notes[(int)_gt]?.t2D中心基準描画(x, y, new Rectangle(Lane * TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1] * 3, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); - break; - case 5: - TJAPlayer3.Tx.Note_Swap?.t2D中心基準描画(x, y, new Rectangle(0, TJAPlayer3.Skin.Game_Notes_Size[1] * 3, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.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 (TJAPlayer3.ConfigIni.eSTEALTH[TJAPlayer3.GetActualPlayer(player)] != EStealthMode.OFF || !chip.bShow) - return; - - if (length == -1) - { - length = TJAPlayer3.Skin.Game_Notes_Size[0]; - } - - EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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)) - { - TJAPlayer3.Tx.Note_Mine?.t2D描画(x, y); - return; - } - else if (IsPurpleNote(chip)) - { - TJAPlayer3.Tx.Note_Swap?.t2D描画(x, y, new Rectangle(0, frame, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); - return; - } - else if (IsKusudama(chip)) - { - TJAPlayer3.Tx.Note_Kusu?.t2D描画(x, y, new Rectangle(0, frame, length, TJAPlayer3.Skin.Game_Notes_Size[1])); - return; - } - else if (IsADLIB(chip)) - { - var puchichara = TJAPlayer3.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(TJAPlayer3.GetActualPlayer(player))]; - if (puchichara.effect.ShowAdlib) - { - TJAPlayer3.Tx.Note_Adlib?.tUpdateOpacity(50); - TJAPlayer3.Tx.Note_Adlib?.t2D描画(x, y, new Rectangle(0, frame, length, TJAPlayer3.Skin.Game_Notes_Size[1])); - } - return; - } - - TJAPlayer3.Tx.Notes[(int)_gt]?.t2D描画(x, y, new Rectangle(noteType * TJAPlayer3.Skin.Game_Notes_Size[0], frame, length, TJAPlayer3.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 = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(player)]; - - if (TJAPlayer3.ConfigIni.eSTEALTH[TJAPlayer3.GetActualPlayer(player)] != EStealthMode.OFF || !chip.bShow) - return; - - int _offset = 0; - var _texarr = TJAPlayer3.Tx.Notes[(int)_gt]; - int rollOrigin = (TJAPlayer3.Skin.Game_Notes_Size[0] * 5); - float _adjust = TJAPlayer3.Skin.Game_Notes_Size[0] / 2.0f; - float image_size = TJAPlayer3.Skin.Game_Notes_Size[0]; - - if (IsSmallRoll(chip) || (_gt == EGameType.TAIKO && IsYellowRoll(chip))) - { - _offset = 0; - } - if (IsBigRoll(chip) || (_gt == EGameType.TAIKO && IsClapRoll(chip))) - { - _offset = TJAPlayer3.Skin.Game_Notes_Size[0] * 3; - } - else if (IsClapRoll(chip) && _gt == EGameType.KONGA) - { - _offset = TJAPlayer3.Skin.Game_Notes_Size[0] * 11; - } - else if (IsYellowRoll(chip) && _gt == EGameType.KONGA) - { - _offset = TJAPlayer3.Skin.Game_Notes_Size[0] * 8; - } - else if (IsFuzeRoll(chip)) - { - _texarr = TJAPlayer3.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 (TJAPlayer3.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 + TJAPlayer3.Skin.Game_Notes_Size[0] + _offset, 0, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.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 + (TJAPlayer3.Skin.Game_Notes_Size[0] * 2) + _offset, frame, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); - } - - _texarr.fZ軸中心回転 = 0; - - if (TJAPlayer3.Skin.Game_RollColorMode == CSkin.RollColorMode.All) - _texarr.color4 = effectedColor; - else - _texarr.color4 = normalColor; - - // Head - _texarr.t2D描画(x, y, 0, new Rectangle(rollOrigin + _offset, frame, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); - _texarr.color4 = normalColor; - } - - // SENotes - public static void DisplaySENotes(int player, int x, int y, CDTX.CChip chip) - { - if (TJAPlayer3.ConfigIni.eSTEALTH[TJAPlayer3.GetActualPlayer(player)] == EStealthMode.STEALTH) - return; - - EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(player)]; - - if (IsMine(chip)) - { - TJAPlayer3.Tx.SENotesExtension?.t2D描画(x, y, new Rectangle(0, TJAPlayer3.Skin.Game_SENote_Size[1], TJAPlayer3.Skin.Game_SENote_Size[0], TJAPlayer3.Skin.Game_SENote_Size[1])); - } - else if (IsPurpleNote(chip) && _gt != EGameType.KONGA) - { - TJAPlayer3.Tx.SENotesExtension?.t2D描画(x, y, new Rectangle(0, 0, TJAPlayer3.Skin.Game_SENote_Size[0], TJAPlayer3.Skin.Game_SENote_Size[1])); - } - else if (IsFuzeRoll(chip)) - { - TJAPlayer3.Tx.SENotesExtension?.t2D描画(x, y, new Rectangle(0, TJAPlayer3.Skin.Game_SENote_Size[1] * 2, TJAPlayer3.Skin.Game_SENote_Size[0], TJAPlayer3.Skin.Game_SENote_Size[1])); - } - else if (IsKusudama(chip)) - { - TJAPlayer3.Tx.SENotesExtension?.t2D描画(x, y, new Rectangle(0, TJAPlayer3.Skin.Game_SENote_Size[1] * 3, TJAPlayer3.Skin.Game_SENote_Size[0], TJAPlayer3.Skin.Game_SENote_Size[1])); - } - else - { - TJAPlayer3.Tx.SENotes[(int)_gt]?.t2D描画(x, y, new Rectangle(0, TJAPlayer3.Skin.Game_SENote_Size[1] * chip.nSenote, TJAPlayer3.Skin.Game_SENote_Size[0], TJAPlayer3.Skin.Game_SENote_Size[1])); - } - } - - - #endregion - - } +namespace TJAPlayer3 { + + // Simple class containing functions to simplify readability of CChip elements + class NotesManager { + + #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; + } + + 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 = TJAPlayer3.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 = TJAPlayer3.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 = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(player)]; + + switch (Lane) { + case 1: + case 2: + case 3: + case 4: + TJAPlayer3.Tx.Notes[(int)_gt]?.t2D中心基準描画(x, y, new Rectangle(Lane * TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1] * 3, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); + break; + case 5: + TJAPlayer3.Tx.Note_Swap?.t2D中心基準描画(x, y, new Rectangle(0, TJAPlayer3.Skin.Game_Notes_Size[1] * 3, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.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 (TJAPlayer3.ConfigIni.eSTEALTH[TJAPlayer3.GetActualPlayer(player)] != EStealthMode.OFF || !chip.bShow) + return; + + if (length == -1) { + length = TJAPlayer3.Skin.Game_Notes_Size[0]; + } + + EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.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)) { + TJAPlayer3.Tx.Note_Mine?.t2D描画(x, y); + return; + } else if (IsPurpleNote(chip)) { + TJAPlayer3.Tx.Note_Swap?.t2D描画(x, y, new Rectangle(0, frame, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); + return; + } else if (IsKusudama(chip)) { + TJAPlayer3.Tx.Note_Kusu?.t2D描画(x, y, new Rectangle(0, frame, length, TJAPlayer3.Skin.Game_Notes_Size[1])); + return; + } else if (IsADLIB(chip)) { + var puchichara = TJAPlayer3.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(TJAPlayer3.GetActualPlayer(player))]; + if (puchichara.effect.ShowAdlib) { + TJAPlayer3.Tx.Note_Adlib?.tUpdateOpacity(50); + TJAPlayer3.Tx.Note_Adlib?.t2D描画(x, y, new Rectangle(0, frame, length, TJAPlayer3.Skin.Game_Notes_Size[1])); + } + return; + } + + TJAPlayer3.Tx.Notes[(int)_gt]?.t2D描画(x, y, new Rectangle(noteType * TJAPlayer3.Skin.Game_Notes_Size[0], frame, length, TJAPlayer3.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 = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(player)]; + + if (TJAPlayer3.ConfigIni.eSTEALTH[TJAPlayer3.GetActualPlayer(player)] != EStealthMode.OFF || !chip.bShow) + return; + + int _offset = 0; + var _texarr = TJAPlayer3.Tx.Notes[(int)_gt]; + int rollOrigin = (TJAPlayer3.Skin.Game_Notes_Size[0] * 5); + float _adjust = TJAPlayer3.Skin.Game_Notes_Size[0] / 2.0f; + float image_size = TJAPlayer3.Skin.Game_Notes_Size[0]; + + if (IsSmallRoll(chip) || (_gt == EGameType.TAIKO && IsYellowRoll(chip))) { + _offset = 0; + } + if (IsBigRoll(chip) || (_gt == EGameType.TAIKO && IsClapRoll(chip))) { + _offset = TJAPlayer3.Skin.Game_Notes_Size[0] * 3; + } else if (IsClapRoll(chip) && _gt == EGameType.KONGA) { + _offset = TJAPlayer3.Skin.Game_Notes_Size[0] * 11; + } else if (IsYellowRoll(chip) && _gt == EGameType.KONGA) { + _offset = TJAPlayer3.Skin.Game_Notes_Size[0] * 8; + } else if (IsFuzeRoll(chip)) { + _texarr = TJAPlayer3.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 (TJAPlayer3.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 + TJAPlayer3.Skin.Game_Notes_Size[0] + _offset, 0, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.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 + (TJAPlayer3.Skin.Game_Notes_Size[0] * 2) + _offset, frame, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); + } + + _texarr.fZ軸中心回転 = 0; + + if (TJAPlayer3.Skin.Game_RollColorMode == CSkin.RollColorMode.All) + _texarr.color4 = effectedColor; + else + _texarr.color4 = normalColor; + + // Head + _texarr.t2D描画(x, y, 0, new Rectangle(rollOrigin + _offset, frame, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); + _texarr.color4 = normalColor; + } + + // SENotes + public static void DisplaySENotes(int player, int x, int y, CDTX.CChip chip) { + if (TJAPlayer3.ConfigIni.eSTEALTH[TJAPlayer3.GetActualPlayer(player)] == EStealthMode.STEALTH) + return; + + EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(player)]; + + if (IsMine(chip)) { + TJAPlayer3.Tx.SENotesExtension?.t2D描画(x, y, new Rectangle(0, TJAPlayer3.Skin.Game_SENote_Size[1], TJAPlayer3.Skin.Game_SENote_Size[0], TJAPlayer3.Skin.Game_SENote_Size[1])); + } else if (IsPurpleNote(chip) && _gt != EGameType.KONGA) { + TJAPlayer3.Tx.SENotesExtension?.t2D描画(x, y, new Rectangle(0, 0, TJAPlayer3.Skin.Game_SENote_Size[0], TJAPlayer3.Skin.Game_SENote_Size[1])); + } else if (IsFuzeRoll(chip)) { + TJAPlayer3.Tx.SENotesExtension?.t2D描画(x, y, new Rectangle(0, TJAPlayer3.Skin.Game_SENote_Size[1] * 2, TJAPlayer3.Skin.Game_SENote_Size[0], TJAPlayer3.Skin.Game_SENote_Size[1])); + } else if (IsKusudama(chip)) { + TJAPlayer3.Tx.SENotesExtension?.t2D描画(x, y, new Rectangle(0, TJAPlayer3.Skin.Game_SENote_Size[1] * 3, TJAPlayer3.Skin.Game_SENote_Size[0], TJAPlayer3.Skin.Game_SENote_Size[1])); + } else { + TJAPlayer3.Tx.SENotes[(int)_gt]?.t2D描画(x, y, new Rectangle(0, TJAPlayer3.Skin.Game_SENote_Size[1] * chip.nSenote, TJAPlayer3.Skin.Game_SENote_Size[0], TJAPlayer3.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 41eed45e..e32935a6 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/Rainbow.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/Rainbow.cs @@ -1,164 +1,132 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; +using System.Drawing; using System.Runtime.InteropServices; using FDK; -namespace TJAPlayer3 -{ - internal class Rainbow : CActivity - { +namespace TJAPlayer3 { + internal class Rainbow : CActivity { // コンストラクタ - public Rainbow() - { + public Rainbow() { base.IsDeActivated = true; } - - public virtual void Start( int player ) - { - if (TJAPlayer3.Tx.Effects_Rainbow != null && !TJAPlayer3.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, TJAPlayer3.Skin.Game_Effect_Rainbow_Timer, TJAPlayer3.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, TJAPlayer3.Skin.Game_Effect_Rainbow_Timer, TJAPlayer3.Timer); // カウンタ - this.Rainbow2P[i].Player = player; - break; - } - } - } + + public virtual void Start(int player) { + if (TJAPlayer3.Tx.Effects_Rainbow != null && !TJAPlayer3.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, TJAPlayer3.Skin.Game_Effect_Rainbow_Timer, TJAPlayer3.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, TJAPlayer3.Skin.Game_Effect_Rainbow_Timer, TJAPlayer3.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(); + 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(); + base.Activate(); } - public override void DeActivate() - { - for( int i = 0; i < 2; i++ ) - { - this.Rainbow1P[ i ].Counter = null; - this.Rainbow2P[ i ].Counter = null; + 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() - { + public override void CreateManagedResource() { base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { base.ReleaseManagedResource(); } - public override int Draw() - { - if( !base.IsDeActivated && !TJAPlayer3.ConfigIni.SimpleMode) - { - if (TJAPlayer3.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; - } + public override int Draw() { + if (!base.IsDeActivated && !TJAPlayer3.ConfigIni.SimpleMode) { + if (TJAPlayer3.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(TJAPlayer3.Tx.Effects_Rainbow != null && this.Rainbow1P[f].Player == 0 ) //画像が出来るまで - { - //this.st虹[f].ct進行.n現在の値 = 164; + if (TJAPlayer3.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 * TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Width) / 85); - TJAPlayer3.Tx.Effects_Rainbow.t2D描画(TJAPlayer3.Skin.Game_Effect_Rainbow_X[0], TJAPlayer3.Skin.Game_Effect_Rainbow_Y[0], - new Rectangle(0, 0, nRectX, TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Height)); - } - else if (this.Rainbow1P[f].Counter.CurrentValue >= 82) - { - int nRectX = (((this.Rainbow1P[f].Counter.CurrentValue - 82) * TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Width) / 85); - TJAPlayer3.Tx.Effects_Rainbow.t2D描画(TJAPlayer3.Skin.Game_Effect_Rainbow_X[0] + nRectX, TJAPlayer3.Skin.Game_Effect_Rainbow_Y[0], - new Rectangle(nRectX, 0, TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Width - nRectX, TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Height)); - } + if (this.Rainbow1P[f].Counter.CurrentValue < 82) { + int nRectX = ((this.Rainbow1P[f].Counter.CurrentValue * TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Width) / 85); + TJAPlayer3.Tx.Effects_Rainbow.t2D描画(TJAPlayer3.Skin.Game_Effect_Rainbow_X[0], TJAPlayer3.Skin.Game_Effect_Rainbow_Y[0], + new Rectangle(0, 0, nRectX, TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Height)); + } else if (this.Rainbow1P[f].Counter.CurrentValue >= 82) { + int nRectX = (((this.Rainbow1P[f].Counter.CurrentValue - 82) * TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Width) / 85); + TJAPlayer3.Tx.Effects_Rainbow.t2D描画(TJAPlayer3.Skin.Game_Effect_Rainbow_X[0] + nRectX, TJAPlayer3.Skin.Game_Effect_Rainbow_Y[0], + new Rectangle(nRectX, 0, TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Width - nRectX, TJAPlayer3.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; - } + } + } + 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(TJAPlayer3.Tx.Effects_Rainbow != null && this.Rainbow2P[f].Player == 1 ) //画像が出来るまで - { - //this.st虹[f].ct進行.n現在の値 = 164; + if (TJAPlayer3.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 * TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Width) / 85); - TJAPlayer3.Tx.Effects_Rainbow.t2D上下反転描画(TJAPlayer3.Skin.Game_Effect_Rainbow_X[0], TJAPlayer3.Skin.Game_Effect_Rainbow_Y[1], - new Rectangle(0, 0, nRectX, TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Height)); - } - else if (this.Rainbow2P[f].Counter.CurrentValue >= 82) - { - int nRectX = (((this.Rainbow2P[f].Counter.CurrentValue - 82) * TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Width) / 85); - TJAPlayer3.Tx.Effects_Rainbow.t2D上下反転描画(TJAPlayer3.Skin.Game_Effect_Rainbow_X[0] + nRectX, TJAPlayer3.Skin.Game_Effect_Rainbow_Y[1], - new Rectangle(nRectX, 0, TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Width - nRectX, TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Height)); - } + if (this.Rainbow2P[f].Counter.CurrentValue < 82) { + int nRectX = ((this.Rainbow2P[f].Counter.CurrentValue * TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Width) / 85); + TJAPlayer3.Tx.Effects_Rainbow.t2D上下反転描画(TJAPlayer3.Skin.Game_Effect_Rainbow_X[0], TJAPlayer3.Skin.Game_Effect_Rainbow_Y[1], + new Rectangle(0, 0, nRectX, TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Height)); + } else if (this.Rainbow2P[f].Counter.CurrentValue >= 82) { + int nRectX = (((this.Rainbow2P[f].Counter.CurrentValue - 82) * TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Width) / 85); + TJAPlayer3.Tx.Effects_Rainbow.t2D上下反転描画(TJAPlayer3.Skin.Game_Effect_Rainbow_X[0] + nRectX, TJAPlayer3.Skin.Game_Effect_Rainbow_Y[1], + new Rectangle(nRectX, 0, TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Width - nRectX, TJAPlayer3.Tx.Effects_Rainbow.szTextureSize.Height)); + } - } + } - } - } + } + } } - return base.Draw(); - } - + return base.Draw(); + } + // その他 #region [ private ] //----------------- - [StructLayout(LayoutKind.Sequential)] - private struct StructRainbow - { - public bool IsUsing; - public int Player; - public CCounter Counter; - public float X; - } + [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]; + 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 ae9b71e7..67f0c7a8 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/ScriptBG.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/ScriptBG.cs @@ -1,354 +1,290 @@ -using System; -using System.IO; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NLua; +using System.Text; using FDK; +using NLua; -namespace TJAPlayer3 -{ - class ScriptBGFunc - { - private Dictionary Textures; - private string DirPath; +namespace TJAPlayer3 { + class ScriptBGFunc { + private Dictionary Textures; + private string DirPath; - public ScriptBGFunc(Dictionary texs, string dirPath) - { - Textures = texs; - DirPath = dirPath; - } - public void DrawText(double x, double y, string text) - { - TJAPlayer3.actTextConsole.tPrint((int)x, (int)y, CTextConsole.EFontType.White, text); - } - public void DrawNum(double x, double y, double text) - { - TJAPlayer3.actTextConsole.tPrint((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, TJAPlayer3.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; - } - } - } - - 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; - } - } - class ScriptBG : IDisposable - { - public Dictionary Textures; + public ScriptBGFunc(Dictionary texs, string dirPath) { + Textures = texs; + DirPath = dirPath; + } + public void DrawText(double x, double y, string text) { + TJAPlayer3.actTextConsole.tPrint((int)x, (int)y, CTextConsole.EFontType.White, text); + } + public void DrawNum(double x, double y, double text) { + TJAPlayer3.actTextConsole.tPrint((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, TJAPlayer3.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; + } + } + } - 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]; - TJAPlayer3.tテクスチャの解放(ref tex); - } + 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]; + TJAPlayer3.tテクスチャの解放(ref tex); + } - Textures.Clear(); + Textures.Clear(); - LuaScript?.Dispose(); + LuaScript?.Dispose(); - LuaSetConstValues?.Dispose(); - LuaUpdateValues?.Dispose(); - LuaClearIn?.Dispose(); - LuaClearOut?.Dispose(); - LuaInit?.Dispose(); - LuaUpdate?.Dispose(); - LuaDraw?.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" }; + 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 (TJAPlayer3.Tx.Puchichara != null && TJAPlayer3.Tx.Characters != null) - { - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - raritiesP[i] = TJAPlayer3.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(TJAPlayer3.GetActualPlayer(i))].metadata.Rarity; - raritiesC[i] = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(i)].data.Character].metadata.Rarity; - } - } + if (TJAPlayer3.Tx.Puchichara != null && TJAPlayer3.Tx.Characters != null) { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + raritiesP[i] = TJAPlayer3.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(TJAPlayer3.GetActualPlayer(i))].metadata.Rarity; + raritiesC[i] = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(i)].data.Character].metadata.Rarity; + } + } - // Initialisation - LuaSetConstValues.Call(TJAPlayer3.ConfigIni.nPlayerCount, - TJAPlayer3.P1IsBlue(), - TJAPlayer3.ConfigIni.sLang, - TJAPlayer3.ConfigIni.SimpleMode, - raritiesP, - raritiesC - ); + // Initialisation + LuaSetConstValues.Call(TJAPlayer3.ConfigIni.nPlayerCount, + TJAPlayer3.P1IsBlue(), + TJAPlayer3.ConfigIni.sLang, + TJAPlayer3.ConfigIni.SimpleMode, + raritiesP, + raritiesC + ); - LuaUpdateValues.Call(TJAPlayer3.FPS.DeltaTime, - TJAPlayer3.FPS.NowFPS, - TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared, - 0, - TJAPlayer3.stage演奏ドラム画面.AIBattleState, - TJAPlayer3.stage演奏ドラム画面.bIsAIBattleWin, - TJAPlayer3.stage演奏ドラム画面.actGauge.db現在のゲージ値, - TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM, - new bool[] { false, false, false, false, false }, - -1 - ); + LuaUpdateValues.Call(TJAPlayer3.FPS.DeltaTime, + TJAPlayer3.FPS.NowFPS, + TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared, + 0, + TJAPlayer3.stage演奏ドラム画面.AIBattleState, + TJAPlayer3.stage演奏ドラム画面.bIsAIBattleWin, + TJAPlayer3.stage演奏ドラム画面.actGauge.db現在のゲージ値, + TJAPlayer3.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; + LuaInit.Call(); + } catch (Exception ex) { + LuaScript.Dispose(); + LuaScript = null; + } + } + public void Update() { + if (LuaScript == null) return; + try { + float currentFloorPositionMax140 = 0; - if (TJAPlayer3.stageSongSelect.rChoosenSong != null && TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[5] != null) - { - int maxFloor = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor; - int nightTime = Math.Max(140, maxFloor / 2); + if (TJAPlayer3.stageSongSelect.rChoosenSong != null && TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[5] != null) { + int maxFloor = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor; + int nightTime = Math.Max(140, maxFloor / 2); - currentFloorPositionMax140 = Math.Min(TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] / (float)nightTime, 1f); - } - double timestamp = -1.0; + currentFloorPositionMax140 = Math.Min(TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] / (float)nightTime, 1f); + } + double timestamp = -1.0; - if (TJAPlayer3.DTX != null) - { - double timeoffset = TJAPlayer3.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 (TJAPlayer3.DTX != null) { + double timeoffset = TJAPlayer3.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 * TJAPlayer3.ConfigIni.SongPlaybackSpeed)) / 1000.0) + - (-(TJAPlayer3.ConfigIni.MusicPreTimeMs + TJAPlayer3.DTX.nOFFSET) / 1000.0) + - timeoffset; - } + timestamp = (((double)(SoundManager.PlayTimer.NowTime * TJAPlayer3.ConfigIni.SongPlaybackSpeed)) / 1000.0) + + (-(TJAPlayer3.ConfigIni.MusicPreTimeMs + TJAPlayer3.DTX.nOFFSET) / 1000.0) + + timeoffset; + } - LuaUpdateValues.Call(TJAPlayer3.FPS.DeltaTime, - TJAPlayer3.FPS.NowFPS, - TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared, - (double)currentFloorPositionMax140, - TJAPlayer3.stage演奏ドラム画面.AIBattleState, - TJAPlayer3.stage演奏ドラム画面.bIsAIBattleWin, - TJAPlayer3.stage演奏ドラム画面.actGauge.db現在のゲージ値, - TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM, - TJAPlayer3.stage演奏ドラム画面.bIsGOGOTIME, - timestamp); - /*LuaScript.SetObjectToPath("fps", TJAPlayer3.FPS.n現在のFPS); + LuaUpdateValues.Call(TJAPlayer3.FPS.DeltaTime, + TJAPlayer3.FPS.NowFPS, + TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared, + (double)currentFloorPositionMax140, + TJAPlayer3.stage演奏ドラム画面.AIBattleState, + TJAPlayer3.stage演奏ドラム画面.bIsAIBattleWin, + TJAPlayer3.stage演奏ドラム画面.actGauge.db現在のゲージ値, + TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM, + TJAPlayer3.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; - } - } - } + 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; + } + } + } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/TaikoLaneFlash.cs b/OpenTaiko/src/Stages/07.Game/Taiko/TaikoLaneFlash.cs index b9a4c764..5f082e54 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/TaikoLaneFlash.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/TaikoLaneFlash.cs @@ -1,99 +1,78 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; -using System.Drawing; -using FDK; +using FDK; using static TJAPlayer3.PlayerLane; -namespace TJAPlayer3 -{ - internal class TaikoLaneFlash : CActivity - { +namespace TJAPlayer3 { + internal class TaikoLaneFlash : CActivity { // コンストラクタ - public TaikoLaneFlash() - { + public TaikoLaneFlash() { base.IsDeActivated = true; } - public override void Activate() - { - PlayerLane = new PlayerLane[TJAPlayer3.ConfigIni.nPlayerCount]; - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - PlayerLane[i] = new PlayerLane(i); - } + public override void Activate() { + PlayerLane = new PlayerLane[TJAPlayer3.ConfigIni.nPlayerCount]; + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + PlayerLane[i] = new PlayerLane(i); + } base.Activate(); } - public override void DeActivate() - { - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - PlayerLane[i] = null; - } - base.DeActivate(); + public override void DeActivate() { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + PlayerLane[i] = null; + } + base.DeActivate(); } - public override int Draw() - { - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - for (int j = 0; j < (int)FlashType.Total; j++) - { - PlayerLane[i].Flash[j].Draw(); - } - } - return base.Draw(); - } + public override int Draw() { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + for (int j = 0; j < (int)FlashType.Total; j++) { + PlayerLane[i].Flash[j].Draw(); + } + } + return base.Draw(); + } - public PlayerLane[] PlayerLane; + public PlayerLane[] PlayerLane; - } - public class PlayerLane - { - public PlayerLane(int player) - { - Flash = new LaneFlash[(int)FlashType.Total]; - var _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(player)]; + } + public class PlayerLane { + public PlayerLane(int player) { + Flash = new LaneFlash[(int)FlashType.Total]; + var _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(player)]; - for (int i = 0; i < (int)FlashType.Total; i++) - { - switch (i) - { - case (int)FlashType.Red: - Flash[i] = new LaneFlash(ref TJAPlayer3.Tx.Lane_Red[(int)_gt], player); - break; - case (int)FlashType.Blue: - Flash[i] = new LaneFlash(ref TJAPlayer3.Tx.Lane_Blue[(int)_gt], player); - break; - case (int)FlashType.Clap: - Flash[i] = new LaneFlash(ref TJAPlayer3.Tx.Lane_Clap[(int)_gt], player); - break; - case (int)FlashType.Hit: - Flash[i] = new LaneFlash(ref TJAPlayer3.Tx.Lane_Yellow, player); - break; - default: - break; - } - } - } - public void Start(FlashType flashType) - { - if (flashType == FlashType.Total) return; - Flash[(int)flashType].Start(); - } + for (int i = 0; i < (int)FlashType.Total; i++) { + switch (i) { + case (int)FlashType.Red: + Flash[i] = new LaneFlash(ref TJAPlayer3.Tx.Lane_Red[(int)_gt], player); + break; + case (int)FlashType.Blue: + Flash[i] = new LaneFlash(ref TJAPlayer3.Tx.Lane_Blue[(int)_gt], player); + break; + case (int)FlashType.Clap: + Flash[i] = new LaneFlash(ref TJAPlayer3.Tx.Lane_Clap[(int)_gt], player); + break; + case (int)FlashType.Hit: + Flash[i] = new LaneFlash(ref TJAPlayer3.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 LaneFlash[] Flash; - public enum FlashType - { - Red, - Blue, - Clap, - Hit, - Total - } - } + 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 82cbcd19..b3322842 100644 --- a/OpenTaiko/src/Stages/08.Result/CActResultImage.cs +++ b/OpenTaiko/src/Stages/08.Result/CActResultImage.cs @@ -1,72 +1,54 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; -using System.IO; -using System.Drawing; +using System.Diagnostics; using FDK; -namespace TJAPlayer3 -{ - internal class CActResultImage : CActivity - { +namespace TJAPlayer3 { + internal class CActResultImage : CActivity { // コンストラクタ - /// - /// リザルト画像を表示させるクラス。XG化するにあたって動画は廃止。 - /// また、中央の画像も表示する。(STAGE表示、STANDARD_CLASSICなど) - /// - public CActResultImage() - { + /// + /// リザルト画像を表示させるクラス。XG化するにあたって動画は廃止。 + /// また、中央の画像も表示する。(STAGE表示、STANDARD_CLASSICなど) + /// + public CActResultImage() { base.IsDeActivated = true; } // メソッド - public void tアニメを完了させる() - { + public void tアニメを完了させる() { this.ct登場用.CurrentValue = (int)this.ct登場用.EndValue; } // CActivity 実装 - public override void Activate() - { + public override void Activate() { base.Activate(); } - public override void DeActivate() - { - if( this.ct登場用 != null ) - { + public override void DeActivate() { + if (this.ct登場用 != null) { this.ct登場用 = null; } base.DeActivate(); } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { base.ReleaseManagedResource(); } - public override unsafe int Draw() - { - if( base.IsDeActivated ) - { + public override unsafe int Draw() { + if (base.IsDeActivated) { return 0; } - if( base.IsFirstDraw ) - { - this.ct登場用 = new CCounter( 0, 100, 5, TJAPlayer3.Timer ); + if (base.IsFirstDraw) { + this.ct登場用 = new CCounter(0, 100, 5, TJAPlayer3.Timer); base.IsFirstDraw = false; } this.ct登場用.Tick(); - if( !this.ct登場用.IsEnded ) - { + if (!this.ct登場用.IsEnded) { return 0; } return 1; @@ -81,23 +63,20 @@ namespace TJAPlayer3 private CTexture r表示するリザルト画像; private CTexture txリザルト画像; - private bool tプレビュー画像の指定があれば構築する() - { - if( string.IsNullOrEmpty( TJAPlayer3.DTX.PREIMAGE ) ) - { + private bool tプレビュー画像の指定があれば構築する() { + if (string.IsNullOrEmpty(TJAPlayer3.DTX.PREIMAGE)) { return false; } - TJAPlayer3.tDisposeSafely( ref this.txリザルト画像 ); + TJAPlayer3.tDisposeSafely(ref this.txリザルト画像); this.r表示するリザルト画像 = null; string path = TJAPlayer3.DTX.strフォルダ名 + TJAPlayer3.DTX.PREIMAGE; - if( !File.Exists( path ) ) - { - Trace.TraceWarning( "ファイルが存在しません。({0})", new object[] { path } ); + if (!File.Exists(path)) { + Trace.TraceWarning("ファイルが存在しません。({0})", new object[] { path }); return false; } - this.txリザルト画像 = TJAPlayer3.tテクスチャの生成( path ); + this.txリザルト画像 = TJAPlayer3.tテクスチャの生成(path); this.r表示するリザルト画像 = this.txリザルト画像; - return ( this.r表示するリザルト画像 != null ); + return (this.r表示するリザルト画像 != null); } //----------------- #endregion diff --git a/OpenTaiko/src/Stages/08.Result/CActResultParameterPanel.cs b/OpenTaiko/src/Stages/08.Result/CActResultParameterPanel.cs index ab6a8649..11964345 100644 --- a/OpenTaiko/src/Stages/08.Result/CActResultParameterPanel.cs +++ b/OpenTaiko/src/Stages/08.Result/CActResultParameterPanel.cs @@ -1,19 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Drawing; using System.Runtime.InteropServices; -using System.Drawing; -using System.IO; using FDK; -namespace TJAPlayer3 -{ - internal class CActResultParameterPanel : CActivity - { +namespace TJAPlayer3 { + internal class CActResultParameterPanel : CActivity { // コンストラクタ - public CActResultParameterPanel() - { + public CActResultParameterPanel() { ST文字位置[] st文字位置Array = new ST文字位置[11]; ST文字位置 st文字位置 = new ST文字位置(); st文字位置.ch = '0'; @@ -160,60 +153,52 @@ namespace TJAPlayer3 // メソッド - public void tアニメを完了させる() - { + public void tアニメを完了させる() { this.ct表示用.CurrentValue = (int)this.ct表示用.EndValue; } - public void tSkipResultAnimations() - { + public void tSkipResultAnimations() { TJAPlayer3.stage結果.Background.SkipAnimation(); ctMainCounter.CurrentValue = (int)MountainAppearValue; - - for (int i = 0; i < b音声再生.Length; i++) - { + + for (int i = 0; i < b音声再生.Length; i++) { b音声再生[i] = true; } - for (int i = 0; i < 5; i++) - { + for (int i = 0; i < 5; i++) { if (!ctゲージアニメ[i].IsTicked) ctゲージアニメ[i].Start(0, gaugeValues[i] / 2, 59, TJAPlayer3.Timer); ctゲージアニメ[i].CurrentValue = (int)ctゲージアニメ[i].EndValue; } - + TJAPlayer3.Skin.soundGauge.tStop(); } // CActivity 実装 - public override void Activate() - { + public override void Activate() { this.sdDTXで指定されたフルコンボ音 = null; ttkAISection = new CActSelect曲リスト.TitleTextureKey[TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count]; - for (int i = 0; i < ttkAISection.Length; i++) - { + for (int i = 0; i < ttkAISection.Length; i++) { ttkAISection[i] = new CActSelect曲リスト.TitleTextureKey($"{i + 1}区", pfAISectionText, Color.White, Color.Black, 1280); } - for (int i = 0; i < 5; i++) - { + for (int i = 0; i < 5; i++) { ttkSpeechText[i] = new CActSelect曲リスト.TitleTextureKey[6]; int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(i)].data.Character; - - for (int j = 0; j < 6; j++) - { + + for (int j = 0; j < 6; j++) { // { "simplestyleSweat", "...", "○", "◎", "★", "!!!!" } ttkSpeechText[i][j] = new CActSelect曲リスト.TitleTextureKey( - TJAPlayer3.Tx.Characters[_charaId].metadata.SpeechText[j].GetString(""), + TJAPlayer3.Tx.Characters[_charaId].metadata.SpeechText[j].GetString(""), pfSpeechText, Color.White, Color.Black, TJAPlayer3.Skin.Result_Speech_Text_MaxWidth); } } - + ctMainCounter = new CCounter(0, 50000, 1, TJAPlayer3.Timer); ctゲージアニメ = new CCounter[5]; @@ -240,8 +225,7 @@ namespace TJAPlayer3 ctUIMove = new CCounter(); - for (int i = 0; i < 5; i++) - { + for (int i = 0; i < 5; i++) { CResultCharacter.tMenuResetTimer(CResultCharacter.ECharacterResult.NORMAL); CResultCharacter.tDisableCounter(CResultCharacter.ECharacterResult.CLEAR); CResultCharacter.tDisableCounter(CResultCharacter.ECharacterResult.FAILED); @@ -249,61 +233,51 @@ namespace TJAPlayer3 } gaugeValues = new int[5]; - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { gaugeValues[i] = (int)TJAPlayer3.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) - { + public override void DeActivate() { + if (this.ct表示用 != null) { this.ct表示用 = null; } - for(int i = 0; i < this.b音声再生.Length; i++) - { + for (int i = 0; i < this.b音声再生.Length; i++) { b音声再生[i] = false; - } + } - if (this.sdDTXで指定されたフルコンボ音 != null) - { + if (this.sdDTXで指定されたフルコンボ音 != null) { TJAPlayer3.SoundManager.tDisposeSound(this.sdDTXで指定されたフルコンボ音); this.sdDTXで指定されたフルコンボ音 = null; } base.DeActivate(); } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { pfSpeechText = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Result_Speech_Text_Size); pfAISectionText = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Result_AIBattle_SectionText_Scale); - + base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { TJAPlayer3.tDisposeSafely(ref pfSpeechText); TJAPlayer3.tDisposeSafely(ref pfAISectionText); base.ReleaseManagedResource(); } - public override int Draw() - { - if (base.IsDeActivated) - { + public override int Draw() { + if (base.IsDeActivated) { return 0; } - if (base.IsFirstDraw) - { + if (base.IsFirstDraw) { this.ct表示用 = new CCounter(0, 0x3e7, 2, TJAPlayer3.Timer); base.IsFirstDraw = false; } @@ -326,25 +300,18 @@ namespace TJAPlayer3 // this.PuchiChara.IdleAnimation(); - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) - { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) { int[] namePlate_x = new int[5]; int[] namePlate_y = new int[5]; - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { namePlate_x[i] = TJAPlayer3.Skin.Result_NamePlate_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[i]; namePlate_y[i] = TJAPlayer3.Skin.Result_NamePlate_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[i]; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { namePlate_x[i] = TJAPlayer3.Skin.Result_NamePlate_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[i]; namePlate_y[i] = TJAPlayer3.Skin.Result_NamePlate_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[i]; - } - else - { + } else { int pos = i; if (TJAPlayer3.P1IsBlue()) pos = 1; @@ -367,14 +334,12 @@ namespace TJAPlayer3 int uioffset_x = 0; double uioffset_value = Math.Sin((ctUIMove.CurrentValue / 1000.0) * Math.PI / 2.0); - if (is1P) - { + if (is1P) { uioffset_x = (int)(uioffset_value * TJAPlayer3.Skin.Resolution[0] / 2.0); if (is2PSide) uioffset_x *= -1; } - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) break; // 1 if right, 0 if left @@ -386,21 +351,15 @@ namespace TJAPlayer3 #region [General plate animations] - if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) - { + if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) { if (shiftPos == 0) TJAPlayer3.Tx.Result_Panel.t2D描画(0 + uioffset_x, 0); else TJAPlayer3.Tx.Result_Panel_2P.t2D描画(0 + uioffset_x, 0); - } - else - { - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { + } else { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { TJAPlayer3.Tx.Result_Panel_5P[i].t2D描画(TJAPlayer3.Skin.Result_UIMove_5P_X[i], TJAPlayer3.Skin.Result_UIMove_5P_Y[i]); - } - else - { + } else { TJAPlayer3.Tx.Result_Panel_4P[i].t2D描画(TJAPlayer3.Skin.Result_UIMove_4P_X[i], TJAPlayer3.Skin.Result_UIMove_4P_Y[i]); } } @@ -413,25 +372,20 @@ namespace TJAPlayer3 int gauge_base_x; int gauge_base_y; - - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { + + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { _frame.vcScaleRatio.X = 0.5f; bar_x = TJAPlayer3.Skin.Result_DifficultyBar_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; bar_y = TJAPlayer3.Skin.Result_DifficultyBar_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; gauge_base_x = TJAPlayer3.Skin.Result_Gauge_Base_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; gauge_base_y = TJAPlayer3.Skin.Result_Gauge_Base_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { _frame.vcScaleRatio.X = 0.5f; bar_x = TJAPlayer3.Skin.Result_DifficultyBar_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[pos]; bar_y = TJAPlayer3.Skin.Result_DifficultyBar_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[pos]; gauge_base_x = TJAPlayer3.Skin.Result_Gauge_Base_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[pos]; gauge_base_y = TJAPlayer3.Skin.Result_Gauge_Base_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[pos]; - } - else - { + } else { _frame.vcScaleRatio.X = 1.0f; bar_x = TJAPlayer3.Skin.Result_DifficultyBar_X[pos] + uioffset_x; bar_y = TJAPlayer3.Skin.Result_DifficultyBar_Y[pos]; @@ -446,42 +400,34 @@ namespace TJAPlayer3 _frame.vcScaleRatio.X = 1.0f; } - if (ctMainCounter.CurrentValue >= 2000) - { + if (ctMainCounter.CurrentValue >= 2000) { #region [ Gauge updates ] - if (!b音声再生[0]) - { + if (!b音声再生[0]) { TJAPlayer3.Skin.soundGauge.tPlay(); b音声再生[0] = true; } // Split gauge counter, one for each player in two - if (!ctゲージアニメ[i].IsTicked) - { + if (!ctゲージアニメ[i].IsTicked) { ctゲージアニメ[i].Start(0, gaugeValues[i] / 2, 59, TJAPlayer3.Timer); if (ctMainCounter.CurrentValue >= MountainAppearValue) ctゲージアニメ[i].CurrentValue = (int)ctゲージアニメ[i].EndValue; } - if (ctゲージアニメ[i].IsEnded) - { - if (ctゲージアニメ[i].CurrentValue != 50) - { + if (ctゲージアニメ[i].IsEnded) { + if (ctゲージアニメ[i].CurrentValue != 50) { // Gauge didn't reach rainbow if (TJAPlayer3.ConfigIni.nPlayerCount < 2 || ctゲージアニメ[(i == 0) ? 1 : 0].IsEnded) TJAPlayer3.Skin.soundGauge.tStop(); - } - else - { + } else { // Gauge reached rainbow - if (!TJAPlayer3.Skin.soundGauge.bIsPlaying) - { + if (!TJAPlayer3.Skin.soundGauge.bIsPlaying) { TJAPlayer3.Skin.soundGauge.tStop(); } - + if (!ct虹ゲージアニメ.IsTicked) ct虹ゲージアニメ.Start(0, TJAPlayer3.Skin.Result_Gauge_Rainbow_Ptn - 1, TJAPlayer3.Skin.Result_Gauge_Rainbow_Interval, TJAPlayer3.Timer); @@ -498,8 +444,7 @@ namespace TJAPlayer3 #endregion } - if (ctMainCounter.CurrentValue >= 2000) - { + 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) ] @@ -522,8 +467,7 @@ namespace TJAPlayer3 int[][] num_x; int[][] num_y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { + if (TJAPlayer3.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] }; @@ -547,9 +491,7 @@ namespace TJAPlayer3 num_x[6][pos] = TJAPlayer3.Skin.Result_Bomb_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; num_y[6][pos] = TJAPlayer3.Skin.Result_Bomb_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount > 2) - { + } else if (TJAPlayer3.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] }; @@ -573,9 +515,7 @@ namespace TJAPlayer3 num_x[6][pos] = TJAPlayer3.Skin.Result_Bomb_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[pos]; num_y[6][pos] = TJAPlayer3.Skin.Result_Bomb_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[pos]; - } - else - { + } else { num_x = new int[][] { TJAPlayer3.Skin.Result_Perfect_X, TJAPlayer3.Skin.Result_Good_X, @@ -597,41 +537,32 @@ namespace TJAPlayer3 }; } - for (int k = 0; k < 7; k++) - { - if (ctMainCounter.CurrentValue >= AnimeCount + (Interval * k)) - { + for (int k = 0; k < 7; k++) { + if (ctMainCounter.CurrentValue >= AnimeCount + (Interval * k)) { float numScale = 1.0f; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { numScale = TJAPlayer3.Skin.Result_Number_Scale_5P; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 3 || TJAPlayer3.ConfigIni.nPlayerCount == 4) - { + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 3 || TJAPlayer3.ConfigIni.nPlayerCount == 4) { numScale = TJAPlayer3.Skin.Result_Number_Scale_4P; } TJAPlayer3.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; TJAPlayer3.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 || TJAPlayer3.Skin.Result_ADLib_Show) && (k != 6 || TJAPlayer3.Skin.Result_Bomb_Show)) - { + if ((k != 5 || TJAPlayer3.Skin.Result_ADLib_Show) && (k != 6 || TJAPlayer3.Skin.Result_Bomb_Show)) { this.t小文字表示(num_x[k][pos] + uioffset_x, num_y[k][pos], scoresArr[k], numScale); } TJAPlayer3.Tx.Result_Number.vcScaleRatio.X = 1f; TJAPlayer3.Tx.Result_Number.vcScaleRatio.Y = 1f; - if (!this.b音声再生[1 + k]) - { - if ((k != 5 || TJAPlayer3.Skin.Result_ADLib_Show) && (k != 6 || TJAPlayer3.Skin.Result_Bomb_Show)) - { + if (!this.b音声再生[1 + k]) { + if ((k != 5 || TJAPlayer3.Skin.Result_ADLib_Show) && (k != 6 || TJAPlayer3.Skin.Result_Bomb_Show)) { TJAPlayer3.Skin.soundPon.tPlay(); } this.b音声再生[1 + k] = true; } - } - else + } else break; } @@ -639,25 +570,19 @@ namespace TJAPlayer3 #region [ Score display ] - if (ctMainCounter.CurrentValue >= AnimeCount + Interval * 4 + 840) - { + if (ctMainCounter.CurrentValue >= AnimeCount + Interval * 4 + 840) { float numScale = 1.0f; int score_x; int score_y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { numScale = TJAPlayer3.Skin.Result_Score_Scale_5P; score_x = TJAPlayer3.Skin.Result_Score_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; score_y = TJAPlayer3.Skin.Result_Score_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { numScale = TJAPlayer3.Skin.Result_Score_Scale_4P; score_x = TJAPlayer3.Skin.Result_Score_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[pos]; score_y = TJAPlayer3.Skin.Result_Score_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[pos]; - } - else - { + } else { score_x = TJAPlayer3.Skin.Result_Score_X[pos] + uioffset_x; score_y = TJAPlayer3.Skin.Result_Score_Y[pos]; } @@ -671,8 +596,7 @@ namespace TJAPlayer3 this.tスコア文字表示(score_x, score_y, (int)TJAPlayer3.stage演奏ドラム画面.actScore.Get(i), numScale);// TJAPlayer3.stage演奏ドラム画面.CChartScore[i].nScore.ToString())); - if (!b音声再生[8]) - { + if (!b音声再生[8]) { TJAPlayer3.Skin.soundScoreDon.tPlay(); b音声再生[8] = true; } @@ -686,26 +610,21 @@ namespace TJAPlayer3 } - if (ctAISectionChange.CurrentValue == ctAISectionChange.EndValue && TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count > 5) - { + if (ctAISectionChange.CurrentValue == ctAISectionChange.EndValue && TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count > 5) { NextAISection(); - } - else if (nNowAISection > 0 && TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count <= 5) - { + } else if (nNowAISection > 0 && TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count <= 5) { // Fix locked sections nNowAISection = 0; - } + } - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { + if (TJAPlayer3.ConfigIni.bAIBattleMode) { TJAPlayer3.Tx.Result_AIBattle_Panel_AI.t2D描画(0, 0); int batch_width = TJAPlayer3.Tx.Result_AIBattle_Batch.szTextureSize.Width / 3; int batch_height = TJAPlayer3.Tx.Result_AIBattle_Batch.szTextureSize.Height; - for (int i = 0; i < TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count; i++) - { + for (int i = 0; i < TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count; i++) { int nowIndex = (i / 5); int drawCount = Math.Min(TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count - (nowIndex * 5), 5); @@ -720,15 +639,12 @@ namespace TJAPlayer3 int opacityCounter = Math.Min(ctAISectionChange.CurrentValue, 255); - if (nowIndex == nNowAISection) - { + if (nowIndex == nNowAISection) { TJAPlayer3.Tx.Result_AIBattle_Batch.Opacity = opacityCounter; TJAPlayer3.Tx.Result_AIBattle_SectionPlate.Opacity = opacityCounter; if (TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkAISection[i]) != null) TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkAISection[i]).Opacity = opacityCounter; - } - else - { + } else { TJAPlayer3.Tx.Result_AIBattle_Batch.Opacity = 255 - opacityCounter; TJAPlayer3.Tx.Result_AIBattle_SectionPlate.Opacity = 255 - opacityCounter; if (TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkAISection[i]) != null) @@ -737,8 +653,7 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Result_AIBattle_Batch.t2D描画(x, y, new RectangleF(batch_width * 0, 0, batch_width, batch_height)); - switch (section.End) - { + switch (section.End) { case CStage演奏画面共通.AIBattleSection.EndType.Clear: TJAPlayer3.Tx.Result_AIBattle_Batch.t2D描画(x, y, new Rectangle(batch_width * 1, 0, batch_width, batch_height)); break; @@ -754,8 +669,7 @@ namespace TJAPlayer3 TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkAISection[i])?.t2D中心基準描画(x + TJAPlayer3.Skin.Result_AIBattle_SectionText_Offset[0], y + TJAPlayer3.Skin.Result_AIBattle_SectionText_Offset[1]); } - if (ctMainCounter.CurrentValue >= MountainAppearValue) - { + if (ctMainCounter.CurrentValue >= MountainAppearValue) { float flagScale = 2.0f - (Math.Min(Math.Max(ctMainCounter.CurrentValue - MountainAppearValue, 0), 200) / 200.0f); CTexture tex = TJAPlayer3.stage結果.bClear[0] ? TJAPlayer3.Tx.Result_AIBattle_WinFlag_Clear : TJAPlayer3.Tx.Result_AIBattle_WinFlag_Lose; @@ -776,30 +690,25 @@ namespace TJAPlayer3 #region [Character related animations] - for (int p = 0; p < TJAPlayer3.ConfigIni.nPlayerCount; p++) - { + for (int p = 0; p < TJAPlayer3.ConfigIni.nPlayerCount; p++) { if (TJAPlayer3.ConfigIni.bAIBattleMode && p == 1) break; int pos = p; if (is2PSide) pos = 1; - if (ctMainCounter.CurrentValue >= MountainAppearValue) - { + if (ctMainCounter.CurrentValue >= MountainAppearValue) { #region [Mountain animation counter setup] if (!this.ctMountain_ClearIn.IsTicked) this.ctMountain_ClearIn.Start(0, 515, 3, TJAPlayer3.Timer); - + if (ctUIMove.EndValue != 1000 && TJAPlayer3.Skin.Result_Use1PUI && is1P) ctUIMove = new CCounter(0, 1000, 0.5, TJAPlayer3.Timer); - if (TJAPlayer3.stage結果.bClear[p]) - { + if (TJAPlayer3.stage結果.bClear[p]) { if (!CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.CLEAR)) CResultCharacter.tMenuResetTimer(p, CResultCharacter.ECharacterResult.CLEAR); - } - else - { + } 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) @@ -830,60 +739,42 @@ namespace TJAPlayer3 float renderRatioX = TJAPlayer3.Skin.Resolution[0] / (float)TJAPlayer3.Skin.Characters_Resolution[_charaId][0]; float renderRatioY = TJAPlayer3.Skin.Resolution[1] / (float)TJAPlayer3.Skin.Characters_Resolution[_charaId][1]; - if (CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.CLEAR)) - { + if (CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.CLEAR)) { CResultCharacter.tMenuDisplayCharacter(p, chara_x, chara_y, CResultCharacter.ECharacterResult.CLEAR, pos); var tex = pos == 0 ? TJAPlayer3.Tx.Characters_Result_Clear_1P[_charaId] : TJAPlayer3.Tx.Characters_Result_Clear_2P[_charaId]; - if (TJAPlayer3.Skin.Characters_UseResult1P[_charaId] && TJAPlayer3.Skin.Result_Use1PUI && tex != null) - { + if (TJAPlayer3.Skin.Characters_UseResult1P[_charaId] && TJAPlayer3.Skin.Result_Use1PUI && tex != null) { tex.vcScaleRatio.X = renderRatioX; tex.vcScaleRatio.Y = renderRatioY; - if (is2PSide) - { + if (is2PSide) { tex.t2D左右反転描画(p1chara_x, p1chara_y); - } - else - { + } else { tex.t2D描画(p1chara_x, p1chara_y); } } - } - else if (CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.FAILED)) - { + } else if (CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.FAILED)) { CResultCharacter.tMenuDisplayCharacter(p, chara_x, chara_y, CResultCharacter.ECharacterResult.FAILED, pos); - if (TJAPlayer3.Skin.Characters_UseResult1P[_charaId] && TJAPlayer3.Skin.Result_Use1PUI && TJAPlayer3.Tx.Characters_Result_Failed_1P[_charaId] != null) - { + if (TJAPlayer3.Skin.Characters_UseResult1P[_charaId] && TJAPlayer3.Skin.Result_Use1PUI && TJAPlayer3.Tx.Characters_Result_Failed_1P[_charaId] != null) { TJAPlayer3.Tx.Characters_Result_Failed_1P[_charaId].vcScaleRatio.X = renderRatioX; TJAPlayer3.Tx.Characters_Result_Failed_1P[_charaId].vcScaleRatio.Y = renderRatioY; - if (is2PSide) - { + if (is2PSide) { TJAPlayer3.Tx.Characters_Result_Failed_1P[_charaId].t2D左右反転描画(p1chara_x, p1chara_y); - } - else - { + } else { TJAPlayer3.Tx.Characters_Result_Failed_1P[_charaId].t2D描画(p1chara_x, p1chara_y); } } - } - else if (CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.FAILED_IN) && TJAPlayer3.Tx.Characters_Result_Failed_1P[_charaId] != null) - { + } else if (CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.FAILED_IN) && TJAPlayer3.Tx.Characters_Result_Failed_1P[_charaId] != null) { CResultCharacter.tMenuDisplayCharacter(p, chara_x, chara_y, CResultCharacter.ECharacterResult.FAILED_IN, pos); - if (TJAPlayer3.Skin.Characters_UseResult1P[_charaId] && TJAPlayer3.Skin.Result_Use1PUI) - { + if (TJAPlayer3.Skin.Characters_UseResult1P[_charaId] && TJAPlayer3.Skin.Result_Use1PUI) { TJAPlayer3.Tx.Characters_Result_Failed_1P[_charaId].vcScaleRatio.X = renderRatioX; TJAPlayer3.Tx.Characters_Result_Failed_1P[_charaId].vcScaleRatio.Y = renderRatioY; - if (is2PSide) - { + if (is2PSide) { TJAPlayer3.Tx.Characters_Result_Failed_1P[_charaId].t2D左右反転描画(p1chara_x, p1chara_y); - } - else - { + } else { TJAPlayer3.Tx.Characters_Result_Failed_1P[_charaId].t2D描画(p1chara_x, p1chara_y); } } - } - else + } else CResultCharacter.tMenuDisplayCharacter(p, chara_x, chara_y, CResultCharacter.ECharacterResult.NORMAL, pos); #endregion @@ -892,19 +783,18 @@ namespace TJAPlayer3 #region [PuchiChara] int puchi_x = chara_x + TJAPlayer3.Skin.Adjustments_MenuPuchichara_X[TJAPlayer3.ConfigIni.nPlayerCount <= 2 ? pos : 0]; - int puchi_y = chara_y + TJAPlayer3.Skin.Adjustments_MenuPuchichara_Y[TJAPlayer3.ConfigIni.nPlayerCount <= 2 ? pos : 0]; + int puchi_y = chara_y + TJAPlayer3.Skin.Adjustments_MenuPuchichara_Y[TJAPlayer3.ConfigIni.nPlayerCount <= 2 ? pos : 0]; - //int ttdiff = 640 - 152; + //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); + this.PuchiChara.On進行描画(puchi_x, puchi_y, false, 255, false, p); - #endregion + #endregion - if (ctMainCounter.CurrentValue >= MountainAppearValue) - { + if (ctMainCounter.CurrentValue >= MountainAppearValue) { float AddCount = 135; int baseX = (pos == 1) ? 1280 - 182 : 182; @@ -912,15 +802,14 @@ namespace TJAPlayer3 #region [Cherry blossom animation] - if (gaugeValues[p] >= 80.0f && TJAPlayer3.ConfigIni.nPlayerCount <= 2) - { + if (gaugeValues[p] >= 80.0f && TJAPlayer3.ConfigIni.nPlayerCount <= 2) { TJAPlayer3.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); TJAPlayer3.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 = TJAPlayer3.Tx.Result_Flower.szTextureSize.Width; int flower_height = TJAPlayer3.Tx.Result_Flower.szTextureSize.Height / 2; - TJAPlayer3.Tx.Result_Flower.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Result_Flower_X[pos], TJAPlayer3.Skin.Result_Flower_Y[pos], + TJAPlayer3.Tx.Result_Flower.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Result_Flower_X[pos], TJAPlayer3.Skin.Result_Flower_Y[pos], new Rectangle(0, 0, flower_width, flower_height)); } @@ -928,19 +817,16 @@ namespace TJAPlayer3 #region [Cherry blossom Rotating flowers] - if (gaugeValues[p] >= 80.0f && TJAPlayer3.ConfigIni.nPlayerCount <= 2) - { + if (gaugeValues[p] >= 80.0f && TJAPlayer3.ConfigIni.nPlayerCount <= 2) { float FlowerTime = ctRotate_Flowers.CurrentValue; - for (int i = 0; i < 5; i++) - { + for (int i = 0; i < 5; i++) { if ((int)FlowerTime < ApparitionTimeStamps[i] || (int)FlowerTime > ApparitionTimeStamps[i] + 2 * ApparitionFade + ApparitionDuration) TJAPlayer3.Tx.Result_Flower_Rotate[i].Opacity = 0; else if ((int)FlowerTime <= ApparitionTimeStamps[i] + ApparitionDuration + ApparitionFade && (int)FlowerTime >= ApparitionTimeStamps[i] + ApparitionFade) TJAPlayer3.Tx.Result_Flower_Rotate[i].Opacity = 255; - else - { + else { int CurrentGradiant = 0; if ((int)FlowerTime >= ApparitionTimeStamps[i] + ApparitionFade + ApparitionDuration) CurrentGradiant = ApparitionFade - ((int)FlowerTime - ApparitionTimeStamps[i] - ApparitionDuration - ApparitionFade); @@ -964,13 +850,11 @@ namespace TJAPlayer3 #region [Panel shines] - if (gaugeValues[p] >= 80.0f && TJAPlayer3.ConfigIni.nPlayerCount <= 2) - { + if (gaugeValues[p] >= 80.0f && TJAPlayer3.ConfigIni.nPlayerCount <= 2) { int ShineTime = (int)ctShine_Plate.CurrentValue; int Quadrant500 = ShineTime % 500; - for (int i = 0; i < TJAPlayer3.Skin.Result_PlateShine_Count; i++) - { + for (int i = 0; i < TJAPlayer3.Skin.Result_PlateShine_Count; i++) { if (i < 3 && ShineTime >= 500 || i >= 3 && ShineTime < 500) TJAPlayer3.Tx.Result_Shine.Opacity = 0; else if (Quadrant500 >= ShinePFade && Quadrant500 <= 500 - ShinePFade) @@ -1002,39 +886,25 @@ namespace TJAPlayer3 else if (gaugeValues[p] >= 40.0f) Mood = 1; - if (TJAPlayer3.stage結果.nクリア[p] == 4) - { + if (TJAPlayer3.stage結果.nクリア[p] == 4) { MoodV2 = 5; - } - else if (TJAPlayer3.stage結果.nクリア[p] == 3) - { + } else if (TJAPlayer3.stage結果.nクリア[p] == 3) { MoodV2 = 4; - } - else if (TJAPlayer3.stage結果.nクリア[p] >= 1) - { - if (gaugeValues[p] >= 100.0f) - { + } else if (TJAPlayer3.stage結果.nクリア[p] >= 1) { + if (gaugeValues[p] >= 100.0f) { MoodV2 = 3; - } - else - { + } else { MoodV2 = 2; } - } - else if (TJAPlayer3.stage結果.nクリア[p] == 0) - { - if (gaugeValues[p] >= 40.0f) - { + } else if (TJAPlayer3.stage結果.nクリア[p] == 0) { + if (gaugeValues[p] >= 40.0f) { MoodV2 = 1; - } - else - { + } else { MoodV2 = 0; } } - if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) - { + if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) { int speechBuddle_width = TJAPlayer3.Tx.Result_Speech_Bubble[pos].szTextureSize.Width / 4; int speechBuddle_height = TJAPlayer3.Tx.Result_Speech_Bubble[pos].szTextureSize.Height / 3; @@ -1044,34 +914,26 @@ namespace TJAPlayer3 new Rectangle(Mood * speechBuddle_width, RandomText * speechBuddle_height, speechBuddle_width, speechBuddle_height)); } int speech_vubble_index = TJAPlayer3.ConfigIni.nPlayerCount <= 2 ? pos : 2; - if (TJAPlayer3.Tx.Result_Speech_Bubble_V2[speech_vubble_index] != null) - { + if (TJAPlayer3.Tx.Result_Speech_Bubble_V2[speech_vubble_index] != null) { int speechBuddle_width = TJAPlayer3.Tx.Result_Speech_Bubble_V2[speech_vubble_index].szTextureSize.Width; int speechBuddle_height = TJAPlayer3.Tx.Result_Speech_Bubble_V2[speech_vubble_index].szTextureSize.Height / 6; int speech_bubble_x; int speech_bubble_y; float scale; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { speech_bubble_x = TJAPlayer3.Skin.Result_Speech_Bubble_V2_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; speech_bubble_y = TJAPlayer3.Skin.Result_Speech_Bubble_V2_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; scale = 0.5f; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { speech_bubble_x = TJAPlayer3.Skin.Result_Speech_Bubble_V2_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[pos]; speech_bubble_y = TJAPlayer3.Skin.Result_Speech_Bubble_V2_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[pos]; scale = 0.5f; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 2) - { + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 2) { speech_bubble_x = TJAPlayer3.Skin.Result_Speech_Bubble_V2_2P_X[pos]; speech_bubble_y = TJAPlayer3.Skin.Result_Speech_Bubble_V2_2P_Y[pos]; scale = 0.5f; - } - else - { + } else { speech_bubble_x = TJAPlayer3.Skin.Result_Speech_Bubble_V2_X[pos]; speech_bubble_y = TJAPlayer3.Skin.Result_Speech_Bubble_V2_Y[pos]; scale = 1.0f; @@ -1085,22 +947,18 @@ namespace TJAPlayer3 TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkSpeechText[p][MoodV2]).vcScaleRatio.X = scale; TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkSpeechText[p][MoodV2]).vcScaleRatio.Y = scale; TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkSpeechText[p][MoodV2]).t2D拡大率考慮中央基準描画( - speech_bubble_x + (int)(TJAPlayer3.Skin.Result_Speech_Text_Offset[0] * scale), + speech_bubble_x + (int)(TJAPlayer3.Skin.Result_Speech_Text_Offset[0] * scale), speech_bubble_y + (int)(TJAPlayer3.Skin.Result_Speech_Text_Offset[1] * scale)); } - if (!b音声再生[11]) - { - if (gaugeValues[p] >= 80.0f) - { + if (!b音声再生[11]) { + if (gaugeValues[p] >= 80.0f) { //TJAPlayer3.Skin.soundDonClear.t再生する(); TJAPlayer3.Skin.voiceResultClearSuccess[TJAPlayer3.GetActualPlayer(p)]?.tPlay(); - } - else - { + } else { //TJAPlayer3.Skin.soundDonFailed.t再生する(); TJAPlayer3.Skin.voiceResultClearFailed[TJAPlayer3.GetActualPlayer(p)]?.tPlay(); } - + if (p == TJAPlayer3.ConfigIni.nPlayerCount - 1) b音声再生[11] = true; } @@ -1113,8 +971,7 @@ namespace TJAPlayer3 - if (ctMainCounter.CurrentValue >= ScoreApparitionTimeStamp + 1000) - { + if (ctMainCounter.CurrentValue >= ScoreApparitionTimeStamp + 1000) { //if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) { #region [Score rank apparition] @@ -1122,26 +979,20 @@ namespace TJAPlayer3 int scoreRank_width = TJAPlayer3.Tx.Result_ScoreRankEffect.szTextureSize.Width / 7; int scoreRank_height = TJAPlayer3.Tx.Result_ScoreRankEffect.szTextureSize.Height / 4; - if (ctMainCounter.CurrentValue <= ScoreApparitionTimeStamp + 1180) - { + if (ctMainCounter.CurrentValue <= ScoreApparitionTimeStamp + 1180) { TJAPlayer3.Tx.Result_ScoreRankEffect.Opacity = (int)((ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 1000)) / 180.0f * 255.0f); TJAPlayer3.Tx.Result_ScoreRankEffect.vcScaleRatio.X = 1.0f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 910)) / 1.5f * (Math.PI / 180)) * 1.4f; TJAPlayer3.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) - { + } else if (ctMainCounter.CurrentValue <= ScoreApparitionTimeStamp + 1270) { TJAPlayer3.Tx.Result_ScoreRankEffect.vcScaleRatio.X = 0.5f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 1180)) * (Math.PI / 180)) * 0.5f; TJAPlayer3.Tx.Result_ScoreRankEffect.vcScaleRatio.Y = 0.5f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 1180)) * (Math.PI / 180)) * 0.5f; - } - else - { + } else { TJAPlayer3.Tx.Result_ScoreRankEffect.Opacity = 255; TJAPlayer3.Tx.Result_ScoreRankEffect.vcScaleRatio.X = 1f; TJAPlayer3.Tx.Result_ScoreRankEffect.vcScaleRatio.Y = 1f; } - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && TJAPlayer3.stage結果.nスコアランク[p] > 0) - { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && TJAPlayer3.stage結果.nスコアランク[p] > 0) { int CurrentFlash = 0; int[] FlashTimes = { 1500, 1540, 1580, 1620, 1660, 1700, 1740, 1780 }; @@ -1155,18 +1006,13 @@ namespace TJAPlayer3 int scoreRankEffect_x; int scoreRankEffect_y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { scoreRankEffect_x = TJAPlayer3.Skin.Result_ScoreRankEffect_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; scoreRankEffect_y = TJAPlayer3.Skin.Result_ScoreRankEffect_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { scoreRankEffect_x = TJAPlayer3.Skin.Result_ScoreRankEffect_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[pos]; scoreRankEffect_y = TJAPlayer3.Skin.Result_ScoreRankEffect_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[pos]; - } - else - { + } else { scoreRankEffect_x = TJAPlayer3.Skin.Result_ScoreRankEffect_X[pos] + uioffset_x; scoreRankEffect_y = TJAPlayer3.Skin.Result_ScoreRankEffect_Y[pos]; } @@ -1174,8 +1020,7 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Result_ScoreRankEffect.t2D拡大率考慮中央基準描画(scoreRankEffect_x, scoreRankEffect_y, new Rectangle((TJAPlayer3.stage結果.nスコアランク[p] - 1) * scoreRank_width, CurrentFlash * scoreRank_height, scoreRank_width, scoreRank_height)); - if (!b音声再生[9] && ctMainCounter.CurrentValue >= ScoreApparitionTimeStamp + 1180) - { + if (!b音声再生[9] && ctMainCounter.CurrentValue >= ScoreApparitionTimeStamp + 1180) { TJAPlayer3.Skin.soundRankIn.tPlay(); b音声再生[9] = true; } @@ -1186,8 +1031,7 @@ namespace TJAPlayer3 } - if (ctMainCounter.CurrentValue >= ScoreApparitionTimeStamp + 2500) - { + if (ctMainCounter.CurrentValue >= ScoreApparitionTimeStamp + 2500) { //if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) { #region [Crown apparition] @@ -1195,19 +1039,14 @@ namespace TJAPlayer3 int crownEffect_width = TJAPlayer3.Tx.Result_CrownEffect.szTextureSize.Width / 4; int crownEffect_height = TJAPlayer3.Tx.Result_CrownEffect.szTextureSize.Height / 4; - if (ctMainCounter.CurrentValue <= ScoreApparitionTimeStamp + 2680) - { + if (ctMainCounter.CurrentValue <= ScoreApparitionTimeStamp + 2680) { TJAPlayer3.Tx.Result_CrownEffect.Opacity = (int)((ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 2500)) / 180.0f * 255.0f); TJAPlayer3.Tx.Result_CrownEffect.vcScaleRatio.X = 1.0f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 2410)) / 1.5f * (Math.PI / 180)) * 1.4f; TJAPlayer3.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) - { + } else if (ctMainCounter.CurrentValue <= ScoreApparitionTimeStamp + 2770) { TJAPlayer3.Tx.Result_CrownEffect.vcScaleRatio.X = 0.5f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 2680)) * (Math.PI / 180)) * 0.5f; TJAPlayer3.Tx.Result_CrownEffect.vcScaleRatio.Y = 0.5f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 2680)) * (Math.PI / 180)) * 0.5f; - } - else - { + } else { TJAPlayer3.Tx.Result_CrownEffect.Opacity = 255; TJAPlayer3.Tx.Result_CrownEffect.vcScaleRatio.X = 1f; TJAPlayer3.Tx.Result_CrownEffect.vcScaleRatio.Y = 1f; @@ -1215,8 +1054,7 @@ namespace TJAPlayer3 int ClearType = TJAPlayer3.stage結果.nクリア[p] - 1; - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)(Difficulty.Dan) && ClearType >= 0) - { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)(Difficulty.Dan) && ClearType >= 0) { int CurrentFlash = 0; int[] FlashTimes = { 2000, 2040, 2080, 2120, 2160, 2200, 2240, 2280 }; @@ -1230,18 +1068,13 @@ namespace TJAPlayer3 int crownEffect_x; int crownEffect_y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { crownEffect_x = TJAPlayer3.Skin.Result_CrownEffect_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; crownEffect_y = TJAPlayer3.Skin.Result_CrownEffect_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { crownEffect_x = TJAPlayer3.Skin.Result_CrownEffect_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[pos]; crownEffect_y = TJAPlayer3.Skin.Result_CrownEffect_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[pos]; - } - else - { + } else { crownEffect_x = TJAPlayer3.Skin.Result_CrownEffect_X[pos] + uioffset_x; crownEffect_y = TJAPlayer3.Skin.Result_CrownEffect_Y[pos]; } @@ -1249,8 +1082,7 @@ namespace TJAPlayer3 TJAPlayer3.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) - { + if (!b音声再生[10] && ctMainCounter.CurrentValue >= ScoreApparitionTimeStamp + 2680) { TJAPlayer3.Skin.soundCrownIn.tPlay(); b音声再生[10] = true; } @@ -1263,13 +1095,12 @@ namespace TJAPlayer3 #endregion - + #endregion } - if (!this.ct表示用.IsEnded) - { + if (!this.ct表示用.IsEnded) { return 0; } return 1; @@ -1282,8 +1113,7 @@ namespace TJAPlayer3 #region [ private ] //----------------- [StructLayout(LayoutKind.Sequential)] - private struct ST文字位置 - { + private struct ST文字位置 { public char ch; public Point pt; } @@ -1322,8 +1152,8 @@ namespace TJAPlayer3 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[] 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; @@ -1348,26 +1178,22 @@ namespace TJAPlayer3 private int nNowAISection; - private void NextAISection() - { + private void NextAISection() { ctAISectionChange = new CCounter(0, 2000, 1, TJAPlayer3.Timer); ctAISectionChange.CurrentValue = 0; nNowAISection++; - if (nNowAISection >= Math.Ceiling(TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count / 5.0)) - { + if (nNowAISection >= Math.Ceiling(TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count / 5.0)) { nNowAISection = 0; } } - public void t小文字表示(int x, int y, int num, float scale) - { + public void t小文字表示(int x, int y, int num, float scale) { TJAPlayer3.Tx.Result_Number.vcScaleRatio.X *= scale; TJAPlayer3.Tx.Result_Number.vcScaleRatio.Y *= scale; int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) - { + for (int j = 0; j < nums.Length; j++) { float offset = j; float width = (TJAPlayer3.Tx.Result_Number.sz画像サイズ.Width / 11.0f); @@ -1376,30 +1202,23 @@ namespace TJAPlayer3 float _x = x - ((TJAPlayer3.Skin.Result_Number_Interval[0] * scale) * offset) + (width * 2); float _y = y - ((TJAPlayer3.Skin.Result_Number_Interval[1] * scale) * offset); - TJAPlayer3.Tx.Result_Number.t2D拡大率考慮中央基準描画(_x + (width * scale / 2), _y + (height * scale / 2), + TJAPlayer3.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) - { + 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) - { + 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 == '.') - { + if (ch == '.') { rectangle.Width -= 2; rectangle.Height -= 2; } - if (TJAPlayer3.Tx.Result_Number != null) - { + if (TJAPlayer3.Tx.Result_Number != null) { TJAPlayer3.Tx.Result_Number.t2D描画(x, y, rectangle); } break; @@ -1409,13 +1228,11 @@ namespace TJAPlayer3 } } - public void tスコア文字表示(int x, int y, int num, float scale) - { + public void tスコア文字表示(int x, int y, int num, float scale) { TJAPlayer3.Tx.Result_Score_Number.vcScaleRatio.X *= scale; TJAPlayer3.Tx.Result_Score_Number.vcScaleRatio.Y *= scale; int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) - { + for (int j = 0; j < nums.Length; j++) { float offset = j; float _x = x - (TJAPlayer3.Skin.Result_Score_Number_Interval[0] * scale * offset); float _y = y - (TJAPlayer3.Skin.Result_Score_Number_Interval[1] * scale * offset); diff --git a/OpenTaiko/src/Stages/08.Result/CActResultRank.cs b/OpenTaiko/src/Stages/08.Result/CActResultRank.cs index 86347184..a4af3f1a 100644 --- a/OpenTaiko/src/Stages/08.Result/CActResultRank.cs +++ b/OpenTaiko/src/Stages/08.Result/CActResultRank.cs @@ -1,62 +1,46 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - internal class CActResultRank : CActivity - { +namespace TJAPlayer3 { + internal class CActResultRank : CActivity { // コンストラクタ - public CActResultRank() - { + public CActResultRank() { base.IsDeActivated = true; } // CActivity 実装 - public override void Activate() - { + public override void Activate() { base.Activate(); } - public override void DeActivate() - { + public override void DeActivate() { base.DeActivate(); } - public override void CreateManagedResource() - { - if( !base.IsDeActivated ) - { + public override void CreateManagedResource() { + if (!base.IsDeActivated) { base.CreateManagedResource(); } } - public override void ReleaseManagedResource() - { - if( !base.IsDeActivated ) - { + public override void ReleaseManagedResource() { + if (!base.IsDeActivated) { base.ReleaseManagedResource(); } } - public override int Draw() - { - if( base.IsDeActivated ) - { + public override int Draw() { + if (base.IsDeActivated) { return 0; } - if( base.IsFirstDraw ) - { + if (base.IsFirstDraw) { base.IsFirstDraw = false; } return 1; } - + // その他 diff --git a/OpenTaiko/src/Stages/08.Result/CActResultSongBar.cs b/OpenTaiko/src/Stages/08.Result/CActResultSongBar.cs index 5464f8c9..79ddf053 100644 --- a/OpenTaiko/src/Stages/08.Result/CActResultSongBar.cs +++ b/OpenTaiko/src/Stages/08.Result/CActResultSongBar.cs @@ -1,101 +1,76 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Diagnostics; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - internal class CActResultSongBar : CActivity - { +namespace TJAPlayer3 { + internal class CActResultSongBar : CActivity { // コンストラクタ - public CActResultSongBar() - { + public CActResultSongBar() { base.IsDeActivated = true; } // メソッド - public void tアニメを完了させる() - { + public void tアニメを完了させる() { this.ct登場用.CurrentValue = (int)this.ct登場用.EndValue; } // CActivity 実装 - public override void Activate() - { + public override void Activate() { - // After performing calibration, inform the player that - // calibration has been completed, rather than - // displaying the song title as usual. + // After performing calibration, inform the player that + // calibration has been completed, rather than + // displaying the song title as usual. - var title = TJAPlayer3.IsPerformingCalibration - ? $"Calibration complete. InputAdjustTime is now {TJAPlayer3.ConfigIni.nInputAdjustTimeMs}ms (Note : InputAdjust is deprecated, please transfer the value to GlobalOffset and reload the songs" - : TJAPlayer3.DTX.TITLE.GetString(""); + var title = TJAPlayer3.IsPerformingCalibration + ? $"Calibration complete. InputAdjustTime is now {TJAPlayer3.ConfigIni.nInputAdjustTimeMs}ms (Note : InputAdjust is deprecated, please transfer the value to GlobalOffset and reload the songs" + : TJAPlayer3.DTX.TITLE.GetString(""); - using (var bmpSongTitle = pfMusicName.DrawText(title, TJAPlayer3.Skin.Result_MusicName_ForeColor, TJAPlayer3.Skin.Result_MusicName_BackColor, null, 30)) - - { - this.txMusicName = TJAPlayer3.tテクスチャの生成(bmpSongTitle, false); - txMusicName.vcScaleRatio.X = TJAPlayer3.GetSongNameXScaling(ref txMusicName, TJAPlayer3.Skin.Result_MusicName_MaxSize); - } + using (var bmpSongTitle = pfMusicName.DrawText(title, TJAPlayer3.Skin.Result_MusicName_ForeColor, TJAPlayer3.Skin.Result_MusicName_BackColor, null, 30)) { + this.txMusicName = TJAPlayer3.tテクスチャの生成(bmpSongTitle, false); + txMusicName.vcScaleRatio.X = TJAPlayer3.GetSongNameXScaling(ref txMusicName, TJAPlayer3.Skin.Result_MusicName_MaxSize); + } base.Activate(); } - public override void DeActivate() - { - if( this.ct登場用 != null ) - { + public override void DeActivate() { + if (this.ct登場用 != null) { this.ct登場用 = null; } - - TJAPlayer3.tテクスチャの解放( ref this.txMusicName ); + + TJAPlayer3.tテクスチャの解放(ref this.txMusicName); base.DeActivate(); } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { this.pfMusicName = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Result_MusicName_FontSize); base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { - TJAPlayer3.tDisposeSafely(ref this.pfMusicName); - base.ReleaseManagedResource(); + public override void ReleaseManagedResource() { + TJAPlayer3.tDisposeSafely(ref this.pfMusicName); + base.ReleaseManagedResource(); } - public override int Draw() - { - if( base.IsDeActivated ) - { + public override int Draw() { + if (base.IsDeActivated) { return 0; } - if( base.IsFirstDraw ) - { - this.ct登場用 = new CCounter( 0, 270, 4, TJAPlayer3.Timer ); + if (base.IsFirstDraw) { + this.ct登場用 = new CCounter(0, 270, 4, TJAPlayer3.Timer); base.IsFirstDraw = false; } this.ct登場用.Tick(); - if (TJAPlayer3.Skin.Result_MusicName_ReferencePoint == CSkin.ReferencePoint.Center) - { - this.txMusicName.t2D描画(TJAPlayer3.Skin.Result_MusicName_X - ((this.txMusicName.szTextureSize.Width * txMusicName.vcScaleRatio.X) / 2), TJAPlayer3.Skin.Result_MusicName_Y); - } - else if (TJAPlayer3.Skin.Result_MusicName_ReferencePoint == CSkin.ReferencePoint.Left) - { - this.txMusicName.t2D描画(TJAPlayer3.Skin.Result_MusicName_X, TJAPlayer3.Skin.Result_MusicName_Y); - } - else - { - this.txMusicName.t2D描画(TJAPlayer3.Skin.Result_MusicName_X - this.txMusicName.szTextureSize.Width * txMusicName.vcScaleRatio.X, TJAPlayer3.Skin.Result_MusicName_Y); - } + if (TJAPlayer3.Skin.Result_MusicName_ReferencePoint == CSkin.ReferencePoint.Center) { + this.txMusicName.t2D描画(TJAPlayer3.Skin.Result_MusicName_X - ((this.txMusicName.szTextureSize.Width * txMusicName.vcScaleRatio.X) / 2), TJAPlayer3.Skin.Result_MusicName_Y); + } else if (TJAPlayer3.Skin.Result_MusicName_ReferencePoint == CSkin.ReferencePoint.Left) { + this.txMusicName.t2D描画(TJAPlayer3.Skin.Result_MusicName_X, TJAPlayer3.Skin.Result_MusicName_Y); + } else { + this.txMusicName.t2D描画(TJAPlayer3.Skin.Result_MusicName_X - this.txMusicName.szTextureSize.Width * txMusicName.vcScaleRatio.X, TJAPlayer3.Skin.Result_MusicName_Y); + } - if( !this.ct登場用.IsEnded ) - { + if (!this.ct登場用.IsEnded) { return 0; } return 1; @@ -108,9 +83,9 @@ namespace TJAPlayer3 //----------------- private CCounter ct登場用; - private CTexture txMusicName; - private CCachedFontRenderer pfMusicName; - //----------------- + 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 4d035f47..b4052ef7 100644 --- a/OpenTaiko/src/Stages/08.Result/CStage結果.cs +++ b/OpenTaiko/src/Stages/08.Result/CStage結果.cs @@ -1,19 +1,12 @@ -using System; -using System.IO; -using System.Diagnostics; -using FDK; -using System.Linq; +using System.Diagnostics; using System.Drawing; -using System.Collections.Generic; -using DiscordRPC; -using static TJAPlayer3.CActSelect曲リスト; using System.Text; -using System.ArrayExtensions; +using DiscordRPC; +using FDK; +using static TJAPlayer3.CActSelect曲リスト; -namespace TJAPlayer3 -{ - internal class CStage結果 : CStage - { +namespace TJAPlayer3 { + internal class CStage結果 : CStage { // プロパティ public STDGBVALUE b新記録スキル; @@ -42,8 +35,7 @@ namespace TJAPlayer3 // コンストラクタ - public CStage結果() - { + public CStage結果() { this.st演奏記録.Drums = new CScoreIni.C演奏記録(); this.st演奏記録.Guitar = new CScoreIni.C演奏記録(); this.st演奏記録.Bass = new CScoreIni.C演奏記録(); @@ -62,15 +54,13 @@ namespace TJAPlayer3 } - public bool isAutoDisabled(int player) - { + public bool isAutoDisabled(int player) { return ((player != 1 && !TJAPlayer3.ConfigIni.bAutoPlay[player]) || (player == 1 && !TJAPlayer3.ConfigIni.bAutoPlay[player] && !TJAPlayer3.ConfigIni.bAIBattleMode)); } - public int GetTowerScoreRank() - { + public int GetTowerScoreRank() { int tmpClear = 0; double progress = CFloorManagement.LastRegisteredFloor / ((double)TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor); @@ -91,8 +81,7 @@ namespace TJAPlayer3 */ }; - for (int i = 0; i < conditions.Length; i++) - { + for (int i = 0; i < conditions.Length; i++) { if (conditions[i] == true) tmpClear++; else @@ -104,14 +93,12 @@ namespace TJAPlayer3 // CStage 実装 - public override void Activate() - { - + public override void Activate() { + Trace.TraceInformation("結果ステージを活性化します。"); Trace.Indent(); bAddedToRecentlyPlayedSongs = false; - try - { + try { /* * Notes about the difference between Replay - Save statuses and the "Assisted clear" clear status * @@ -122,34 +109,34 @@ namespace TJAPlayer3 int[] ClearStatus_Replay = new int[5] { 0, 0, 0, 0, 0 }; int[] ScoreRank_Replay = new int[5] { 0, 0, 0, 0, 0 }; - int[] clearStatuses = - { - -1, - -1, - -1, - -1, - -1 - }; + int[] clearStatuses = + { + -1, + -1, + -1, + -1, + -1 + }; - int[] scoreRanks = - { - -1, - -1, - -1, - -1, - -1 - }; + int[] scoreRanks = + { + -1, + -1, + -1, + -1, + -1 + }; - bool[] assistedClear = - { - (TJAPlayer3.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 0) < 1f), - (TJAPlayer3.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 1) < 1f), - (TJAPlayer3.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 2) < 1f), - (TJAPlayer3.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 3) < 1f), - (TJAPlayer3.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 4) < 1f) - }; + bool[] assistedClear = + { + (TJAPlayer3.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 0) < 1f), + (TJAPlayer3.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 1) < 1f), + (TJAPlayer3.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 2) < 1f), + (TJAPlayer3.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 3) < 1f), + (TJAPlayer3.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 4) < 1f) + }; - { + { #region [ 初期化 ] //--------------------- this.eフェードアウト完了時の戻り値 = E戻り値.継続; @@ -158,30 +145,25 @@ namespace TJAPlayer3 this.n最後に再生したHHのWAV番号 = -1; this.n最後に再生したHHのチャンネル番号 = 0; - for (int i = 0; i < 3; i++) - { + for (int i = 0; i < 3; i++) { this.b新記録スキル[i] = false; this.b新記録スコア[i] = false; this.b新記録ランク[i] = false; } - //--------------------- - #endregion + //--------------------- + #endregion - #region [ Results calculus ] - //--------------------- + #region [ Results calculus ] + //--------------------- - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) - { - for (int p = 0; p < TJAPlayer3.ConfigIni.nPlayerCount; p++) - { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) { + for (int p = 0; p < TJAPlayer3.ConfigIni.nPlayerCount; p++) { var ccf = TJAPlayer3.stage演奏ドラム画面.CChartScore[p]; this.nクリア[p] = 0; - if (HGaugeMethods.UNSAFE_FastNormaCheck(p)) - { + if (HGaugeMethods.UNSAFE_FastNormaCheck(p)) { this.nクリア[p] = 2; - if (ccf.nMiss == 0 && ccf.nMine == 0) - { + if (ccf.nMiss == 0 && ccf.nMine == 0) { this.nクリア[p] = 3; if (ccf.nGood == 0) this.nクリア[p] = 4; } @@ -190,29 +172,24 @@ namespace TJAPlayer3 clearStatuses[p] = this.nクリア[p] - 1; - } - - if ((int)TJAPlayer3.stage演奏ドラム画面.actScore.Get(p) < 500000) - { - this.nスコアランク[p] = 0; } - else - { + + if ((int)TJAPlayer3.stage演奏ドラム画面.actScore.Get(p) < 500000) { + this.nスコアランク[p] = 0; + } else { var sr = TJAPlayer3.stage演奏ドラム画面.ScoreRank.ScoreRank[p]; - for (int i = 0; i < 7; i++) - { - if ((int)TJAPlayer3.stage演奏ドラム画面.actScore.Get(p) >= sr[i]) - { + for (int i = 0; i < 7; i++) { + if ((int)TJAPlayer3.stage演奏ドラム画面.actScore.Get(p) >= sr[i]) { this.nスコアランク[p] = i + 1; } } } scoreRanks[p] = this.nスコアランク[p] - 1; - } + } + - } //--------------------- @@ -223,16 +200,14 @@ namespace TJAPlayer3 // Clear and score ranks - - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) - { - // Regular (Ensou game) Score and Score Rank saves - #region [Regular saves] + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) { + // Regular (Ensou game) Score and Score Rank saves - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { + #region [Regular saves] + + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { int diff = TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]; ClearStatus_Replay[i] = this.nクリア[i]; @@ -241,9 +216,7 @@ namespace TJAPlayer3 #endregion - } - else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - { + } else if (TJAPlayer3.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) @@ -261,8 +234,7 @@ namespace TJAPlayer3 int clearValue = 0; - if (examStatus != Exam.Status.Failure) - { + if (examStatus != Exam.Status.Failure) { // Red Goukaku clearValue += 1; @@ -271,8 +243,7 @@ namespace TJAPlayer3 clearValue += 1; // Gold Iki - if (this.st演奏記録.Drums.nBadCount == 0) - { + if (this.st演奏記録.Drums.nBadCount == 0) { clearValue += 2; // Rainbow Iki @@ -283,18 +254,16 @@ namespace TJAPlayer3 if (assistedClear[0]) clearStatuses[0] = (examStatus == Exam.Status.Better_Success) ? 1 : 0; else clearStatuses[0] = clearValue + 1; - } + } - if (isAutoDisabled(0)) - { + 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 && !TJAPlayer3.ConfigIni.bAutoPlay[0]) - { + if (clearValue > 0 && !TJAPlayer3.ConfigIni.bAutoPlay[0]) { /* this.newGradeGranted = TJAPlayer3.NamePlateConfig.tUpdateDanTitle(TJAPlayer3.stage選曲.r確定された曲.strタイトル.Substring(0, 2), clearValue % 2 == 0, @@ -302,16 +271,14 @@ namespace TJAPlayer3 TJAPlayer3.SaveFile); */ - this.newGradeGranted = TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].tUpdateDanTitle(TJAPlayer3.stageSongSelect.rChoosenSong.ldTitle.GetString("").Substring(0, 2), - clearValue % 2 == 0, - (clearValue - 1) / 2); - } + this.newGradeGranted = TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].tUpdateDanTitle(TJAPlayer3.stageSongSelect.rChoosenSong.ldTitle.GetString("").Substring(0, 2), + clearValue % 2 == 0, + (clearValue - 1) / 2); + } #endregion - } - else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - { + } else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { // Clear if top reached, then FC or DFC like any regular chart // Score Rank cointains highest reached floor @@ -321,8 +288,7 @@ namespace TJAPlayer3 if (tmpClear != 0) clearStatuses[0] = assistedClear[0] ? 0 : tmpClear; - if (isAutoDisabled(0)) - { + if (isAutoDisabled(0)) { ClearStatus_Replay[0] = tmpClear; } @@ -330,13 +296,12 @@ namespace TJAPlayer3 } - //--------------------- - #endregion + //--------------------- + #endregion } - string diffToString(int diff) - { + string diffToString(int diff) { string[] diffArr = { " Easy ", @@ -361,25 +326,22 @@ namespace TJAPlayer3 } string details = TJAPlayer3.ConfigIni.SendDiscordPlayingInformation ? TJAPlayer3.stageSongSelect.rChoosenSong.ldTitle.GetString("") - + diffToString(TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]) : ""; + + diffToString(TJAPlayer3.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) - { + 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の更新 - TJAPlayer3.DiscordClient?.SetPresence(new RichPresence() - { + TJAPlayer3.DiscordClient?.SetPresence(new RichPresence() { Details = details, State = "Result" + (TJAPlayer3.ConfigIni.bAutoPlay[0] == true ? " (Auto)" : ""), Timestamps = new Timestamps(TJAPlayer3.StartupTime), - Assets = new Assets() - { + Assets = new Assets() { LargeImageKey = TJAPlayer3.LargeImageKey, LargeImageText = TJAPlayer3.LargeImageText, } @@ -394,7 +356,7 @@ namespace TJAPlayer3 this.nEarnedMedalsCount[3] = 0; this.nEarnedMedalsCount[4] = 0; - + // Medals @@ -416,8 +378,7 @@ namespace TJAPlayer3 TJAPlayer3.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.COINS, false, 4) }; - float getCoinMul(int player) - { + float getCoinMul(int player) { var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character]; var puchichara = TJAPlayer3.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(TJAPlayer3.GetActualPlayer(player))]; @@ -425,8 +386,7 @@ namespace TJAPlayer3 return chara.GetEffectCoinMultiplier() * puchichara.GetEffectCoinMultiplier(); } - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { diffModifier = 3; int stars = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[(int)Difficulty.Tower].譜面情報.nレベル[(int)Difficulty.Tower]; @@ -442,24 +402,20 @@ namespace TJAPlayer3 #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); - } - } + + 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 (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - { + } else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { int partialScore = 0; #region [Clear and Goukaku modifier] @@ -469,11 +425,9 @@ namespace TJAPlayer3 int clearModifier = -1; int goukakuModifier = 0; - if (examStatus != Exam.Status.Failure) - { + if (examStatus != Exam.Status.Failure) { clearModifier = 0; - if (this.st演奏記録.Drums.nBadCount == 0) - { + if (this.st演奏記録.Drums.nBadCount == 0) { clearModifier = 4; if (this.st演奏記録.Drums.nOkCount == 0) clearModifier = 6; @@ -487,10 +441,8 @@ namespace TJAPlayer3 #region [Partial scores] - for (int i = 0; i < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count; i++) - { - if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[i] != null) - { + for (int i = 0; i < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count; i++) { + if (TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[i] != null) { int diff = TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[i].Difficulty; int stars = TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[i].Level; @@ -508,16 +460,12 @@ namespace TJAPlayer3 if (clearModifier < 0) this.nEarnedMedalsCount[0] = 10; - else - { + 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 < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { + } else { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { int diff = TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[i]; int stars = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[diff].譜面情報.nレベル[diff]; @@ -532,17 +480,15 @@ namespace TJAPlayer3 int clearModifier = modifiers[0]; - if (HGaugeMethods.UNSAFE_FastNormaCheck(i)) - { + if (HGaugeMethods.UNSAFE_FastNormaCheck(i)) { clearModifier = modifiers[1] * diffModifier; - if (TJAPlayer3.stage演奏ドラム画面.CChartScore[i].nMiss == 0) - { + if (TJAPlayer3.stage演奏ドラム画面.CChartScore[i].nMiss == 0) { clearModifier = modifiers[2] * diffModifier; if (TJAPlayer3.stage演奏ドラム画面.CChartScore[i].nGood == 0) clearModifier = modifiers[3] * diffModifier; } } - + #endregion #region [Score rank modifier] @@ -553,8 +499,7 @@ namespace TJAPlayer3 int scoreRankModifier = srModifiers[0] * diffModifier; - for (int j = 1; j < 8; j++) - { + for (int j = 1; j < 8; j++) { if (TJAPlayer3.stage演奏ドラム画面.actScore.GetScore(i) >= TJAPlayer3.stage演奏ドラム画面.ScoreRank.ScoreRank[i][j - 1]) scoreRankModifier = srModifiers[j] * diffModifier; } @@ -567,8 +512,7 @@ namespace TJAPlayer3 if (clearModifier < 0) this.nEarnedMedalsCount[i] = 5; - else - { + 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))); } @@ -576,8 +520,7 @@ namespace TJAPlayer3 } // ADLIB bonuses : 1 coin per ADLIB - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { + for (int i = 0; i < TJAPlayer3.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); @@ -588,28 +531,24 @@ namespace TJAPlayer3 var _sf = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(i)]; - if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 0) - { + if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 0) { _sf.tRegisterAIBattleModePlay(bClear[0]); - } + } if (this.nEarnedMedalsCount[i] > 0) _sf.tEarnCoins(this.nEarnedMedalsCount[i]); if (!TJAPlayer3.ConfigIni.bAutoPlay[i] - && !(TJAPlayer3.ConfigIni.bAIBattleMode && i == 1)) - { + && !(TJAPlayer3.ConfigIni.bAIBattleMode && i == 1)) { int _cs = -1; - if (HGaugeMethods.UNSAFE_FastNormaCheck(i)) - { - _cs = 0; - if (TJAPlayer3.stage演奏ドラム画面.CChartScore[i].nMiss == 0) - { - _cs = 1; - if (TJAPlayer3.stage演奏ドラム画面.CChartScore[i].nGood == 0) - _cs = 2; - } - } + if (HGaugeMethods.UNSAFE_FastNormaCheck(i)) { + _cs = 0; + if (TJAPlayer3.stage演奏ドラム画面.CChartScore[i].nMiss == 0) { + _cs = 1; + if (TJAPlayer3.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]); @@ -623,8 +562,7 @@ namespace TJAPlayer3 #region [Replay files generation] - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { if (TJAPlayer3.ConfigIni.bAutoPlay[i]) continue; if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) @@ -637,52 +575,42 @@ namespace TJAPlayer3 #region [Modals preprocessing] - if (TJAPlayer3.ConfigIni.nPlayerCount == 1 || TJAPlayer3.ConfigIni.bAIBattleMode) - { + if (TJAPlayer3.ConfigIni.nPlayerCount == 1 || TJAPlayer3.ConfigIni.bAIBattleMode) { mqModals = new ModalQueue(Modal.EModalFormat.Full); - } - else if(TJAPlayer3.ConfigIni.nPlayerCount == 2) - { + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 2) { mqModals = new ModalQueue(Modal.EModalFormat.Half); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 3 || TJAPlayer3.ConfigIni.nPlayerCount == 4) - { + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 3 || TJAPlayer3.ConfigIni.nPlayerCount == 4) { mqModals = new ModalQueue(Modal.EModalFormat.Half_4P); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { mqModals = new ModalQueue(Modal.EModalFormat.Half_5P); } - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { if (TJAPlayer3.ConfigIni.bAutoPlay[i] || TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) continue; - if (this.nEarnedMedalsCount[i] > 0) + if (this.nEarnedMedalsCount[i] > 0) mqModals.tAddModal( new Modal( - Modal.EModalType.Coin, + Modal.EModalType.Coin, 0, - this.nEarnedMedalsCount[i]), + this.nEarnedMedalsCount[i]), i); // Check unlockables { - TJAPlayer3.Databases.DBNameplateUnlockables.tGetUnlockedItems(i, mqModals); + TJAPlayer3.Databases.DBNameplateUnlockables.tGetUnlockedItems(i, mqModals); TJAPlayer3.Databases.DBSongUnlockables.tGetUnlockedItems(i, mqModals); - foreach (var puchi in TJAPlayer3.Tx.Puchichara) - { - puchi.tGetUnlockedItems(i, mqModals); - } + foreach (var puchi in TJAPlayer3.Tx.Puchichara) { + puchi.tGetUnlockedItems(i, mqModals); + } - foreach (var chara in TJAPlayer3.Tx.Characters) - { - chara.tGetUnlockedItems(i, mqModals); - } - } - - } + foreach (var chara in TJAPlayer3.Tx.Characters) { + chara.tGetUnlockedItems(i, mqModals); + } + } + + } displayedModals = new Modal[] { null, null, null, null, null }; @@ -694,11 +622,11 @@ namespace TJAPlayer3 this.ctPhase2 = null; this.ctPhase3 = null; examsShift = 0; - + Dan_Plate = TJAPlayer3.tテクスチャの生成(Path.GetDirectoryName(TJAPlayer3.DTX.strファイル名の絶対パス) + @$"{Path.DirectorySeparatorChar}Dan_Plate.png"); base.Activate(); - + ctShine_Plate = new CCounter(0, 1000, 1, TJAPlayer3.Timer); ctWork_Plate = new CCounter(0, 4000, 1, TJAPlayer3.Timer); @@ -711,12 +639,11 @@ namespace TJAPlayer3 ctDanSongInfoChange = new CCounter(0, 3000, 1, TJAPlayer3.Timer); ctDanSongInfoChange.CurrentValue = 255; - + b音声再生 = false; this.EndAnime = false; - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { this.ttkMaxFloors = new TitleTextureKey("/" + TJAPlayer3.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"), pfTowerText, Color.Black, Color.Transparent, 700); @@ -724,19 +651,13 @@ namespace TJAPlayer3 this.ttkScore = new TitleTextureKey(CLangManager.LangInstance.GetString("TOWER_SCORE_INITIAL"), 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(TJAPlayer3.stage演奏ドラム画面.actScore.GetScore(0).ToString(), pfTowerText, Color.Black, Color.Transparent, 700); - } - else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - { + } else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { Background = new ResultBG(CSkin.Path($@"{TextureLoader.BASE}{TextureLoader.DANRESULT}Script.lua")); Background.Init(); - } - else if (TJAPlayer3.ConfigIni.bAIBattleMode) - { + } else if (TJAPlayer3.ConfigIni.bAIBattleMode) { Background = new ResultBG(CSkin.Path($@"{TextureLoader.BASE}{TextureLoader.RESULT}AIBattle{Path.DirectorySeparatorChar}Script.lua")); Background.Init(); - } - else - { + } else { //Luaに移植する時にコメントアウトを解除 Background = new ResultBG(CSkin.Path($@"{TextureLoader.BASE}{TextureLoader.RESULT}{Path.DirectorySeparatorChar}Script.lua")); Background.Init(); @@ -744,19 +665,16 @@ namespace TJAPlayer3 this.ttkDanTitles = new TitleTextureKey[TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count]; - for (int i = 0; i < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count; i++) - { + for (int i = 0; i < TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count; i++) { this.ttkDanTitles[i] = new TitleTextureKey(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[i].bTitleShow - ? "???" - : TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[i].Title, - pfDanTitles, - Color.White, - Color.Black, + ? "???" + : TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs[i].Title, + pfDanTitles, + Color.White, + Color.Black, 700); } - } - finally - { + } finally { Trace.TraceInformation("結果ステージの活性化を完了しました。"); Trace.Unindent(); } @@ -764,82 +682,66 @@ namespace TJAPlayer3 if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) bgmResultIn.tPlay(); } - public override void DeActivate() - { + public override void DeActivate() { TJAPlayer3.tDisposeSafely(ref Background); - if (this.rResultSound != null) - { + if (this.rResultSound != null) { TJAPlayer3.SoundManager.tDisposeSound(this.rResultSound); this.rResultSound = null; } - if (this.ct登場用 != null) - { + if (this.ct登場用 != null) { this.ct登場用 = null; } Dan_Plate?.Dispose(); - + base.DeActivate(); } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { this.pfTowerText = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.TowerResult_Font_TowerText); this.pfTowerText48 = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.TowerResult_Font_TowerText48); this.pfTowerText72 = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.TowerResult_Font_TowerText72); - + this.pfDanTitles = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.DanResult_Font_DanTitles_Size); base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { TJAPlayer3.tDisposeSafely(ref pfTowerText); TJAPlayer3.tDisposeSafely(ref pfTowerText48); TJAPlayer3.tDisposeSafely(ref pfTowerText72); - } - else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - { + } else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { TJAPlayer3.tDisposeSafely(ref pfDanTitles); } base.ReleaseManagedResource(); } - public override int Draw() - { - if (!base.IsDeActivated) - { + public override int Draw() { + if (!base.IsDeActivated) { ctShine_Plate.TickLoop(); // int num; - - if (base.IsFirstDraw) - { + + if (base.IsFirstDraw) { this.ct登場用 = new CCounter(0, 100, 5, TJAPlayer3.Timer); this.actFI.tフェードイン開始(); base.ePhaseID = CStage.EPhase.Common_FADEIN; - if (this.rResultSound != null) - { + if (this.rResultSound != null) { this.rResultSound.PlayStart(); } base.IsFirstDraw = false; } this.bアニメが完了 = true; - if (this.ct登場用.IsTicked) - { + if (this.ct登場用.IsTicked) { this.ct登場用.Tick(); - if (this.ct登場用.IsEnded) - { + if (this.ct登場用.IsEnded) { this.ct登場用.Stop(); - } - else - { + } else { this.bアニメが完了 = false; } } @@ -849,17 +751,14 @@ namespace TJAPlayer3 Background?.Update(); Background?.Draw(); - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) - { - #region [Ensou game result screen] + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) { + #region [Ensou game result screen] - if (!b音声再生 && !bgmResultIn.bIsPlaying) - { + if (!b音声再生 && !bgmResultIn.bIsPlaying) { bgmResultLoop.tPlay(); b音声再生 = true; } - if (!TJAPlayer3.ConfigIni.bAIBattleMode) - { + if (!TJAPlayer3.ConfigIni.bAIBattleMode) { /* if (TJAPlayer3.Tx.Result_Background != null) { @@ -1107,17 +1006,15 @@ namespace TJAPlayer3 } } */ - if (TJAPlayer3.Tx.Result_Header != null) - { + if (TJAPlayer3.Tx.Result_Header != null) { TJAPlayer3.Tx.Result_Header.t2D描画(0, 0); } } - if (this.ct登場用.IsTicked && (TJAPlayer3.Tx.Result_Header != null)) - { + if (this.ct登場用.IsTicked && (TJAPlayer3.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; } /* @@ -1127,8 +1024,7 @@ namespace TJAPlayer3 } */ - if (!b音声再生 && !bgmResultIn.bIsPlaying) - { + if (!b音声再生 && !bgmResultIn.bIsPlaying) { bgmResultLoop.tPlay(); b音声再生 = true; } @@ -1136,11 +1032,8 @@ namespace TJAPlayer3 #endregion - } - else - { - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - { + } else { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { double screen_ratio_x = TJAPlayer3.Skin.Resolution[0] / 1280.0; #region [Counter processings] @@ -1154,12 +1047,11 @@ namespace TJAPlayer3 ** 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) - { + if (ctPhase1 == null) { ctPhase1 = new CCounter(0, 8200 + songCount * 300, 0.5f, TJAPlayer3.Timer); ctPhase1.CurrentValue = 0; } - + ctPhase1.Tick(); if (ctPhase2 != null) @@ -1170,8 +1062,7 @@ namespace TJAPlayer3 #region [DaniDoujou result screen] - if (!b音声再生 && !TJAPlayer3.Skin.bgmDanResult.bIsPlaying) - { + if (!b音声再生 && !TJAPlayer3.Skin.bgmDanResult.bIsPlaying) { TJAPlayer3.Skin.bgmDanResult.tPlay(); b音声再生 = true; } @@ -1198,17 +1089,13 @@ namespace TJAPlayer3 ctDanSongInfoChange.Tick(); - if (ctDanSongInfoChange.CurrentValue == ctDanSongInfoChange.EndValue && songCount > 3) - { + if (ctDanSongInfoChange.CurrentValue == ctDanSongInfoChange.EndValue && songCount > 3) { NextDanSongInfo(); - } - else if(nNowDanSongInfo > 0 && songCount <= 3) - { + } else if (nNowDanSongInfo > 0 && songCount <= 3) { nNowDanSongInfo = 0; - } + } - for (int i = 0; i < songCount; i++) - { + 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; @@ -1239,32 +1126,25 @@ namespace TJAPlayer3 int unitsBeforeAppearance = Math.Max(0, 8200 + 300 * songCount - ctPhase1.CurrentValue); - if (unitsBeforeAppearance <= 270) - { + if (unitsBeforeAppearance <= 270) { TJAPlayer3.Tx.DanResult_Rank.Opacity = 255; int rank_width = TJAPlayer3.Tx.DanResult_Rank.szTextureSize.Width / 7; int rank_height = TJAPlayer3.Tx.DanResult_Rank.szTextureSize.Height; - if (examStatus != Exam.Status.Failure) - { + if (examStatus != Exam.Status.Failure) { #region [Goukaku] #region [ Appear animation ] - if (unitsBeforeAppearance >= 90) - { + if (unitsBeforeAppearance >= 90) { TJAPlayer3.Tx.DanResult_Rank.Opacity = (int)((270 - unitsBeforeAppearance) / 180.0f * 255.0f); TJAPlayer3.Tx.DanResult_Rank.vcScaleRatio.X = 1.0f + (float)Math.Sin((360 - unitsBeforeAppearance) / 1.5f * (Math.PI / 180)) * 1.4f; TJAPlayer3.Tx.DanResult_Rank.vcScaleRatio.Y = 1.0f + (float)Math.Sin((360 - unitsBeforeAppearance) / 1.5f * (Math.PI / 180)) * 1.4f; - } - else if (unitsBeforeAppearance > 0) - { + } else if (unitsBeforeAppearance > 0) { TJAPlayer3.Tx.Result_ScoreRankEffect.vcScaleRatio.X = 0.5f + (float)Math.Sin((float)(90 - unitsBeforeAppearance) * (Math.PI / 180)) * 0.5f; TJAPlayer3.Tx.Result_ScoreRankEffect.vcScaleRatio.Y = 0.5f + (float)Math.Sin((float)(90 - unitsBeforeAppearance) * (Math.PI / 180)) * 0.5f; - } - else - { + } else { TJAPlayer3.Tx.DanResult_Rank.vcScaleRatio.X = 1f; TJAPlayer3.Tx.DanResult_Rank.vcScaleRatio.Y = 1f; } @@ -1279,8 +1159,7 @@ namespace TJAPlayer3 successType += 1; int comboType = 0; - if (this.st演奏記録.Drums.nBadCount == 0) - { + if (this.st演奏記録.Drums.nBadCount == 0) { comboType += 1; if (this.st演奏記録.Drums.nOkCount == 0) @@ -1289,19 +1168,16 @@ namespace TJAPlayer3 #endregion - TJAPlayer3.Tx.DanResult_Rank.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.DanResult_Rank[0], TJAPlayer3.Skin.DanResult_Rank[1], + TJAPlayer3.Tx.DanResult_Rank.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.DanResult_Rank[0], TJAPlayer3.Skin.DanResult_Rank[1], new Rectangle(rank_width * (2 * comboType + successType + 1), 0, rank_width, rank_height)); #endregion - } - else - { + } else { #region [Fugoukaku] #region [ Appear animation ] - if (unitsBeforeAppearance >= 90) - { + if (unitsBeforeAppearance >= 90) { TJAPlayer3.Tx.DanResult_Rank.Opacity = (int)((270 - unitsBeforeAppearance) / 180.0f * 255.0f); } @@ -1310,7 +1186,7 @@ namespace TJAPlayer3 #endregion - TJAPlayer3.Tx.DanResult_Rank.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.DanResult_Rank[0], TJAPlayer3.Skin.DanResult_Rank[1] - (unitsBeforeAppearance / 10f), + TJAPlayer3.Tx.DanResult_Rank.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.DanResult_Rank[0], TJAPlayer3.Skin.DanResult_Rank[1] - (unitsBeforeAppearance / 10f), new Rectangle(0, 0, rank_width, rank_height)); #endregion @@ -1319,21 +1195,17 @@ namespace TJAPlayer3 #endregion - if (!b音声再生 && !TJAPlayer3.Skin.bgmDanResult.bIsPlaying) - { + if (!b音声再生 && !TJAPlayer3.Skin.bgmDanResult.bIsPlaying) { TJAPlayer3.Skin.bgmDanResult.tPlay(); b音声再生 = true; } #endregion - } - else - { + } else { #region [Tower result screen] - if (!b音声再生 && !TJAPlayer3.Skin.bgmTowerResult.bIsPlaying) - { + if (!b音声再生 && !TJAPlayer3.Skin.bgmTowerResult.bIsPlaying) { TJAPlayer3.Skin.bgmTowerResult.tPlay(); b音声再生 = true; } @@ -1342,10 +1214,9 @@ namespace TJAPlayer3 this.ctTower_Animation.Tick(); - #region [Tower background] + #region [Tower background] - if (TJAPlayer3.Skin.Game_Tower_Ptn_Result > 0) - { + if (TJAPlayer3.Skin.Game_Tower_Ptn_Result > 0) { int xFactor = 0; float yFactor = 1f; @@ -1354,8 +1225,7 @@ namespace TJAPlayer3 if (currentTowerType < 0 || currentTowerType >= TJAPlayer3.Skin.Game_Tower_Ptn_Result) currentTowerType = 0; - if (TJAPlayer3.Tx.TowerResult_Background != null && TJAPlayer3.Tx.TowerResult_Tower[currentTowerType] != null) - { + if (TJAPlayer3.Tx.TowerResult_Background != null && TJAPlayer3.Tx.TowerResult_Tower[currentTowerType] != null) { xFactor = (TJAPlayer3.Tx.TowerResult_Background.szTextureSize.Width - TJAPlayer3.Tx.TowerResult_Tower[currentTowerType].szTextureSize.Width) / 2; yFactor = TJAPlayer3.Tx.TowerResult_Tower[currentTowerType].szTextureSize.Height / (float)TJAPlayer3.Tx.TowerResult_Background.szTextureSize.Height; } @@ -1374,8 +1244,7 @@ namespace TJAPlayer3 TJAPlayer3.actTextConsole.tPrint(0, 40, CTextConsole.EFontType.White, sc.ToString()); - if (sc >= 0 && TJAPlayer3.Tx.TowerResult_ScoreRankEffect != null) - { + if (sc >= 0 && TJAPlayer3.Tx.TowerResult_ScoreRankEffect != null) { int scoreRankEffect_width = TJAPlayer3.Tx.TowerResult_ScoreRankEffect.szTextureSize.Width / 7; int scoreRankEffect_height = TJAPlayer3.Tx.TowerResult_ScoreRankEffect.szTextureSize.Height; @@ -1387,7 +1256,7 @@ namespace TJAPlayer3 TJAPlayer3.Skin.TowerResult_ScoreRankEffect[1], new Rectangle(sc * scoreRankEffect_width, 0, scoreRankEffect_width, scoreRankEffect_height)); } - + #endregion @@ -1414,8 +1283,7 @@ namespace TJAPlayer3 #endregion - if (!b音声再生 && !TJAPlayer3.Skin.bgmTowerResult.bIsPlaying) - { + if (!b音声再生 && !TJAPlayer3.Skin.bgmTowerResult.bIsPlaying) { TJAPlayer3.Skin.bgmTowerResult.tPlay(); b音声再生 = true; } @@ -1425,7 +1293,7 @@ namespace TJAPlayer3 } - } + } // Display medals debug @@ -1434,20 +1302,17 @@ namespace TJAPlayer3 - if (this.actParameterPanel.Draw() == 0) - { + if (this.actParameterPanel.Draw() == 0) { this.bアニメが完了 = false; } - if (this.actSongBar.Draw() == 0) - { + if (this.actSongBar.Draw() == 0) { this.bアニメが完了 = false; } #region Nameplate - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { if (TJAPlayer3.ConfigIni.bAIBattleMode && i == 1) break; int pos = i; @@ -1459,22 +1324,17 @@ namespace TJAPlayer3 int modIcons_x; int modIcons_y; - if (TJAPlayer3.ConfigIni.nPlayerCount == 5) - { + if (TJAPlayer3.ConfigIni.nPlayerCount == 5) { namePlate_x = TJAPlayer3.Skin.Result_NamePlate_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; namePlate_y = TJAPlayer3.Skin.Result_NamePlate_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; modIcons_x = TJAPlayer3.Skin.Result_ModIcons_5P[0] + TJAPlayer3.Skin.Result_UIMove_5P_X[pos]; modIcons_y = TJAPlayer3.Skin.Result_ModIcons_5P[1] + TJAPlayer3.Skin.Result_UIMove_5P_Y[pos]; - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) - { + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 4 || TJAPlayer3.ConfigIni.nPlayerCount == 3) { namePlate_x = TJAPlayer3.Skin.Result_NamePlate_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[pos]; namePlate_y = TJAPlayer3.Skin.Result_NamePlate_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[pos]; modIcons_x = TJAPlayer3.Skin.Result_ModIcons_4P[0] + TJAPlayer3.Skin.Result_UIMove_4P_X[pos]; modIcons_y = TJAPlayer3.Skin.Result_ModIcons_4P[1] + TJAPlayer3.Skin.Result_UIMove_4P_Y[pos]; - } - else - { + } else { namePlate_x = TJAPlayer3.Skin.Result_NamePlate_X[pos]; namePlate_y = TJAPlayer3.Skin.Result_NamePlate_Y[pos]; modIcons_x = TJAPlayer3.Skin.Result_ModIcons_X[pos]; @@ -1498,23 +1358,19 @@ namespace TJAPlayer3 #region [Display modals] // Display modal is present - for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) { if (displayedModals[i] != null) displayedModals[i].tDisplayModal(); } #endregion - if (base.ePhaseID == CStage.EPhase.Common_FADEIN) - { - if (this.actFI.Draw() != 0) - { + 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 ) ) - { + } else if ((base.ePhaseID == CStage.EPhase.Common_FADEOUT)) //&& ( this.actFO.On進行描画() != 0 ) ) + { return (int)this.eフェードアウト完了時の戻り値; } @@ -1522,10 +1378,10 @@ namespace TJAPlayer3 if (this.bアニメが完了 == true && this.bIsCheckedWhetherResultScreenShouldSaveOrNot == false // #24609 2011.3.14 yyagi; to save result screen in case BestRank or HiSkill. && TJAPlayer3.ConfigIni.bIsAutoResultCapture) // #25399 2011.6.9 yyagi { - string strFullPath = - Path.Combine(TJAPlayer3.strEXEのあるフォルダ, "Capture_img"); - strFullPath = Path.Combine(strFullPath, DateTime.Now.ToString("yyyyMMddHHmmss") + ".png"); - TJAPlayer3.app.SaveResultScreen(strFullPath); + string strFullPath = + Path.Combine(TJAPlayer3.strEXEのあるフォルダ, "Capture_img"); + strFullPath = Path.Combine(strFullPath, DateTime.Now.ToString("yyyyMMddHHmmss") + ".png"); + TJAPlayer3.app.SaveResultScreen(strFullPath); this.bIsCheckedWhetherResultScreenShouldSaveOrNot = true; } @@ -1533,12 +1389,9 @@ namespace TJAPlayer3 // キー入力 - if (TJAPlayer3.act現在入力を占有中のプラグイン == null) - { - if (base.ePhaseID == CStage.EPhase.Common_NORMAL) - { - if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) - { + if (TJAPlayer3.act現在入力を占有中のプラグイン == null) { + if (base.ePhaseID == CStage.EPhase.Common_NORMAL) { + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) { #region [ Return to song select screen (Faster method) ] bgmResultLoop.tStop(); @@ -1546,7 +1399,7 @@ namespace TJAPlayer3 TJAPlayer3.Skin.bgmTowerResult.tStop(); TJAPlayer3.Skin.soundDecideSFX.tPlay(); actFI.tフェードアウト開始(); - + if (TJAPlayer3.latestSongSelect == TJAPlayer3.stageSongSelect)// TJAPlayer3.stage選曲.n確定された曲の難易度[0] != (int)Difficulty.Dan) if (TJAPlayer3.stageSongSelect.rNowSelectedSong.rParentNode != null) TJAPlayer3.stageSongSelect.actSongList.tCloseBOX(); @@ -1557,43 +1410,35 @@ namespace TJAPlayer3 #endregion } - if (((TJAPlayer3.Pad.bPressedDGB(EPad.CY) - || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RD)) - || (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LC) - || (TJAPlayer3.Pad.bPressedDGB(EPad.Decide) - || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))))) - { + if (((TJAPlayer3.Pad.bPressedDGB(EPad.CY) + || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RD)) + || (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LC) + || (TJAPlayer3.Pad.bPressedDGB(EPad.Decide) + || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))))) { TJAPlayer3.Skin.soundDecideSFX.tPlay(); - #region [ Skip animations ] + #region [ Skip animations ] - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] < (int)Difficulty.Tower - && this.actParameterPanel.ctMainCounter.CurrentValue < this.actParameterPanel.MountainAppearValue) - { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] < (int)Difficulty.Tower + && this.actParameterPanel.ctMainCounter.CurrentValue < this.actParameterPanel.MountainAppearValue) { this.actParameterPanel.tSkipResultAnimations(); - } - else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan - && (ctPhase1 != null && ctPhase1.IsUnEnded)) - { + } else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan + && (ctPhase1 != null && ctPhase1.IsUnEnded)) { ctPhase1.CurrentValue = (int)ctPhase1.EndValue; - } + } #endregion - else - { - if (!mqModals.tIsQueueEmpty(0) + else { + if (!mqModals.tIsQueueEmpty(0) && ( TJAPlayer3.Pad.bPressedDGB(EPad.Decide) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) ) - ) - { + ) { displayedModals[0] = mqModals.tPopModal(0); displayedModals[0]?.tPlayModalSfx(); - } - else if (TJAPlayer3.ConfigIni.nPlayerCount == 1 || mqModals.tAreBothQueuesEmpty()) - { + } else if (TJAPlayer3.ConfigIni.nPlayerCount == 1 || mqModals.tAreBothQueuesEmpty()) { #region [ Return to song select screen ] actFI.tフェードアウト開始(); @@ -1615,52 +1460,41 @@ namespace TJAPlayer3 #endregion } } - } - else if ((TJAPlayer3.ConfigIni.nPlayerCount > 1 && ( - TJAPlayer3.Pad.bPressedDGB(EPad.LRed2P) - || TJAPlayer3.Pad.bPressedDGB(EPad.RRed2P) - ))) { - if (!mqModals.tIsQueueEmpty(1) && this.actParameterPanel.ctMainCounter.CurrentValue >= this.actParameterPanel.MountainAppearValue) - { + } else if ((TJAPlayer3.ConfigIni.nPlayerCount > 1 && ( + TJAPlayer3.Pad.bPressedDGB(EPad.LRed2P) + || TJAPlayer3.Pad.bPressedDGB(EPad.RRed2P) + ))) { + if (!mqModals.tIsQueueEmpty(1) && this.actParameterPanel.ctMainCounter.CurrentValue >= this.actParameterPanel.MountainAppearValue) { TJAPlayer3.Skin.soundDecideSFX.tPlay(); displayedModals[1] = mqModals.tPopModal(1); displayedModals[1]?.tPlayModalSfx(); } - } - else if ((TJAPlayer3.ConfigIni.nPlayerCount > 2 && ( - TJAPlayer3.Pad.bPressedDGB(EPad.LRed3P) - || TJAPlayer3.Pad.bPressedDGB(EPad.RRed3P) - ))) - { - if (!mqModals.tIsQueueEmpty(2) && this.actParameterPanel.ctMainCounter.CurrentValue >= this.actParameterPanel.MountainAppearValue) - { + } else if ((TJAPlayer3.ConfigIni.nPlayerCount > 2 && ( + TJAPlayer3.Pad.bPressedDGB(EPad.LRed3P) + || TJAPlayer3.Pad.bPressedDGB(EPad.RRed3P) + ))) { + if (!mqModals.tIsQueueEmpty(2) && this.actParameterPanel.ctMainCounter.CurrentValue >= this.actParameterPanel.MountainAppearValue) { TJAPlayer3.Skin.soundDecideSFX.tPlay(); displayedModals[2] = mqModals.tPopModal(2); displayedModals[2]?.tPlayModalSfx(); } - } - else if ((TJAPlayer3.ConfigIni.nPlayerCount > 3 && ( - TJAPlayer3.Pad.bPressedDGB(EPad.LRed4P) - || TJAPlayer3.Pad.bPressedDGB(EPad.RRed4P) - ))) - { - if (!mqModals.tIsQueueEmpty(3) && this.actParameterPanel.ctMainCounter.CurrentValue >= this.actParameterPanel.MountainAppearValue) - { + } else if ((TJAPlayer3.ConfigIni.nPlayerCount > 3 && ( + TJAPlayer3.Pad.bPressedDGB(EPad.LRed4P) + || TJAPlayer3.Pad.bPressedDGB(EPad.RRed4P) + ))) { + if (!mqModals.tIsQueueEmpty(3) && this.actParameterPanel.ctMainCounter.CurrentValue >= this.actParameterPanel.MountainAppearValue) { TJAPlayer3.Skin.soundDecideSFX.tPlay(); displayedModals[3] = mqModals.tPopModal(3); displayedModals[3]?.tPlayModalSfx(); } - } - else if ((TJAPlayer3.ConfigIni.nPlayerCount > 4 && ( - TJAPlayer3.Pad.bPressedDGB(EPad.LRed5P) - || TJAPlayer3.Pad.bPressedDGB(EPad.RRed5P) - ))) - { - if (!mqModals.tIsQueueEmpty(4) && this.actParameterPanel.ctMainCounter.CurrentValue >= this.actParameterPanel.MountainAppearValue) - { + } else if ((TJAPlayer3.ConfigIni.nPlayerCount > 4 && ( + TJAPlayer3.Pad.bPressedDGB(EPad.LRed5P) + || TJAPlayer3.Pad.bPressedDGB(EPad.RRed5P) + ))) { + if (!mqModals.tIsQueueEmpty(4) && this.actParameterPanel.ctMainCounter.CurrentValue >= this.actParameterPanel.MountainAppearValue) { TJAPlayer3.Skin.soundDecideSFX.tPlay(); displayedModals[4] = mqModals.tPopModal(4); @@ -1672,14 +1506,11 @@ namespace TJAPlayer3 if (TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftArrow) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange) || TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightArrow) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange)) - { - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - { + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange)) { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { #region [ Phase 2 (Swap freely between Exams and Songs) ] - if (ctPhase1 != null && ctPhase1.IsEnded && (ctPhase2 == null || ctPhase2.IsEnded)) - { + if (ctPhase1 != null && ctPhase1.IsEnded && (ctPhase2 == null || ctPhase2.IsEnded)) { ctPhase2 = new CCounter(0, 1280, 0.5f, TJAPlayer3.Timer); ctPhase2.CurrentValue = 0; @@ -1702,8 +1533,7 @@ namespace TJAPlayer3 #region [Dan result exam information] - private void ftDanDisplayExamInfo(int offset = 0) - { + private void ftDanDisplayExamInfo(int offset = 0) { int baseX = TJAPlayer3.Skin.DanResult_StatePanel[0] + offset; int baseY = TJAPlayer3.Skin.DanResult_StatePanel[1]; @@ -1747,25 +1577,21 @@ namespace TJAPlayer3 #endregion } - #endregion + #endregion - #region [Dan result individual song information] + #region [Dan result individual song information] - private void ftDanDisplaySongInfo(int i, int offset = 0) - { + 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) - { + if (nowIndex == nNowDanSongInfo) { opacity = opacityCounter; - } - else - { + } else { opacity = 255 - opacityCounter; } @@ -1789,9 +1615,9 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Dani_Difficulty_Cymbol.Opacity = opacity; TJAPlayer3.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画(TJAPlayer3.Skin.DanResult_Difficulty_Cymbol_X[drawPos] + offset, TJAPlayer3.Skin.DanResult_Difficulty_Cymbol_Y[drawPos], new Rectangle(song.Difficulty * difficulty_cymbol_width, 0, difficulty_cymbol_width, difficulty_cymbol_height)); - TJAPlayer3.Tx.Dani_Difficulty_Cymbol.Opacity = 255; + TJAPlayer3.Tx.Dani_Difficulty_Cymbol.Opacity = 255; - TJAPlayer3.Tx.Dani_Level_Number.Opacity = opacity; + TJAPlayer3.Tx.Dani_Level_Number.Opacity = opacity; TJAPlayer3.stage段位選択.段位リスト.tLevelNumberDraw(TJAPlayer3.Skin.DanResult_Level_Number_X[drawPos] + offset, TJAPlayer3.Skin.DanResult_Level_Number_Y[drawPos], song.Level); TJAPlayer3.Tx.Dani_Level_Number.Opacity = 255; @@ -1832,11 +1658,9 @@ namespace TJAPlayer3 #endregion - public void tPostprocessing() - { - - if (!bAddedToRecentlyPlayedSongs) - { + public void tPostprocessing() { + + if (!bAddedToRecentlyPlayedSongs) { // Song added to recently added songs here TJAPlayer3.RecentlyPlayedSongs.tAddChart(TJAPlayer3.stageSongSelect.rChoosenSong.uniqueId.data.id); @@ -1846,8 +1670,7 @@ namespace TJAPlayer3 } - public enum E戻り値 : int - { + public enum E戻り値 : int { 継続, 完了 } @@ -1877,41 +1700,32 @@ namespace TJAPlayer3 private CSound rResultSound; public ResultBG Background; - public bool[] bClear - { - get - { - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { + public bool[] bClear { + get { + if (TJAPlayer3.ConfigIni.bAIBattleMode) { int clearCount = 0; - for (int i = 0; i < TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count; i++) - { - if (TJAPlayer3.stage演奏ドラム画面.AIBattleSections[i].End == CStage演奏画面共通.AIBattleSection.EndType.Clear) - { + for (int i = 0; i < TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count; i++) { + if (TJAPlayer3.stage演奏ドラム画面.AIBattleSections[i].End == CStage演奏画面共通.AIBattleSection.EndType.Clear) { clearCount++; } - } + } return new bool[] { clearCount >= TJAPlayer3.stage演奏ドラム画面.AIBattleSections.Count / 2.0, false }; - } - else - { + } else { return new bool[] { TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared[0], TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared[1], TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared[2], TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared[3], TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared[4] }; } } - } + } private CCounter ctDanSongInfoChange; private int nNowDanSongInfo; - private void NextDanSongInfo() - { + private void NextDanSongInfo() { ctDanSongInfoChange = new CCounter(0, 2000, 1, TJAPlayer3.Timer); ctDanSongInfoChange.CurrentValue = 0; nNowDanSongInfo++; - if (nNowDanSongInfo >= Math.Ceiling(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count / 3.0)) - { + if (nNowDanSongInfo >= Math.Ceiling(TJAPlayer3.stageSongSelect.rChoosenSong.DanSongs.Count / 3.0)) { nNowDanSongInfo = 0; } } @@ -1968,31 +1782,21 @@ namespace TJAPlayer3 private CCachedFontRenderer pfTowerText48; private CCachedFontRenderer pfTowerText72; - private CSkin.CSystemSound bgmResultIn - { - get - { - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { + private CSkin.CSystemSound bgmResultIn { + get { + if (TJAPlayer3.ConfigIni.bAIBattleMode) { return TJAPlayer3.Skin.bgmResultIn_AI; - } - else - { + } else { return TJAPlayer3.Skin.bgmリザルトイン音; } } } - private CSkin.CSystemSound bgmResultLoop - { - get - { - if (TJAPlayer3.ConfigIni.bAIBattleMode) - { + private CSkin.CSystemSound bgmResultLoop { + get { + if (TJAPlayer3.ConfigIni.bAIBattleMode) { return TJAPlayer3.Skin.bgmResult_AI; - } - else - { + } else { return TJAPlayer3.Skin.bgmリザルト音; } } diff --git a/OpenTaiko/src/Stages/08.Result/ResultBG.cs b/OpenTaiko/src/Stages/08.Result/ResultBG.cs index e84c3323..acae8bfd 100644 --- a/OpenTaiko/src/Stages/08.Result/ResultBG.cs +++ b/OpenTaiko/src/Stages/08.Result/ResultBG.cs @@ -1,41 +1,26 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NLua; -using FDK; +using NLua; -namespace TJAPlayer3 -{ - class ResultBG : ScriptBG - { - private LuaFunction LuaSkipAnimation; +namespace TJAPlayer3 { + class ResultBG : ScriptBG { + private LuaFunction LuaSkipAnimation; - public ResultBG(string filePath) : base(filePath) - { - if (LuaScript != null) - { - LuaSkipAnimation = LuaScript.GetFunction("skipAnime"); - } - } + 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 9b805ab4..0e08a80b 100644 --- a/OpenTaiko/src/Stages/09.Ending/CStage終了.cs +++ b/OpenTaiko/src/Stages/09.Ending/CStage終了.cs @@ -1,17 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; +using System.Diagnostics; using FDK; -namespace TJAPlayer3 -{ - internal class CStage終了 : CStage - { +namespace TJAPlayer3 { + internal class CStage終了 : CStage { // コンストラクタ - public CStage終了() - { + public CStage終了() { base.eStageID = CStage.EStage.End; base.ePhaseID = CStage.EPhase.Common_NORMAL; base.IsDeActivated = true; @@ -20,64 +14,53 @@ namespace TJAPlayer3 // CStage 実装 - public override void Activate() - { - Trace.TraceInformation( "終了ステージを活性化します。" ); + public override void Activate() { + Trace.TraceInformation("終了ステージを活性化します。"); Trace.Indent(); - try - { + try { this.ct時間稼ぎ = new CCounter(); Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.EXIT}Script.lua")); Background.Init(); base.Activate(); - } - finally - { - Trace.TraceInformation( "終了ステージの活性化を完了しました。" ); + } finally { + Trace.TraceInformation("終了ステージの活性化を完了しました。"); Trace.Unindent(); } } - public override void DeActivate() - { - Trace.TraceInformation( "終了ステージを非活性化します。" ); + public override void DeActivate() { + Trace.TraceInformation("終了ステージを非活性化します。"); Trace.Indent(); - try - { + try { TJAPlayer3.tDisposeSafely(ref Background); base.DeActivate(); - } - finally - { - Trace.TraceInformation( "終了ステージの非活性化を完了しました。" ); + } finally { + Trace.TraceInformation("終了ステージの非活性化を完了しました。"); Trace.Unindent(); } } - public override void CreateManagedResource() - { + 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 ); + // 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() - { + 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背景 ); + //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() - { + public override int Draw() { /* if( !TJAPlayer3.ConfigIni.bEndingAnime ) //2017.01.27 DD { @@ -85,13 +68,11 @@ namespace TJAPlayer3 } */ - if( !base.IsDeActivated ) - { - if( base.IsFirstDraw ) - { + if (!base.IsDeActivated) { + if (base.IsFirstDraw) { TJAPlayer3.Skin.soundゲーム終了音.tPlay(); - this.ct時間稼ぎ.Start( 0, TJAPlayer3.Skin.Exit_Duration, 1, TJAPlayer3.Timer ); - base.IsFirstDraw = false; + this.ct時間稼ぎ.Start(0, TJAPlayer3.Skin.Exit_Duration, 1, TJAPlayer3.Timer); + base.IsFirstDraw = false; } @@ -102,8 +83,7 @@ namespace TJAPlayer3 //TJAPlayer3.Tx.Exit_Background?.t2D描画( 0, 0 ); - if( this.ct時間稼ぎ.IsEnded && !TJAPlayer3.Skin.soundゲーム終了音.bIsPlaying ) - { + if (this.ct時間稼ぎ.IsEnded && !TJAPlayer3.Skin.soundゲーム終了音.bIsPlaying) { return 1; } } @@ -118,11 +98,11 @@ namespace TJAPlayer3 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白; + // 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 561c7811..18843a97 100644 --- a/OpenTaiko/src/Stages/10.ChangeSkin/CStageChangeSkin.cs +++ b/OpenTaiko/src/Stages/10.ChangeSkin/CStageChangeSkin.cs @@ -1,24 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; -using System.Threading; -using System.IO; -using FDK; -using System.Runtime.Serialization.Formatters.Binary; +using System.Diagnostics; -namespace TJAPlayer3 -{ +namespace TJAPlayer3 { /// /// box.defによるスキン変更時に一時的に遷移する、スキン画像の一切無いステージ。 /// - internal class CStageChangeSkin : CStage - { + internal class CStageChangeSkin : CStage { // コンストラクタ - public CStageChangeSkin() - { + public CStageChangeSkin() { base.eStageID = CStage.EStage.ChangeSkin; base.IsDeActivated = true; } @@ -26,62 +16,47 @@ namespace TJAPlayer3 // CStage 実装 - public override void Activate() - { - Trace.TraceInformation( "スキン変更ステージを活性化します。" ); + public override void Activate() { + Trace.TraceInformation("スキン変更ステージを活性化します。"); Trace.Indent(); - try - { + try { base.Activate(); - Trace.TraceInformation( "スキン変更ステージの活性化を完了しました。" ); - } - finally - { + Trace.TraceInformation("スキン変更ステージの活性化を完了しました。"); + } finally { Trace.Unindent(); } } - public override void DeActivate() - { - Trace.TraceInformation( "スキン変更ステージを非活性化します。" ); + public override void DeActivate() { + Trace.TraceInformation("スキン変更ステージを非活性化します。"); Trace.Indent(); - try - { + try { base.DeActivate(); - Trace.TraceInformation( "スキン変更ステージの非活性化を完了しました。" ); - } - finally - { + Trace.TraceInformation("スキン変更ステージの非活性化を完了しました。"); + } finally { Trace.Unindent(); } } - public override void CreateManagedResource() - { - if( !base.IsDeActivated ) - { + public override void CreateManagedResource() { + if (!base.IsDeActivated) { base.CreateManagedResource(); } } - public override void ReleaseManagedResource() - { - if( !base.IsDeActivated ) - { + public override void ReleaseManagedResource() { + if (!base.IsDeActivated) { base.ReleaseManagedResource(); } } - public override int Draw() - { - if( !base.IsDeActivated ) - { - if ( base.IsFirstDraw ) - { + public override int Draw() { + if (!base.IsDeActivated) { + if (base.IsFirstDraw) { base.IsFirstDraw = false; return 0; } - //スキン変更処理 - TJAPlayer3.app.RefreshSkin(); + //スキン変更処理 + TJAPlayer3.app.RefreshSkin(); - return 1; + return 1; } return 0; } @@ -95,8 +70,8 @@ namespace TJAPlayer3 // CDTXMania.Skin.ReloadSkin(); - // CDTXMania.Tx.DisposeTexture(); - // CDTXMania.Tx.LoadTexture(); + // 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 96749fd7..9e46b87d 100644 --- a/OpenTaiko/src/Stages/11.Heya/CHeyaDisplayAssetInformations.cs +++ b/OpenTaiko/src/Stages/11.Heya/CHeyaDisplayAssetInformations.cs @@ -1,123 +1,101 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using FDK; +using FDK; using static TJAPlayer3.CActSelect曲リスト; using Color = System.Drawing.Color; -namespace TJAPlayer3 -{ - class CHeyaDisplayAssetInformations - { - private static TitleTextureKey? ttkDescription = null; +namespace TJAPlayer3 { + class CHeyaDisplayAssetInformations { + private static TitleTextureKey? ttkDescription = null; - private static String ToHex(System.Drawing.Color c) => $"#{c.R:X2}{c.G:X2}{c.B:X2}"; + private static String ToHex(System.Drawing.Color c) => $"#{c.R:X2}{c.G:X2}{c.B:X2}"; - private static int XOrigin - { - get - { - return TJAPlayer3.Skin.Heya_DescriptionTextOrigin[0]; - } - } + private static int XOrigin { + get { + return TJAPlayer3.Skin.Heya_DescriptionTextOrigin[0]; + } + } - private static int YOrigin - { - get - { - return TJAPlayer3.Skin.Heya_DescriptionTextOrigin[1]; - } - } + private static int YOrigin { + get { + return TJAPlayer3.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"; + 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 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"; + var bombFactor = character.effect.BombFactor; - if (ttkDescription is null || ttkDescription.str文字 != description) - { - ttkDescription = new TitleTextureKey(description, pf, Color.White, Color.Black, 1000); - } + 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"; - TJAPlayer3.Tx.Heya_Description_Panel?.t2D描画(0, 0); - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkDescription).t2D描画(XOrigin, YOrigin); - } + 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"; - 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 += "All big notes become Swap notes\n"; - if (puchi.effect.ShowAdlib) description += "ADLib notes become visible\n"; - if (puchi.effect.Autoroll > 0) description += $"Automatic Rolls at {puchi.effect.Autoroll} hits/s\n"; - if (puchi.effect.SplitLane) description += "Split Lanes\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); + } - if (ttkDescription is null || ttkDescription.str文字 != description) - { - ttkDescription = new TitleTextureKey(description, pf, Color.White, Color.Black, 1000); - } + TJAPlayer3.Tx.Heya_Description_Panel?.t2D描画(0, 0); + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkDescription).t2D描画(XOrigin, YOrigin); + } - TJAPlayer3.Tx.Heya_Description_Panel?.t2D描画(0, 0); - TJAPlayer3.stageSongSelect.actSongList.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"; - public static void DisplayNameplateTitleInfo(CCachedFontRenderer pf) - { + if (puchi.effect.AllPurple) description += "All big notes become Swap notes\n"; + if (puchi.effect.ShowAdlib) description += "ADLib notes become visible\n"; + if (puchi.effect.Autoroll > 0) description += $"Automatic Rolls at {puchi.effect.Autoroll} hits/s\n"; + if (puchi.effect.SplitLane) description += "Split Lanes\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); + } - public static void DisplayDanplateInfo(CCachedFontRenderer pf) - { + TJAPlayer3.Tx.Heya_Description_Panel?.t2D描画(0, 0); + TJAPlayer3.stageSongSelect.actSongList.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 997156d0..1b70fd75 100644 --- a/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs +++ b/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -85,7 +85,7 @@ namespace TJAPlayer3 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 + else this.ttkDanTitles[idx] = new TitleTextureKey(item.Key, this.pfHeyaFont, Color.White, Color.Black, 1000); idx++; } @@ -118,7 +118,7 @@ namespace TJAPlayer3 this.titlesKeys[idx] = _ref; idx++; } - + } } @@ -163,7 +163,7 @@ namespace TJAPlayer3 this.tResetOpts(); this.PuchiChara.IdleAnimation(); - + Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.HEYA}Script.lua")); Background.Init(); @@ -173,7 +173,7 @@ namespace TJAPlayer3 public override void DeActivate() { TJAPlayer3.tDisposeSafely(ref Background); - + base.DeActivate(); } @@ -291,11 +291,11 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Puchichara[pos].tx.vcScaleRatio.Y = puchiScale; } - TJAPlayer3.Tx.Puchichara[pos].tx?.t2D拡大率考慮中央基準描画(scroll.Item1 + TJAPlayer3.Skin.Heya_Center_Menu_Box_Item_Offset[0], - scroll.Item2 + TJAPlayer3.Skin.Heya_Center_Menu_Box_Item_Offset[1] + (int)(PuchiChara.sineY), - new Rectangle((PuchiChara.Counter.CurrentValue + 2 * puriColumn) * TJAPlayer3.Skin.Game_PuchiChara[0], - puriRow * TJAPlayer3.Skin.Game_PuchiChara[1], - TJAPlayer3.Skin.Game_PuchiChara[0], + TJAPlayer3.Tx.Puchichara[pos].tx?.t2D拡大率考慮中央基準描画(scroll.Item1 + TJAPlayer3.Skin.Heya_Center_Menu_Box_Item_Offset[0], + scroll.Item2 + TJAPlayer3.Skin.Heya_Center_Menu_Box_Item_Offset[1] + (int)(PuchiChara.sineY), + new Rectangle((PuchiChara.Counter.CurrentValue + 2 * puriColumn) * TJAPlayer3.Skin.Game_PuchiChara[0], + puriRow * TJAPlayer3.Skin.Game_PuchiChara[1], + TJAPlayer3.Skin.Game_PuchiChara[0], TJAPlayer3.Skin.Game_PuchiChara[1])); TJAPlayer3.Tx.Puchichara[pos].tx?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); @@ -434,8 +434,8 @@ namespace TJAPlayer3 /* TJAPlayer3.NamePlate.tNamePlateDisplayNamePlateBase( - scroll.Item1 - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2, - scroll.Item2 - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Height / 24, + 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); @@ -483,7 +483,7 @@ namespace TJAPlayer3 _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; @@ -493,7 +493,7 @@ namespace TJAPlayer3 TJAPlayer3.Tx.NamePlate_Title[iType][TJAPlayer3.NamePlate.ctAnimatedNamePlateTitle.CurrentValue % TJAPlayer3.Skin.Config_NamePlate_Ptn_Title_Boxes[iType]].t2D拡大率考慮上中央基準描画( scroll.Item1, scroll.Item2); - + } */ TJAPlayer3.NamePlate.lcNamePlate.DrawTitlePlate(scroll.Item1, scroll.Item2, 255, iType, tmpTex, _rarity, _titleid); @@ -540,7 +540,7 @@ namespace TJAPlayer3 if (!ctChara_In.IsStarted) { TJAPlayer3.Skin.soundHeyaBGM.tPlay(); - ctChara_In.Start(0, 180, 1.25f, TJAPlayer3.Timer); + ctChara_In.Start(0, 180, 1.25f, TJAPlayer3.Timer); } #region [ キャラ関連 ] @@ -581,7 +581,7 @@ namespace TJAPlayer3 #endregion - + #region [ Inputs ] @@ -739,7 +739,7 @@ namespace TJAPlayer3 TJAPlayer3.SaveFileInstances[iPlayer].data.TitleId = -1; TJAPlayer3.SaveFileInstances[iPlayer].data.TitleRarityInt = 1; } - + TJAPlayer3.NamePlate.tNamePlateRefreshTitles(iPlayer); @@ -762,7 +762,7 @@ namespace TJAPlayer3 else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Cancel)) { - + TJAPlayer3.Skin.soundCancelSFX.tPlay(); if (iCurrentMenu == -1) @@ -778,7 +778,7 @@ namespace TJAPlayer3 this.ttkInfoSection = null; this.tResetOpts(); } - + return 0; } @@ -858,7 +858,7 @@ namespace TJAPlayer3 iPuchiCharaCurrent = PuchiChara.tGetPuchiCharaIndexByName(this.iPlayer); } - + private bool tMove(int off) { @@ -947,7 +947,7 @@ namespace TJAPlayer3 && !TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedCharacters.Contains(TJAPlayer3.Skin.Characters_DirName[iCharacterCurrent])) { string _cond = "???"; - if (HRarity.tRarityToModalInt(TJAPlayer3.Tx.Characters[iCharacterCurrent].metadata.Rarity) + if (HRarity.tRarityToModalInt(TJAPlayer3.Tx.Characters[iCharacterCurrent].metadata.Rarity) < HRarity.tRarityToModalInt("Epic")) _cond = TJAPlayer3.Tx.Characters[iCharacterCurrent].unlock.tConditionMessage(); this.ttkInfoSection = new TitleTextureKey(_cond, this.pfHeyaFont, Color.White, Color.Black, 1000); diff --git a/OpenTaiko/src/Stages/12.OnlineLounge/API.cs b/OpenTaiko/src/Stages/12.OnlineLounge/API.cs index 4429087b..605f73c0 100644 --- a/OpenTaiko/src/Stages/12.OnlineLounge/API.cs +++ b/OpenTaiko/src/Stages/12.OnlineLounge/API.cs @@ -1,150 +1,127 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Net.Http; -using Newtonsoft.Json; +using Newtonsoft.Json; using Newtonsoft.Json.Serialization; -namespace TJAPlayer3 -{ - internal class API - { - public class APICharterInfo - { - public string charter_name; - } +namespace TJAPlayer3 { + internal class API { + public class APICharterInfo { + public string charter_name; + } - public class APIGenreInfo - { - public string genre; - } + 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; + 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; + // Additional + public APICharterInfo charter; + public APIGenreInfo Genre; - [JsonIgnore] - public bool DownloadNow; - } + [JsonIgnore] + public bool DownloadNow; + } - #region [ContractResolver override for properties] + #region [ContractResolver override for properties] - public class SongContractResolver : DefaultContractResolver - { - private Dictionary PropertyMappings { get; set; } + public class SongContractResolver : DefaultContractResolver { + private Dictionary PropertyMappings { get; set; } - private string GetAssignedLanguageValue(Dictionary ens) - { - if (ens.ContainsKey(TJAPlayer3.ConfigIni.sLang)) - return ens[TJAPlayer3.ConfigIni.sLang]; - return ens["default"]; - } + private string GetAssignedLanguageValue(Dictionary ens) { + if (ens.ContainsKey(TJAPlayer3.ConfigIni.sLang)) + return ens[TJAPlayer3.ConfigIni.sLang]; + return ens["default"]; + } - 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 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); - } - } + protected override string ResolvePropertyName(string propertyName) { + string resolvedName = null; + var resolved = this.PropertyMappings.TryGetValue(propertyName, out resolvedName); + return (resolved) ? resolvedName : base.ResolvePropertyName(propertyName); + } + } - #endregion + #endregion - public API(DBCDN.CDNData selectedCDN) - { - cdnData = selectedCDN; - FetchedSongsList = new APISongData[0]; - } + public API(DBCDN.CDNData selectedCDN) { + cdnData = selectedCDN; + FetchedSongsList = new APISongData[0]; + } - public APISongData[] FetchedSongsList; + public APISongData[] FetchedSongsList; - public void tLoadSongsFromInternalCDN() - { - string url = cdnData.BaseUrl + cdnData.SongList; + public void tLoadSongsFromInternalCDN() { + string url = cdnData.BaseUrl + cdnData.SongList; - var _fetched = GetCallAPI(url); + var _fetched = GetCallAPI(url); - _fetched.Wait(); + _fetched.Wait(); - if (_fetched.Result != null) - FetchedSongsList = _fetched.Result; + if (_fetched.Result != null) + FetchedSongsList = _fetched.Result; - } + } - #region [private] + #region [private] - private DBCDN.CDNData cdnData; + private DBCDN.CDNData cdnData; - private async Task GetCallAPI(string url) - { - try - { - using (HttpClient client = new HttpClient()) - { - var response = await client.GetAsync(url).ConfigureAwait(false); + 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); + 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; - } + 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 + #endregion - } + } } diff --git a/OpenTaiko/src/Stages/12.OnlineLounge/CStageOnlineLounge.cs b/OpenTaiko/src/Stages/12.OnlineLounge/CStageOnlineLounge.cs index 2e469df9..b722ab6f 100644 --- a/OpenTaiko/src/Stages/12.OnlineLounge/CStageOnlineLounge.cs +++ b/OpenTaiko/src/Stages/12.OnlineLounge/CStageOnlineLounge.cs @@ -1,808 +1,697 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Diagnostics; using System.Drawing; -using System.Diagnostics; -using System.IO; +using System.Text; using FDK; using static TJAPlayer3.CActSelect曲リスト; -namespace TJAPlayer3 -{ - class CStageOnlineLounge : CStage - { +namespace TJAPlayer3 { + class CStageOnlineLounge : CStage { - public CStageOnlineLounge() - { - base.eStageID = EStage.OnlineLounge; - base.ePhaseID = CStage.EPhase.Common_NORMAL; + public CStageOnlineLounge() { + base.eStageID = EStage.OnlineLounge; + base.ePhaseID = CStage.EPhase.Common_NORMAL; - // Load CActivity objects here - // base.list子Activities.Add(this.act = new CAct()); + // Load CActivity objects here + // base.list子Activities.Add(this.act = new CAct()); - base.ChildActivities.Add(this.actFOtoTitle = new CActFIFOBlack()); + 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"); - } - } + 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 + public override void Activate() { + // On activation - if (base.IsActivated) - return; + if (base.IsActivated) + return; - base.ePhaseID = CStage.EPhase.Common_NORMAL; - this.eフェードアウト完了時の戻り値 = EReturnValue.Continuation; + base.ePhaseID = CStage.EPhase.Common_NORMAL; + this.eフェードアウト完了時の戻り値 = EReturnValue.Continuation; - TJAPlayer3.Skin.soundOnlineLoungeBGM?.tPlay(); + TJAPlayer3.Skin.soundOnlineLoungeBGM?.tPlay(); - this.currentMenu = ECurrentMenu.MAIN; - this.menuPointer = ECurrentMenu.CDN_SELECT; - this.menus = new CMenuInfo[(int)ECurrentMenu.TOTAL]; + 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)); - + for (int i = 0; i < (int)ECurrentMenu.TOTAL; i++) + this.menus[i] = new CMenuInfo(GetMenuName(i)); - dbCDN = TJAPlayer3.Databases.DBCDN; - dbCDNData = null; - IsDownloading = false; + dbCDN = TJAPlayer3.Databases.DBCDN; + dbCDNData = null; - #region [Main menu] + IsDownloading = false; - this.ttkMainMenuOpt = new TitleTextureKey[3]; + #region [Main menu] - 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.ttkMainMenuOpt = new TitleTextureKey[3]; - this.mainMenu = new ECurrentMenu[] { ECurrentMenu.RETURN, ECurrentMenu.CDN_SELECT, ECurrentMenu.MULTI_SELECT }; + 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.mainMenuIndex = 0; + this.mainMenu = new ECurrentMenu[] { ECurrentMenu.RETURN, ECurrentMenu.CDN_SELECT, ECurrentMenu.MULTI_SELECT }; - #endregion + this.mainMenuIndex = 0; - #region [CDN Select] + #endregion - int keyCount = dbCDN.data.Count; + #region [CDN Select] - this.ttkCDNSelectOpt = new TitleTextureKey[keyCount + 1]; + int keyCount = dbCDN.data.Count; - this.ttkCDNSelectOpt[0] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.MAIN), this.pfOLFont, Color.White, Color.DarkRed, 1000); + this.ttkCDNSelectOpt = new TitleTextureKey[keyCount + 1]; - 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.ttkCDNSelectOpt[0] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.MAIN), this.pfOLFont, Color.White, Color.DarkRed, 1000); - this.CDNSelectIndex = 0; + 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); + } - #endregion + this.CDNSelectIndex = 0; - #region [CDN Option] + #endregion - this.ttkCDNOptionOpt = new TitleTextureKey[4]; + #region [CDN Option] - 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.ttkCDNOptionOpt = new TitleTextureKey[4]; - this.cdnOptMenu = new ECurrentMenu[] { ECurrentMenu.CDN_SELECT, ECurrentMenu.CDN_SONGS, ECurrentMenu.CDN_CHARACTERS, ECurrentMenu.CDN_PUCHICHARAS }; + 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.cdnOptMenuIndex = 0; + this.cdnOptMenu = new ECurrentMenu[] { ECurrentMenu.CDN_SELECT, ECurrentMenu.CDN_SONGS, ECurrentMenu.CDN_CHARACTERS, ECurrentMenu.CDN_PUCHICHARAS }; - #endregion + this.cdnOptMenuIndex = 0; - Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.ONLINELOUNGE}Script.lua")); - Background.Init(); + #endregion - base.Activate(); - } + Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.ONLINELOUNGE}Script.lua")); + Background.Init(); - public override void DeActivate() - { - // On de-activation + base.Activate(); + } - TJAPlayer3.tDisposeSafely(ref Background); + public override void DeActivate() { + // On de-activation - TJAPlayer3.Songs管理.UpdateDownloadBox(); + TJAPlayer3.tDisposeSafely(ref Background); - base.DeActivate(); - } + TJAPlayer3.Songs管理.UpdateDownloadBox(); - public override void CreateManagedResource() - { - // Ressource allocation + base.DeActivate(); + } - this.pfOLFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.OnlineLounge_Font_OLFont); - this.pfOLFontLarge = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.OnlineLounge_Font_OLFontLarge); + public override void CreateManagedResource() { + // Ressource allocation - base.CreateManagedResource(); - } + this.pfOLFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.OnlineLounge_Font_OLFont); + this.pfOLFontLarge = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.OnlineLounge_Font_OLFontLarge); - public override void ReleaseManagedResource() - { - // Ressource freeing - this.pfOLFont?.Dispose(); - this.pfOLFontLarge?.Dispose(); + base.CreateManagedResource(); + } - base.ReleaseManagedResource(); - } + public override void ReleaseManagedResource() { + // Ressource freeing + this.pfOLFont?.Dispose(); + this.pfOLFontLarge?.Dispose(); - public override int Draw() - { - Background.Update(); - Background.Draw(); + base.ReleaseManagedResource(); + } - //OnlineLounge_Background.t2D描画(0, 0); + public override int Draw() { + Background.Update(); + Background.Draw(); - #region [Menus] + //OnlineLounge_Background.t2D描画(0, 0); + #region [Menus] - #region [Base Menus] - TitleTextureKey[] _ref = this.ttkMainMenuOpt; - int _selector = mainMenuIndex; + #region [Base Menus] - if (currentMenu == ECurrentMenu.CDN_SELECT) - { - _ref = this.ttkCDNSelectOpt; - _selector = CDNSelectIndex; - } - else if (currentMenu == ECurrentMenu.CDN_OPTION) - { - _ref = this.ttkCDNOptionOpt; - _selector = cdnOptMenuIndex; - } - + TitleTextureKey[] _ref = this.ttkMainMenuOpt; + int _selector = mainMenuIndex; - if (currentMenu == ECurrentMenu.MAIN - || currentMenu == ECurrentMenu.CDN_SELECT - || currentMenu == ECurrentMenu.CDN_OPTION) - { - int baseX = TJAPlayer3.Skin.OnlineLounge_Side_Menu[0] - _ref.Length * (TJAPlayer3.Skin.OnlineLounge_Side_Menu_Move[0] / 2); - int baseY = TJAPlayer3.Skin.OnlineLounge_Side_Menu[1] - _ref.Length * (TJAPlayer3.Skin.OnlineLounge_Side_Menu_Move[1] / 2); + if (currentMenu == ECurrentMenu.CDN_SELECT) { + _ref = this.ttkCDNSelectOpt; + _selector = CDNSelectIndex; + } else if (currentMenu == ECurrentMenu.CDN_OPTION) { + _ref = this.ttkCDNOptionOpt; + _selector = cdnOptMenuIndex; + } - for (int i = 0; i < _ref.Length; i++) - { - CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(_ref[i]); - if (_selector != i) - { - tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray); - TJAPlayer3.Tx.OnlineLounge_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); - } - else - { - tmpTex.color4 = CConversion.ColorToColor4(Color.White); - TJAPlayer3.Tx.OnlineLounge_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); - } + if (currentMenu == ECurrentMenu.MAIN + || currentMenu == ECurrentMenu.CDN_SELECT + || currentMenu == ECurrentMenu.CDN_OPTION) { + int baseX = TJAPlayer3.Skin.OnlineLounge_Side_Menu[0] - _ref.Length * (TJAPlayer3.Skin.OnlineLounge_Side_Menu_Move[0] / 2); + int baseY = TJAPlayer3.Skin.OnlineLounge_Side_Menu[1] - _ref.Length * (TJAPlayer3.Skin.OnlineLounge_Side_Menu_Move[1] / 2); - TJAPlayer3.Tx.OnlineLounge_Side_Menu?.t2D拡大率考慮上中央基準描画(baseX + TJAPlayer3.Skin.OnlineLounge_Side_Menu_Move[0] * i, - baseY + TJAPlayer3.Skin.OnlineLounge_Side_Menu_Move[1] * i); - tmpTex.t2D拡大率考慮上中央基準描画( - baseX + TJAPlayer3.Skin.OnlineLounge_Side_Menu_Text_Offset[0] + TJAPlayer3.Skin.OnlineLounge_Side_Menu_Move[0] * i, - baseY + TJAPlayer3.Skin.OnlineLounge_Side_Menu_Text_Offset[1] + TJAPlayer3.Skin.OnlineLounge_Side_Menu_Move[1] * i); - } - } + for (int i = 0; i < _ref.Length; i++) { + CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(_ref[i]); - #endregion + if (_selector != i) { + tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray); + TJAPlayer3.Tx.OnlineLounge_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); + } else { + tmpTex.color4 = CConversion.ColorToColor4(Color.White); + TJAPlayer3.Tx.OnlineLounge_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + } - #region [Song list menu] + TJAPlayer3.Tx.OnlineLounge_Side_Menu?.t2D拡大率考慮上中央基準描画(baseX + TJAPlayer3.Skin.OnlineLounge_Side_Menu_Move[0] * i, + baseY + TJAPlayer3.Skin.OnlineLounge_Side_Menu_Move[1] * i); + tmpTex.t2D拡大率考慮上中央基準描画( + baseX + TJAPlayer3.Skin.OnlineLounge_Side_Menu_Text_Offset[0] + TJAPlayer3.Skin.OnlineLounge_Side_Menu_Move[0] * i, + baseY + TJAPlayer3.Skin.OnlineLounge_Side_Menu_Text_Offset[1] + TJAPlayer3.Skin.OnlineLounge_Side_Menu_Move[1] * i); + } + } - if (currentMenu == ECurrentMenu.CDN_SONGS) - { - _ref = this.ttkCDNSongList; - _selector = cdnSongListIndex; - - int baseX = TJAPlayer3.Skin.OnlineLounge_Song[0]; - int baseY = TJAPlayer3.Skin.OnlineLounge_Song[1]; - - for (int i = -4; i < 4; i++) - { - int pos = (_ref.Length * 5 + _selector + i) % _ref.Length; - - CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(_ref[pos]); - CTexture tmpSubtitle = TJAPlayer3.stageSongSelect.actSongList.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 + TJAPlayer3.Skin.OnlineLounge_Song_Move[0] * i; - int y = baseY + TJAPlayer3.Skin.OnlineLounge_Song_Move[1] * i; + #endregion - if (pos == 0) - { - TJAPlayer3.Tx.OnlineLounge_Return_Box?.tUpdateColor4(_color); - TJAPlayer3.Tx.OnlineLounge_Return_Box?.t2D拡大率考慮上中央基準描画(x, y); - } - else - { - TJAPlayer3.Tx.OnlineLounge_Song_Box?.tUpdateColor4(_color); - TJAPlayer3.Tx.OnlineLounge_Song_Box?.t2D拡大率考慮上中央基準描画(x, y); - } - - - tmpTex.t2D拡大率考慮上中央基準描画(x + TJAPlayer3.Skin.OnlineLounge_Song_Title_Offset[0], y + TJAPlayer3.Skin.OnlineLounge_Song_Title_Offset[1]); - tmpSubtitle.t2D拡大率考慮上中央基準描画(x + TJAPlayer3.Skin.OnlineLounge_Song_SubTitle_Offset[0], y + TJAPlayer3.Skin.OnlineLounge_Song_SubTitle_Offset[1]); - - if (pos != 0 && i == 0) - { - TJAPlayer3.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_ = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture( - new TitleTextureKey("Charter : " + song_.charter.charter_name, this.pfOLFontLarge, Color.White, Color.Black, 1000)); - charter_?.t2D中心基準描画(TJAPlayer3.Skin.OnlineLounge_Context_Charter[0], TJAPlayer3.Skin.OnlineLounge_Context_Charter[1]); - } - - #endregion - - #region [Song Genre] - - if (song_.Genre != null && song_.Genre.genre != null && song_.Genre.genre != "") - { - var genre_ = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture( - new TitleTextureKey(song_.Genre.genre, this.pfOLFontLarge, Color.White, Color.Black, 1000)); - genre_?.t2D中心基準描画(TJAPlayer3.Skin.OnlineLounge_Context_Genre[0], TJAPlayer3.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) ? TJAPlayer3.Skin.OnlineLounge_Context_Couse_Move[0] : 0; - int row = TJAPlayer3.Skin.OnlineLounge_Context_Couse_Move[1] * (k % 3); - - if (diff > 0) - { - TJAPlayer3.Tx.Couse_Symbol[k]?.t2D中心基準描画( - TJAPlayer3.Skin.OnlineLounge_Context_Couse_Symbol[0] + column, - TJAPlayer3.Skin.OnlineLounge_Context_Couse_Symbol[1] + row); - - var difnb_ = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture( - new TitleTextureKey(diff.ToString(), this.pfOLFontLarge, (diff > 10) ? Color.Red : Color.White, Color.Black, 1000)); - difnb_?.t2D中心基準描画(TJAPlayer3.Skin.OnlineLounge_Context_Level[0] + column, TJAPlayer3.Skin.OnlineLounge_Context_Level[1] + row); - } - - } - - #endregion - - - } - - } - } - - #endregion - - if (IsDownloading) - { - TJAPlayer3.Tx.OnlineLounge_Box.t2D描画(0, 0); - - var text = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture( - new TitleTextureKey("Downloading...", this.pfOLFontLarge, Color.White, Color.Black, 1000)); - text.t2D中心基準描画(TJAPlayer3.Skin.OnlineLounge_Downloading[0], TJAPlayer3.Skin.OnlineLounge_Downloading[1]); - } - - #endregion - - - - #region [Input] - - //if (!IsDownloading) - { - if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange)) - { - if (this.tMove(1)) - { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - } - } - - else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange)) - { - if (this.tMove(-1)) - { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - } - } - - else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Cancel)) - { - - #region [Fast return (Escape)] - - TJAPlayer3.Skin.soundCancelSFX.tPlay(); - - if (currentMenu == ECurrentMenu.MAIN) - { - // Return to title screen - TJAPlayer3.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 (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || - TJAPlayer3.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 - TJAPlayer3.Skin.soundCancelSFX.tPlay(); - TJAPlayer3.Skin.soundOnlineLoungeBGM?.tStop(); - this.eフェードアウト完了時の戻り値 = EReturnValue.ReturnToTitle; - this.actFOtoTitle.tフェードアウト開始(); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - } - else - { - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - } - } - else - { - TJAPlayer3.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; - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - } - else - { - currentMenu = ECurrentMenu.MAIN; - TJAPlayer3.Skin.soundCancelSFX.tPlay(); - } - } - else if (currentMenu == ECurrentMenu.CDN_OPTION) - { - // CDN Option Menu - currentMenu = cdnOptMenu[cdnOptMenuIndex]; - if (currentMenu == ECurrentMenu.CDN_SELECT) - TJAPlayer3.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 - } - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - } - - } - else if (currentMenu == ECurrentMenu.CDN_SONGS) - { - if (this.cdnSongListIndex == 0) - { - TJAPlayer3.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) - { - TJAPlayer3.Skin.soundError.tPlay(); - } - else - { - TJAPlayer3.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(TJAPlayer3.ConfigIni.sLang)) - return ens[TJAPlayer3.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 < TJAPlayer3.Songs管理.list曲ルート.Count; i++) - { - if (TJAPlayer3.Songs管理.list曲ルート[i].strジャンル == "Download") - { - downloadBox = TJAPlayer3.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 < TJAPlayer3.Songs管理.list曲ルート.Count; i++) - { - if (TJAPlayer3.Songs管理.list曲ルート[i].strジャンル == song.Genre.genre - && TJAPlayer3.Songs管理.list曲ルート[i].eノード種別 == CSongListNode.ENodeType.BOX) - correspondingBox = TJAPlayer3.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(TJAPlayer3.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()); - TJAPlayer3.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; + #region [Song list menu] - private bool IsDownloading; + if (currentMenu == ECurrentMenu.CDN_SONGS) { + _ref = this.ttkCDNSongList; + _selector = cdnSongListIndex; - private class CMenuInfo - { - public CMenuInfo(string ttl) - { - title = ttl; - } + int baseX = TJAPlayer3.Skin.OnlineLounge_Song[0]; + int baseY = TJAPlayer3.Skin.OnlineLounge_Song[1]; - public string title; - } + for (int i = -4; i < 4; i++) { + int pos = (_ref.Length * 5 + _selector + i) % _ref.Length; - #endregion + CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(_ref[pos]); + CTexture tmpSubtitle = TJAPlayer3.stageSongSelect.actSongList.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 + TJAPlayer3.Skin.OnlineLounge_Song_Move[0] * i; + int y = baseY + TJAPlayer3.Skin.OnlineLounge_Song_Move[1] * i; + + if (pos == 0) { + TJAPlayer3.Tx.OnlineLounge_Return_Box?.tUpdateColor4(_color); + TJAPlayer3.Tx.OnlineLounge_Return_Box?.t2D拡大率考慮上中央基準描画(x, y); + } else { + TJAPlayer3.Tx.OnlineLounge_Song_Box?.tUpdateColor4(_color); + TJAPlayer3.Tx.OnlineLounge_Song_Box?.t2D拡大率考慮上中央基準描画(x, y); + } + + + tmpTex.t2D拡大率考慮上中央基準描画(x + TJAPlayer3.Skin.OnlineLounge_Song_Title_Offset[0], y + TJAPlayer3.Skin.OnlineLounge_Song_Title_Offset[1]); + tmpSubtitle.t2D拡大率考慮上中央基準描画(x + TJAPlayer3.Skin.OnlineLounge_Song_SubTitle_Offset[0], y + TJAPlayer3.Skin.OnlineLounge_Song_SubTitle_Offset[1]); + + if (pos != 0 && i == 0) { + TJAPlayer3.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_ = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture( + new TitleTextureKey("Charter : " + song_.charter.charter_name, this.pfOLFontLarge, Color.White, Color.Black, 1000)); + charter_?.t2D中心基準描画(TJAPlayer3.Skin.OnlineLounge_Context_Charter[0], TJAPlayer3.Skin.OnlineLounge_Context_Charter[1]); + } + + #endregion + + #region [Song Genre] + + if (song_.Genre != null && song_.Genre.genre != null && song_.Genre.genre != "") { + var genre_ = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture( + new TitleTextureKey(song_.Genre.genre, this.pfOLFontLarge, Color.White, Color.Black, 1000)); + genre_?.t2D中心基準描画(TJAPlayer3.Skin.OnlineLounge_Context_Genre[0], TJAPlayer3.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) ? TJAPlayer3.Skin.OnlineLounge_Context_Couse_Move[0] : 0; + int row = TJAPlayer3.Skin.OnlineLounge_Context_Couse_Move[1] * (k % 3); + + if (diff > 0) { + TJAPlayer3.Tx.Couse_Symbol[k]?.t2D中心基準描画( + TJAPlayer3.Skin.OnlineLounge_Context_Couse_Symbol[0] + column, + TJAPlayer3.Skin.OnlineLounge_Context_Couse_Symbol[1] + row); + + var difnb_ = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture( + new TitleTextureKey(diff.ToString(), this.pfOLFontLarge, (diff > 10) ? Color.Red : Color.White, Color.Black, 1000)); + difnb_?.t2D中心基準描画(TJAPlayer3.Skin.OnlineLounge_Context_Level[0] + column, TJAPlayer3.Skin.OnlineLounge_Context_Level[1] + row); + } + + } + + #endregion + + + } + + } + } + + #endregion + + if (IsDownloading) { + TJAPlayer3.Tx.OnlineLounge_Box.t2D描画(0, 0); + + var text = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture( + new TitleTextureKey("Downloading...", this.pfOLFontLarge, Color.White, Color.Black, 1000)); + text.t2D中心基準描画(TJAPlayer3.Skin.OnlineLounge_Downloading[0], TJAPlayer3.Skin.OnlineLounge_Downloading[1]); + } + + #endregion + + + + #region [Input] + + //if (!IsDownloading) + { + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange)) { + if (this.tMove(1)) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + } + } else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange)) { + if (this.tMove(-1)) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + } + } else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Cancel)) { + + #region [Fast return (Escape)] + + TJAPlayer3.Skin.soundCancelSFX.tPlay(); + + if (currentMenu == ECurrentMenu.MAIN) { + // Return to title screen + TJAPlayer3.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 (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || + TJAPlayer3.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 + TJAPlayer3.Skin.soundCancelSFX.tPlay(); + TJAPlayer3.Skin.soundOnlineLoungeBGM?.tStop(); + this.eフェードアウト完了時の戻り値 = EReturnValue.ReturnToTitle; + this.actFOtoTitle.tフェードアウト開始(); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + } else { + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + } + } else { + TJAPlayer3.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; + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + } else { + currentMenu = ECurrentMenu.MAIN; + TJAPlayer3.Skin.soundCancelSFX.tPlay(); + } + } else if (currentMenu == ECurrentMenu.CDN_OPTION) { + // CDN Option Menu + currentMenu = cdnOptMenu[cdnOptMenuIndex]; + if (currentMenu == ECurrentMenu.CDN_SELECT) + TJAPlayer3.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 + } + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + } + + } else if (currentMenu == ECurrentMenu.CDN_SONGS) { + if (this.cdnSongListIndex == 0) { + TJAPlayer3.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) { + TJAPlayer3.Skin.soundError.tPlay(); + } else { + TJAPlayer3.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(TJAPlayer3.ConfigIni.sLang)) + return ens[TJAPlayer3.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 < TJAPlayer3.Songs管理.list曲ルート.Count; i++) { + if (TJAPlayer3.Songs管理.list曲ルート[i].strジャンル == "Download") { + downloadBox = TJAPlayer3.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 < TJAPlayer3.Songs管理.list曲ルート.Count; i++) { + if (TJAPlayer3.Songs管理.list曲ルート[i].strジャンル == song.Genre.genre + && TJAPlayer3.Songs管理.list曲ルート[i].eノード種別 == CSongListNode.ENodeType.BOX) + correspondingBox = TJAPlayer3.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(TJAPlayer3.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()); + TJAPlayer3.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 979d1472..4f3bf1fc 100644 --- a/OpenTaiko/src/Stages/13.TowerSelect/CStageTowerSelect.cs +++ b/OpenTaiko/src/Stages/13.TowerSelect/CStageTowerSelect.cs @@ -1,357 +1,307 @@ -using FDK; -using System; -using System.Collections.Generic; -using System.Diagnostics; +using System.Diagnostics; using System.Drawing; -using System.Linq; using System.Text; -using System.Threading.Tasks; +using FDK; // Minimalist menu class to use for custom menus -namespace TJAPlayer3 -{ - class CStageTowerSelect : CStage - { - public CStageTowerSelect() - { - base.eStageID = EStage.TaikoTowers; - base.ePhaseID = CStage.EPhase.Common_NORMAL; +namespace TJAPlayer3 { + class CStageTowerSelect : CStage { + public CStageTowerSelect() { + base.eStageID = EStage.TaikoTowers; + base.ePhaseID = CStage.EPhase.Common_NORMAL; - // Load CActivity objects here - // base.list子Activities.Add(this.act = new CAct()); + // 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()); + 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; + public override void Activate() { + // On activation - if (listSongs == null) - listSongs = TJAPlayer3.Songs管理.list曲ルート_Tower; + if (base.IsActivated) + return; - tUpdateBarInfos(); + base.ePhaseID = CStage.EPhase.Common_NORMAL; + this.eフェードアウト完了時の戻り値 = EReturnValue.Continuation; - Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.TOWERSELECT}Script.lua")); - Background.Init(); + if (listSongs == null) + listSongs = TJAPlayer3.Songs管理.list曲ルート_Tower; - base.Activate(); - } + tUpdateBarInfos(); - public override void DeActivate() - { - // On de-activation + Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.TOWERSELECT}Script.lua")); + Background.Init(); - TJAPlayer3.tDisposeSafely(ref Background); - - base.DeActivate(); - } - - public override void CreateManagedResource() - { - // Ressource allocation - - pfTitleFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.TowerSelect_Title_Size); - pfSubTitleFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.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 < TJAPlayer3.Skin.TowerSelect_Bar_Count; i++) - { - int currentSong = nCurrentSongIndex + i - ((TJAPlayer3.Skin.TowerSelect_Bar_Count - 1) / 2); - if (currentSong < 0 || currentSong >= BarInfos.Length) continue; - var bar = BarInfos[currentSong]; - - int x = TJAPlayer3.Skin.TowerSelect_Bar_X[i]; - int y = TJAPlayer3.Skin.TowerSelect_Bar_Y[i]; - tDrawTower(x, y, bar); - } - - #region [Input] - - if (this.eフェードアウト完了時の戻り値 == EReturnValue.Continuation) - { - int returnTitle() - { - TJAPlayer3.Skin.soundCancelSFX.tPlay(); - this.eフェードアウト完了時の戻り値 = EReturnValue.ReturnToTitle; - this.actFOtoTitle.tフェードアウト開始(); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - return 0; - } - - if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange)) - { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - - if (nCurrentSongIndex < BarInfos.Length - 1) - { - nCurrentSongIndex++; - } - } - - else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange)) - { - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - - if (nCurrentSongIndex > 0) - { - nCurrentSongIndex--; - } - } - - else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Cancel)) - { - - #region [Fast return (Escape)] - - TJAPlayer3.Skin.soundCancelSFX.tPlay(); - returnTitle(); - - #endregion - } - - else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Decide)) - { - #region [Decide] - - TJAPlayer3.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 (TJAPlayer3.Songs管理.list曲ルート.Contains(currentSong.rParentNode) && currentSong.rParentNode.strジャンル == "太鼓タワー") - { - returnTitle(); - } - else - { - tCloseFolder(currentSong); - } - } - break; - } - - #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 CActSelect曲リスト.TitleTextureKey ttkTitle; - public CActSelect曲リスト.TitleTextureKey ttkSubTitle; - } - - public void tSelectSong() - { - TJAPlayer3.ConfigIni.bTokkunMode = false; - TJAPlayer3.stageSongSelect.rChoosenSong = listSongs[nCurrentSongIndex]; - TJAPlayer3.stageSongSelect.r確定されたスコア = listSongs[nCurrentSongIndex].arスコア[(int)Difficulty.Tower]; - TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] = (int)Difficulty.Tower; - TJAPlayer3.stageSongSelect.str確定された曲のジャンル = listSongs[nCurrentSongIndex].strジャンル; - if ((TJAPlayer3.stageSongSelect.rChoosenSong != null) && (TJAPlayer3.stageSongSelect.r確定されたスコア != null)) - { - CFloorManagement.reinitialize(TJAPlayer3.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(); - TJAPlayer3.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 = TJAPlayer3.Random.Next(selectableSongCount); - - if (TJAPlayer3.ConfigIni.bLogDTX詳細ログ出力) - { - 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 - TJAPlayer3.stageSongSelect.rChoosenSong = song.listランダム用ノードリスト[randomSongIndex]; - TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] = (int)Difficulty.Tower; - - CFloorManagement.reinitialize(TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[(int)Difficulty.Tower].譜面情報.nLife); - TJAPlayer3.stageSongSelect.r確定されたスコア = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[TJAPlayer3.stageSongSelect.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(TJAPlayer3.stageSongSelect.rChoosenSong)]; - TJAPlayer3.stageSongSelect.str確定された曲のジャンル = TJAPlayer3.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: - TJAPlayer3.Tx.TowerSelect_Tower.t2D中心基準描画(x, y); - break; - case CSongListNode.ENodeType.RANDOM: - TJAPlayer3.Tx.TowerSelect_Tower.t2D中心基準描画(x, y); - break; - case CSongListNode.ENodeType.BOX: - TJAPlayer3.Tx.TowerSelect_Tower.t2D中心基準描画(x, y); - break; - case CSongListNode.ENodeType.BACKBOX: - TJAPlayer3.Tx.TowerSelect_Tower.t2D中心基準描画(x, y); - break; - } - - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(barInfo.ttkTitle).t2D拡大率考慮中央基準描画(x + TJAPlayer3.Skin.TowerSelect_Title_Offset[0], y + TJAPlayer3.Skin.TowerSelect_Title_Offset[1]); - TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(barInfo.ttkSubTitle).t2D拡大率考慮中央基準描画(x + TJAPlayer3.Skin.TowerSelect_SubTitle_Offset[0], y + TJAPlayer3.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 CActSelect曲リスト.TitleTextureKey(bar.strTitle, pfTitleFont, Color.Black, Color.Transparent, TJAPlayer3.Skin.TowerSelect_Title_MaxWidth); - bar.ttkSubTitle = new CActSelect曲リスト.TitleTextureKey(bar.strSubTitle, pfTitleFont, Color.Black, Color.Transparent, TJAPlayer3.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 - } + base.Activate(); + } + + public override void DeActivate() { + // On de-activation + + TJAPlayer3.tDisposeSafely(ref Background); + + base.DeActivate(); + } + + public override void CreateManagedResource() { + // Ressource allocation + + pfTitleFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.TowerSelect_Title_Size); + pfSubTitleFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.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 < TJAPlayer3.Skin.TowerSelect_Bar_Count; i++) { + int currentSong = nCurrentSongIndex + i - ((TJAPlayer3.Skin.TowerSelect_Bar_Count - 1) / 2); + if (currentSong < 0 || currentSong >= BarInfos.Length) continue; + var bar = BarInfos[currentSong]; + + int x = TJAPlayer3.Skin.TowerSelect_Bar_X[i]; + int y = TJAPlayer3.Skin.TowerSelect_Bar_Y[i]; + tDrawTower(x, y, bar); + } + + #region [Input] + + if (this.eフェードアウト完了時の戻り値 == EReturnValue.Continuation) { + int returnTitle() { + TJAPlayer3.Skin.soundCancelSFX.tPlay(); + this.eフェードアウト完了時の戻り値 = EReturnValue.ReturnToTitle; + this.actFOtoTitle.tフェードアウト開始(); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + return 0; + } + + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange)) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + + if (nCurrentSongIndex < BarInfos.Length - 1) { + nCurrentSongIndex++; + } + } else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange)) { + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + + if (nCurrentSongIndex > 0) { + nCurrentSongIndex--; + } + } else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Cancel)) { + + #region [Fast return (Escape)] + + TJAPlayer3.Skin.soundCancelSFX.tPlay(); + returnTitle(); + + #endregion + } else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Decide)) { + #region [Decide] + + TJAPlayer3.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 (TJAPlayer3.Songs管理.list曲ルート.Contains(currentSong.rParentNode) && currentSong.rParentNode.strジャンル == "太鼓タワー") { + returnTitle(); + } else { + tCloseFolder(currentSong); + } + } + break; + } + + #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 CActSelect曲リスト.TitleTextureKey ttkTitle; + public CActSelect曲リスト.TitleTextureKey ttkSubTitle; + } + + public void tSelectSong() { + TJAPlayer3.ConfigIni.bTokkunMode = false; + TJAPlayer3.stageSongSelect.rChoosenSong = listSongs[nCurrentSongIndex]; + TJAPlayer3.stageSongSelect.r確定されたスコア = listSongs[nCurrentSongIndex].arスコア[(int)Difficulty.Tower]; + TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] = (int)Difficulty.Tower; + TJAPlayer3.stageSongSelect.str確定された曲のジャンル = listSongs[nCurrentSongIndex].strジャンル; + if ((TJAPlayer3.stageSongSelect.rChoosenSong != null) && (TJAPlayer3.stageSongSelect.r確定されたスコア != null)) { + CFloorManagement.reinitialize(TJAPlayer3.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(); + TJAPlayer3.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 = TJAPlayer3.Random.Next(selectableSongCount); + + if (TJAPlayer3.ConfigIni.bLogDTX詳細ログ出力) { + 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 + TJAPlayer3.stageSongSelect.rChoosenSong = song.listランダム用ノードリスト[randomSongIndex]; + TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] = (int)Difficulty.Tower; + + CFloorManagement.reinitialize(TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[(int)Difficulty.Tower].譜面情報.nLife); + TJAPlayer3.stageSongSelect.r確定されたスコア = TJAPlayer3.stageSongSelect.rChoosenSong.arスコア[TJAPlayer3.stageSongSelect.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(TJAPlayer3.stageSongSelect.rChoosenSong)]; + TJAPlayer3.stageSongSelect.str確定された曲のジャンル = TJAPlayer3.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: + TJAPlayer3.Tx.TowerSelect_Tower.t2D中心基準描画(x, y); + break; + case CSongListNode.ENodeType.RANDOM: + TJAPlayer3.Tx.TowerSelect_Tower.t2D中心基準描画(x, y); + break; + case CSongListNode.ENodeType.BOX: + TJAPlayer3.Tx.TowerSelect_Tower.t2D中心基準描画(x, y); + break; + case CSongListNode.ENodeType.BACKBOX: + TJAPlayer3.Tx.TowerSelect_Tower.t2D中心基準描画(x, y); + break; + } + + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(barInfo.ttkTitle).t2D拡大率考慮中央基準描画(x + TJAPlayer3.Skin.TowerSelect_Title_Offset[0], y + TJAPlayer3.Skin.TowerSelect_Title_Offset[1]); + TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(barInfo.ttkSubTitle).t2D拡大率考慮中央基準描画(x + TJAPlayer3.Skin.TowerSelect_SubTitle_Offset[0], y + TJAPlayer3.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 CActSelect曲リスト.TitleTextureKey(bar.strTitle, pfTitleFont, Color.Black, Color.Transparent, TJAPlayer3.Skin.TowerSelect_Title_MaxWidth); + bar.ttkSubTitle = new CActSelect曲リスト.TitleTextureKey(bar.strSubTitle, pfTitleFont, Color.Black, Color.Transparent, TJAPlayer3.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/15.OpenEncyclopedia/CEncyclopediaControler.cs b/OpenTaiko/src/Stages/15.OpenEncyclopedia/CEncyclopediaControler.cs index d9f2e6e4..dd5547c9 100644 --- a/OpenTaiko/src/Stages/15.OpenEncyclopedia/CEncyclopediaControler.cs +++ b/OpenTaiko/src/Stages/15.OpenEncyclopedia/CEncyclopediaControler.cs @@ -1,274 +1,234 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Drawing; -using System.Threading.Tasks; -using System.IO; +using System.Drawing; using FDK; using static TJAPlayer3.CActSelect曲リスト; -namespace TJAPlayer3 -{ - class CEncyclopediaControler - { - - public CEncyclopediaControler() - { - _callStack = new Stack(); - _idxStack = new Stack(); +namespace TJAPlayer3 { + class CEncyclopediaControler { - _current = TJAPlayer3.Databases.DBEncyclopediaMenus.data; + public CEncyclopediaControler() { + _callStack = new Stack(); + _idxStack = new Stack(); - _lang = CLangManager.fetchLang(); + _current = TJAPlayer3.Databases.DBEncyclopediaMenus.data; - tResetIndexes(); - tReloadFonts(); - tReallocateCurrentAccordingly(); - } + _lang = CLangManager.fetchLang(); - #region [Fonts] + tResetIndexes(); + tReloadFonts(); + tReallocateCurrentAccordingly(); + } - private void tReloadFonts() - { - _pfEncyclopediaMenu?.Dispose(); - _pfEncyclopediaMenu = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.OpenEncyclopedia_Font_EncyclopediaMenu_Size); - } + #region [Fonts] - #endregion + private void tReloadFonts() { + _pfEncyclopediaMenu?.Dispose(); + _pfEncyclopediaMenu = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.OpenEncyclopedia_Font_EncyclopediaMenu_Size); + } - #region [Menu files parsing] + #endregion - private string _GetPathTextFile(string parent) - { - string _expected = parent + Path.DirectorySeparatorChar + _lang + ".txt"; - string _default = parent + Path.DirectorySeparatorChar + CLangManager.DefaultLanguage.Item1 + ".txt"; + #region [Menu files parsing] - if (File.Exists(_expected)) - return _expected; - return _default; - } + private string _GetPathTextFile(string parent) { + string _expected = parent + Path.DirectorySeparatorChar + _lang + ".txt"; + string _default = parent + Path.DirectorySeparatorChar + CLangManager.DefaultLanguage.Item1 + ".txt"; - private string _GetSectionContents(int key, bool _fetchingMenus) - { - try - { - string _path = _GetPathTextFile(@$"{TJAPlayer3.strEXEのあるフォルダ}Encyclopedia{Path.DirectorySeparatorChar}" + (_fetchingMenus ? @$"Menus{Path.DirectorySeparatorChar}" : @$"Pages{Path.DirectorySeparatorChar}") + key.ToString()); + if (File.Exists(_expected)) + return _expected; + return _default; + } - return File.ReadAllText(_path); - } - catch - { - return "[File not found]"; - } - } + private string _GetSectionContents(int key, bool _fetchingMenus) { + try { + string _path = _GetPathTextFile(@$"{TJAPlayer3.strEXEのあるフォルダ}Encyclopedia{Path.DirectorySeparatorChar}" + (_fetchingMenus ? @$"Menus{Path.DirectorySeparatorChar}" : @$"Pages{Path.DirectorySeparatorChar}") + key.ToString()); - private string _GetImagePath(int key) - { - return @$"{TJAPlayer3.strEXEのあるフォルダ}Encyclopedia{Path.DirectorySeparatorChar}Images{Path.DirectorySeparatorChar}" + key.ToString() + @".png"; - } + return File.ReadAllText(_path); + } catch { + return "[File not found]"; + } + } - #endregion + private string _GetImagePath(int key) { + return @$"{TJAPlayer3.strEXEのあるフォルダ}Encyclopedia{Path.DirectorySeparatorChar}Images{Path.DirectorySeparatorChar}" + key.ToString() + @".png"; + } - #region [Memory management] + #endregion - private void tFreeRessources(bool pages) - { - if (pages) - { - if (Pages != null) - { - for (int i = 0; i < Pages.Length; i++) - { - Pages[i].Item3?.Dispose(); - } - } - } - } + #region [Memory management] - private void tReallocateSubMenus() - { - tFreeRessources(false); + private void tFreeRessources(bool pages) { + if (pages) { + if (Pages != null) { + for (int i = 0; i < Pages.Length; i++) { + Pages[i].Item3?.Dispose(); + } + } + } + } - int _count = _current.Menus.Length + 1; - Submenus = new (int, CTexture)[_count]; + private void tReallocateSubMenus() { + tFreeRessources(false); - Submenus[0].Item1 = -1; - Submenus[0].Item2 = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture( - new TitleTextureKey(CLangManager.LangInstance.GetString("MENU_RETURN"), _pfEncyclopediaMenu, Color.White, Color.Brown, 1000)); + int _count = _current.Menus.Length + 1; + Submenus = new (int, CTexture)[_count]; - for (int i = 1; i < _count; i++) - { - int _idx = i - 1; // Excluding return - var _menu = _current.Menus[_idx]; - Submenus[i].Item1 = _menu.Key; - Submenus[i].Item2 = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture( - new TitleTextureKey(_GetSectionContents(_menu.Key, true), _pfEncyclopediaMenu, Color.White, Color.Brown, 1000)); - } - } + Submenus[0].Item1 = -1; + Submenus[0].Item2 = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture( + new TitleTextureKey(CLangManager.LangInstance.GetString("MENU_RETURN"), _pfEncyclopediaMenu, Color.White, Color.Brown, 1000)); - private void tReallocatePages() - { - tFreeRessources(true); + for (int i = 1; i < _count; i++) { + int _idx = i - 1; // Excluding return + var _menu = _current.Menus[_idx]; + Submenus[i].Item1 = _menu.Key; + Submenus[i].Item2 = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture( + new TitleTextureKey(_GetSectionContents(_menu.Key, true), _pfEncyclopediaMenu, Color.White, Color.Brown, 1000)); + } + } - if (_current.Pages == null) - { - Pages = new (int, CTexture, CTexture)[0]; - return; // Menus and Pages are null - } + private void tReallocatePages() { + tFreeRessources(true); - int _count = _current.Pages.Length; - Pages = new (int, CTexture, CTexture)[_count]; + if (_current.Pages == null) { + Pages = new (int, CTexture, CTexture)[0]; + return; // Menus and Pages are null + } - for (int i = 0; i < _count; i++) - { - var _page = _current.Pages[i]; - Pages[i].Item1 = _page; - Pages[i].Item2 = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture( - new TitleTextureKey(_GetSectionContents(_page, false), _pfEncyclopediaMenu, Color.White, Color.Brown, 1000)); - Pages[i].Item3 = TJAPlayer3.tテクスチャの生成(_GetImagePath(_page)); - } - } + int _count = _current.Pages.Length; + Pages = new (int, CTexture, CTexture)[_count]; - #endregion + for (int i = 0; i < _count; i++) { + var _page = _current.Pages[i]; + Pages[i].Item1 = _page; + Pages[i].Item2 = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture( + new TitleTextureKey(_GetSectionContents(_page, false), _pfEncyclopediaMenu, Color.White, Color.Brown, 1000)); + Pages[i].Item3 = TJAPlayer3.tテクスチャの生成(_GetImagePath(_page)); + } + } - #region [Input handlers] + #endregion - // Bool return value = "Back to main menu ?" - public bool tHandleBack() - { - if (_callStack.Count() <= 0) - return true; + #region [Input handlers] - var _oldIndex = _idxStack.Pop(); + // Bool return value = "Back to main menu ?" + public bool tHandleBack() { + if (_callStack.Count() <= 0) + return true; - if (tArePagesOpened()) - PageIndex = 0; - else - MenuIndex = _oldIndex; - - _current = _callStack.Pop(); + var _oldIndex = _idxStack.Pop(); - tReallocateCurrentAccordingly(); + if (tArePagesOpened()) + PageIndex = 0; + else + MenuIndex = _oldIndex; - return false; - } + _current = _callStack.Pop(); - // Bool return value = ("Went forward ?", "Back to main menu ?" - public (bool, bool) tHandleEnter() - { - // If not page and not return button - if (!tArePagesOpened() && MenuIndex != 0) - { - _callStack.Push(_current); - _idxStack.Push(MenuIndex); - _current = _current.Menus[MenuIndex - 1].Value; + tReallocateCurrentAccordingly(); - bool _hasPages = tArePagesOpened(); - - if (_hasPages) - PageIndex = 0; - else - tResetIndexes(); + return false; + } - tReallocateCurrentAccordingly(); + // Bool return value = ("Went forward ?", "Back to main menu ?" + public (bool, bool) tHandleEnter() { + // If not page and not return button + if (!tArePagesOpened() && MenuIndex != 0) { + _callStack.Push(_current); + _idxStack.Push(MenuIndex); + _current = _current.Menus[MenuIndex - 1].Value; - if (_hasPages) - tUpdatePageIndex(); + bool _hasPages = tArePagesOpened(); - return (true, false); - } - var _mainMenu = tHandleBack(); - return (false, _mainMenu); - } + if (_hasPages) + PageIndex = 0; + else + tResetIndexes(); - public void tHandleLeft() - { - tMove(tArePagesOpened(), -1); - } + tReallocateCurrentAccordingly(); - public void tHandleRight() - { - tMove(tArePagesOpened(), 1); - } + if (_hasPages) + tUpdatePageIndex(); + + return (true, false); + } + var _mainMenu = tHandleBack(); + return (false, _mainMenu); + } + + public void tHandleLeft() { + tMove(tArePagesOpened(), -1); + } + + public void tHandleRight() { + tMove(tArePagesOpened(), 1); + } - #endregion + #endregion - #region [private utils methods] + #region [private utils methods] - private void tUpdatePageIndex() - { - PageText = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture( - new TitleTextureKey((PageIndex + 1).ToString() + "/" + Pages.Length.ToString(), _pfEncyclopediaMenu, Color.White, Color.Brown, 1000)); - } + private void tUpdatePageIndex() { + PageText = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture( + new TitleTextureKey((PageIndex + 1).ToString() + "/" + Pages.Length.ToString(), _pfEncyclopediaMenu, Color.White, Color.Brown, 1000)); + } - private void tMove(bool pages, int count) - { - if (pages) - { - if (Pages.Length > 0) - { - PageIndex = (PageIndex + count + Pages.Length) % Pages.Length; - tUpdatePageIndex(); - } - - } - else - { - if (Submenus.Length > 0) - MenuIndex = (MenuIndex + count + Submenus.Length) % Submenus.Length; - } - } + private void tMove(bool pages, int count) { + if (pages) { + if (Pages.Length > 0) { + PageIndex = (PageIndex + count + Pages.Length) % Pages.Length; + tUpdatePageIndex(); + } - private void tResetIndexes() - { - MenuIndex = 0; - PageIndex = 0; - } + } else { + if (Submenus.Length > 0) + MenuIndex = (MenuIndex + count + Submenus.Length) % Submenus.Length; + } + } - private void tReallocateCurrentAccordingly() - { - if (tIsMenu(_current)) - tReallocateSubMenus(); - else - tReallocatePages(); - } + private void tResetIndexes() { + MenuIndex = 0; + PageIndex = 0; + } - #endregion + private void tReallocateCurrentAccordingly() { + if (tIsMenu(_current)) + tReallocateSubMenus(); + else + tReallocatePages(); + } - #region [public utils methods] + #endregion - public bool tArePagesOpened() - { - return (!tIsMenu(_current)); - } + #region [public utils methods] - public bool tIsMenu(DBEncyclopediaMenus.EncyclopediaMenu menu) - { - return (!(menu.Menus == null || menu.Menus.Length == 0)); - } + public bool tArePagesOpened() { + return (!tIsMenu(_current)); + } - #endregion + public bool tIsMenu(DBEncyclopediaMenus.EncyclopediaMenu menu) { + return (!(menu.Menus == null || menu.Menus.Length == 0)); + } - #region [public variables] + #endregion - public (int, CTexture)[] Submenus; - public (int, CTexture, CTexture)[] Pages; - public CTexture PageText; - public int MenuIndex; - public int PageIndex; + #region [public variables] - #endregion + public (int, CTexture)[] Submenus; + public (int, CTexture, CTexture)[] Pages; + public CTexture PageText; + public int MenuIndex; + public int PageIndex; - #region [private variables] + #endregion - private Stack _callStack; - private Stack _idxStack; - private DBEncyclopediaMenus.EncyclopediaMenu _current; - private string _lang; - private static CCachedFontRenderer _pfEncyclopediaMenu; + #region [private variables] - #endregion - } + private Stack _callStack; + private Stack _idxStack; + private DBEncyclopediaMenus.EncyclopediaMenu _current; + private string _lang; + private static CCachedFontRenderer _pfEncyclopediaMenu; + + #endregion + } } diff --git a/OpenTaiko/src/Stages/15.OpenEncyclopedia/COpenEncyclopedia.cs b/OpenTaiko/src/Stages/15.OpenEncyclopedia/COpenEncyclopedia.cs index fa350041..86f03d64 100644 --- a/OpenTaiko/src/Stages/15.OpenEncyclopedia/COpenEncyclopedia.cs +++ b/OpenTaiko/src/Stages/15.OpenEncyclopedia/COpenEncyclopedia.cs @@ -1,217 +1,184 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Drawing; using FDK; -using System.Drawing; // Minimalist menu class to use for custom menus -namespace TJAPlayer3 -{ - class COpenEncyclopedia : CStage - { - public COpenEncyclopedia() - { - base.eStageID = EStage.TEMPLATE; - base.ePhaseID = CStage.EPhase.Common_NORMAL; +namespace TJAPlayer3 { + class COpenEncyclopedia : CStage { + public COpenEncyclopedia() { + base.eStageID = EStage.TEMPLATE; + base.ePhaseID = CStage.EPhase.Common_NORMAL; - // Load CActivity objects here - // base.list子Activities.Add(this.act = new CAct()); + // Load CActivity objects here + // base.list子Activities.Add(this.act = new CAct()); - base.ChildActivities.Add(this.actFOtoTitle = new CActFIFOBlack()); + base.ChildActivities.Add(this.actFOtoTitle = new CActFIFOBlack()); - } + } - public override void Activate() - { - // On activation + public override void Activate() { + // On activation - if (base.IsActivated) - return; + if (base.IsActivated) + return; - base.ePhaseID = CStage.EPhase.Common_NORMAL; - this.eフェードアウト完了時の戻り値 = EReturnValue.Continuation; + base.ePhaseID = CStage.EPhase.Common_NORMAL; + this.eフェードアウト完了時の戻り値 = EReturnValue.Continuation; - TJAPlayer3.Skin.soundEncyclopediaBGM?.tPlay(); + TJAPlayer3.Skin.soundEncyclopediaBGM?.tPlay(); - _controler = new CEncyclopediaControler(); + _controler = new CEncyclopediaControler(); - Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.OPENENCYCLOPEDIA}Script.lua")); - Background.Init(); - - base.Activate(); - } + Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.OPENENCYCLOPEDIA}Script.lua")); + Background.Init(); - public override void DeActivate() - { - // On de-activation + base.Activate(); + } - TJAPlayer3.tDisposeSafely(ref Background); + public override void DeActivate() { + // On de-activation - base.DeActivate(); - } + TJAPlayer3.tDisposeSafely(ref Background); - public override void CreateManagedResource() - { - // Ressource allocation + base.DeActivate(); + } - base.CreateManagedResource(); - } + public override void CreateManagedResource() { + // Ressource allocation - public override void ReleaseManagedResource() - { - // Ressource freeing + base.CreateManagedResource(); + } - base.ReleaseManagedResource(); - } + public override void ReleaseManagedResource() { + // Ressource freeing - public override int Draw() - { - #region [Fetch variables] + base.ReleaseManagedResource(); + } - _arePagesOpened = _controler.tArePagesOpened(); - bool _backToMain = false; + public override int Draw() { + #region [Fetch variables] - #endregion + _arePagesOpened = _controler.tArePagesOpened(); + bool _backToMain = false; - #region [Displayables] + #endregion - Background.Update(); - Background.Draw(); + #region [Displayables] - //OpenEncyclopedia_Background?.t2D描画(0, 0); + Background.Update(); + Background.Draw(); - if (_arePagesOpened) - { - TJAPlayer3.Tx.OpenEncyclopedia_Context?.t2D描画(0, 0); + //OpenEncyclopedia_Background?.t2D描画(0, 0); - if (_controler.Pages.Length > 0) - { - var _page = _controler.Pages[_controler.PageIndex]; + if (_arePagesOpened) { + TJAPlayer3.Tx.OpenEncyclopedia_Context?.t2D描画(0, 0); - _page.Item2?.t2D中心基準描画(TJAPlayer3.Skin.OpenEncyclopedia_Context_Item2[0], TJAPlayer3.Skin.OpenEncyclopedia_Context_Item2[1]); - if (_page.Item3 != null) - { - _page.Item3.vcScaleRatio.X = TJAPlayer3.Skin.Resolution[0] / (2f * _page.Item3.szTextureSize.Width); - _page.Item3.vcScaleRatio.Y = TJAPlayer3.Skin.Resolution[1] / (2f * _page.Item3.szTextureSize.Height); - _page.Item3.t2D描画(TJAPlayer3.Skin.OpenEncyclopedia_Context_Item3[0], TJAPlayer3.Skin.OpenEncyclopedia_Context_Item3[1]); - } - _controler.PageText?.t2D下中央基準描画(TJAPlayer3.Skin.OpenEncyclopedia_Context_PageText[0], TJAPlayer3.Skin.OpenEncyclopedia_Context_PageText[1]); - } - } + if (_controler.Pages.Length > 0) { + var _page = _controler.Pages[_controler.PageIndex]; - for (int i = -7; i < 7; i++) - { - var _pos = (_controler.MenuIndex + i + (_controler.Submenus.Length * 7)) % _controler.Submenus.Length; - var _menu = _controler.Submenus[_pos]; + _page.Item2?.t2D中心基準描画(TJAPlayer3.Skin.OpenEncyclopedia_Context_Item2[0], TJAPlayer3.Skin.OpenEncyclopedia_Context_Item2[1]); + if (_page.Item3 != null) { + _page.Item3.vcScaleRatio.X = TJAPlayer3.Skin.Resolution[0] / (2f * _page.Item3.szTextureSize.Width); + _page.Item3.vcScaleRatio.Y = TJAPlayer3.Skin.Resolution[1] / (2f * _page.Item3.szTextureSize.Height); + _page.Item3.t2D描画(TJAPlayer3.Skin.OpenEncyclopedia_Context_Item3[0], TJAPlayer3.Skin.OpenEncyclopedia_Context_Item3[1]); + } + _controler.PageText?.t2D下中央基準描画(TJAPlayer3.Skin.OpenEncyclopedia_Context_PageText[0], TJAPlayer3.Skin.OpenEncyclopedia_Context_PageText[1]); + } + } - if (i != 0) - { - TJAPlayer3.Tx.OpenEncyclopedia_Return_Box?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); - TJAPlayer3.Tx.OpenEncyclopedia_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); - _menu.Item2?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); - } - else - { - TJAPlayer3.Tx.OpenEncyclopedia_Return_Box?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); - TJAPlayer3.Tx.OpenEncyclopedia_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); - _menu.Item2?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); - } + for (int i = -7; i < 7; i++) { + var _pos = (_controler.MenuIndex + i + (_controler.Submenus.Length * 7)) % _controler.Submenus.Length; + var _menu = _controler.Submenus[_pos]; - int x = TJAPlayer3.Skin.OpenEncyclopedia_Side_Menu[0] + TJAPlayer3.Skin.OpenEncyclopedia_Side_Menu_Move[0] * i; - int y = TJAPlayer3.Skin.OpenEncyclopedia_Side_Menu[1] + TJAPlayer3.Skin.OpenEncyclopedia_Side_Menu_Move[1] * i; + if (i != 0) { + TJAPlayer3.Tx.OpenEncyclopedia_Return_Box?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); + TJAPlayer3.Tx.OpenEncyclopedia_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); + _menu.Item2?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); + } else { + TJAPlayer3.Tx.OpenEncyclopedia_Return_Box?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + TJAPlayer3.Tx.OpenEncyclopedia_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + _menu.Item2?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + } - if (_pos == 0) - TJAPlayer3.Tx.OpenEncyclopedia_Return_Box?.t2D中心基準描画(x, y); - else - TJAPlayer3.Tx.OpenEncyclopedia_Side_Menu?.t2D中心基準描画(x, y); - _menu.Item2?.t2D中心基準描画( - x + TJAPlayer3.Skin.OpenEncyclopedia_Side_Menu_Text_Offset[0], - y + TJAPlayer3.Skin.OpenEncyclopedia_Side_Menu_Text_Offset[1]); - } + int x = TJAPlayer3.Skin.OpenEncyclopedia_Side_Menu[0] + TJAPlayer3.Skin.OpenEncyclopedia_Side_Menu_Move[0] * i; + int y = TJAPlayer3.Skin.OpenEncyclopedia_Side_Menu[1] + TJAPlayer3.Skin.OpenEncyclopedia_Side_Menu_Move[1] * i; - #endregion + if (_pos == 0) + TJAPlayer3.Tx.OpenEncyclopedia_Return_Box?.t2D中心基準描画(x, y); + else + TJAPlayer3.Tx.OpenEncyclopedia_Side_Menu?.t2D中心基準描画(x, y); + _menu.Item2?.t2D中心基準描画( + x + TJAPlayer3.Skin.OpenEncyclopedia_Side_Menu_Text_Offset[0], + y + TJAPlayer3.Skin.OpenEncyclopedia_Side_Menu_Text_Offset[1]); + } - #region [Inputs] + #endregion - if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange)) - { - _controler.tHandleRight(); - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - } + #region [Inputs] - else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange)) - { - _controler.tHandleLeft(); - TJAPlayer3.Skin.soundChangeSFX.tPlay(); - } + if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange)) { + _controler.tHandleRight(); + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + } else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange)) { + _controler.tHandleLeft(); + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + } else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Cancel)) { + _backToMain = _controler.tHandleBack(); + TJAPlayer3.Skin.soundCancelSFX.tPlay(); + } else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Decide)) { + var (_b1, _b2) = _controler.tHandleEnter(); + _backToMain = _b2; - else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Cancel)) - { - _backToMain = _controler.tHandleBack(); - TJAPlayer3.Skin.soundCancelSFX.tPlay(); - } + if (_b1) + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + else + TJAPlayer3.Skin.soundCancelSFX.tPlay(); + } - else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || - TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Decide)) - { - var (_b1, _b2) = _controler.tHandleEnter(); - _backToMain = _b2; + #endregion - if (_b1) - TJAPlayer3.Skin.soundDecideSFX.tPlay(); - else - TJAPlayer3.Skin.soundCancelSFX.tPlay(); - } + #region [Postprocessing] - #endregion + if (_backToMain) { + TJAPlayer3.Skin.soundEncyclopediaBGM?.tStop(); + this.eフェードアウト完了時の戻り値 = EReturnValue.ReturnToTitle; + this.actFOtoTitle.tフェードアウト開始(); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + } - #region [Postprocessing] - - if (_backToMain) - { - TJAPlayer3.Skin.soundEncyclopediaBGM?.tStop(); - this.eフェードアウト完了時の戻り値 = EReturnValue.ReturnToTitle; - this.actFOtoTitle.tフェードアウト開始(); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - } - - #endregion + #endregion - #region [FadeOut] + #region [FadeOut] - // Menu exit fade out transition - switch (base.ePhaseID) - { - case CStage.EPhase.Common_FADEOUT: - if (this.actFOtoTitle.Draw() == 0) - { - break; - } - return (int)this.eフェードアウト完了時の戻り値; + // Menu exit fade out transition + switch (base.ePhaseID) { + case CStage.EPhase.Common_FADEOUT: + if (this.actFOtoTitle.Draw() == 0) { + break; + } + return (int)this.eフェードアウト完了時の戻り値; - } + } - #endregion + #endregion - return 0; - } + return 0; + } - #region [Private] + #region [Private] - private ScriptBG Background; + private ScriptBG Background; - private CEncyclopediaControler _controler; - private bool _arePagesOpened; + private CEncyclopediaControler _controler; + private bool _arePagesOpened; - public EReturnValue eフェードアウト完了時の戻り値; - public CActFIFOBlack actFOtoTitle; + public EReturnValue eフェードアウト完了時の戻り値; + public CActFIFOBlack actFOtoTitle; - #endregion - } + #endregion + } } diff --git a/OpenTaiko/src/Stages/CActDFPFont.cs b/OpenTaiko/src/Stages/CActDFPFont.cs index f4ac326d..d32ea73b 100644 --- a/OpenTaiko/src/Stages/CActDFPFont.cs +++ b/OpenTaiko/src/Stages/CActDFPFont.cs @@ -1,74 +1,52 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; -using System.Drawing; -using Silk.NET.Maths; +using System.Runtime.InteropServices; using FDK; - +using Silk.NET.Maths; using Rectangle = System.Drawing.Rectangle; -namespace TJAPlayer3 -{ - internal class CActDFPFont : CActivity - { +namespace TJAPlayer3 { + internal class CActDFPFont : CActivity { // コンストラクタ - public CActDFPFont() - { + public CActDFPFont() { } // メソッド - public int n文字列長dot( string str ) - { - return this.n文字列長dot( str, 1f ); + public int n文字列長dot(string str) { + return this.n文字列長dot(str, 1f); } - public int n文字列長dot( string str, float fScale ) - { - if( string.IsNullOrEmpty( str ) ) - { + 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 ); + 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) { + 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強調) { + 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 ) ) - { + public void t文字列描画(int x, int y, string str, bool b強調, float fScale) { + if (!base.IsDeActivated && !string.IsNullOrEmpty(str)) { CTexture texture = b強調 ? TJAPlayer3.Tx.Config_Font_Bold : TJAPlayer3.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 ); + 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; } } @@ -80,499 +58,496 @@ namespace TJAPlayer3 // 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 ); + 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文字領域[] 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); + 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 = TJAPlayer3.Tx.Config_Font.szTextureSize.Width / 256.0f; - float scaleY = TJAPlayer3.Tx.Config_Font.szTextureSize.Height / 256.0f; + float scaleX = TJAPlayer3.Tx.Config_Font.szTextureSize.Width / 256.0f; + float scaleY = TJAPlayer3.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)); - } + 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(); + this.st文字領域 = st文字領域Array; + base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { + public override void ReleaseManagedResource() { //if( !base.b活性化してない ) //{ // if( this.tx強調文字 != null ) @@ -585,18 +560,17 @@ namespace TJAPlayer3 // this.tx通常文字.Dispose(); // this.tx通常文字 = null; // } - base.ReleaseManagedResource(); + base.ReleaseManagedResource(); //} } - + // その他 #region [ private ] //----------------- - [StructLayout( LayoutKind.Sequential )] - private struct ST文字領域 - { + [StructLayout(LayoutKind.Sequential)] + private struct ST文字領域 { public char ch; public Rectangle rc; } diff --git a/OpenTaiko/src/Stages/CActFIFOBlack.cs b/OpenTaiko/src/Stages/CActFIFOBlack.cs index 6d971549..b88cf92e 100644 --- a/OpenTaiko/src/Stages/CActFIFOBlack.cs +++ b/OpenTaiko/src/Stages/CActFIFOBlack.cs @@ -1,64 +1,48 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Diagnostics; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - internal class CActFIFOBlack : CActivity - { +namespace TJAPlayer3 { + internal class CActFIFOBlack : CActivity { // メソッド - public void tフェードアウト開始(int start = 0, int end = 100, int interval = 5) - { + public void tフェードアウト開始(int start = 0, int end = 100, int interval = 5) { this.mode = EFIFOモード.フェードアウト; - this.counter = new CCounter(start, end, interval, TJAPlayer3.Timer ); + this.counter = new CCounter(start, end, interval, TJAPlayer3.Timer); } - public void tフェードイン開始(int start = 0, int end = 100, int interval = 5) - { + public void tフェードイン開始(int start = 0, int end = 100, int interval = 5) { this.mode = EFIFOモード.フェードイン; - this.counter = new CCounter(start, end, interval, TJAPlayer3.Timer ); + this.counter = new CCounter(start, end, interval, TJAPlayer3.Timer); } - + // CActivity 実装 - public override void DeActivate() - { - if( !base.IsDeActivated ) - { + public override void DeActivate() { + if (!base.IsDeActivated) { //CDTXMania.tテクスチャの解放( ref this.tx黒タイル64x64 ); base.DeActivate(); } } - public override void 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 ) ) - { + 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 (TJAPlayer3.Tx.Tile_Black != null) - { - TJAPlayer3.Tx.Tile_Black.Opacity = ( this.mode == EFIFOモード.フェードイン ) ? ( ( ( 100 - this.counter.CurrentValue ) * 0xff ) / 100 ) : ( ( this.counter.CurrentValue * 0xff ) / 100 ); - for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / TJAPlayer3.Tx.Tile_Black.szTextureSize.Width); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size + if (TJAPlayer3.Tx.Tile_Black != null) { + TJAPlayer3.Tx.Tile_Black.Opacity = (this.mode == EFIFOモード.フェードイン) ? (((100 - this.counter.CurrentValue) * 0xff) / 100) : ((this.counter.CurrentValue * 0xff) / 100); + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / TJAPlayer3.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 / TJAPlayer3.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 / TJAPlayer3.Tx.Tile_Black.szTextureSize.Height); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size { - TJAPlayer3.Tx.Tile_Black.t2D描画( i * TJAPlayer3.Tx.Tile_Black.szTextureSize.Width, j * TJAPlayer3.Tx.Tile_Black.szTextureSize.Height); + TJAPlayer3.Tx.Tile_Black.t2D描画(i * TJAPlayer3.Tx.Tile_Black.szTextureSize.Width, j * TJAPlayer3.Tx.Tile_Black.szTextureSize.Height); } } } - if( this.counter.CurrentValue != this.counter.EndValue ) - { + if (this.counter.CurrentValue != this.counter.EndValue) { return 0; } return 1; diff --git a/OpenTaiko/src/Stages/CActFIFOResult.cs b/OpenTaiko/src/Stages/CActFIFOResult.cs index c7cfce6b..af9860e1 100644 --- a/OpenTaiko/src/Stages/CActFIFOResult.cs +++ b/OpenTaiko/src/Stages/CActFIFOResult.cs @@ -1,70 +1,48 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Diagnostics; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - internal class CActFIFOResult : CActivity - { +namespace TJAPlayer3 { + internal class CActFIFOResult : CActivity { // メソッド - public void tフェードアウト開始() - { + public void tフェードアウト開始() { this.mode = EFIFOモード.フェードアウト; this.counter = new CCounter(0, 100, 30, TJAPlayer3.Timer); } - public void tフェードイン開始() - { + public void tフェードイン開始() { this.mode = EFIFOモード.フェードイン; this.counter = new CCounter(0, 300, 2, TJAPlayer3.Timer); } - public void tフェードイン完了() - { + public void tフェードイン完了() { this.counter.CurrentValue = (int)counter.BeginValue; } // CActivity 実装 - public override void DeActivate() - { - if (!base.IsDeActivated) - { + public override void DeActivate() { + if (!base.IsDeActivated) { //CDTXMania.tテクスチャの解放( ref this.tx黒タイル64x64 ); base.DeActivate(); } } - public override void 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)) - { + 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 (TJAPlayer3.Tx.Tile_Black != null) - { - if (this.mode == EFIFOモード.フェードイン) - { - if (counter.CurrentValue >= 200) - { + if (TJAPlayer3.Tx.Tile_Black != null) { + if (this.mode == EFIFOモード.フェードイン) { + if (counter.CurrentValue >= 200) { TJAPlayer3.Tx.Tile_Black.Opacity = (((100 - (this.counter.CurrentValue - 200)) * 0xff) / 100); - } - else - { + } else { TJAPlayer3.Tx.Tile_Black.Opacity = 255; } - } - else - { + } else { TJAPlayer3.Tx.Tile_Black.Opacity = (((this.counter.CurrentValue) * 0xff) / 100); } @@ -76,17 +54,12 @@ namespace TJAPlayer3 } } } - if (this.mode == EFIFOモード.フェードアウト) - { - if (this.counter.CurrentValue != 100) - { + if (this.mode == EFIFOモード.フェードアウト) { + if (this.counter.CurrentValue != 100) { return 0; } - } - else - { - if (this.counter.CurrentValue != 300) - { + } else { + if (this.counter.CurrentValue != 300) { return 0; } } diff --git a/OpenTaiko/src/Stages/CActFIFOStart.cs b/OpenTaiko/src/Stages/CActFIFOStart.cs index 72b808b0..99a6e004 100644 --- a/OpenTaiko/src/Stages/CActFIFOStart.cs +++ b/OpenTaiko/src/Stages/CActFIFOStart.cs @@ -1,48 +1,33 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; +using System.Drawing; using FDK; -namespace TJAPlayer3 -{ - internal class CActFIFOStart : CActivity - { +namespace TJAPlayer3 { + internal class CActFIFOStart : CActivity { // メソッド - public void tフェードアウト開始() - { + public void tフェードアウト開始() { this.mode = EFIFOモード.フェードアウト; TJAPlayer3.Skin.soundDanSelectBGM.tStop(); if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) this.counter = new CCounter(0, 1255, 1, TJAPlayer3.Timer); - else if (TJAPlayer3.ConfigIni.bAIBattleMode) - { + else if (TJAPlayer3.ConfigIni.bAIBattleMode) { this.counter = new CCounter(0, 5500, 1, TJAPlayer3.Timer); - } - else - { + } else { this.counter = new CCounter(0, 3580, 1, TJAPlayer3.Timer); } } - public void tフェードイン開始() - { + public void tフェードイン開始() { this.mode = EFIFOモード.フェードイン; - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { this.counter = new CCounter(0, 255, 1, TJAPlayer3.Timer); TJAPlayer3.stage演奏ドラム画面.actDan.Start(TJAPlayer3.stage演奏ドラム画面.ListDan_Number); TJAPlayer3.stage演奏ドラム画面.ListDan_Number++; - } - else if (TJAPlayer3.ConfigIni.bAIBattleMode) - { + } else if (TJAPlayer3.ConfigIni.bAIBattleMode) { this.counter = new CCounter(0, 3580, 1, TJAPlayer3.Timer); - } - else - { + } else { this.counter = new CCounter(0, 3580, 1, TJAPlayer3.Timer); } } @@ -53,29 +38,23 @@ namespace TJAPlayer3 // CActivity 実装 - public override void DeActivate() - { + public override void DeActivate() { //CDTXMania.tテクスチャの解放( ref this.tx幕 ); base.DeActivate(); } - public override void CreateManagedResource() - { + 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)) - { + public override int Draw() { + if (base.IsDeActivated || (this.counter == null)) { return 0; } this.counter.Tick(); - if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] >= (int)Difficulty.Tower) - { - if (TJAPlayer3.Tx.Tile_Black != null) - { + if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] >= (int)Difficulty.Tower) { + if (TJAPlayer3.Tx.Tile_Black != null) { TJAPlayer3.Tx.Tile_Black.Opacity = this.mode == EFIFOモード.フェードアウト ? -1000 + counter.CurrentValue : 255 - counter.CurrentValue; for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / TJAPlayer3.Tx.Tile_Black.szTextureSize.Width); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size { @@ -85,29 +64,23 @@ namespace TJAPlayer3 } } } - } - else if (TJAPlayer3.ConfigIni.bAIBattleMode) - { - if (this.mode == EFIFOモード.フェードアウト) - { + } else if (TJAPlayer3.ConfigIni.bAIBattleMode) { + if (this.mode == EFIFOモード.フェードアウト) { var preTime = (this.counter.CurrentValue >= 2000 ? this.counter.CurrentValue - 2000 : 0) * 2; TJAPlayer3.Tx.SongLoading_Fade_AI.Opacity = preTime; TJAPlayer3.Tx.SongLoading_Fade_AI.t2D描画(0, 0); - if (preTime > 500) - { + if (preTime > 500) { TJAPlayer3.Tx.SongLoading_Fade_AI_Anime_Base.vcScaleRatio.X = Math.Min(((preTime - 500) / 255.0f), 1.0f); TJAPlayer3.Tx.SongLoading_Fade_AI_Anime_Base.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Resolution[0] / 2, TJAPlayer3.Skin.Resolution[1] / 2); } - if (preTime > 1000) - { + if (preTime > 1000) { TJAPlayer3.Tx.SongLoading_Fade_AI_Anime_Ring.Opacity = preTime - 1000; TJAPlayer3.Tx.SongLoading_Fade_AI_Anime_Ring.fZ軸中心回転 = preTime / 6000.0f; TJAPlayer3.Tx.SongLoading_Fade_AI_Anime_Ring.t2D描画(TJAPlayer3.Skin.SongLoading_Fade_AI_Anime_Ring[0], TJAPlayer3.Skin.SongLoading_Fade_AI_Anime_Ring[1]); - if (preTime - 1000 < 1500) - { + if (preTime - 1000 < 1500) { TJAPlayer3.Tx.SongLoading_Fade_AI_Anime_NowLoading.Opacity = preTime - 1000; TJAPlayer3.Tx.SongLoading_Fade_AI_Anime_NowLoading.t2D描画(0, 0); @@ -119,11 +92,9 @@ namespace TJAPlayer3 value = 1.0f - (float)Math.Cos(value * Math.PI / 2.0); TJAPlayer3.Tx.SongLoading_Fade_AI_Anime_LoadBar.t2D描画(TJAPlayer3.Skin.SongLoading_Fade_AI_Anime_LoadBar[0], TJAPlayer3.Skin.SongLoading_Fade_AI_Anime_LoadBar[1], - new RectangleF(0, 0, TJAPlayer3.Tx.SongLoading_Fade_AI_Anime_LoadBar.szTextureSize.Width * value, + new RectangleF(0, 0, TJAPlayer3.Tx.SongLoading_Fade_AI_Anime_LoadBar.szTextureSize.Width * value, TJAPlayer3.Tx.SongLoading_Fade_AI_Anime_LoadBar.szTextureSize.Height)); - } - else - { + } else { TJAPlayer3.Tx.SongLoading_Fade_AI_Anime_Start.t2D描画(0, 0); } } @@ -137,31 +108,20 @@ namespace TJAPlayer3 TJAPlayer3.Tx.SongLoading_Bg_AI_Wait.t2D描画(0, 0); TJAPlayer3.Tx.SongLoading_Plate_AI.Opacity = time - 255; - if (TJAPlayer3.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Left) - { + if (TJAPlayer3.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Left) { TJAPlayer3.Tx.SongLoading_Plate_AI.t2D描画(TJAPlayer3.Skin.SongLoading_Plate_X_AI, TJAPlayer3.Skin.SongLoading_Plate_Y_AI - (TJAPlayer3.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); - } - else if (TJAPlayer3.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Right) - { + } else if (TJAPlayer3.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Right) { TJAPlayer3.Tx.SongLoading_Plate_AI.t2D描画(TJAPlayer3.Skin.SongLoading_Plate_X_AI - TJAPlayer3.Tx.SongLoading_Plate_AI.sz画像サイズ.Width, TJAPlayer3.Skin.SongLoading_Plate_Y_AI - (TJAPlayer3.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); - } - else - { + } else { TJAPlayer3.Tx.SongLoading_Plate_AI.t2D描画(TJAPlayer3.Skin.SongLoading_Plate_X_AI - (TJAPlayer3.Tx.SongLoading_Plate_AI.sz画像サイズ.Width / 2), TJAPlayer3.Skin.SongLoading_Plate_Y_AI - (TJAPlayer3.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); } - } - else - { + } else { TJAPlayer3.Tx.SongLoading_Bg_AI.Opacity = 255 - counter.CurrentValue; TJAPlayer3.Tx.SongLoading_Bg_AI.t2D描画(0, 0); } - } - else - { - if (this.mode == EFIFOモード.フェードアウト) - { - if (TJAPlayer3.Tx.SongLoading_Fade != null) - { + } else { + if (this.mode == EFIFOモード.フェードアウト) { + if (TJAPlayer3.Tx.SongLoading_Fade != null) { // 曲開始幕アニメ。 // 地味に横の拡大率が変動しているのが一番厄介... var time = this.counter.CurrentValue >= 2580 ? this.counter.CurrentValue - 2580 : 0; @@ -174,11 +134,8 @@ namespace TJAPlayer3 DrawChara(time, (time - 730f) * (255f / 270f)); } - } - else - { - if (TJAPlayer3.Tx.SongLoading_Fade != null) - { + } else { + if (TJAPlayer3.Tx.SongLoading_Fade != null) { // 曲開始幕アニメ。 // 地味に横の拡大率が変動しているのが一番厄介... var time = this.counter.CurrentValue; @@ -193,25 +150,19 @@ namespace TJAPlayer3 } } - if (this.mode == EFIFOモード.フェードアウト) - { - if (this.counter.CurrentValue != this.counter.EndValue) - { + if (this.mode == EFIFOモード.フェードアウト) { + if (this.counter.CurrentValue != this.counter.EndValue) { return 0; } - } - else if (this.mode == EFIFOモード.フェードイン) - { - if (this.counter.CurrentValue != this.counter.EndValue) - { + } else if (this.mode == EFIFOモード.フェードイン) { + if (this.counter.CurrentValue != this.counter.EndValue) { return 0; } } return 1; } - private void DrawBack(CTexture ShowTex, double time, double max, double end, bool IsExit) - { + private void DrawBack(CTexture ShowTex, double time, double max, double end, bool IsExit) { if (ShowTex == null) return; if (time - max >= end) time = end + max; @@ -230,8 +181,7 @@ namespace TJAPlayer3 /// キラキラ✨ /// /// - private void DrawStar(float opacity) - { + private void DrawStar(float opacity) { if (TJAPlayer3.Tx.SongLoading_BgWait is null) return; TJAPlayer3.Tx.SongLoading_BgWait.Opacity = (int)opacity; @@ -243,8 +193,7 @@ namespace TJAPlayer3 /// /// /// - private void DrawPlate(float opacity, float scaleX, float scaleY = 1f) - { + private void DrawPlate(float opacity, float scaleX, float scaleY = 1f) { if (TJAPlayer3.Tx.SongLoading_Plate is null) return; var SizeX_Harf = TJAPlayer3.Tx.SongLoading_Plate.szTextureSize.Width / 2.0f; var SizeY_Harf = TJAPlayer3.Tx.SongLoading_Plate.szTextureSize.Height / 2.0f; @@ -255,14 +204,12 @@ namespace TJAPlayer3 TJAPlayer3.Tx.SongLoading_Plate.t2D描画(TJAPlayer3.Skin.SongLoading_Plate_X + SizeX_Harf - (SizeX_Harf * scaleX) - SizeX_Harf, TJAPlayer3.Skin.SongLoading_Plate_Y - SizeY_Harf + ((1f - scaleY) * SizeY_Harf)); } - private void DrawChara(double time, float opacity, float X = -1, float Y = -1) - { + private void DrawChara(double time, float opacity, float X = -1, float Y = -1) { if (TJAPlayer3.Tx.SongLoading_Plate is null || (X == -1 && Y == -1 ? time <= 680 : false)) return; var SizeXHarf = TJAPlayer3.Tx.SongLoading_Chara.szTextureSize.Width / 2f; var SizeY = TJAPlayer3.Tx.SongLoading_Chara.szTextureSize.Height; - if (X == -1 && Y == -1) - { + if (X == -1 && Y == -1) { Y = (float)(Math.Sin((time - 680f) * (Math.PI / 320.0)) * TJAPlayer3.Skin.SongLoading_Chara_Move[1]); X = (float)((time - 680f) / 320.0) * TJAPlayer3.Skin.SongLoading_Chara_Move[0]; } @@ -286,4 +233,4 @@ namespace TJAPlayer3 //----------------- #endregion } -} \ No newline at end of file +} diff --git a/OpenTaiko/src/Stages/CActFIFOWhite.cs b/OpenTaiko/src/Stages/CActFIFOWhite.cs index 0addb202..859409c7 100644 --- a/OpenTaiko/src/Stages/CActFIFOWhite.cs +++ b/OpenTaiko/src/Stages/CActFIFOWhite.cs @@ -1,72 +1,56 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - internal class CActFIFOWhite : CActivity - { +namespace TJAPlayer3 { + internal class CActFIFOWhite : CActivity { // メソッド - public void tフェードアウト開始() - { + public void tフェードアウト開始() { this.mode = EFIFOモード.フェードアウト; - this.counter = new CCounter( 0, 100, 3, TJAPlayer3.Timer ); + this.counter = new CCounter(0, 100, 3, TJAPlayer3.Timer); } - public void tフェードイン開始() - { + public void tフェードイン開始() { this.mode = EFIFOモード.フェードイン; - this.counter = new CCounter( 0, 100, 3, TJAPlayer3.Timer ); + this.counter = new CCounter(0, 100, 3, TJAPlayer3.Timer); } - public void tフェードイン完了() // #25406 2011.6.9 yyagi + public void tフェードイン完了() // #25406 2011.6.9 yyagi { this.counter.CurrentValue = (int)this.counter.EndValue; } // CActivity 実装 - public override void DeActivate() - { - if( !base.IsDeActivated ) - { + public override void DeActivate() { + if (!base.IsDeActivated) { //CDTXMania.tテクスチャの解放( ref this.tx白タイル64x64 ); base.DeActivate(); } } - public override void CreateManagedResource() - { + public override void CreateManagedResource() { //this.tx白タイル64x64 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\Tile white 64x64.png" ), false ); base.CreateManagedResource(); } - public override void ReleaseUnmanagedResource() - { + public override void ReleaseUnmanagedResource() { base.ReleaseUnmanagedResource(); } - public override int Draw() - { - if( base.IsDeActivated || ( this.counter == null ) ) - { + 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 (TJAPlayer3.Tx.Tile_Black != null) - { - TJAPlayer3.Tx.Tile_Black.Opacity = ( this.mode == EFIFOモード.フェードイン ) ? ( ( ( 100 - this.counter.CurrentValue ) * 0xff ) / 100 ) : ( ( this.counter.CurrentValue * 0xff ) / 100 ); - for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / TJAPlayer3.Tx.Tile_Black.szTextureSize.Width); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size + if (TJAPlayer3.Tx.Tile_Black != null) { + TJAPlayer3.Tx.Tile_Black.Opacity = (this.mode == EFIFOモード.フェードイン) ? (((100 - this.counter.CurrentValue) * 0xff) / 100) : ((this.counter.CurrentValue * 0xff) / 100); + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / TJAPlayer3.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 / TJAPlayer3.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 / TJAPlayer3.Tx.Tile_Black.szTextureSize.Height); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size { - TJAPlayer3.Tx.Tile_Black.t2D描画( i * TJAPlayer3.Tx.Tile_Black.szTextureSize.Width, j * TJAPlayer3.Tx.Tile_Black.szTextureSize.Height); + TJAPlayer3.Tx.Tile_Black.t2D描画(i * TJAPlayer3.Tx.Tile_Black.szTextureSize.Width, j * TJAPlayer3.Tx.Tile_Black.szTextureSize.Height); } } } - if( this.counter.CurrentValue != 100 ) - { + if (this.counter.CurrentValue != 100) { return 0; } return 1; diff --git a/OpenTaiko/src/Stages/CActLVLNFont.cs b/OpenTaiko/src/Stages/CActLVLNFont.cs index 77386916..2f3399bd 100644 --- a/OpenTaiko/src/Stages/CActLVLNFont.cs +++ b/OpenTaiko/src/Stages/CActLVLNFont.cs @@ -1,29 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Drawing; using System.Runtime.InteropServices; -using System.Drawing; -using System.Diagnostics; using FDK; -namespace TJAPlayer3 -{ - public class CActLVLNFont : CActivity - { +namespace TJAPlayer3 { + public class CActLVLNFont : CActivity { // コンストラクタ const int numWidth = 15; const int numHeight = 19; - public CActLVLNFont() - { + public CActLVLNFont() { string numChars = "0123456789?-"; st数字 = new ST数字[12, 4]; - for (int j = 0; j < 4; j++) - { - for (int i = 0; i < 12; i++) - { + 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, @@ -37,27 +28,22 @@ namespace TJAPlayer3 // メソッド - public void t文字列描画(int x, int y, string str) - { + 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) - { + 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) // 右詰なら文字列反転して右から描画 + if (bRightAlign) // 右詰なら文字列反転して右から描画 { char[] chars = str.ToCharArray(); Array.Reverse(chars); str = new string(chars); } - foreach (char ch in str) - { + foreach (char ch in str) { int p = (ch == '-' ? 11 : ch - '0'); ST数字 s = st数字[p, (int)efc]; int sw = s.rc.Width; @@ -72,15 +58,12 @@ namespace TJAPlayer3 // CActivity 実装 - public override void CreateManagedResource() - { + public override void CreateManagedResource() { this.tx数値 = TJAPlayer3.tテクスチャの生成(CSkin.Path(@"Graphics\ScreenSelect level numbers.png")); base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { - if ( this.tx数値 != null ) - { + public override void ReleaseManagedResource() { + if (this.tx数値 != null) { this.tx数値.Dispose(); this.tx数値 = null; } @@ -93,21 +76,18 @@ namespace TJAPlayer3 #region [ private ] //----------------- [StructLayout(LayoutKind.Sequential)] - private struct ST数字 - { + private struct ST数字 { public char ch; public Rectangle rc; } - public enum EFontColor - { + public enum EFontColor { Red = 0, Yellow = 1, Orange = 2, White = 3 } - public enum EFontAlign - { + public enum EFontAlign { Left, Right } diff --git a/OpenTaiko/src/Stages/CActNewHeya.cs b/OpenTaiko/src/Stages/CActNewHeya.cs index b7b07d62..a0b389ae 100644 --- a/OpenTaiko/src/Stages/CActNewHeya.cs +++ b/OpenTaiko/src/Stages/CActNewHeya.cs @@ -95,7 +95,7 @@ namespace TJAPlayer3 { if (item.Value.isGold == true) this.ttkDanTitles[idx] = new CActSelect曲リスト.TitleTextureKey(item.Key, this.MenuFont, Color.Gold, Color.Black, 1000); - else + else this.ttkDanTitles[idx] = new CActSelect曲リスト.TitleTextureKey(item.Key, this.MenuFont, Color.White, Color.Black, 1000); idx++; } @@ -185,7 +185,7 @@ namespace TJAPlayer3 MenuTitleKeys[2] = new CActSelect曲リスト.TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_CHARA"), MenuFont, Color.White, Color.Black, 9999); MenuTitleKeys[3] = new CActSelect曲リスト.TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_DAN"), MenuFont, Color.White, Color.Black, 9999); MenuTitleKeys[4] = new CActSelect曲リスト.TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_NAMEPLATE"), MenuFont, Color.White, Color.Black, 9999); - + ttkPuchiCharaNames = new CActSelect曲リスト.TitleTextureKey[TJAPlayer3.Skin.Puchichara_Ptn]; ttkPuchiCharaAuthors = new CActSelect曲リスト.TitleTextureKey[TJAPlayer3.Skin.Puchichara_Ptn]; @@ -196,7 +196,7 @@ namespace TJAPlayer3 ttkPuchiCharaAuthors[i] = new CActSelect曲リスト.TitleTextureKey(TJAPlayer3.Tx.Puchichara[i].metadata.tGetAuthor(), this.MenuFont, Color.White, Color.Black, 1000); } - + ttkCharacterAuthors = new CActSelect曲リスト.TitleTextureKey[TJAPlayer3.Skin.Characters_Ptn]; ttkCharacterNames = new CActSelect曲リスト.TitleTextureKey[TJAPlayer3.Skin.Characters_Ptn]; @@ -206,14 +206,14 @@ namespace TJAPlayer3 ttkCharacterNames[i] = new CActSelect曲リスト.TitleTextureKey(TJAPlayer3.Tx.Characters[i].metadata.tGetName(), this.MenuFont, textColor, Color.Black, 1000); ttkCharacterAuthors[i] = new CActSelect曲リスト.TitleTextureKey(TJAPlayer3.Tx.Characters[i].metadata.tGetAuthor(), this.MenuFont, Color.White, Color.Black, 1000); } - + base.Activate(); } public override void DeActivate() { - + base.DeActivate(); } @@ -299,7 +299,7 @@ namespace TJAPlayer3 TJAPlayer3.SaveFileInstances[CurrentPlayer].tSpendCoins(TJAPlayer3.Tx.Puchichara[CurrentIndex].unlock.Values[0]); TJAPlayer3.Skin.soundDecideSFX.tPlay(); } - else + else { TJAPlayer3.Skin.soundError.tPlay(); } @@ -337,7 +337,7 @@ namespace TJAPlayer3 TJAPlayer3.SaveFileInstances[CurrentPlayer].tSpendCoins(TJAPlayer3.Tx.Characters[CurrentIndex].unlock.Values[0]); TJAPlayer3.Skin.soundDecideSFX.tPlay(); } - else + else { TJAPlayer3.Skin.soundError.tPlay(); } @@ -410,7 +410,7 @@ namespace TJAPlayer3 } InFade.Tick(); - + if (TJAPlayer3.Tx.Tile_Black != null) { TJAPlayer3.Tx.Tile_Black.Opacity = InFade.CurrentValue / 2; @@ -431,7 +431,7 @@ namespace TJAPlayer3 { TJAPlayer3.Tx.NewHeya_Close_Select.t2D描画(TJAPlayer3.Skin.SongSelect_NewHeya_Close_Select[0], TJAPlayer3.Skin.SongSelect_NewHeya_Close_Select[1]); } - else + else { TJAPlayer3.Tx.NewHeya_PlayerPlate_Select.t2D描画(TJAPlayer3.Skin.SongSelect_NewHeya_PlayerPlate_X[CurrentIndex - 1], TJAPlayer3.Skin.SongSelect_NewHeya_PlayerPlate_Y[CurrentIndex - 1]); } @@ -451,13 +451,13 @@ namespace TJAPlayer3 int x = TJAPlayer3.Skin.SongSelect_NewHeya_Box_X[i]; int y = TJAPlayer3.Skin.SongSelect_NewHeya_Box_Y[i]; int index = i - (TJAPlayer3.Skin.SongSelect_NewHeya_Box_Count / 2) + CurrentIndex; - while (index < 0) + while (index < 0) { index += CurrentMaxIndex; } - while (index >= CurrentMaxIndex) + while (index >= CurrentMaxIndex) { - index -= CurrentMaxIndex; + index -= CurrentMaxIndex; } TJAPlayer3.Tx.NewHeya_Box.t2D描画(x, y); @@ -478,7 +478,7 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Characters_Heya_Preview[index]?.t2D拡大率考慮中央基準描画(x + TJAPlayer3.Skin.SongSelect_NewHeya_Box_Chara_Offset[0], y + TJAPlayer3.Skin.SongSelect_NewHeya_Box_Chara_Offset[1]); TJAPlayer3.Tx.Characters_Heya_Preview[index]?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); - + if (ttkCharacterNames[index] != null) { CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkCharacterNames[index]); @@ -497,7 +497,7 @@ namespace TJAPlayer3 && !TJAPlayer3.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Contains(TJAPlayer3.Skin.Characters_DirName[index])) { TJAPlayer3.Tx.NewHeya_Lock?.t2D描画(x + TJAPlayer3.Skin.SongSelect_NewHeya_Lock_Offset[0], y + TJAPlayer3.Skin.SongSelect_NewHeya_Lock_Offset[1]); - + if (this.ttkInfoSection != null) TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkInfoSection) .t2D拡大率考慮上中央基準描画(x + TJAPlayer3.Skin.SongSelect_NewHeya_InfoSection_Offset[0], y + TJAPlayer3.Skin.SongSelect_NewHeya_InfoSection_Offset[1]); @@ -510,13 +510,13 @@ namespace TJAPlayer3 int x = TJAPlayer3.Skin.SongSelect_NewHeya_Box_X[i]; int y = TJAPlayer3.Skin.SongSelect_NewHeya_Box_Y[i]; int index = i - (TJAPlayer3.Skin.SongSelect_NewHeya_Box_Count / 2) + CurrentIndex; - while (index < 0) + while (index < 0) { index += CurrentMaxIndex; } - while (index >= CurrentMaxIndex) + while (index >= CurrentMaxIndex) { - index -= CurrentMaxIndex; + index -= CurrentMaxIndex; } TJAPlayer3.Tx.NewHeya_Box.t2D描画(x, y); @@ -531,11 +531,11 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Puchichara[index].tx.vcScaleRatio.Y = puchiScale; } - TJAPlayer3.Tx.Puchichara[index].tx?.t2D拡大率考慮中央基準描画(x + TJAPlayer3.Skin.SongSelect_NewHeya_Box_Chara_Offset[0], - y + TJAPlayer3.Skin.SongSelect_NewHeya_Box_Chara_Offset[1] + (int)(TJAPlayer3.stageSongSelect.PuchiChara.sineY), - new Rectangle((TJAPlayer3.stageSongSelect.PuchiChara.Counter.CurrentValue + 2 * puriColumn) * TJAPlayer3.Skin.Game_PuchiChara[0], - puriRow * TJAPlayer3.Skin.Game_PuchiChara[1], - TJAPlayer3.Skin.Game_PuchiChara[0], + TJAPlayer3.Tx.Puchichara[index].tx?.t2D拡大率考慮中央基準描画(x + TJAPlayer3.Skin.SongSelect_NewHeya_Box_Chara_Offset[0], + y + TJAPlayer3.Skin.SongSelect_NewHeya_Box_Chara_Offset[1] + (int)(TJAPlayer3.stageSongSelect.PuchiChara.sineY), + new Rectangle((TJAPlayer3.stageSongSelect.PuchiChara.Counter.CurrentValue + 2 * puriColumn) * TJAPlayer3.Skin.Game_PuchiChara[0], + puriRow * TJAPlayer3.Skin.Game_PuchiChara[1], + TJAPlayer3.Skin.Game_PuchiChara[0], TJAPlayer3.Skin.Game_PuchiChara[1])); TJAPlayer3.Tx.Puchichara[index].tx?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); @@ -559,7 +559,7 @@ namespace TJAPlayer3 && !TJAPlayer3.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Contains(TJAPlayer3.Skin.Puchicharas_Name[index])) { TJAPlayer3.Tx.NewHeya_Lock?.t2D描画(x + TJAPlayer3.Skin.SongSelect_NewHeya_Lock_Offset[0], y + TJAPlayer3.Skin.SongSelect_NewHeya_Lock_Offset[1]); - + if (this.ttkInfoSection != null) TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkInfoSection) .t2D拡大率考慮上中央基準描画(x + TJAPlayer3.Skin.SongSelect_NewHeya_InfoSection_Offset[0], y + TJAPlayer3.Skin.SongSelect_NewHeya_InfoSection_Offset[1]); @@ -572,13 +572,13 @@ namespace TJAPlayer3 int x = TJAPlayer3.Skin.SongSelect_NewHeya_Box_X[i]; int y = TJAPlayer3.Skin.SongSelect_NewHeya_Box_Y[i]; int index = i - (TJAPlayer3.Skin.SongSelect_NewHeya_Box_Count / 2) + CurrentIndex; - while (index < 0) + while (index < 0) { index += CurrentMaxIndex; } - while (index >= CurrentMaxIndex) + while (index >= CurrentMaxIndex) { - index -= CurrentMaxIndex; + index -= CurrentMaxIndex; } CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkTitles[index]); @@ -609,7 +609,7 @@ namespace TJAPlayer3 //TJAPlayer3.Tx.NamePlate_Title[iType][TJAPlayer3.NamePlate.ctAnimatedNamePlateTitle.CurrentValue % TJAPlayer3.Skin.Config_NamePlate_Ptn_Title_Boxes[iType]].t2D拡大率考慮上中央基準描画( // x, // y); - } + } tmpTex.t2D拡大率考慮上中央基準描画(x + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[0], y + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[1]); @@ -621,13 +621,13 @@ namespace TJAPlayer3 int x = TJAPlayer3.Skin.SongSelect_NewHeya_Box_X[i]; int y = TJAPlayer3.Skin.SongSelect_NewHeya_Box_Y[i]; int index = i - (TJAPlayer3.Skin.SongSelect_NewHeya_Box_Count / 2) + CurrentIndex; - while (index < 0) + while (index < 0) { index += CurrentMaxIndex; } - while (index >= CurrentMaxIndex) + while (index >= CurrentMaxIndex) { - index -= CurrentMaxIndex; + index -= CurrentMaxIndex; } CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkDanTitles[index]); @@ -655,8 +655,8 @@ namespace TJAPlayer3 /* TJAPlayer3.NamePlate.tNamePlateDisplayNamePlateBase( - x - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2, - y - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Height / 24, + x - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2, + y - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Height / 24, (8 + danGrade)); TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.White); @@ -675,7 +675,7 @@ namespace TJAPlayer3 { TJAPlayer3.Tx.NewHeya_PlayerPlate[TJAPlayer3.GetActualPlayer(i)].t2D描画(TJAPlayer3.Skin.SongSelect_NewHeya_PlayerPlate_X[i], TJAPlayer3.Skin.SongSelect_NewHeya_PlayerPlate_Y[i]); } - + for(int i = 0; i < 5; i++) { TJAPlayer3.Tx.NewHeya_ModeBar.t2D描画(TJAPlayer3.Skin.SongSelect_NewHeya_ModeBar_X[i], TJAPlayer3.Skin.SongSelect_NewHeya_ModeBar_Y[i]); diff --git a/OpenTaiko/src/Stages/CActオプションパネル.cs b/OpenTaiko/src/Stages/CActオプションパネル.cs index 31be1939..c6f891dc 100644 --- a/OpenTaiko/src/Stages/CActオプションパネル.cs +++ b/OpenTaiko/src/Stages/CActオプションパネル.cs @@ -1,36 +1,25 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; +using System.Drawing; using FDK; -namespace TJAPlayer3 -{ - internal class CActオプションパネル : CActivity - { +namespace TJAPlayer3 { + internal class CActオプションパネル : CActivity { // CActivity 実装 - public override void DeActivate() - { - if( !base.IsDeActivated ) - { + public override void DeActivate() { + if (!base.IsDeActivated) { base.DeActivate(); } } - public override void CreateManagedResource() - { - this.txオプションパネル = TJAPlayer3.tテクスチャの生成( CSkin.Path( @"Graphics\Screen option panels.png" ), false ); + public override void CreateManagedResource() { + this.txオプションパネル = TJAPlayer3.tテクスチャの生成(CSkin.Path(@"Graphics\Screen option panels.png"), false); base.CreateManagedResource(); } - public override void ReleaseManagedResource() - { - TJAPlayer3.tテクスチャの解放( ref this.txオプションパネル ); + public override void ReleaseManagedResource() { + TJAPlayer3.tテクスチャの解放(ref this.txオプションパネル); base.ReleaseManagedResource(); } - public override int Draw() - { - if( !base.IsDeActivated ) - { + public override int Draw() { + if (!base.IsDeActivated) { CConfigIni configIni = TJAPlayer3.ConfigIni; /* if( this.txオプションパネル != null ) @@ -87,13 +76,13 @@ namespace TJAPlayer3 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[] 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 @@ -102,18 +91,18 @@ namespace TJAPlayer3 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[] 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 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/CDTXVmode.cs b/OpenTaiko/src/Stages/CDTXVmode.cs index 829ae408..13ea649b 100644 --- a/OpenTaiko/src/Stages/CDTXVmode.cs +++ b/OpenTaiko/src/Stages/CDTXVmode.cs @@ -1,157 +1,128 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; -using System.IO; -using System.Threading; +using System.Diagnostics; using FDK; -namespace TJAPlayer3 -{ - public class CDTXVmode - { - public enum ECommand - { +namespace TJAPlayer3 { + public class CDTXVmode { + public enum ECommand { Stop, Play, Preview - } - + } + /// /// DTXVモードかどうか /// - public bool Enabled - { + public bool Enabled { get; set; - } - + } + /// /// プレビューサウンドの再生が発生した /// - public bool Preview - { + public bool Preview { get; set; - } - + } + /// /// 外部から再指示が発生したか /// - public bool Refreshed - { + public bool Refreshed { get; set; - } - + } + /// /// 演奏開始小節番号 /// - public int nStartBar - { + public int nStartBar { get; set; - } - + } + /// /// DTXファイルの再読み込みが必要かどうか /// - public bool NeedReload - { + public bool NeedReload { get; - private set; -// private set; // 本来はprivate setにすべきだが、デバッグが簡単になるので、しばらくはprivateなしのままにする。 - } - + private set; + // private set; // 本来はprivate setにすべきだが、デバッグが簡単になるので、しばらくはprivateなしのままにする。 + } + /// /// DTXCからのコマンド /// - public ECommand Command - { + public ECommand Command { get; private set; } - public ESoundDeviceType soundDeviceType - { + public ESoundDeviceType soundDeviceType { get; private set; } - public int nASIOdevice - { + public int nASIOdevice { get; private set; - } + } /// /// 前回からサウンドデバイスが変更されたか /// - public bool ChangedSoundDevice - { + public bool ChangedSoundDevice { get; private set; } - public string filename - { - get - { + public string filename { + get { return last_path; } } - public string previewFilename - { + public string previewFilename { get; private set; } - public int previewVolume - { + public int previewVolume { get; private set; } - public int previewPan - { + public int previewPan { get; private set; } - public bool GRmode - { + public bool GRmode { get; private set; } - public bool lastGRmode - { + public bool lastGRmode { get; private set; } - public bool TimeStretch - { + public bool TimeStretch { get; private set; } - public bool lastTimeStretch - { + public bool lastTimeStretch { get; private set; } - public bool VSyncWait - { + public bool VSyncWait { get; private set; } - public bool lastVSyncWait - { + public bool lastVSyncWait { get; private set; - } - - + } + + /// /// コンストラクタ /// - public CDTXVmode() - { + public CDTXVmode() { this.last_path = ""; this.last_timestamp = DateTime.MinValue; this.Enabled = false; @@ -165,8 +136,8 @@ namespace TJAPlayer3 this.lastTimeStretch = false; this.VSyncWait = true; this.lastVSyncWait = true; - } - + } + /// /// DTXファイルのリロードが必要かどうか判定する /// @@ -175,23 +146,21 @@ namespace TJAPlayer3 /// プロパティNeedReloadにも結果が入る /// これを呼び出すたびに、Refreshedをtrueにする /// - public bool bIsNeedReloadDTX( string filename ) - { - if ( !File.Exists( filename ) ) // 指定したファイルが存在しないなら例外終了 + public bool bIsNeedReloadDTX(string filename) { + if (!File.Exists(filename)) // 指定したファイルが存在しないなら例外終了 { - Trace.TraceError( "ファイルが見つかりません。({0})", filename ); - throw new FileNotFoundException(); - //return false; + Trace.TraceError("ファイルが見つかりません。({0})", filename); + throw new FileNotFoundException(); + //return false; } - this.Refreshed = true; - - // 前回とファイル名が異なるか、タイムスタンプが更新されているか、 - // GRmode等の設定を変更したなら、DTX要更新 - DateTime current_timestamp = File.GetLastWriteTime( filename ); - if ( last_path != filename || current_timestamp > last_timestamp || - this.lastGRmode != this.GRmode || this.lastTimeStretch != this.TimeStretch || this.lastVSyncWait != this.VSyncWait ) - { + this.Refreshed = true; + + // 前回とファイル名が異なるか、タイムスタンプが更新されているか、 + // GRmode等の設定を変更したなら、DTX要更新 + DateTime current_timestamp = File.GetLastWriteTime(filename); + if (last_path != filename || current_timestamp > last_timestamp || + this.lastGRmode != this.GRmode || this.lastTimeStretch != this.TimeStretch || this.lastVSyncWait != this.VSyncWait) { this.last_path = filename; this.last_timestamp = current_timestamp; this.lastGRmode = this.GRmode; @@ -203,8 +172,8 @@ namespace TJAPlayer3 } this.NeedReload = false; return false; - } - + } + /// /// /// @@ -213,193 +182,164 @@ namespace TJAPlayer3 /// /// DTXV用の引数であればtrue /// 内部でEnabled, nStartBar, Command, NeedReload, filename, last_path, last_timestampを設定する - public bool ParseArguments( string arg ) - { + public bool ParseArguments(string arg) { bool ret = false, analyzing = true; this.nStartBar = 0; - if ( arg != null ) - { - while ( analyzing ) - { - if ( arg == "" ) - { + if (arg != null) { + while (analyzing) { + if (arg == "") { analyzing = false; - } - else if ( arg.StartsWith( "-V", StringComparison.OrdinalIgnoreCase ) ) // サウンド再生 - { - // -Vvvv,ppp,"filename"の形式。 vvv=volume, ppp=pan. + } else if (arg.StartsWith("-V", StringComparison.OrdinalIgnoreCase)) // サウンド再生 + { + // -Vvvv,ppp,"filename"の形式。 vvv=volume, ppp=pan. this.Enabled = true; this.Command = ECommand.Preview; this.Refreshed = true; ret = true; - arg = arg.Substring( 2 ); + arg = arg.Substring(2); - int pVol = arg.IndexOf( ',' ); //Trace.TraceInformation( "pVol=" + pVol ); - string strVol = arg.Substring( 0, pVol ); //Trace.TraceInformation( "strVol=" + strVol ); - this.previewVolume = Convert.ToInt32( strVol ); //Trace.TraceInformation( "previewVolume=" + previewVolume ); - int pPan = arg.IndexOf( ',', pVol + 1 ); //Trace.TraceInformation( "pPan=" + pPan ); - string strPan = arg.Substring( pVol + 1, pPan - pVol - 1 ); //Trace.TraceInformation( "strPan=" + strPan ); - this.previewPan = Convert.ToInt32( strPan ); //Trace.TraceInformation( "previewPan=" + previewPan ); - - arg = arg.Substring( pPan + 1 ); - arg = arg.Trim( new char[] { '\"' } ); + int pVol = arg.IndexOf(','); //Trace.TraceInformation( "pVol=" + pVol ); + string strVol = arg.Substring(0, pVol); //Trace.TraceInformation( "strVol=" + strVol ); + this.previewVolume = Convert.ToInt32(strVol); //Trace.TraceInformation( "previewVolume=" + previewVolume ); + int pPan = arg.IndexOf(',', pVol + 1); //Trace.TraceInformation( "pPan=" + pPan ); + string strPan = arg.Substring(pVol + 1, pPan - pVol - 1); //Trace.TraceInformation( "strPan=" + strPan ); + this.previewPan = Convert.ToInt32(strPan); //Trace.TraceInformation( "previewPan=" + previewPan ); + + arg = arg.Substring(pPan + 1); + arg = arg.Trim(new char[] { '\"' }); this.previewFilename = arg; analyzing = false; - } - // -S -Nxxx filename - else if ( arg.StartsWith( "-S", StringComparison.OrdinalIgnoreCase ) ) // DTXV再生停止 - { + } + // -S -Nxxx filename + else if (arg.StartsWith("-S", StringComparison.OrdinalIgnoreCase)) // DTXV再生停止 + { this.Enabled = true; this.Command = ECommand.Stop; this.Refreshed = true; ret = true; - arg = arg.Substring( 2 ); - } - else if ( arg.StartsWith( "-D", StringComparison.OrdinalIgnoreCase ) ) - { - // -DW, -DA1など - arg = arg.Substring( 2 ); // -D を削除 - switch ( arg[ 0 ] ) - { + arg = arg.Substring(2); + } else if (arg.StartsWith("-D", StringComparison.OrdinalIgnoreCase)) { + // -DW, -DA1など + arg = arg.Substring(2); // -D を削除 + switch (arg[0]) { #region [ DirectSound ] case 'D': this.ChangedSoundDevice = false; - arg = arg.Substring( 1 ); - break; + arg = arg.Substring(1); + break; #endregion #region [ WASAPI ] case 'W': - if ( this.soundDeviceType != ESoundDeviceType.ExclusiveWASAPI ) - { + if (this.soundDeviceType != ESoundDeviceType.ExclusiveWASAPI) { this.ChangedSoundDevice = true; this.soundDeviceType = ESoundDeviceType.ExclusiveWASAPI; - } - else - { + } else { this.ChangedSoundDevice = false; } - arg = arg.Substring( 1 ); - break; + arg = arg.Substring(1); + break; #endregion #region [ ASIO ] case 'A': - if ( this.soundDeviceType != ESoundDeviceType.ASIO ) - { + if (this.soundDeviceType != ESoundDeviceType.ASIO) { this.ChangedSoundDevice = true; this.soundDeviceType = ESoundDeviceType.ASIO; - } - else - { + } else { this.ChangedSoundDevice = false; } - arg = arg.Substring( 1 ); + arg = arg.Substring(1); int nAsioDev = 0, p = 0; - while ( true ) - { - char c = arg[ 0 ]; - if ( '0' <= c && c <= '9' ) - { + while (true) { + char c = arg[0]; + if ('0' <= c && c <= '9') { nAsioDev *= 10; nAsioDev += c - '0'; p++; - arg = arg.Substring( 1 ); + arg = arg.Substring(1); continue; - } - else - { + } else { break; } } - if ( this.nASIOdevice != nAsioDev ) - { + if (this.nASIOdevice != nAsioDev) { this.ChangedSoundDevice = true; this.nASIOdevice = nAsioDev; } - break; - #endregion - } + break; + #endregion + } #region [ GRmode, TimeStretch, VSyncWait ] - { - // Reload判定は、-Nのところで行う - this.GRmode = ( arg[ 0 ] == 'Y' ); - this.TimeStretch = ( arg[ 1 ] == 'Y' ); - this.VSyncWait = ( arg[ 2 ] == 'Y' ); + { + // Reload判定は、-Nのところで行う + this.GRmode = (arg[0] == 'Y'); + this.TimeStretch = (arg[1] == 'Y'); + this.VSyncWait = (arg[2] == 'Y'); - arg = arg.Substring( 3 ); - } + arg = arg.Substring(3); + } #endregion - } - else if ( arg.StartsWith( "-N", StringComparison.OrdinalIgnoreCase ) ) - { + } else if (arg.StartsWith("-N", StringComparison.OrdinalIgnoreCase)) { this.Enabled = true; this.Command = ECommand.Play; ret = true; - arg = arg.Substring( 2 ); // "-N"を除去 - string[] p = arg.Split( new char[] { ' ' } ); - this.nStartBar = int.Parse( p[ 0 ] ); // 再生開始小節 - if ( this.nStartBar < 0 ) - { + arg = arg.Substring(2); // "-N"を除去 + string[] p = arg.Split(new char[] { ' ' }); + this.nStartBar = int.Parse(p[0]); // 再生開始小節 + if (this.nStartBar < 0) { this.nStartBar = -1; } - int startIndex = arg.IndexOf( ' ' ); - string filename = arg.Substring( startIndex + 1 ); // 再生ファイル名(フルパス) これで引数が終わっていることを想定 - try - { - filename = filename.Trim( new char[] { '\"' } ); - bIsNeedReloadDTX( filename ); - } - catch (Exception e) // 指定ファイルが存在しない - { - Trace.TraceError( e.ToString() ); - Trace.TraceError( "例外が発生しましたが処理を継続します。 (d309a608-7311-411e-a565-19226c3116c2)" ); + int startIndex = arg.IndexOf(' '); + string filename = arg.Substring(startIndex + 1); // 再生ファイル名(フルパス) これで引数が終わっていることを想定 + try { + filename = filename.Trim(new char[] { '\"' }); + bIsNeedReloadDTX(filename); + } catch (Exception e) // 指定ファイルが存在しない + { + Trace.TraceError(e.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (d309a608-7311-411e-a565-19226c3116c2)"); } arg = ""; analyzing = false; } } - } -string[] s = { "Stop", "Play", "Preview" }; -Trace.TraceInformation( "Command: " + s[ (int) this.Command ] ); + } + string[] s = { "Stop", "Play", "Preview" }; + Trace.TraceInformation("Command: " + s[(int)this.Command]); return ret; - } - + } + /// /// Viewer関連の設定のみを更新して、Config.iniに書き出す /// - public void tUpdateConfigIni() - { + public void tUpdateConfigIni() { CConfigIni cc = new CConfigIni(); string path = TJAPlayer3.strEXEのあるフォルダ + "Config.ini"; - if ( File.Exists( path ) ) - { - FileInfo fi = new FileInfo( path ); - if ( fi.Length > 0 ) // Config.iniが0byteだったなら、読み込まない + if (File.Exists(path)) { + FileInfo fi = new FileInfo(path); + if (fi.Length > 0) // Config.iniが0byteだったなら、読み込まない { - try - { - cc.tファイルから読み込み( path ); - } - catch (Exception e) - { - //ConfigIni = new CConfigIni(); // 存在してなければ新規生成 - Trace.TraceError( e.ToString() ); - Trace.TraceError( "例外が発生しましたが処理を継続します。 (825f9ba6-9164-4f2e-8c41-edf4d73c06c9)" ); + try { + cc.tファイルから読み込み(path); + } catch (Exception e) { + //ConfigIni = new CConfigIni(); // 存在してなければ新規生成 + Trace.TraceError(e.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (825f9ba6-9164-4f2e-8c41-edf4d73c06c9)"); } } fi = null; - } - - //cc.nViewerScrollSpeed[0] = TJAPlayer3.ConfigIni.nScrollSpeed[TJAPlayer3.SaveFile]; + } + + //cc.nViewerScrollSpeed[0] = TJAPlayer3.ConfigIni.nScrollSpeed[TJAPlayer3.SaveFile]; cc.bViewerShowDebugStatus = TJAPlayer3.ConfigIni.bDisplayDebugInfo; - cc.bViewerVSyncWait = TJAPlayer3.ConfigIni.bEnableVSync; - cc.bViewerTimeStretch = TJAPlayer3.ConfigIni.bTimeStretch; - cc.bViewerDrums有効 = true; + cc.bViewerVSyncWait = TJAPlayer3.ConfigIni.bEnableVSync; + cc.bViewerTimeStretch = TJAPlayer3.ConfigIni.bTimeStretch; + cc.bViewerDrums有効 = true; - cc.t書き出し( path ); + cc.t書き出し(path); } private string last_path; diff --git a/OpenTaiko/src/Stages/CNamePlate.cs b/OpenTaiko/src/Stages/CNamePlate.cs index e305bbd4..c3edf52a 100644 --- a/OpenTaiko/src/Stages/CNamePlate.cs +++ b/OpenTaiko/src/Stages/CNamePlate.cs @@ -136,4 +136,4 @@ namespace TJAPlayer3 private bool[] bIsPrevAI = new bool[5]; } -} \ No newline at end of file +} diff --git a/OpenTaiko/src/Stages/CStage.cs b/OpenTaiko/src/Stages/CStage.cs index 41bbb2a3..3aa66a05 100644 --- a/OpenTaiko/src/Stages/CStage.cs +++ b/OpenTaiko/src/Stages/CStage.cs @@ -1,18 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Text; -using FDK; +using FDK; -namespace TJAPlayer3 -{ - public class CStage : CActivity - { +namespace TJAPlayer3 { + public class CStage : CActivity { internal EStage eStageID; - public enum EStage - { + public enum EStage { None, StartUp, - Title, // Title screen + Title, // Title screen Options, Config, SongSelect, @@ -20,7 +14,7 @@ namespace TJAPlayer3 SongLoading, Game, Results, - ChangeSkin, // #28195 2011.5.4 yyagi + ChangeSkin, // #28195 2011.5.4 yyagi Heya, TaikoTowers, BoukenTitle, @@ -31,13 +25,12 @@ namespace TJAPlayer3 PlayerStats, ChartEditor, Toolbox, - TEMPLATE, // No effect, for template class + TEMPLATE, // No effect, for template class End } - + internal EPhase ePhaseID; - public enum EPhase - { + public enum EPhase { Common_NORMAL, Common_FADEIN, Common_FADEOUT, @@ -48,21 +41,21 @@ namespace TJAPlayer3 Startup_3_ApplyScoreCache, Startup_4_LoadSongsNotSeenInScoreCacheAndApplyThem, Startup_5_PostProcessSonglist, - Startup_6_LoadTextures, + Startup_6_LoadTextures, Startup_Complete, Title_FadeIn, SongSelect_FadeInFromResults, - SongSelect_FadeOutToCourseSelect, //2016.10.20 kairera0467 + SongSelect_FadeOutToCourseSelect, //2016.10.20 kairera0467 SongSelect_FadeOutToNowLoading, SongLoading_LoadDTXFile, - SongLoading_WaitToLoadWAVFile, + 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_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 25474790..6614a6ac 100644 --- a/OpenTaiko/src/Stages/XX.Templates/CStageTemplate.cs +++ b/OpenTaiko/src/Stages/XX.Templates/CStageTemplate.cs @@ -1,90 +1,74 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +// Minimalist menu class to use for custom menus +namespace TJAPlayer3 { + class CStageTemplate : CStage { + public CStageTemplate() { + base.eStageID = EStage.TEMPLATE; + base.ePhaseID = CStage.EPhase.Common_NORMAL; -// Minimalist menu class to use for custom menus -namespace TJAPlayer3 -{ - class CStageTemplate : CStage - { - public CStageTemplate() - { - base.eStageID = EStage.TEMPLATE; - base.ePhaseID = CStage.EPhase.Common_NORMAL; + // Load CActivity objects here + // base.list子Activities.Add(this.act = new CAct()); - // Load CActivity objects here - // base.list子Activities.Add(this.act = new CAct()); + base.ChildActivities.Add(this.actFOtoTitle = new CActFIFOBlack()); - base.ChildActivities.Add(this.actFOtoTitle = new CActFIFOBlack()); + } - } + public override void Activate() { + // On activation - public override void Activate() - { - // On activation + if (base.IsActivated) + return; - if (base.IsActivated) - return; + base.ePhaseID = CStage.EPhase.Common_NORMAL; + this.eフェードアウト完了時の戻り値 = EReturnValue.Continuation; - base.ePhaseID = CStage.EPhase.Common_NORMAL; - this.eフェードアウト完了時の戻り値 = EReturnValue.Continuation; - - 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() - { - // Ressource allocation + public override void CreateManagedResource() { + // Ressource allocation - base.CreateManagedResource(); - } + base.CreateManagedResource(); + } - public override void ReleaseManagedResource() - { - // Ressource freeing + public override void ReleaseManagedResource() { + // Ressource freeing - base.ReleaseManagedResource(); - } + base.ReleaseManagedResource(); + } - public override int Draw() - { + 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フェードアウト完了時の戻り値; + // 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; - } + return 0; + } - #region [Private] + #region [Private] - public EReturnValue eフェードアウト完了時の戻り値; - public CActFIFOBlack actFOtoTitle; + public EReturnValue eフェードアウト完了時の戻り値; + public CActFIFOBlack actFOtoTitle; - #endregion - } + #endregion + } }