├── .github └── FUNDING.yml ├── .gitignore ├── .gitmodules ├── BeatSaberPlus.sln ├── LICENSE ├── LICENSE.ChatCore ├── Modules ├── BeatSaberPlus_Chat │ ├── BSIPA.cs │ ├── BeatSaberPlus_Chat.csproj │ ├── BeatSaberPlus_Chat.csproj.user │ ├── BuildTargets.targets │ ├── ChatPlexMod_Chat │ │ ├── CConfig.cs │ │ ├── Chat.cs │ │ ├── Components │ │ │ ├── ChatImage.cs │ │ │ ├── ChatMessageText.cs │ │ │ └── ChatMessageWidget.cs │ │ ├── Extensions │ │ │ └── EnhancedFontInfo.cs │ │ ├── Logger.cs │ │ ├── Resources │ │ │ └── ViewerIcon.png │ │ ├── UI │ │ │ ├── ChatFloatingPanelView.cs │ │ │ ├── Data │ │ │ │ └── ChatUserListItem.cs │ │ │ ├── HypeTrainFloatingPanelView.cs │ │ │ ├── ModerationLeftView.cs │ │ │ ├── ModerationMainView.cs │ │ │ ├── ModerationRightView.cs │ │ │ ├── ModerationShortcutsMainView.cs │ │ │ ├── ModerationViewFlowCoordinator.cs │ │ │ ├── PollFloatingPanelView.cs │ │ │ ├── PredictionFloatingPanelView.cs │ │ │ ├── SettingsLeftView.cs │ │ │ ├── SettingsMainView.cs │ │ │ ├── SettingsRightView.cs │ │ │ └── StatusFloatingPanelView.cs │ │ └── Utils │ │ │ └── ChatMessageBuilder.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── manifest.json ├── BeatSaberPlus_ChatEmoteRain │ ├── BSIPA.cs │ ├── BeatSaberPlus_ChatEmoteRain.csproj │ ├── BeatSaberPlus_ChatEmoteRain.csproj.user │ ├── BuildTargets.targets │ ├── ChatPlexMod_ChatEmoteRain │ │ ├── CERConfig.cs │ │ ├── ChatEmoteRain.cs │ │ ├── Logger.cs │ │ └── UI │ │ │ ├── SettingsLeftView.cs │ │ │ ├── SettingsMainView.cs │ │ │ ├── SettingsRightView.cs │ │ │ └── Widgets │ │ │ └── EmitterWidget.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── manifest.json ├── BeatSaberPlus_ChatIntegrations │ ├── BSIPA.cs │ ├── BeatSaber │ │ ├── Actions │ │ │ ├── Camera2.cs │ │ │ ├── ChatRequest.cs │ │ │ ├── GamePlay.cs │ │ │ ├── NoteTweaker.cs │ │ │ └── SongChartVisualizer.cs │ │ ├── Conditions │ │ │ ├── ChatRequest.cs │ │ │ └── GamePlay.cs │ │ ├── Enums │ │ │ ├── BeatmapModType.cs │ │ │ ├── EChatRequestQueueToggle.cs │ │ │ ├── LevelType.cs │ │ │ ├── QueueStatus.cs │ │ │ └── ValueSource.cs │ │ ├── Events │ │ │ ├── LevelEnded.cs │ │ │ ├── LevelPaused.cs │ │ │ ├── LevelResumed.cs │ │ │ └── LevelStarted.cs │ │ ├── Manager.cs │ │ ├── ModPresence.cs │ │ ├── Models │ │ │ ├── Actions │ │ │ │ ├── Camera2.cs │ │ │ │ ├── ChatRequest.cs │ │ │ │ ├── GamePlay.cs │ │ │ │ ├── NoteTweaker.cs │ │ │ │ └── SongChartVisualizer.cs │ │ │ └── Conditions │ │ │ │ ├── ChatRequest.cs │ │ │ │ └── GamePlay.cs │ │ └── ModulePresence.cs │ ├── BeatSaberPlus_ChatIntegrations.csproj │ ├── BeatSaberPlus_ChatIntegrations.csproj.user │ ├── BuildTargets.targets │ ├── ChatPlexMod_ChatIntegrations │ │ ├── Actions │ │ │ ├── Chat.cs │ │ │ ├── EmoteRain.cs │ │ │ ├── Event.cs │ │ │ ├── Misc.cs │ │ │ ├── OBS.cs │ │ │ └── Twitch.cs │ │ ├── CIConfig.cs │ │ ├── ChatIntegrations.cs │ │ ├── ChatIntegrations_Database.cs │ │ ├── ChatIntegrations_Events.cs │ │ ├── Conditions │ │ │ ├── Bits.cs │ │ │ ├── Event.cs │ │ │ ├── Misc.cs │ │ │ ├── OBS.cs │ │ │ ├── Subscription.cs │ │ │ └── User.cs │ │ ├── Enums │ │ │ ├── ChangeType.cs │ │ │ ├── Comparison.cs │ │ │ ├── EVisibility.cs │ │ │ ├── Toggle.cs │ │ │ ├── TwitchSubscribtionPlanType.cs │ │ │ └── Visibility.cs │ │ ├── Events │ │ │ ├── ChatBits.cs │ │ │ ├── ChatCommand.cs │ │ │ ├── ChatFollow.cs │ │ │ ├── ChatPointsReward.cs │ │ │ ├── ChatRaid.cs │ │ │ ├── ChatSubscription.cs │ │ │ ├── Dummy.cs │ │ │ └── VoiceAttackCommand.cs │ │ ├── Interfaces │ │ │ ├── ETriggerType.cs │ │ │ ├── EValueType.cs │ │ │ ├── IAction.cs │ │ │ ├── IActionBase.cs │ │ │ ├── ICondition.cs │ │ │ ├── IConditionBase.cs │ │ │ ├── IEvent.cs │ │ │ ├── IEventBase.cs │ │ │ └── IUIConfigurable.cs │ │ ├── Logger.cs │ │ ├── Models │ │ │ ├── Action.cs │ │ │ ├── Actions │ │ │ │ ├── Chat.cs │ │ │ │ ├── EmoteRain.cs │ │ │ │ ├── Event.cs │ │ │ │ ├── Misc.cs │ │ │ │ └── OBS.cs │ │ │ ├── Condition.cs │ │ │ ├── Conditions │ │ │ │ ├── Bits.cs │ │ │ │ ├── Events.cs │ │ │ │ ├── Misc.cs │ │ │ │ ├── OBS.cs │ │ │ │ ├── Subscription.cs │ │ │ │ └── User.cs │ │ │ ├── Event.cs │ │ │ ├── EventContext.cs │ │ │ └── Events │ │ │ │ ├── ChatBits.cs │ │ │ │ ├── ChatCommand.cs │ │ │ │ ├── ChatFollow.cs │ │ │ │ ├── ChatPointsReward.cs │ │ │ │ ├── ChatSubscription.cs │ │ │ │ └── VoiceAttackCommand.cs │ │ ├── ModulePresence.cs │ │ └── UI │ │ │ ├── Data │ │ │ ├── ActionListItem.cs │ │ │ ├── ConditionListItem.cs │ │ │ └── EventListItem.cs │ │ │ ├── Modals │ │ │ ├── AddXModal.cs │ │ │ ├── EventCreateModal.cs │ │ │ ├── EventImportModal.cs │ │ │ └── EventTemplateModal.cs │ │ │ ├── SettingsLeftView.cs │ │ │ ├── SettingsMainView.cs │ │ │ └── SettingsRightView.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── manifest.json ├── BeatSaberPlus_ChatRequest │ ├── BeatSaberPlus_ChatRequest.csproj │ ├── BeatSaberPlus_ChatRequest.csproj.user │ ├── BuildTargets.targets │ ├── CRConfig.cs │ ├── ChatRequest.cs │ ├── ChatRequest_Commands.cs │ ├── ChatRequest_Database.cs │ ├── ChatRequest_Logic.cs │ ├── Logger.cs │ ├── Models │ │ ├── AddToQueueResult.cs │ │ ├── EAddToQueueResult.cs │ │ ├── RequesterRateLimit.cs │ │ └── SongEntry.cs │ ├── Plugin.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── Blacklist.png │ │ └── Unblacklist.png │ ├── UI │ │ ├── Data │ │ │ ├── CommandListCell.cs │ │ │ └── CommandListItem.cs │ │ ├── ManagerLeftView.cs │ │ ├── ManagerMainView.cs │ │ ├── ManagerRightView.cs │ │ ├── ManagerViewFlowCoordinator.cs │ │ ├── SettingsLeftView.cs │ │ ├── SettingsMainView.cs │ │ └── SettingsRightView.cs │ └── manifest.json ├── BeatSaberPlus_GameTweaker │ ├── BeatSaberPlus_GameTweaker.csproj │ ├── BeatSaberPlus_GameTweaker.csproj.user │ ├── BuildTargets.targets │ ├── Components │ │ ├── FPFCEscape.cs │ │ └── MusicBandLogoRemover.cs │ ├── GTConfig.cs │ ├── GameTweaker.cs │ ├── Logger.cs │ ├── Managers │ │ └── CustomMenuLightManager.cs │ ├── Patches │ │ ├── Lights │ │ │ └── PLightsPatches.cs │ │ ├── PComboUIController.cs │ │ ├── PFireworksController.cs │ │ ├── PLevelListTableCell.cs │ │ ├── PLevelSearchViewController.cs │ │ ├── PMainMenuViewController.cs │ │ ├── PMenuLightsManager.cs │ │ ├── PMusicPackPromoBanner.cs │ │ ├── PNoteCutCoreEffectsSpawner.cs │ │ ├── PNoteDebrisSpawner.cs │ │ ├── PObstacleSaberSparkleEffectManager.cs │ │ ├── PPlayerHeightSettingsController.cs │ │ ├── PPlayerSettingsPanelController.cs │ │ ├── PSaberBurnMarkArea.cs │ │ ├── PSaberBurnMarkSparkles.cs │ │ ├── PSaberClashEffect.cs │ │ └── PStandardLevelDetailView.cs │ ├── Plugin.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Resources │ │ └── Delete.png │ ├── UI │ │ ├── SettingsLeftView.cs │ │ └── SettingsMainView.cs │ └── manifest.json ├── BeatSaberPlus_MenuMusic │ ├── BSIPA.cs │ ├── BeatSaberPlus_MenuMusic.csproj │ ├── BeatSaberPlus_MenuMusic.csproj.user │ ├── BuildTargets.targets │ ├── ChatPlexMod_MenuMusic │ │ ├── Data │ │ │ ├── CustomMusicProvider.cs │ │ │ ├── EMusicProviderType.cs │ │ │ ├── GameMusicProvider.cs │ │ │ ├── IMusicProvider.cs │ │ │ └── Music.cs │ │ ├── Logger.cs │ │ ├── MMConfig.cs │ │ ├── MenuMusic.cs │ │ ├── Patches │ │ │ └── PSongPreviewPlayer.cs │ │ ├── Resources │ │ │ ├── BackgroundMask.png │ │ │ ├── CoverMask.png │ │ │ ├── DefaultCover.png │ │ │ ├── Glass.png │ │ │ ├── Next.png │ │ │ ├── Originals.rar │ │ │ ├── Pause.png │ │ │ ├── Play.png │ │ │ ├── Playlist.png │ │ │ ├── Prev.png │ │ │ ├── Rand.png │ │ │ └── Sound.png │ │ ├── UI │ │ │ ├── PlayerFloatingPanel.cs │ │ │ ├── SettingsLeftView.cs │ │ │ └── SettingsMainView.cs │ │ └── Utils │ │ │ └── ArtProvider.cs │ ├── ModulePresence.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── manifest.json ├── BeatSaberPlus_NoteTweaker │ ├── BeatSaberPlus_NoteTweaker.csproj │ ├── BeatSaberPlus_NoteTweaker.csproj.user │ ├── BuildTargets.targets │ ├── Logger.cs │ ├── NTConfig.cs │ ├── NoteTweaker.cs │ ├── Patches │ │ ├── PBombNoteController.cs │ │ ├── PBurstSliderGameNoteController.cs │ │ ├── PColorNoteVisuals.cs │ │ ├── PGameNoteController.cs │ │ ├── PSliderController.cs │ │ └── PSliderHapticFeedbackInteractionEffect.cs │ ├── Plugin.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── UI │ │ ├── Modals │ │ │ └── ProfileImportModal.cs │ │ ├── SettingsLeftView.cs │ │ ├── SettingsMainView.cs │ │ └── SettingsRightView.cs │ └── manifest.json ├── BeatSaberPlus_SongChartVisualizer │ ├── BSIPA.cs │ ├── BeatSaberPlus_SongChartVisualizer.csproj │ ├── BeatSaberPlus_SongChartVisualizer.csproj.user │ ├── BuildTargets.targets │ ├── ChatPlexMod_SongChartVisualizer │ │ ├── Data │ │ │ ├── Graph.cs │ │ │ ├── GraphBuilder.cs │ │ │ └── GraphPoint.cs │ │ ├── Logger.cs │ │ ├── SCVConfig.cs │ │ ├── SongChartVisualizer.cs │ │ └── UI │ │ │ ├── ChartFloatingPanelView.cs │ │ │ ├── SettingsLeftView.cs │ │ │ ├── SettingsMainView.cs │ │ │ └── SettingsRightView.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── manifest.json └── BeatSaberPlus_SongOverlay │ ├── BeatSaberPlus_SongOverlay.csproj │ ├── BuildTargets.targets │ ├── Logger.cs │ ├── Models │ ├── Event.cs │ ├── MapInfo.cs │ └── Score.cs │ ├── Network │ ├── OverlayServer.cs │ └── OverlaySession.cs │ ├── Plugin.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── SOConfig.cs │ ├── SongOverlay.cs │ ├── UI │ ├── SettingsLeftView.cs │ └── SettingsMainView.cs │ └── manifest.json ├── README.md ├── Samples └── BeatSaberPlus_ModuleTemplate │ ├── BeatSaberPlus_ModuleTemplate.csproj │ ├── BeatSaberPlus_ModuleTemplate.csproj.user │ ├── BuildTargets.targets │ ├── Logger.cs │ ├── MTConfig.cs │ ├── ModuleTemplate.cs │ ├── Plugin.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── UI │ └── SettingsMainView.cs │ └── manifest.json └── SwitchVersion.ps1 /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: BeatSaberPlus 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .vs/ 3 | packages/ 4 | BeatSaberPlus/obj/ 5 | BeatSaberPlus/bin/ 6 | 7 | Modules/BeatSaberPlus_Chat/obj/ 8 | Modules/BeatSaberPlus_Chat/bin/ 9 | Modules/BeatSaberPlus_ChatEmoteRain/obj/ 10 | Modules/BeatSaberPlus_ChatEmoteRain/bin/ 11 | Modules/BeatSaberPlus_ChatIntegrations/obj/ 12 | Modules/BeatSaberPlus_ChatIntegrations/bin/ 13 | Modules/BeatSaberPlus_ChatRequest/obj/ 14 | Modules/BeatSaberPlus_ChatRequest/bin/ 15 | Modules/BeatSaberPlus_GameTweaker/obj/ 16 | Modules/BeatSaberPlus_GameTweaker/bin/ 17 | Modules/BeatSaberPlus_MenuMusic/obj/ 18 | Modules/BeatSaberPlus_MenuMusic/bin/ 19 | Modules/BeatSaberPlus_NoteTweaker/obj/ 20 | Modules/BeatSaberPlus_NoteTweaker/bin/ 21 | Modules/BeatSaberPlus_SongChartVisualizer/obj/ 22 | Modules/BeatSaberPlus_SongChartVisualizer/bin/ 23 | Modules/BeatSaberPlus_SongOverlay/obj/ 24 | Modules/BeatSaberPlus_SongOverlay/bin/ 25 | 26 | PrivateModules/BeatSaberPlusYoutube/obj/ 27 | PrivateModules/BeatSaberPlusYoutube/bin/ 28 | PrivateModules/BeatSaberPlus_ChatIntegrationsActions/obj/ 29 | PrivateModules/BeatSaberPlus_ChatIntegrationsActions/bin/ 30 | PrivateModules/BeatSaberPlus_ChatIntegrationsActions/UI/Crypted/ 31 | PrivateModules/BeatSaberPlus_CustomEdition/obj/ 32 | PrivateModules/BeatSaberPlus_CustomEdition/bin/ 33 | PrivateModules/BeatSaberPlusYoutube/obj/ 34 | PrivateModules/BeatSaberPlusYoutube/bin/ 35 | PrivateModules/BeatSaberPlusYoutube/Resources/Crypted/CRYPTED_Endpoint.txt 36 | PrivateModules/BeatSaberPlus_Multiplayer/obj/ 37 | PrivateModules/BeatSaberPlus_Multiplayer/bin/ 38 | 39 | Plugins/BeatSaberPlus_VoiceAttack/obj/ 40 | Plugins/BeatSaberPlus_VoiceAttack/bin/ 41 | 42 | Samples/BeatSaberPlus_ModuleTemplate/obj/ 43 | Samples/BeatSaberPlus_ModuleTemplate/bin/ 44 | 45 | Test/bin/ 46 | Test/obj/ 47 | 48 | # This .gitignore file should be placed at the root of your Unity project directory 49 | # 50 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 51 | # 52 | ChatEmoteRainUnity/[Ll]ibrary/ 53 | ChatEmoteRainUnity/[Tt]emp/ 54 | ChatEmoteRainUnity/[Oo]bj/ 55 | ChatEmoteRainUnity/[Bb]uild/ 56 | ChatEmoteRainUnity/[Bb]uilds/ 57 | ChatEmoteRainUnity/[Ll]ogs/ 58 | ChatEmoteRainUnity/[Uu]ser[Ss]ettings/ 59 | 60 | # MemoryCaptures can get excessive in size. 61 | # They also could contain extremely sensitive data 62 | ChatEmoteRainUnity/[Mm]emoryCaptures/ 63 | 64 | # Asset meta data should only be ignored when the corresponding asset is also ignored 65 | !ChatEmoteRainUnity/[Aa]ssets/**/*.meta 66 | 67 | # Uncomment this line if you wish to ignore the asset store tools plugin 68 | # /[Aa]ssets/AssetStoreTools* 69 | 70 | # Autogenerated Jetbrains Rider plugin 71 | ChatEmoteRainUnity/[Aa]ssets/Plugins/Editor/JetBrains* 72 | 73 | *.user 74 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ChatPlexSDK-BS"] 2 | path = ChatPlexSDK-BS 3 | url = https://github.com/hardcpp/ChatPlexSDK-BS.git 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 HardCPP 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LICENSE.ChatCore: -------------------------------------------------------------------------------- 1 | 2 | MIT License 3 | 4 | Copyright (c) 2020 Brian Weber 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_Chat/BSIPA.cs: -------------------------------------------------------------------------------- 1 | using IPA; 2 | 3 | namespace BeatSaberPlus_Chat 4 | { 5 | /// 6 | /// Main plugin class 7 | /// 8 | [Plugin(RuntimeOptions.SingleStartInit)] 9 | public class BSIPA 10 | { 11 | /// 12 | /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled). 13 | /// 14 | /// Logger instance 15 | [Init] 16 | public BSIPA(IPA.Logging.Logger p_Logger) 17 | { 18 | /// Setup logger 19 | ChatPlexMod_Chat.Logger.Instance = new CP_SDK.Logging.IPALogger(p_Logger); 20 | } 21 | 22 | //////////////////////////////////////////////////////////////////////////// 23 | //////////////////////////////////////////////////////////////////////////// 24 | 25 | /// 26 | /// On BeatSaberPlus enable 27 | /// 28 | [OnEnable] 29 | public void OnEnable() 30 | { 31 | 32 | } 33 | /// 34 | /// On BeatSaberPlus disable 35 | /// 36 | [OnDisable] 37 | public void OnDisable() 38 | { 39 | 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_Chat/BeatSaberPlus_Chat.csproj.user: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_Chat/BeatSaberPlus_Chat.csproj.user -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/Components/ChatImage.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UI; 2 | 3 | namespace ChatPlexMod_Chat.Components 4 | { 5 | /// 6 | /// Enhanced image with state updater 7 | /// 8 | internal class ChatImage : Image 9 | { 10 | /// 11 | /// Animation state updater instance 12 | /// 13 | internal CP_SDK.Animation.AnimationStateUpdater AnimStateUpdater { get; set; } = null; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/Logger.cs: -------------------------------------------------------------------------------- 1 | namespace ChatPlexMod_Chat 2 | { 3 | /// 4 | /// Logger instance holder 5 | /// 6 | internal class Logger 7 | { 8 | /// 9 | /// Logger instance 10 | /// 11 | internal static CP_SDK.Logging.ILogger Instance; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/Resources/ViewerIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/Resources/ViewerIcon.png -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/UI/Data/ChatUserListItem.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK.Chat.Interfaces; 2 | 3 | namespace ChatPlexMod_Chat.UI.Data 4 | { 5 | /// 6 | /// Chat user list item 7 | /// 8 | internal class ChatUserListItem : CP_SDK.UI.Data.IListItem 9 | { 10 | public IChatService Service; 11 | public IChatUser User; 12 | public string Text; 13 | 14 | //////////////////////////////////////////////////////////////////////////// 15 | //////////////////////////////////////////////////////////////////////////// 16 | 17 | /// 18 | /// Constructor 19 | /// 20 | /// Chat service 21 | /// Chat user 22 | public ChatUserListItem(IChatService p_Service, IChatUser p_User) 23 | { 24 | Service = p_Service; 25 | User = p_User; 26 | 27 | Text = "[" + Service.DisplayName + "] "; 28 | if (User.IsModerator || User.IsBroadcaster) Text += "🗡 "; 29 | else if (User.IsVip) Text += "💎 "; 30 | else if (User.IsSubscriber) Text += "👑 "; 31 | Text += User.DisplayName; 32 | } 33 | 34 | //////////////////////////////////////////////////////////////////////////// 35 | //////////////////////////////////////////////////////////////////////////// 36 | 37 | /// 38 | /// On show 39 | /// 40 | public override void OnShow() 41 | { 42 | if (!(Cell is CP_SDK.UI.Data.TextListCell l_TextListCell)) 43 | return; 44 | 45 | l_TextListCell.Text.SetText(Text); 46 | } 47 | /// 48 | /// On hide 49 | /// 50 | public override void OnHide() { } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/UI/ModerationViewFlowCoordinator.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ChatPlexMod_Chat.UI 4 | { 5 | /// 6 | /// Moderation UI flow coordinator 7 | /// 8 | internal sealed class ModerationViewFlowCoordinator : CP_SDK.UI.FlowCoordinator 9 | { 10 | public override string Title => "Chat Moderation"; 11 | 12 | //////////////////////////////////////////////////////////////////////////// 13 | //////////////////////////////////////////////////////////////////////////// 14 | 15 | private ModerationLeftView m_LeftView; 16 | private ModerationMainView m_MainView; 17 | private ModerationRightView m_RightView; 18 | private ModerationShortcutsMainView m_ShortcutsMainView; 19 | 20 | //////////////////////////////////////////////////////////////////////////// 21 | //////////////////////////////////////////////////////////////////////////// 22 | 23 | /// 24 | /// Constructor 25 | /// 26 | public override void Init() 27 | { 28 | m_LeftView = CP_SDK.UI.UISystem.CreateViewController(); 29 | m_MainView = CP_SDK.UI.UISystem.CreateViewController(); 30 | m_RightView = CP_SDK.UI.UISystem.CreateViewController(); 31 | m_ShortcutsMainView = CP_SDK.UI.UISystem.CreateViewController(); 32 | } 33 | /// 34 | /// On destroy 35 | /// 36 | private void OnDestroy() 37 | { 38 | CP_SDK.UI.UISystem.DestroyUI(ref m_ShortcutsMainView); 39 | CP_SDK.UI.UISystem.DestroyUI(ref m_RightView); 40 | CP_SDK.UI.UISystem.DestroyUI(ref m_LeftView); 41 | CP_SDK.UI.UISystem.DestroyUI(ref m_MainView); 42 | } 43 | 44 | //////////////////////////////////////////////////////////////////////////// 45 | //////////////////////////////////////////////////////////////////////////// 46 | 47 | /// 48 | /// Get initial views controller 49 | /// 50 | /// (Middle, Left, Right) 51 | protected override sealed (CP_SDK.UI.IViewController, CP_SDK.UI.IViewController, CP_SDK.UI.IViewController) GetInitialViewsController() 52 | => (m_MainView, m_LeftView, m_RightView); 53 | 54 | //////////////////////////////////////////////////////////////////////////// 55 | //////////////////////////////////////////////////////////////////////////// 56 | 57 | /// 58 | /// Switch to shortcut view 59 | /// 60 | internal void SwitchToShortcuts() 61 | => ChangeViewControllers(m_ShortcutsMainView); 62 | 63 | //////////////////////////////////////////////////////////////////////////// 64 | //////////////////////////////////////////////////////////////////////////// 65 | 66 | /// 67 | /// On back button pressed 68 | /// 69 | /// Current main view controller 70 | /// True if the event is catched, false if we should dismiss the flow coordinator 71 | public override sealed bool OnBackButtonPressed(CP_SDK.UI.IViewController p_MainViewController) 72 | { 73 | if (p_MainViewController == m_ShortcutsMainView) 74 | { 75 | ChangeViewControllers(m_MainView, m_LeftView, m_RightView); 76 | return true; 77 | } 78 | 79 | return false; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_Chat/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("BeatSaberPlus_Chat")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("HardCPP")] 11 | [assembly: AssemblyProduct("BeatSaberPlus_Chat")] 12 | [assembly: AssemblyCopyright("Copyright © HardCPP 2023")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("en")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("2DE1608F-407F-4B11-BE8A-D4CCDCD910A1")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("6.4.1")] 35 | [assembly: AssemblyFileVersion("6.4.1")] 36 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_Chat/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/beat-saber-modding-group/BSIPA-MetadataFileSchema/master/Schema.json", 3 | "id": "BeatSaberPlus_Chat", 4 | "name": "BeatSaberPlus_Chat", 5 | "author": "HardCPP", 6 | "version": "6.4.1", 7 | "description": "", 8 | "gameVersion": "1.40.0", 9 | "dependsOn": { 10 | "BSIPA": "^4.3.0", 11 | "ChatPlexSDK_BS": "^6.4.1" 12 | }, 13 | "links": { 14 | "project-home": "https://discord.chatplex.org", 15 | "donate": "https://donate.chatplex.org" 16 | } 17 | } -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatEmoteRain/BSIPA.cs: -------------------------------------------------------------------------------- 1 | using IPA; 2 | 3 | namespace BeatSaberPlus_ChatEmoteRain 4 | { 5 | /// 6 | /// Main plugin class 7 | /// 8 | [Plugin(RuntimeOptions.SingleStartInit)] 9 | public class BSIPA 10 | { 11 | /// 12 | /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled). 13 | /// 14 | /// Logger instance 15 | [Init] 16 | public BSIPA(IPA.Logging.Logger p_Logger) 17 | { 18 | /// Setup logger 19 | ChatPlexMod_ChatEmoteRain.Logger.Instance = new CP_SDK.Logging.IPALogger(p_Logger); 20 | } 21 | 22 | //////////////////////////////////////////////////////////////////////////// 23 | //////////////////////////////////////////////////////////////////////////// 24 | 25 | /// 26 | /// On BeatSaberPlus enable 27 | /// 28 | [OnEnable] 29 | public void OnEnable() 30 | { 31 | 32 | } 33 | /// 34 | /// On BeatSaberPlus disable 35 | /// 36 | [OnDisable] 37 | public void OnDisable() 38 | { 39 | 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatEmoteRain/BeatSaberPlus_ChatEmoteRain.csproj.user: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_ChatEmoteRain/BeatSaberPlus_ChatEmoteRain.csproj.user -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatEmoteRain/ChatPlexMod_ChatEmoteRain/Logger.cs: -------------------------------------------------------------------------------- 1 | namespace ChatPlexMod_ChatEmoteRain 2 | { 3 | /// 4 | /// Logger instance holder 5 | /// 6 | internal class Logger 7 | { 8 | /// 9 | /// Logger instance 10 | /// 11 | internal static CP_SDK.Logging.ILogger Instance; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatEmoteRain/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("BeatSaberPlus_ChatEmoteRain")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("HardCPP")] 11 | [assembly: AssemblyProduct("BeatSaberPlus_ChatEmoteRain")] 12 | [assembly: AssemblyCopyright("Copyright © HardCPP 2023")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("en")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("D529EDCC-39F3-47B7-8CD9-B740F8BC6495")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("6.4.1")] 35 | [assembly: AssemblyFileVersion("6.4.1")] 36 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatEmoteRain/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/beat-saber-modding-group/BSIPA-MetadataFileSchema/master/Schema.json", 3 | "id": "BeatSaberPlus_ChatEmoteRain", 4 | "name": "BeatSaberPlus_ChatEmoteRain", 5 | "author": "HardCPP", 6 | "version": "6.4.1", 7 | "description": "", 8 | "gameVersion": "1.40.0", 9 | "dependsOn": { 10 | "BSIPA": "^4.3.0", 11 | "ChatPlexSDK_BS": "^6.4.1" 12 | }, 13 | "links": { 14 | "project-home": "https://discord.chatplex.org", 15 | "donate": "https://donate.chatplex.org" 16 | } 17 | } -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/BSIPA.cs: -------------------------------------------------------------------------------- 1 | using IPA; 2 | 3 | namespace BeatSaberPlus_ChatIntegrations 4 | { 5 | /// 6 | /// Main plugin class 7 | /// 8 | [Plugin(RuntimeOptions.SingleStartInit)] 9 | public class BSIPA 10 | { 11 | /// 12 | /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled). 13 | /// 14 | /// Logger instance 15 | [Init] 16 | public BSIPA(IPA.Logging.Logger p_Logger) 17 | { 18 | /// Setup logger 19 | ChatPlexMod_ChatIntegrations.Logger.Instance = new CP_SDK.Logging.IPALogger(p_Logger); 20 | BeatSaber.Manager.Init(); 21 | } 22 | 23 | //////////////////////////////////////////////////////////////////////////// 24 | //////////////////////////////////////////////////////////////////////////// 25 | 26 | /// 27 | /// On BeatSaberPlus enable 28 | /// 29 | [OnEnable] 30 | public void OnEnable() 31 | { 32 | 33 | } 34 | /// 35 | /// On BeatSaberPlus disable 36 | /// 37 | [OnDisable] 38 | public void OnDisable() 39 | { 40 | 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Actions/SongChartVisualizer.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK.XUI; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace BeatSaberPlus_ChatIntegrations.BeatSaber.Actions 6 | { 7 | public class SongChartVisualizer_ToggleVisibility 8 | : ChatPlexMod_ChatIntegrations.Interfaces.IAction 9 | { 10 | private XUIDropdown m_ChangeType = null; 11 | 12 | //////////////////////////////////////////////////////////////////////////// 13 | //////////////////////////////////////////////////////////////////////////// 14 | 15 | public override string Description => "Show or hide the SongChartVisualizer ingame"; 16 | 17 | //////////////////////////////////////////////////////////////////////////// 18 | //////////////////////////////////////////////////////////////////////////// 19 | 20 | public override sealed void BuildUI(Transform p_Parent) 21 | { 22 | XUIElements = new IXUIElement[] 23 | { 24 | Templates.SettingsHGroup("Change type", 25 | XUIDropdown.Make() 26 | .SetOptions(ChatPlexMod_ChatIntegrations.Enums.Toggle.S).SetValue(ChatPlexMod_ChatIntegrations.Enums.Toggle.ToStr(Model.ChangeType)) 27 | .OnValueChanged((_, __) => OnSettingChanged()) 28 | .Bind(ref m_ChangeType) 29 | ) 30 | }; 31 | 32 | BuildUIAuto(p_Parent); 33 | } 34 | 35 | //////////////////////////////////////////////////////////////////////////// 36 | //////////////////////////////////////////////////////////////////////////// 37 | 38 | private void OnSettingChanged() 39 | => Model.ChangeType = ChatPlexMod_ChatIntegrations.Enums.Toggle.ToEnum(m_ChangeType.Element.GetValue()); 40 | 41 | //////////////////////////////////////////////////////////////////////////// 42 | //////////////////////////////////////////////////////////////////////////// 43 | 44 | public override IEnumerator Eval(ChatPlexMod_ChatIntegrations.Models.EventContext p_Context) 45 | { 46 | if (!ModulePresence.SongChartVisualizer) 47 | { 48 | p_Context.HasActionFailed = true; 49 | CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage("SongChartVisualizer: Action failed, SongChartVisualizer module is missing!"); 50 | yield break; 51 | } 52 | 53 | var l_Instance = ChatPlexMod_SongChartVisualizer.SongChartVisualizer.Instance; 54 | switch (Model.ChangeType) 55 | { 56 | case ChatPlexMod_ChatIntegrations.Enums.Toggle.E.Toggle: 57 | l_Instance?.ToggleVisibility(); 58 | break; 59 | case ChatPlexMod_ChatIntegrations.Enums.Toggle.E.Enable: 60 | l_Instance?.SetVisible(true); 61 | break; 62 | case ChatPlexMod_ChatIntegrations.Enums.Toggle.E.Disable: 63 | l_Instance?.SetVisible(false); 64 | break; 65 | } 66 | 67 | yield return null; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Enums/BeatmapModType.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace BeatSaberPlus_ChatIntegrations.BeatSaber.Enums 5 | { 6 | public static class BeatmapModType 7 | { 8 | public enum E 9 | { 10 | All, 11 | NonNoodle, 12 | Noodle, 13 | Chroma, 14 | NoodleOrChroma 15 | } 16 | 17 | public static List S = new List() 18 | { 19 | "All", 20 | "NonNoodle", 21 | "Noodle", 22 | "Chroma", 23 | "NoodleOrChroma" 24 | }; 25 | 26 | public static int ValueCount => S.Count; 27 | 28 | public static int ToInt(string p_Str) 29 | => Mathf.Clamp(S.IndexOf(p_Str), 0, ValueCount - 1); 30 | public static int ToInt(E p_Enum) 31 | => Mathf.Clamp((int)p_Enum, 0, ValueCount - 1); 32 | 33 | public static E ToEnum(string p_Str) 34 | => (E)ToInt(p_Str); 35 | public static E ToEnum(int p_Int) 36 | => (E)Mathf.Clamp(p_Int, 0, ValueCount - 1); 37 | 38 | public static string ToStr(int p_Int) 39 | => S[Mathf.Clamp(p_Int, 0, ValueCount - 1)]; 40 | public static string ToStr(E p_Enum) 41 | => S[Mathf.Clamp((int)p_Enum, 0, ValueCount - 1)]; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Enums/EChatRequestQueueToggle.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace BeatSaberPlus_ChatIntegrations.BeatSaber.Enums 5 | { 6 | public static class EChatRequestQueueToggle 7 | { 8 | public enum E 9 | { 10 | Toggle = 0, 11 | Open = 1, 12 | Close = 2 13 | } 14 | 15 | public static List S = new List() 16 | { 17 | "Toggle", 18 | "Open", 19 | "Close", 20 | }; 21 | 22 | public static int ValueCount => S.Count; 23 | 24 | public static int ToInt(string p_Str) 25 | => Mathf.Clamp(S.IndexOf(p_Str), 0, ValueCount - 1); 26 | public static int ToInt(E p_Enum) 27 | => Mathf.Clamp((int)p_Enum, 0, ValueCount - 1); 28 | 29 | public static E ToEnum(string p_Str) 30 | => (E)ToInt(p_Str); 31 | public static E ToEnum(int p_Int) 32 | => (E)Mathf.Clamp(p_Int, 0, ValueCount - 1); 33 | 34 | public static string ToStr(int p_Int) 35 | => S[Mathf.Clamp(p_Int, 0, ValueCount - 1)]; 36 | public static string ToStr(E p_Enum) 37 | => S[Mathf.Clamp((int)p_Enum, 0, ValueCount - 1)]; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Enums/LevelType.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace BeatSaberPlus_ChatIntegrations.BeatSaber.Enums 5 | { 6 | public static class LevelType 7 | { 8 | public enum E 9 | { 10 | Any, 11 | Solo, 12 | Multiplayer, 13 | SoloAndMultiplayer, 14 | Replay, 15 | } 16 | 17 | public static List S = new List() 18 | { 19 | "Any", 20 | "Solo", 21 | "Multiplayer", 22 | "SoloAndMultiplayer", 23 | "Replay" 24 | }; 25 | 26 | public static int ValueCount => S.Count; 27 | 28 | public static int ToInt(string p_Str) 29 | => Mathf.Clamp(S.IndexOf(p_Str), 0, ValueCount - 1); 30 | public static int ToInt(E p_Enum) 31 | => Mathf.Clamp((int)p_Enum, 0, ValueCount - 1); 32 | 33 | public static E ToEnum(string p_Str) 34 | => (E)ToInt(p_Str); 35 | public static E ToEnum(int p_Int) 36 | => (E)Mathf.Clamp(p_Int, 0, ValueCount - 1); 37 | 38 | public static string ToStr(int p_Int) 39 | => S[Mathf.Clamp(p_Int, 0, ValueCount - 1)]; 40 | public static string ToStr(E p_Enum) 41 | => S[Mathf.Clamp((int)p_Enum, 0, ValueCount - 1)]; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Enums/QueueStatus.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace BeatSaberPlus_ChatIntegrations.BeatSaber.Enums 5 | { 6 | public static class QueueStatus 7 | { 8 | public enum E 9 | { 10 | Open, 11 | Closed 12 | } 13 | 14 | public static List S = new List() 15 | { 16 | "Open", 17 | "Closed" 18 | }; 19 | 20 | public static int ValueCount => S.Count; 21 | 22 | public static int ToInt(string p_Str) 23 | => Mathf.Clamp(S.IndexOf(p_Str), 0, ValueCount - 1); 24 | public static int ToInt(E p_Enum) 25 | => Mathf.Clamp((int)p_Enum, 0, ValueCount - 1); 26 | 27 | public static E ToEnum(string p_Str) 28 | => (E)ToInt(p_Str); 29 | public static E ToEnum(int p_Int) 30 | => (E)Mathf.Clamp(p_Int, 0, ValueCount - 1); 31 | 32 | public static string ToStr(int p_Int) 33 | => S[Mathf.Clamp(p_Int, 0, ValueCount - 1)]; 34 | public static string ToStr(E p_Enum) 35 | => S[Mathf.Clamp((int)p_Enum, 0, ValueCount - 1)]; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Enums/ValueSource.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace BeatSaberPlus_ChatIntegrations.BeatSaber.Enums 5 | { 6 | public static class ValueSource 7 | { 8 | public enum E 9 | { 10 | Random, 11 | User, 12 | Event, 13 | Config 14 | } 15 | 16 | public static List S = new List() 17 | { 18 | "Random", 19 | "User", 20 | "Event", 21 | "Config" 22 | }; 23 | 24 | public static int ValueCount => S.Count; 25 | 26 | public static int ToInt(string p_Str) 27 | => Mathf.Clamp(S.IndexOf(p_Str), 0, ValueCount - 1); 28 | public static int ToInt(E p_Enum) 29 | => Mathf.Clamp((int)p_Enum, 0, ValueCount - 1); 30 | 31 | public static E ToEnum(string p_Str) 32 | => (E)ToInt(p_Str); 33 | public static E ToEnum(int p_Int) 34 | => (E)Mathf.Clamp(p_Int, 0, ValueCount - 1); 35 | 36 | public static string ToStr(int p_Int) 37 | => S[Mathf.Clamp(p_Int, 0, ValueCount - 1)]; 38 | public static string ToStr(E p_Enum) 39 | => S[Mathf.Clamp((int)p_Enum, 0, ValueCount - 1)]; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/ModPresence.cs: -------------------------------------------------------------------------------- 1 | namespace BeatSaberPlus_ChatIntegrations.BeatSaber 2 | { 3 | internal static class ModPresence 4 | { 5 | private static bool? m_Camera2; 6 | 7 | //////////////////////////////////////////////////////////////////////////// 8 | //////////////////////////////////////////////////////////////////////////// 9 | 10 | internal static bool Camera2 { get { 11 | if (!m_Camera2.HasValue) 12 | m_Camera2 = IPA.Loader.PluginManager.GetPluginFromId("Camera2") != null; 13 | 14 | return m_Camera2.Value; 15 | } } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Models/Actions/Camera2.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using Newtonsoft.Json.Linq; 4 | 5 | namespace BeatSaberPlus_ChatIntegrations.BeatSaber.Models.Actions 6 | { 7 | public class Camera2_SwitchToScene : ChatPlexMod_ChatIntegrations.Models.Action 8 | { 9 | [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] 10 | public string SceneName = ""; 11 | } 12 | 13 | //////////////////////////////////////////////////////////////////////////// 14 | //////////////////////////////////////////////////////////////////////////// 15 | 16 | public class Camera2_ToggleCamera : ChatPlexMod_ChatIntegrations.Models.Action 17 | { 18 | [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] 19 | public string CameraName = ""; 20 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include), JsonConverter(typeof(StringEnumConverter))] 21 | public ChatPlexMod_ChatIntegrations.Enums.Toggle.E ChangeType = ChatPlexMod_ChatIntegrations.Enums.Toggle.E.Toggle; 22 | 23 | //////////////////////////////////////////////////////////////////////////// 24 | //////////////////////////////////////////////////////////////////////////// 25 | 26 | public override void OnDeserialized(JObject p_Serialized) 27 | { 28 | if (p_Serialized.ContainsKey("ChangeType") 29 | || !p_Serialized.ContainsKey("ToggleType")) 30 | return; 31 | 32 | ChangeType = ChatPlexMod_ChatIntegrations.Enums.Toggle.ToEnum(p_Serialized["ToggleType"].Value()); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Models/Actions/ChatRequest.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace BeatSaberPlus_ChatIntegrations.BeatSaber.Models.Actions 5 | { 6 | public class ChatRequest_AddToQueue : ChatPlexMod_ChatIntegrations.Models.Action 7 | { 8 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include), JsonConverter(typeof(StringEnumConverter))] 9 | public Enums.ValueSource.E ValueSource = Enums.ValueSource.E.User; 10 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 11 | public string TitlePrefix = "[ChatIntegrations]"; 12 | [JsonProperty] 13 | public bool AsModerator = false; 14 | [JsonProperty] 15 | public bool AddToTop = false; 16 | [JsonProperty] 17 | public bool SendChatMessage = true; 18 | } 19 | 20 | //////////////////////////////////////////////////////////////////////////// 21 | //////////////////////////////////////////////////////////////////////////// 22 | 23 | public class ChatRequest_ToggleQueue : ChatPlexMod_ChatIntegrations.Models.Action 24 | { 25 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include), JsonConverter(typeof(StringEnumConverter))] 26 | public Enums.EChatRequestQueueToggle.E ChangeType = Enums.EChatRequestQueueToggle.E.Toggle; 27 | } 28 | } -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Models/Actions/NoteTweaker.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using Newtonsoft.Json.Linq; 4 | 5 | namespace BeatSaberPlus_ChatIntegrations.BeatSaber.Models.Actions 6 | { 7 | public class NoteTweaker_SwitchProfile : ChatPlexMod_ChatIntegrations.Models.Action 8 | { 9 | [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] 10 | public string Profile = ""; 11 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 12 | public bool Temporary = true; 13 | 14 | //////////////////////////////////////////////////////////////////////////// 15 | //////////////////////////////////////////////////////////////////////////// 16 | 17 | public override void OnDeserialized(JObject p_Serialized) 18 | { 19 | if (p_Serialized.ContainsKey("Profile") 20 | || !p_Serialized.ContainsKey("BaseValue")) 21 | return; 22 | 23 | Profile = p_Serialized["BaseValue"].Value(); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Models/Actions/SongChartVisualizer.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using Newtonsoft.Json.Linq; 4 | 5 | namespace BeatSaberPlus_ChatIntegrations.BeatSaber.Models.Actions 6 | { 7 | public class SongChartVisualizer_ToggleVisibility : ChatPlexMod_ChatIntegrations.Models.Action 8 | { 9 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include), JsonConverter(typeof(StringEnumConverter))] 10 | public ChatPlexMod_ChatIntegrations.Enums.Toggle.E ChangeType = ChatPlexMod_ChatIntegrations.Enums.Toggle.E.Toggle; 11 | 12 | //////////////////////////////////////////////////////////////////////////// 13 | //////////////////////////////////////////////////////////////////////////// 14 | 15 | public override void OnDeserialized(JObject p_Serialized) 16 | { 17 | if (p_Serialized.ContainsKey("ChangeType") 18 | || !p_Serialized.ContainsKey("ToggleType")) 19 | return; 20 | 21 | ChangeType = ChatPlexMod_ChatIntegrations.Enums.Toggle.ToEnum(p_Serialized["ToggleType"].Value()); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Models/Conditions/GamePlay.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace BeatSaberPlus_ChatIntegrations.BeatSaber.Models.Conditions 4 | { 5 | public class GamePlay_LevelEndType : ChatPlexMod_ChatIntegrations.Models.Condition 6 | { 7 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 8 | public bool Pass = true; 9 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 10 | public bool Fail = true; 11 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 12 | public bool Quit = true; 13 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 14 | public bool Restart = true; 15 | } 16 | 17 | public class GamePlay_PlayingMap : ChatPlexMod_ChatIntegrations.Models.Condition 18 | { 19 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include), JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] 20 | public Enums.LevelType.E LevelType = Enums.LevelType.E.Solo; 21 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include), JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] 22 | public Enums.BeatmapModType.E BeatmapModType = Enums.BeatmapModType.E.All; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/ModulePresence.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | namespace BeatSaberPlus_ChatIntegrations.BeatSaber 4 | { 5 | internal static class ModulePresence 6 | { 7 | private static CP_SDK.IModuleBase m_ChatRequest; 8 | private static bool? m_GameTweaker; 9 | private static bool? m_NoteTweaker; 10 | private static bool? m_SongChartVisualizer; 11 | 12 | //////////////////////////////////////////////////////////////////////////// 13 | //////////////////////////////////////////////////////////////////////////// 14 | 15 | internal static bool ChatRequest { get { 16 | if (m_ChatRequest == null) 17 | m_ChatRequest = CP_SDK.ChatPlexSDK.GetModules().FirstOrDefault(x => x.Name == "Chat Request"); 18 | 19 | return m_ChatRequest?.IsEnabled ?? false; 20 | } } 21 | internal static bool GameTweaker { get { 22 | if (!m_GameTweaker.HasValue) 23 | m_GameTweaker = CP_SDK.ChatPlexSDK.GetModules().Any(x => x.Name == "Game Tweaker"); 24 | 25 | return m_GameTweaker.Value; 26 | } } 27 | internal static bool NoteTweaker { get { 28 | if (!m_NoteTweaker.HasValue) 29 | m_NoteTweaker = CP_SDK.ChatPlexSDK.GetModules().Any(x => x.Name == "Note Tweaker"); 30 | 31 | return m_NoteTweaker.Value; 32 | } } 33 | internal static bool SongChartVisualizer { get { 34 | if (!m_SongChartVisualizer.HasValue) 35 | m_SongChartVisualizer = CP_SDK.ChatPlexSDK.GetModules().Any(x => x.Name == "Song Chart Visualizer"); 36 | 37 | return m_SongChartVisualizer.Value; 38 | } } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/BeatSaberPlus_ChatIntegrations.csproj.user: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_ChatIntegrations/BeatSaberPlus_ChatIntegrations.csproj.user -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/CIConfig.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System.IO; 3 | 4 | namespace ChatPlexMod_ChatIntegrations 5 | { 6 | internal class CIConfig : CP_SDK.Config.JsonConfig 7 | { 8 | [JsonProperty] internal bool Enabled = false; 9 | [JsonProperty] internal string DataLocation = Path.Combine(CP_SDK.ChatPlexSDK.BasePath, $"UserData/{CP_SDK.ChatPlexSDK.ProductName}Plus/ChatIntegrations/"); 10 | [JsonProperty] internal string LastBackup = ""; 11 | 12 | //////////////////////////////////////////////////////////////////////////// 13 | //////////////////////////////////////////////////////////////////////////// 14 | 15 | /// 16 | /// Get relative config path 17 | /// 18 | /// 19 | public override string GetRelativePath() 20 | => $"{CP_SDK.ChatPlexSDK.ProductName}Plus/ChatIntegrations/Config"; 21 | 22 | //////////////////////////////////////////////////////////////////////////// 23 | //////////////////////////////////////////////////////////////////////////// 24 | 25 | /// 26 | /// On config init 27 | /// 28 | /// On creation 29 | protected override void OnInit(bool p_OnCreation) 30 | { 31 | 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Conditions/Bits.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK.XUI; 2 | using UnityEngine; 3 | 4 | namespace ChatPlexMod_ChatIntegrations.Conditions 5 | { 6 | public class Bits_Amount 7 | : Interfaces.ICondition 8 | { 9 | private XUIDropdown m_Comparison = null; 10 | private XUISlider m_Count = null; 11 | 12 | //////////////////////////////////////////////////////////////////////////// 13 | //////////////////////////////////////////////////////////////////////////// 14 | 15 | public override string Description => "Add conditions on chat request queue size!"; 16 | 17 | //////////////////////////////////////////////////////////////////////////// 18 | //////////////////////////////////////////////////////////////////////////// 19 | 20 | public override sealed void BuildUI(Transform p_Parent) 21 | { 22 | XUIElements = new IXUIElement[] 23 | { 24 | Templates.SettingsHGroup("Comparison", 25 | XUIDropdown.Make() 26 | .SetOptions(Enums.Comparison.S).SetValue(Enums.Comparison.ToStr(Model.Comparison)) 27 | .OnValueChanged((_, __) => OnSettingChanged()) 28 | .Bind(ref m_Comparison) 29 | ), 30 | 31 | Templates.SettingsHGroup("Count", 32 | XUISlider.Make() 33 | .SetMinValue(1.0f).SetMaxValue(10000.0f).SetIncrements(1.0f).SetInteger(true) 34 | .SetValue(Model.Count).OnValueChanged((_) => OnSettingChanged()) 35 | .Bind(ref m_Count) 36 | ) 37 | }; 38 | 39 | BuildUIAuto(p_Parent); 40 | } 41 | 42 | //////////////////////////////////////////////////////////////////////////// 43 | //////////////////////////////////////////////////////////////////////////// 44 | 45 | private void OnSettingChanged() 46 | { 47 | Model.Comparison = Enums.Comparison.ToEnum(m_Comparison.Element.GetValue()); 48 | Model.Count = (uint)m_Count.Element.GetValue(); 49 | } 50 | 51 | //////////////////////////////////////////////////////////////////////////// 52 | //////////////////////////////////////////////////////////////////////////// 53 | 54 | public override bool Eval(Models.EventContext p_Context) 55 | { 56 | if (!p_Context.BitsEvent.HasValue) 57 | return false; 58 | 59 | return Enums.Comparison.Evaluate(Model.Comparison, (uint)p_Context.BitsEvent.Value, Model.Count); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Enums/ChangeType.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace ChatPlexMod_ChatIntegrations.Enums 5 | { 6 | public static class ChangeType 7 | { 8 | public enum E 9 | { 10 | Random, 11 | Input, 12 | EventInput 13 | } 14 | 15 | public static List S = new List() 16 | { 17 | "Random", 18 | "Input", 19 | "EventInput" 20 | }; 21 | 22 | public static int ValueCount => S.Count; 23 | 24 | public static int ToInt(string p_Str) 25 | => Mathf.Clamp(S.IndexOf(p_Str), 0, ValueCount - 1); 26 | public static int ToInt(E p_Enum) 27 | => Mathf.Clamp((int)p_Enum, 0, ValueCount - 1); 28 | 29 | public static E ToEnum(string p_Str) 30 | => (E)ToInt(p_Str); 31 | public static E ToEnum(int p_Int) 32 | => (E)Mathf.Clamp(p_Int, 0, ValueCount - 1); 33 | 34 | public static string ToStr(int p_Int) 35 | => S[Mathf.Clamp(p_Int, 0, ValueCount - 1)]; 36 | public static string ToStr(E p_Enum) 37 | => S[Mathf.Clamp((int)p_Enum, 0, ValueCount - 1)]; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Enums/Comparison.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace ChatPlexMod_ChatIntegrations.Enums 5 | { 6 | public static class Comparison 7 | { 8 | public enum E 9 | { 10 | Less, 11 | LessOrEqual, 12 | Equal, 13 | GreaterOrEqual, 14 | Greater 15 | } 16 | 17 | public static List S = new List() 18 | { 19 | "Less", 20 | "LessOrEqual", 21 | "Equal", 22 | "GreaterOrEqual", 23 | "Greater" 24 | }; 25 | 26 | public static int ValueCount => S.Count; 27 | 28 | public static bool Evaluate(E p_Comparison, int p_Left, int p_Right) 29 | { 30 | switch (p_Comparison) 31 | { 32 | case E.Less: return p_Left < p_Right; 33 | case E.LessOrEqual: return p_Left <= p_Right; 34 | case E.Equal: return p_Left == p_Right; 35 | case E.GreaterOrEqual: return p_Left >= p_Right; 36 | case E.Greater: return p_Left > p_Right; 37 | } 38 | return false; 39 | } 40 | public static bool Evaluate(E p_Comparison, uint p_Left, uint p_Right) 41 | { 42 | switch (p_Comparison) 43 | { 44 | case E.Less: return p_Left < p_Right; 45 | case E.LessOrEqual: return p_Left <= p_Right; 46 | case E.Equal: return p_Left == p_Right; 47 | case E.GreaterOrEqual: return p_Left >= p_Right; 48 | case E.Greater: return p_Left > p_Right; 49 | } 50 | return false; 51 | } 52 | 53 | public static int ToInt(string p_Str) 54 | => Mathf.Clamp(S.IndexOf(p_Str), 0, ValueCount - 1); 55 | public static int ToInt(E p_Enum) 56 | => Mathf.Clamp((int)p_Enum, 0, ValueCount - 1); 57 | 58 | public static E ToEnum(string p_Str) 59 | => (E)ToInt(p_Str); 60 | public static E ToEnum(int p_Int) 61 | => (E)Mathf.Clamp(p_Int, 0, ValueCount - 1); 62 | 63 | public static string ToStr(int p_Int) 64 | => S[Mathf.Clamp(p_Int, 0, ValueCount - 1)]; 65 | public static string ToStr(E p_Enum) 66 | => S[Mathf.Clamp((int)p_Enum, 0, ValueCount - 1)]; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Enums/EVisibility.cs: -------------------------------------------------------------------------------- 1 | namespace ChatPlexMod_ChatIntegrations.Enums 2 | { 3 | public enum EVisibility 4 | { 5 | Visible, 6 | Hidden 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Enums/Toggle.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace ChatPlexMod_ChatIntegrations.Enums 5 | { 6 | public static class Toggle 7 | { 8 | public enum E 9 | { 10 | Toggle = 0, 11 | Enable = 1, 12 | Disable = 2 13 | } 14 | 15 | public static List S = new List() 16 | { 17 | "Toggle", 18 | "Enable", 19 | "Disable" 20 | }; 21 | 22 | public static int ValueCount => S.Count; 23 | 24 | public static int ToInt(string p_Str) 25 | => Mathf.Clamp(S.IndexOf(p_Str), 0, ValueCount - 1); 26 | public static int ToInt(E p_Enum) 27 | => Mathf.Clamp((int)p_Enum, 0, ValueCount - 1); 28 | 29 | public static E ToEnum(string p_Str) 30 | => (E)ToInt(p_Str); 31 | public static E ToEnum(int p_Int) 32 | => (E)Mathf.Clamp(p_Int, 0, ValueCount - 1); 33 | 34 | public static string ToStr(int p_Int) 35 | => S[Mathf.Clamp(p_Int, 0, ValueCount - 1)]; 36 | public static string ToStr(E p_Enum) 37 | => S[Mathf.Clamp((int)p_Enum, 0, ValueCount - 1)]; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Enums/TwitchSubscribtionPlanType.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace ChatPlexMod_ChatIntegrations.Enums 5 | { 6 | public static class TwitchSubscribtionPlanType 7 | { 8 | public enum E 9 | { 10 | Prime, 11 | Tier1, 12 | Tier2, 13 | Tier3 14 | } 15 | 16 | public static List S = new List() 17 | { 18 | "Prime", 19 | "Tier1", 20 | "Tier2", 21 | "Tier3" 22 | }; 23 | 24 | public static int ValueCount => S.Count; 25 | 26 | public static int ToInt(string p_Str) 27 | => Mathf.Clamp(S.IndexOf(p_Str), 0, ValueCount - 1); 28 | public static int ToInt(E p_Enum) 29 | => Mathf.Clamp((int)p_Enum, 0, ValueCount - 1); 30 | 31 | public static E ToEnum(string p_Str) 32 | => (E)ToInt(p_Str); 33 | public static E ToEnum(int p_Int) 34 | => (E)Mathf.Clamp(p_Int, 0, ValueCount - 1); 35 | 36 | public static string ToStr(int p_Int) 37 | => S[Mathf.Clamp(p_Int, 0, ValueCount - 1)]; 38 | public static string ToStr(E p_Enum) 39 | => S[Mathf.Clamp((int)p_Enum, 0, ValueCount - 1)]; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Enums/Visibility.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace ChatPlexMod_ChatIntegrations.Enums 5 | { 6 | public static class Visibility 7 | { 8 | public enum E 9 | { 10 | Visible, 11 | Hidden 12 | } 13 | 14 | public static List S = new List() 15 | { 16 | "Visible", 17 | "Hidden" 18 | }; 19 | 20 | public static int ValueCount => S.Count; 21 | 22 | public static int ToInt(string p_Str) 23 | => Mathf.Clamp(S.IndexOf(p_Str), 0, ValueCount - 1); 24 | public static int ToInt(E p_Enum) 25 | => Mathf.Clamp((int)p_Enum, 0, ValueCount - 1); 26 | 27 | public static E ToEnum(string p_Str) 28 | => (E)ToInt(p_Str); 29 | public static E ToEnum(int p_Int) 30 | => (E)Mathf.Clamp(p_Int, 0, ValueCount - 1); 31 | 32 | public static string ToStr(int p_Int) 33 | => S[Mathf.Clamp(p_Int, 0, ValueCount - 1)]; 34 | public static string ToStr(E p_Enum) 35 | => S[Mathf.Clamp((int)p_Enum, 0, ValueCount - 1)]; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Events/Dummy.cs: -------------------------------------------------------------------------------- 1 | using ChatPlexMod_ChatIntegrations.Interfaces; 2 | using CP_SDK.XUI; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using UnityEngine; 6 | 7 | namespace ChatPlexMod_ChatIntegrations.Events 8 | { 9 | /// 10 | /// Dummy event 11 | /// 12 | public class Dummy : IEvent 13 | { 14 | public override IReadOnlyList<(EValueType, string)> ProvidedValues { get; protected set; } 15 | public override IReadOnlyList AvailableConditions { get; protected set; } 16 | public override IReadOnlyList AvailableActions { get; protected set; } 17 | 18 | //////////////////////////////////////////////////////////////////////////// 19 | //////////////////////////////////////////////////////////////////////////// 20 | 21 | /// 22 | /// Constructor 23 | /// 24 | public Dummy() 25 | { 26 | /// Build provided values list 27 | ProvidedValues = new List<(EValueType, string)>() 28 | { 29 | 30 | }.AsReadOnly(); 31 | 32 | /// Build possible list 33 | AvailableConditions = new List() 34 | .Union(ChatIntegrations.RegisteredGlobalConditionsTypes) 35 | .Union(GetCustomConditionTypes()) 36 | .Distinct().ToList().AsReadOnly(); 37 | 38 | /// Build possible list 39 | AvailableActions = new List() 40 | .Union(ChatIntegrations.RegisteredGlobalActionsTypes) 41 | .Union(GetCustomActionTypes()) 42 | .Distinct().ToList().AsReadOnly(); 43 | } 44 | 45 | //////////////////////////////////////////////////////////////////////////// 46 | //////////////////////////////////////////////////////////////////////////// 47 | 48 | /// 49 | /// Build editing UI 50 | /// 51 | /// Parent transform 52 | public override sealed void BuildUI(Transform p_Parent) 53 | { 54 | XUIElements = new IXUIElement[] 55 | { 56 | XUIVLayout.Make( 57 | XUIText.Make("Dummy event that can get triggered by other events!") 58 | .SetAlign(TMPro.TextAlignmentOptions.Midline) 59 | ).SetBackground(true), 60 | 61 | XUIPrimaryButton.Make("Execute", OnExecutePressed) 62 | }; 63 | 64 | BuildUIAuto(p_Parent); 65 | } 66 | /// 67 | /// Execute button pressed 68 | /// 69 | private void OnExecutePressed() 70 | { 71 | ChatIntegrations.Instance.ExecuteEvent(this, new Models.EventContext() { Type = ETriggerType.Dummy }); 72 | UI.SettingsMainView.Instance.ShowMessageModal("Ok!"); 73 | } 74 | 75 | //////////////////////////////////////////////////////////////////////////// 76 | //////////////////////////////////////////////////////////////////////////// 77 | 78 | /// 79 | /// Handle 80 | /// 81 | /// Event context 82 | protected override sealed bool CanBeExecuted(Models.EventContext p_Context) 83 | { 84 | /// Ensure that we have all data 85 | if (p_Context.Type != ETriggerType.Dummy) 86 | return false; 87 | 88 | return true; 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Interfaces/ETriggerType.cs: -------------------------------------------------------------------------------- 1 | namespace ChatPlexMod_ChatIntegrations.Interfaces 2 | { 3 | /// 4 | /// Trigger type 5 | /// 6 | public enum ETriggerType : uint 7 | { 8 | None, 9 | Dummy, 10 | ChatBits, 11 | ChatMessage, 12 | ChatFollow, 13 | ChatPointsReward, 14 | ChatRaid, 15 | ChatSubscription, 16 | LevelStarted, 17 | LevelPaused, 18 | LevelResumed, 19 | LevelEnded, 20 | VoiceAttackCommand, 21 | 22 | _CUSTOM_START = 1000 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Interfaces/EValueType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ChatPlexMod_ChatIntegrations.Interfaces 4 | { 5 | /// 6 | /// Value type 7 | /// 8 | public enum EValueType 9 | { 10 | Integer, 11 | Floating, 12 | Boolean, 13 | Emotes, 14 | String 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Interfaces/IActionBase.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace ChatPlexMod_ChatIntegrations.Interfaces 6 | { 7 | /// 8 | /// IAction generic class 9 | /// 10 | public abstract class IActionBase : IUIConfigurable 11 | { 12 | public IEventBase Event { get; set; } 13 | public abstract string Description { get; } 14 | public abstract bool IsEnabled { get; set; } 15 | 16 | //////////////////////////////////////////////////////////////////////////// 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | /// 20 | /// Get type name 21 | /// 22 | /// 23 | public abstract string GetTypeName(); 24 | /// 25 | /// Serialize 26 | /// 27 | /// 28 | public abstract JObject Serialize(); 29 | /// 30 | /// Unserialize 31 | /// 32 | /// 33 | public abstract bool Unserialize(JObject p_Serialized); 34 | 35 | //////////////////////////////////////////////////////////////////////////// 36 | //////////////////////////////////////////////////////////////////////////// 37 | 38 | /// 39 | /// Build editing UI 40 | /// 41 | /// Parent transform 42 | public abstract void BuildUI(Transform p_Parent); 43 | 44 | //////////////////////////////////////////////////////////////////////////// 45 | //////////////////////////////////////////////////////////////////////////// 46 | 47 | /// 48 | /// Handle 49 | /// 50 | /// Event context 51 | public abstract IEnumerator Eval(Models.EventContext p_Context); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Interfaces/ICondition.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK.XUI; 2 | using Newtonsoft.Json.Linq; 3 | using UnityEngine; 4 | 5 | namespace ChatPlexMod_ChatIntegrations.Interfaces 6 | { 7 | /// 8 | /// ICondition generic class 9 | /// 10 | public abstract class ICondition : IConditionBase 11 | where t_Condition : ICondition, new() 12 | where t_Model : Models.Condition, new() 13 | { 14 | public override bool IsEnabled { get => Model.Enabled; set { Model.Enabled = value; } } 15 | public virtual string UIPlaceHolder => "No available settings..."; 16 | 17 | //////////////////////////////////////////////////////////////////////////// 18 | //////////////////////////////////////////////////////////////////////////// 19 | 20 | /// 21 | /// Model 22 | /// 23 | public t_Model Model { get; protected set; } = new t_Model(); 24 | 25 | //////////////////////////////////////////////////////////////////////////// 26 | //////////////////////////////////////////////////////////////////////////// 27 | 28 | /// 29 | /// Get type name 30 | /// 31 | /// 32 | public override string GetTypeName() => typeof(t_Condition).Name; 33 | /// 34 | /// Serialize 35 | /// 36 | /// 37 | public override JObject Serialize() 38 | { 39 | Model.Type = GetTypeName(); 40 | return JObject.FromObject(Model); 41 | } 42 | /// 43 | /// Unserialize 44 | /// 45 | /// 46 | public override bool Unserialize(JObject p_Serialized) 47 | { 48 | if (!p_Serialized.ContainsKey("Type")) 49 | return false; 50 | 51 | var l_Type = p_Serialized["Type"].Value(); 52 | if (l_Type != GetTypeName()) 53 | return false; 54 | 55 | try 56 | { 57 | Model = p_Serialized.ToObject(); 58 | Model.OnDeserialized(p_Serialized); 59 | 60 | return true; 61 | } 62 | catch (System.Exception l_Exception) 63 | { 64 | Logger.Instance.Error($"[ChatPlexMod_ChatIntegrations.Interfaces][ICondition<{typeof(t_Condition).Name}, {typeof(t_Model).Name}.Unserialize] Error:"); 65 | Logger.Instance.Error(l_Exception); 66 | } 67 | 68 | return false; 69 | } 70 | 71 | //////////////////////////////////////////////////////////////////////////// 72 | //////////////////////////////////////////////////////////////////////////// 73 | 74 | /// 75 | /// Build editing UI 76 | /// 77 | /// Parent transform 78 | public override void BuildUI(Transform p_Parent) 79 | { 80 | XUIElements = new IXUIElement[] { XUIText.Make(UIPlaceHolder) }; 81 | 82 | BuildUIAuto(p_Parent); 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Interfaces/IConditionBase.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using UnityEngine; 3 | 4 | namespace ChatPlexMod_ChatIntegrations.Interfaces 5 | { 6 | /// 7 | /// ICondition generic class 8 | /// 9 | public abstract class IConditionBase : IUIConfigurable 10 | { 11 | public IEventBase Event { get; set; } 12 | public abstract string Description { get; } 13 | public abstract bool IsEnabled { get; set; } 14 | 15 | //////////////////////////////////////////////////////////////////////////// 16 | //////////////////////////////////////////////////////////////////////////// 17 | 18 | /// 19 | /// Get type name 20 | /// 21 | /// 22 | public abstract string GetTypeName(); 23 | /// 24 | /// Serialize 25 | /// 26 | /// 27 | public abstract JObject Serialize(); 28 | /// 29 | /// Unserialize 30 | /// 31 | /// 32 | public abstract bool Unserialize(JObject p_Serialized); 33 | 34 | //////////////////////////////////////////////////////////////////////////// 35 | //////////////////////////////////////////////////////////////////////////// 36 | 37 | /// 38 | /// Build editing UI 39 | /// 40 | /// Parent transform 41 | public abstract void BuildUI(Transform p_Parent); 42 | 43 | //////////////////////////////////////////////////////////////////////////// 44 | //////////////////////////////////////////////////////////////////////////// 45 | 46 | /// 47 | /// Handle 48 | /// 49 | /// Event context 50 | public abstract bool Eval(Models.EventContext p_Context); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Interfaces/IUIConfigurable.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK.XUI; 2 | using System.Collections.Generic; 3 | using TMPro; 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | 7 | namespace ChatPlexMod_ChatIntegrations.Interfaces 8 | { 9 | /// 10 | /// UI Configurable interface 11 | /// 12 | public abstract class IUIConfigurable 13 | { 14 | /// 15 | /// Fields 16 | /// 17 | public CP_SDK.XUI.IXUIElement[] XUIElements; 18 | /// 19 | /// View instance 20 | /// 21 | public UI.SettingsMainView View => UI.SettingsMainView.Instance; 22 | 23 | //////////////////////////////////////////////////////////////////////////// 24 | //////////////////////////////////////////////////////////////////////////// 25 | 26 | /// 27 | /// Build editing UI 28 | /// 29 | /// Parent transform 30 | public void BuildUIAuto(Transform p_Parent) 31 | { 32 | var l_Title = string.Empty; 33 | 34 | if (this is IEventBase l_EventBase) l_Title = l_EventBase.GetTypeName() + " | " + l_EventBase.GenericModel.Name; 35 | else if (this is IActionBase l_ActionBase) l_Title = l_ActionBase.GetTypeName(); 36 | else if (this is IConditionBase l_ConditionBase) l_Title = l_ConditionBase.GetTypeName(); 37 | 38 | l_Title = "" + l_Title.Replace("_", "::"); 39 | 40 | var l_FinalList = new List() 41 | { 42 | XUIText.Make(l_Title).SetStyle(FontStyles.Bold).SetAlign(TextAlignmentOptions.Center) 43 | }; 44 | 45 | if (XUIElements != null) 46 | l_FinalList.AddRange(XUIElements); 47 | 48 | try 49 | { 50 | XUIVScrollView.Make( 51 | XUIVLayout.Make(l_FinalList.ToArray()) 52 | .OnReady(x => x.CSizeFitter.horizontalFit = ContentSizeFitter.FitMode.Unconstrained) 53 | ) 54 | .OnReady(x => x.Container.GetComponent().padding = new RectOffset(0, 0, 0, 0)) 55 | .BuildUI(p_Parent); 56 | } 57 | catch (System.Exception l_Exception) 58 | { 59 | Logger.Instance.Error(l_Exception); 60 | } 61 | 62 | LayoutRebuilder.ForceRebuildLayoutImmediate(p_Parent.parent as RectTransform); 63 | 64 | CP_SDK.Unity.MTMainThreadInvoker.Enqueue(() => 65 | { 66 | if (!p_Parent || !p_Parent.parent) 67 | return; 68 | 69 | LayoutRebuilder.ForceRebuildLayoutImmediate(p_Parent.parent as RectTransform); 70 | }); 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Logger.cs: -------------------------------------------------------------------------------- 1 | namespace ChatPlexMod_ChatIntegrations 2 | { 3 | /// 4 | /// Logger instance holder 5 | /// 6 | internal class Logger 7 | { 8 | /// 9 | /// Logger instance 10 | /// 11 | internal static CP_SDK.Logging.ILogger Instance; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Action.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Linq; 3 | using System; 4 | 5 | namespace ChatPlexMod_ChatIntegrations.Models 6 | { 7 | /// 8 | /// Action data modal 9 | /// 10 | [Serializable] 11 | public class Action 12 | { 13 | [JsonProperty] 14 | public string Type = "?"; 15 | [JsonProperty] 16 | public bool Enabled = false; 17 | [JsonProperty] 18 | public string BaseValue = ""; 19 | 20 | //////////////////////////////////////////////////////////////////////////// 21 | //////////////////////////////////////////////////////////////////////////// 22 | 23 | /// 24 | /// On deserialized 25 | /// 26 | /// Input data 27 | public virtual void OnDeserialized(JObject p_Serialized) 28 | { 29 | 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Actions/Chat.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace ChatPlexMod_ChatIntegrations.Models.Actions 4 | { 5 | public class Chat_SendMessage : Action 6 | { 7 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 8 | public bool AddTTSPefix = true; 9 | 10 | public Chat_SendMessage() 11 | { 12 | BaseValue = "Test content"; 13 | } 14 | } 15 | 16 | //////////////////////////////////////////////////////////////////////////// 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | public class Chat_ToggleVisibility : Action 20 | { 21 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 22 | public int ToggleType = 0; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Actions/EmoteRain.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace ChatPlexMod_ChatIntegrations.Models.Actions 4 | { 5 | public class EmoteRain_CustomRain : Action 6 | { 7 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 8 | public uint Count = 20; 9 | } 10 | 11 | //////////////////////////////////////////////////////////////////////////// 12 | //////////////////////////////////////////////////////////////////////////// 13 | 14 | public class EmoteRain_EmoteBombRain : Action 15 | { 16 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 17 | public uint EmoteKindCount = 20; 18 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 19 | public uint CountPerEmote = 20; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Actions/Event.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace ChatPlexMod_ChatIntegrations.Models.Actions 4 | { 5 | public class Event_ExecuteDummy : Action 6 | { 7 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 8 | public bool Continue = true; 9 | } 10 | 11 | //////////////////////////////////////////////////////////////////////////// 12 | //////////////////////////////////////////////////////////////////////////// 13 | 14 | public class Event_Toggle : Action 15 | { 16 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 17 | public int ChangeType = 0; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Actions/Misc.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace ChatPlexMod_ChatIntegrations.Models.Actions 4 | { 5 | public class Misc_Delay : Action 6 | { 7 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 8 | public uint Delay = 10; 9 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 10 | public uint DelayMs = 0; 11 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 12 | public bool PreventNextActionFailure = true; 13 | } 14 | 15 | //////////////////////////////////////////////////////////////////////////// 16 | //////////////////////////////////////////////////////////////////////////// 17 | 18 | public class Misc_PlaySound : Action 19 | { 20 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 21 | public float Volume = 0; 22 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 23 | public float PitchMin = 1; 24 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 25 | public float PitchMax = 1; 26 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 27 | public bool KillOnSceneSwitch = false; 28 | } 29 | 30 | //////////////////////////////////////////////////////////////////////////// 31 | //////////////////////////////////////////////////////////////////////////// 32 | 33 | public class WaitMenuScene : Action 34 | { 35 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 36 | public bool PreventNextActionFailure = true; 37 | } 38 | 39 | //////////////////////////////////////////////////////////////////////////// 40 | //////////////////////////////////////////////////////////////////////////// 41 | 42 | public class WaitPlayingScene : Action 43 | { 44 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 45 | public bool PreventNextActionFailure = true; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Condition.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Linq; 3 | using System; 4 | 5 | namespace ChatPlexMod_ChatIntegrations.Models 6 | { 7 | /// 8 | /// Condition data modal 9 | /// 10 | [Serializable] 11 | public class Condition 12 | { 13 | [JsonProperty] 14 | public string Type = "?"; 15 | [JsonProperty] 16 | public bool Enabled = false; 17 | 18 | //////////////////////////////////////////////////////////////////////////// 19 | //////////////////////////////////////////////////////////////////////////// 20 | 21 | /// 22 | /// On deserialized 23 | /// 24 | /// Input data 25 | public virtual void OnDeserialized(JObject p_Serialized) 26 | { 27 | 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Conditions/Bits.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using Newtonsoft.Json.Linq; 4 | 5 | namespace ChatPlexMod_ChatIntegrations.Models.Conditions 6 | { 7 | public class Bits_Amount : Condition 8 | { 9 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include), JsonConverter(typeof(StringEnumConverter))] 10 | public Enums.Comparison.E Comparison = Enums.Comparison.E.GreaterOrEqual; 11 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 12 | public uint Count = 10; 13 | 14 | //////////////////////////////////////////////////////////////////////////// 15 | //////////////////////////////////////////////////////////////////////////// 16 | 17 | public override void OnDeserialized(JObject p_Serialized) 18 | { 19 | if (p_Serialized.ContainsKey("Comparison") 20 | || !p_Serialized.ContainsKey("IsGreaterThan")) 21 | return; 22 | 23 | if (p_Serialized["IsGreaterThan"].Value()) 24 | Comparison = Enums.Comparison.E.Greater; 25 | else 26 | Comparison = Enums.Comparison.E.Less; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Conditions/Events.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace ChatPlexMod_ChatIntegrations.Models.Conditions 4 | { 5 | public class Event_Enabled : Condition 6 | { 7 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 8 | public string EventGUID = ""; 9 | } 10 | public class Event_Disabled : Condition 11 | { 12 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 13 | public string EventGUID = ""; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Conditions/Misc.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace ChatPlexMod_ChatIntegrations.Models.Conditions 4 | { 5 | public class Misc_Cooldown : Condition 6 | { 7 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 8 | public bool PerUser = true; 9 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 10 | public uint CooldownTime = 10; 11 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 12 | public bool NotifyUser = true; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Conditions/OBS.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace ChatPlexMod_ChatIntegrations.Models.Conditions 4 | { 5 | public class OBS_IsInScene : Condition 6 | { 7 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 8 | public string SceneName = ""; 9 | } 10 | public class OBS_IsNotInScene : Condition 11 | { 12 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 13 | public string SceneName = ""; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Conditions/Subscription.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using Newtonsoft.Json.Linq; 4 | 5 | namespace ChatPlexMod_ChatIntegrations.Models.Conditions 6 | { 7 | public class Subscription_PlanType : Condition 8 | { 9 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include), JsonConverter(typeof(StringEnumConverter))] 10 | public Enums.TwitchSubscribtionPlanType.E SubscribtionPlanType = Enums.TwitchSubscribtionPlanType.E.Tier1; 11 | 12 | //////////////////////////////////////////////////////////////////////////// 13 | //////////////////////////////////////////////////////////////////////////// 14 | 15 | /// 16 | /// On deserialized 17 | /// 18 | /// Input data 19 | public override void OnDeserialized(JObject p_Serialized) 20 | { 21 | if (p_Serialized.ContainsKey("SubscribtionPlanType") 22 | || !p_Serialized.ContainsKey("PlanType")) 23 | return; 24 | 25 | SubscribtionPlanType = Enums.TwitchSubscribtionPlanType.ToEnum(p_Serialized["PlanType"].Value()); 26 | } 27 | } 28 | 29 | public class Subscription_PurchasedMonthCount : Condition 30 | { 31 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include), JsonConverter(typeof(StringEnumConverter))] 32 | public Enums.Comparison.E Comparison = Enums.Comparison.E.GreaterOrEqual; 33 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 34 | public uint Count = 0; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Conditions/User.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace ChatPlexMod_ChatIntegrations.Models.Conditions 4 | { 5 | public class User_Permissions : Condition 6 | { 7 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 8 | public bool Subscriber = true; 9 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 10 | public bool VIP = true; 11 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 12 | public bool Moderator = true; 13 | 14 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 15 | public bool NotifyWhenNoPermission = true; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Event.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace ChatPlexMod_ChatIntegrations.Models 5 | { 6 | /// 7 | /// Event data modal 8 | /// 9 | [Serializable] 10 | public class Event 11 | { 12 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 13 | public string GUID = ""; 14 | [JsonProperty] 15 | public string Name = "?"; 16 | [JsonProperty] 17 | public string Type = "?"; 18 | [JsonProperty] 19 | public bool Enabled = false; 20 | [JsonProperty] 21 | public UInt64 UsageCount = 0; 22 | [JsonProperty] 23 | public Int64 CreationDate = 0; 24 | [JsonProperty] 25 | public Int64 LastUsageDate = 0; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Events/ChatBits.cs: -------------------------------------------------------------------------------- 1 | namespace ChatPlexMod_ChatIntegrations.Models.Events 2 | { 3 | /// 4 | /// Chat bits event model 5 | /// 6 | public class ChatBits : Event 7 | { 8 | /// 9 | /// Constructor 10 | /// 11 | public ChatBits() 12 | { 13 | Name = "New chat bits event"; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Events/ChatCommand.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace ChatPlexMod_ChatIntegrations.Models.Events 4 | { 5 | /// 6 | /// Chat command event model 7 | /// 8 | public class ChatCommand : Event 9 | { 10 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 11 | internal string Command = "!no_command_set"; 12 | 13 | //////////////////////////////////////////////////////////////////////////// 14 | //////////////////////////////////////////////////////////////////////////// 15 | 16 | /// 17 | /// Constructor 18 | /// 19 | public ChatCommand() 20 | { 21 | Name = "New chat command event"; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Events/ChatFollow.cs: -------------------------------------------------------------------------------- 1 | namespace ChatPlexMod_ChatIntegrations.Models.Events 2 | { 3 | /// 4 | /// Chat follow event model 5 | /// 6 | public class ChatFollow : Event 7 | { 8 | /// 9 | /// Constructor 10 | /// 11 | public ChatFollow() 12 | { 13 | Name = "New chat follow event"; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Events/ChatPointsReward.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace ChatPlexMod_ChatIntegrations.Models.Events 4 | { 5 | /// 6 | /// Chat points reward event model 7 | /// 8 | public class ChatPointsReward : Event 9 | { 10 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 11 | internal string RewardID = ""; 12 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 13 | internal string Title = ""; 14 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 15 | internal string Prompt = "Description"; 16 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 17 | internal int Cost = 50; 18 | 19 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 20 | internal bool RequireInput = false; 21 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 22 | internal int MaxPerStream = 0; 23 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 24 | internal int MaxPerUserPerStream = 0; 25 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 26 | internal int Cooldown = 0; 27 | 28 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 29 | internal bool AutoFullfillRefund = true; 30 | 31 | //////////////////////////////////////////////////////////////////////////// 32 | //////////////////////////////////////////////////////////////////////////// 33 | 34 | /// 35 | /// Constructor 36 | /// 37 | public ChatPointsReward() 38 | { 39 | Name = "New chat points reward event"; 40 | Title = "New reward " + CP_SDK.Misc.Time.UnixTimeNow(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Events/ChatSubscription.cs: -------------------------------------------------------------------------------- 1 | namespace ChatPlexMod_ChatIntegrations.Models.Events 2 | { 3 | /// 4 | /// Chat subscription event model 5 | /// 6 | public class ChatSubscription : Event 7 | { 8 | /// 9 | /// Constructor 10 | /// 11 | public ChatSubscription() 12 | { 13 | Name = "New chat subscription event"; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Models/Events/VoiceAttackCommand.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace ChatPlexMod_ChatIntegrations.Models.Events 4 | { 5 | /// 6 | /// VoiceAttack command event model 7 | /// 8 | public class VoiceAttackCommand : Event 9 | { 10 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 11 | internal string CommandGUID = ""; 12 | [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] 13 | internal string CommandName = ""; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/ModulePresence.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | namespace ChatPlexMod_ChatIntegrations 4 | { 5 | internal static class ModulePresence 6 | { 7 | private static bool? m_Chat; 8 | private static bool? m_ChatEmoteRain; 9 | 10 | //////////////////////////////////////////////////////////////////////////// 11 | //////////////////////////////////////////////////////////////////////////// 12 | 13 | public static bool Chat { get { 14 | if (!m_Chat.HasValue) 15 | m_Chat = CP_SDK.ChatPlexSDK.GetModules().Any(x => x.Name == "Chat"); 16 | 17 | return m_Chat.Value; 18 | } } 19 | 20 | public static bool ChatEmoteRain { get { 21 | if (!m_ChatEmoteRain.HasValue) 22 | m_ChatEmoteRain = CP_SDK.ChatPlexSDK.GetModules().Any(x => x.Name == "Chat Emote Rain"); 23 | 24 | return m_ChatEmoteRain.Value; 25 | } } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/UI/Data/ActionListItem.cs: -------------------------------------------------------------------------------- 1 | namespace ChatPlexMod_ChatIntegrations.UI.Data 2 | { 3 | /// 4 | /// Action list item 5 | /// 6 | internal class ActionListItem : CP_SDK.UI.Data.IListItem 7 | { 8 | public Interfaces.IActionBase Action; 9 | 10 | //////////////////////////////////////////////////////////////////////////// 11 | //////////////////////////////////////////////////////////////////////////// 12 | 13 | /// 14 | /// Constructor 15 | /// 16 | /// Action 17 | public ActionListItem(Interfaces.IActionBase p_Action) 18 | { 19 | Action = p_Action; 20 | } 21 | 22 | //////////////////////////////////////////////////////////////////////////// 23 | //////////////////////////////////////////////////////////////////////////// 24 | 25 | /// 26 | /// On show 27 | /// 28 | public override void OnShow() => Refresh(); 29 | /// 30 | /// On hide 31 | /// 32 | public override void OnHide() { } 33 | 34 | //////////////////////////////////////////////////////////////////////////// 35 | //////////////////////////////////////////////////////////////////////////// 36 | 37 | /// 38 | /// Refresh 39 | /// 40 | public void Refresh() 41 | { 42 | if (Cell == null || !(Cell is CP_SDK.UI.Data.TextListCell l_TextListCell)) 43 | return; 44 | 45 | var l_Text = "" + (Action.IsEnabled ? "" + Action.GetTypeName().Replace("_", "::") : "" + Action.GetTypeName().Replace("_", "::")); 46 | l_TextListCell.Text.SetText(l_Text); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/UI/Data/ConditionListItem.cs: -------------------------------------------------------------------------------- 1 | namespace ChatPlexMod_ChatIntegrations.UI.Data 2 | { 3 | /// 4 | /// Condition list item 5 | /// 6 | internal class ConditionListItem : CP_SDK.UI.Data.IListItem 7 | { 8 | public Interfaces.IConditionBase Condition; 9 | 10 | //////////////////////////////////////////////////////////////////////////// 11 | //////////////////////////////////////////////////////////////////////////// 12 | 13 | /// 14 | /// Constructor 15 | /// 16 | /// Action 17 | public ConditionListItem(Interfaces.IConditionBase p_Condition) 18 | { 19 | Condition = p_Condition; 20 | } 21 | 22 | //////////////////////////////////////////////////////////////////////////// 23 | //////////////////////////////////////////////////////////////////////////// 24 | 25 | /// 26 | /// On show 27 | /// 28 | public override void OnShow() => Refresh(); 29 | /// 30 | /// On hide 31 | /// 32 | public override void OnHide() { } 33 | 34 | //////////////////////////////////////////////////////////////////////////// 35 | //////////////////////////////////////////////////////////////////////////// 36 | 37 | /// 38 | /// Refresh 39 | /// 40 | public void Refresh() 41 | { 42 | if (Cell == null || !(Cell is CP_SDK.UI.Data.TextListCell l_TextListCell)) 43 | return; 44 | 45 | var l_Text = "" + (Condition.IsEnabled ? "" + Condition.GetTypeName().Replace("_", "::") : "" + Condition.GetTypeName().Replace("_", "::")); 46 | l_TextListCell.Text.SetText(l_Text); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/UI/Data/EventListItem.cs: -------------------------------------------------------------------------------- 1 | namespace ChatPlexMod_ChatIntegrations.UI.Data 2 | { 3 | /// 4 | /// Event list item 5 | /// 6 | internal class EventListItem : CP_SDK.UI.Data.IListItem 7 | { 8 | public Interfaces.IEventBase Event; 9 | 10 | //////////////////////////////////////////////////////////////////////////// 11 | //////////////////////////////////////////////////////////////////////////// 12 | 13 | /// 14 | /// Constructor 15 | /// 16 | /// Event 17 | public EventListItem(Interfaces.IEventBase p_Event) 18 | { 19 | Event = p_Event; 20 | } 21 | 22 | //////////////////////////////////////////////////////////////////////////// 23 | //////////////////////////////////////////////////////////////////////////// 24 | 25 | /// 26 | /// On show 27 | /// 28 | public override void OnShow() => Refresh(); 29 | /// 30 | /// On hide 31 | /// 32 | public override void OnHide() { } 33 | 34 | //////////////////////////////////////////////////////////////////////////// 35 | //////////////////////////////////////////////////////////////////////////// 36 | 37 | /// 38 | /// Refresh 39 | /// 40 | public void Refresh() 41 | { 42 | if (Cell == null || !(Cell is CP_SDK.UI.Data.TextListCell l_TextListCell)) 43 | return; 44 | 45 | var l_Text = ""; 46 | 47 | if (!Event.IsEnabled) 48 | l_Text += ""; 49 | else 50 | l_Text += ""; 51 | 52 | l_Text += (Event.IsEnabled ? "" : "") + "[" + Event.GetTypeName() + "] " + (Event.IsEnabled ? "" : ""); 53 | l_Text += " "; 54 | l_Text += Event.GenericModel.Name.Length > 40 ? (Event.GenericModel.Name.Substring(0, 37) + "...") : Event.GenericModel.Name; 55 | 56 | if (!Event.IsEnabled) 57 | l_Text += " (Disabled)"; 58 | else 59 | l_Text += ""; 60 | 61 | l_Text += "\n" + Event.GenericModel.UsageCount + " use(s)"; 62 | 63 | l_TextListCell.Text.SetText(l_Text); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("BeatSaberPlus_ChatIntegrations")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("HardCPP")] 11 | [assembly: AssemblyProduct("BeatSaberPlus_ChatIntegrations")] 12 | [assembly: AssemblyCopyright("Copyright © HardCPP 2023")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("en")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("1C29C6AA-464A-4B20-A32A-9A9E7907A3D2")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("6.4.1")] 35 | [assembly: AssemblyFileVersion("6.4.1")] -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatIntegrations/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/beat-saber-modding-group/BSIPA-MetadataFileSchema/master/Schema.json", 3 | "id": "BeatSaberPlus_ChatIntegrations", 4 | "name": "BeatSaberPlus_ChatIntegrations", 5 | "author": "HardCPP", 6 | "version": "6.4.1", 7 | "description": "", 8 | "gameVersion": "1.40.0", 9 | "dependsOn": { 10 | "BSIPA": "^4.3.0", 11 | "ChatPlexSDK_BS": "^6.4.1" 12 | }, 13 | "loadAfter": [ 14 | "BeatSaberPlus_Chat", 15 | "BeatSaberPlus_ChatEmoteRain", 16 | "BeatSaberPlus_ChatRequest", 17 | "BeatSaberPlus_GameTweaker", 18 | "BeatSaberPlus_MenuMusic", 19 | "BeatSaberPlus_Multiplayer", 20 | "BeatSaberPlus_NoteTweaker", 21 | "BeatSaberPlus_SongChartVisualizer", 22 | "BeatSaberPlus_SongOverlay" 23 | ], 24 | "links": { 25 | "project-home": "https://discord.chatplex.org", 26 | "donate": "https://donate.chatplex.org" 27 | } 28 | } -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatRequest/BeatSaberPlus_ChatRequest.csproj.user: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_ChatRequest/BeatSaberPlus_ChatRequest.csproj.user -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatRequest/Logger.cs: -------------------------------------------------------------------------------- 1 | namespace BeatSaberPlus_ChatRequest 2 | { 3 | /// 4 | /// Logger instance holder 5 | /// 6 | internal class Logger 7 | { 8 | /// 9 | /// Logger instance 10 | /// 11 | internal static CP_SDK.Logging.ILogger Instance; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatRequest/Models/EAddToQueueResult.cs: -------------------------------------------------------------------------------- 1 | namespace BeatSaberPlus_ChatRequest.Models 2 | { 3 | /// 4 | /// Add to queue result codes 5 | /// 6 | public enum EAddToQueueResult 7 | { 8 | OK, 9 | QueueClosed, 10 | MapBanned, 11 | RequesterBanned, 12 | MapperBanned, 13 | AlreadyRequestedThisSession, 14 | AlreadyInQueue, 15 | RequestLimit, 16 | NotFound, 17 | FilterError 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatRequest/Models/RequesterRateLimit.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK.Chat.Interfaces; 2 | 3 | namespace BeatSaberPlus_ChatRequest.Models 4 | { 5 | /// 6 | /// Requester rate limit infomartions 7 | /// 8 | public class RequesterRateLimit 9 | { 10 | public int CurrentRequestCount; 11 | public int RequestMaxCount; 12 | public string RequestLimitType; 13 | 14 | //////////////////////////////////////////////////////////////////////////// 15 | //////////////////////////////////////////////////////////////////////////// 16 | 17 | /// 18 | /// Constructor 19 | /// 20 | /// Max count 21 | /// Type 22 | public RequesterRateLimit(int requestMaxCount, string requestLimitType) 23 | { 24 | RequestMaxCount = requestMaxCount; 25 | RequestLimitType = requestLimitType; 26 | } 27 | 28 | //////////////////////////////////////////////////////////////////////////// 29 | //////////////////////////////////////////////////////////////////////////// 30 | 31 | /// 32 | /// Replace the current rate limit 33 | /// 34 | /// New max count 35 | /// New type 36 | public void SetNewRateLimit(int requestMaxCount, string requestLimitType) 37 | { 38 | RequestMaxCount = requestMaxCount; 39 | RequestLimitType = requestLimitType; 40 | } 41 | 42 | //////////////////////////////////////////////////////////////////////////// 43 | //////////////////////////////////////////////////////////////////////////// 44 | 45 | /// 46 | /// Update this rate limit from a chat user 47 | /// 48 | /// Chat user 49 | public void UpdateRateLimitFromRequester(IChatUser requester) 50 | { 51 | if (requester == null) 52 | return; 53 | 54 | if (requester.IsVip && !requester.IsSubscriber) 55 | { 56 | SetNewRateLimit( 57 | RequestMaxCount + CRConfig.Instance.VIPBonusRequest, 58 | "VIPs" 59 | ); 60 | } 61 | 62 | if (requester.IsSubscriber && !requester.IsVip) 63 | { 64 | SetNewRateLimit( 65 | RequestMaxCount + CRConfig.Instance.SubscriberBonusRequest, 66 | "Subscribers" 67 | ); 68 | } 69 | 70 | if (requester.IsSubscriber && requester.IsVip) 71 | { 72 | SetNewRateLimit( 73 | RequestMaxCount + CRConfig.Instance.VIPBonusRequest + CRConfig.Instance.SubscriberBonusRequest, 74 | "VIP Subscribers" 75 | ); 76 | } 77 | 78 | if (requester.IsModerator || requester.IsBroadcaster) 79 | { 80 | SetNewRateLimit( 81 | 1000, 82 | "Moderators" 83 | ); 84 | } 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatRequest/Plugin.cs: -------------------------------------------------------------------------------- 1 | using IPA; 2 | 3 | namespace BeatSaberPlus_ChatRequest 4 | { 5 | /// 6 | /// Main plugin class 7 | /// 8 | [Plugin(RuntimeOptions.SingleStartInit)] 9 | public class Plugin 10 | { 11 | /// 12 | /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled). 13 | /// 14 | /// Logger instance 15 | [Init] 16 | public Plugin(IPA.Logging.Logger p_Logger) 17 | { 18 | /// Setup logger 19 | Logger.Instance = new CP_SDK.Logging.IPALogger(p_Logger); 20 | } 21 | 22 | //////////////////////////////////////////////////////////////////////////// 23 | //////////////////////////////////////////////////////////////////////////// 24 | 25 | /// 26 | /// On BeatSaberPlus enable 27 | /// 28 | [OnEnable] 29 | public void OnEnable() 30 | { 31 | 32 | } 33 | /// 34 | /// On BeatSaberPlus disable 35 | /// 36 | [OnDisable] 37 | public void OnDisable() 38 | { 39 | 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatRequest/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("BeatSaberPlus_ChatRequest")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("HardCPP")] 11 | [assembly: AssemblyProduct("BeatSaberPlus_ChatRequest")] 12 | [assembly: AssemblyCopyright("Copyright © HardCPP 2023")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("en")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("9D1F098F-D633-4C4C-ACF6-8E6A0D89E588")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("6.4.1")] 35 | [assembly: AssemblyFileVersion("6.4.1")] 36 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatRequest/Resources/Blacklist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_ChatRequest/Resources/Blacklist.png -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatRequest/Resources/Unblacklist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_ChatRequest/Resources/Unblacklist.png -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatRequest/UI/Data/CommandListItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using EPermissions = BeatSaberPlus_ChatRequest.CRConfig._Commands.EPermission; 4 | 5 | namespace BeatSaberPlus_ChatRequest.UI.Data 6 | { 7 | /// 8 | /// Chat user list item 9 | /// 10 | internal class CommandListItem : CP_SDK.UI.Data.IListItem 11 | { 12 | public string CommandName; 13 | public Func GetPermissions; 14 | public Action SetPermissions; 15 | 16 | //////////////////////////////////////////////////////////////////////////// 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | /// 20 | /// Constructor 21 | /// 22 | /// 23 | /// 24 | /// 25 | public CommandListItem(string p_CommandName, Func p_GetPermissions, Action p_SetPermissions) 26 | { 27 | CommandName = p_CommandName; 28 | GetPermissions = p_GetPermissions; 29 | SetPermissions = p_SetPermissions; 30 | } 31 | 32 | //////////////////////////////////////////////////////////////////////////// 33 | //////////////////////////////////////////////////////////////////////////// 34 | 35 | /// 36 | /// On show 37 | /// 38 | public override void OnShow() 39 | { 40 | if (!(Cell is CommandListCell l_CommandListCell)) 41 | return; 42 | 43 | l_CommandListCell.Text.SetText(CommandName); 44 | l_CommandListCell.UpdateFrom(GetPermissions()); 45 | } 46 | /// 47 | /// On hide 48 | /// 49 | public override void OnHide() { } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatRequest/UI/ManagerViewFlowCoordinator.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK.UI.Views; 2 | using UnityEngine; 3 | 4 | namespace BeatSaberPlus_ChatRequest.UI 5 | { 6 | /// 7 | /// Manager UI flow coordinator 8 | /// 9 | internal sealed class ManagerViewFlowCoordinator : CP_SDK.UI.FlowCoordinator 10 | { 11 | public override string Title => "Chat Request"; 12 | 13 | //////////////////////////////////////////////////////////////////////////// 14 | //////////////////////////////////////////////////////////////////////////// 15 | 16 | private ManagerLeftView m_ManagerLeftView; 17 | private ManagerMainView m_ManagerMainView; 18 | private ManagerRightView m_ManagerRightView; 19 | 20 | //////////////////////////////////////////////////////////////////////////// 21 | //////////////////////////////////////////////////////////////////////////// 22 | 23 | /// 24 | /// Constructor 25 | /// 26 | public override void Init() 27 | { 28 | m_ManagerLeftView = CP_SDK.UI.UISystem.CreateViewController(); 29 | m_ManagerMainView = CP_SDK.UI.UISystem.CreateViewController(); 30 | m_ManagerRightView = CP_SDK.UI.UISystem.CreateViewController(); 31 | } 32 | /// 33 | /// On destroy 34 | /// 35 | internal void OnDestroy() 36 | { 37 | CP_SDK.UI.UISystem.DestroyUI(ref m_ManagerLeftView); 38 | CP_SDK.UI.UISystem.DestroyUI(ref m_ManagerMainView); 39 | CP_SDK.UI.UISystem.DestroyUI(ref m_ManagerRightView); 40 | } 41 | 42 | //////////////////////////////////////////////////////////////////////////// 43 | //////////////////////////////////////////////////////////////////////////// 44 | 45 | /// 46 | /// Get initial views controller 47 | /// 48 | /// (Middle, Left, Right) 49 | protected override sealed (CP_SDK.UI.IViewController, CP_SDK.UI.IViewController, CP_SDK.UI.IViewController) GetInitialViewsController() 50 | => (m_ManagerMainView, m_ManagerLeftView, m_ManagerRightView); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_ChatRequest/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/beat-saber-modding-group/BSIPA-MetadataFileSchema/master/Schema.json", 3 | "id": "BeatSaberPlus_ChatRequest", 4 | "name": "BeatSaberPlus_ChatRequest", 5 | "author": "HardCPP", 6 | "version": "6.4.1", 7 | "description": "", 8 | "gameVersion": "1.40.0", 9 | "dependsOn": { 10 | "BSIPA": "^4.3.0", 11 | "ChatPlexSDK_BS": "^6.4.1" 12 | }, 13 | "links": { 14 | "project-home": "https://discord.chatplex.org", 15 | "donate": "https://donate.chatplex.org" 16 | } 17 | } -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/BeatSaberPlus_GameTweaker.csproj.user: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_GameTweaker/BeatSaberPlus_GameTweaker.csproj.user -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Components/MusicBandLogoRemover.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using UnityEngine; 3 | 4 | namespace BeatSaberPlus_GameTweaker.Components 5 | { 6 | /// 7 | /// Music band logo remover 8 | /// 9 | public class MusicBandLogoRemover : MonoBehaviour 10 | { 11 | /// 12 | /// Audio time sync controller 13 | /// 14 | private AudioTimeSyncController m_AudioTimeSyncController; 15 | 16 | //////////////////////////////////////////////////////////////////////////// 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | /// 20 | /// On component first frame 21 | /// 22 | private void Start() 23 | { 24 | m_AudioTimeSyncController = Resources.FindObjectsOfTypeAll().FirstOrDefault(); 25 | } 26 | 27 | //////////////////////////////////////////////////////////////////////////// 28 | //////////////////////////////////////////////////////////////////////////// 29 | 30 | /// 31 | /// Called every frames 32 | /// 33 | public void Update() 34 | { 35 | if (m_AudioTimeSyncController == null || !m_AudioTimeSyncController) 36 | m_AudioTimeSyncController = Resources.FindObjectsOfTypeAll().FirstOrDefault(); 37 | 38 | if (CP_SDK_BS.Game.Logic.ActiveScene != CP_SDK_BS.Game.Logic.ESceneType.Playing 39 | || m_AudioTimeSyncController == null 40 | || !m_AudioTimeSyncController) 41 | { 42 | GameObject.Destroy(gameObject); 43 | return; 44 | } 45 | 46 | if (m_AudioTimeSyncController.songTime == 0f) 47 | return; 48 | 49 | GameObject l_Object = null; 50 | 51 | /// BTS 52 | l_Object = Resources.FindObjectsOfTypeAll().FirstOrDefault(x => x.name == "MagicDoorSprite"); 53 | if (l_Object != null) 54 | { 55 | l_Object.GetComponent().enabled = false; 56 | GameObject.Destroy(gameObject); 57 | return; 58 | } 59 | 60 | /// LinkinPark 61 | l_Object = Resources.FindObjectsOfTypeAll().FirstOrDefault(x => x.name == "LinkinParkTextLogoL"); 62 | if (l_Object != null) 63 | { 64 | l_Object.GetComponent().enabled = false; 65 | 66 | l_Object = Resources.FindObjectsOfTypeAll().FirstOrDefault(x => x.name == "LinkinParkTextLogoR"); 67 | if (l_Object != null) 68 | l_Object.GetComponent().enabled = false; 69 | 70 | l_Object = Resources.FindObjectsOfTypeAll().FirstOrDefault(x => x.name == "Logo" && x.transform.parent.name == "Environment"); 71 | if (l_Object != null) 72 | l_Object.GetComponent().enabled = false; 73 | 74 | GameObject.Destroy(gameObject); 75 | return; 76 | } 77 | 78 | GameObject.Destroy(gameObject); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Logger.cs: -------------------------------------------------------------------------------- 1 | namespace BeatSaberPlus_GameTweaker 2 | { 3 | /// 4 | /// Logger instance holder 5 | /// 6 | internal class Logger 7 | { 8 | /// 9 | /// Logger instance 10 | /// 11 | internal static CP_SDK.Logging.ILogger Instance; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Patches/PComboUIController.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace BeatSaberPlus_GameTweaker.Patches 4 | { 5 | /// 6 | /// ComboUIController full combo loss animation remover 7 | /// 8 | [HarmonyPatch(typeof(ComboUIController))] 9 | [HarmonyPatch(nameof(ComboUIController.HandleComboBreakingEventHappened))] 10 | public class PComboUIController : ComboUIController 11 | { 12 | /// 13 | /// Prefix 14 | /// 15 | /// ComboUIController instance 16 | internal static bool Prefix(ref ComboUIController __instance, ref bool ____fullComboLost) 17 | { 18 | if (!GTConfig.Instance.Enabled || !GTConfig.Instance.Environment.RemoveFullComboLossAnimation) 19 | return true; ///< Continue to original function 20 | 21 | if (!____fullComboLost) 22 | { 23 | ____fullComboLost = true; 24 | 25 | __instance.transform.Find("Line0")?.gameObject.SetActive(false); 26 | __instance.transform.Find("Line1")?.gameObject.SetActive(false); 27 | 28 | return false; ///< Skip original function 29 | } 30 | 31 | return true; ///< Continue to original function 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Patches/PFireworksController.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace BeatSaberPlus_GameTweaker.Patches 4 | { 5 | /// 6 | /// FireworksController disabler 7 | /// 8 | [HarmonyPatch(typeof(FireworksController))] 9 | [HarmonyPatch(nameof(FireworksController.OnEnable))] 10 | public class PFireworksController : FireworksController 11 | { 12 | /// 13 | /// Prefix 14 | /// 15 | internal static bool Prefix() 16 | { 17 | if (!GTConfig.Instance.Enabled || !GTConfig.Instance.MainMenu.DisableFireworks) 18 | return true; ///< Continue to original function 19 | 20 | return false; ///< Skip original function 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Patches/PLevelListTableCell.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK.Unity.Extensions; 2 | using HarmonyLib; 3 | using TMPro; 4 | 5 | namespace BeatSaberPlus_GameTweaker.Patches 6 | { 7 | [HarmonyPatch(typeof(LevelListTableCell))] 8 | [HarmonyPatch(nameof(LevelListTableCell.SetDataFromLevelAsync))] 9 | public class PLevelListTableCell 10 | { 11 | /// 12 | /// DidActivate 13 | /// 14 | internal static void Postfix(BeatmapLevel beatmapLevel, bool isFavorite, 15 | ref TextMeshProUGUI ____songNameText) 16 | { 17 | if (GTConfig.Instance.LevelSelection.HighlightEnabled) 18 | { 19 | CP_SDK_BS.Game.Levels.GetScoresByLevelID(beatmapLevel.levelID, out var l_HaveAnyScore, out var l_HaveAllScores); 20 | 21 | var l_ColorPrefix = ""; 22 | if (l_HaveAllScores) 23 | l_ColorPrefix = "<" + ColorU.ToHexRGB(GTConfig.Instance.LevelSelection.HighlightAllPlayed) + ">"; 24 | else if (l_HaveAnyScore) 25 | l_ColorPrefix = "<" + ColorU.ToHexRGB(GTConfig.Instance.LevelSelection.HighlightPlayed) + ">"; 26 | 27 | ____songNameText.text = l_ColorPrefix + ____songNameText.text; 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Patches/PLevelSearchViewController.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using TMPro; 3 | using UnityEngine; 4 | 5 | namespace BeatSaberPlus_GameTweaker.Patches 6 | { 7 | /// 8 | /// Base game filter removing 9 | /// 10 | [HarmonyPatch(typeof(LevelSearchViewController))] 11 | [HarmonyPatch(nameof(LevelSearchViewController.Setup))] 12 | public class PLevelSearchViewController : LevelSearchViewController 13 | { 14 | /// 15 | /// Filter button 16 | /// 17 | static private GameObject m_FilterButton = null; 18 | 19 | //////////////////////////////////////////////////////////////////////////// 20 | //////////////////////////////////////////////////////////////////////////// 21 | 22 | /// 23 | /// Prefix 24 | /// 25 | /// Filter button text instance 26 | internal static void Prefix(ref TextMeshProUGUI ____filterParamsText) 27 | { 28 | /// Cache filter button instance 29 | m_FilterButton = (____filterParamsText != null && ____filterParamsText) ? ____filterParamsText.transform.parent.gameObject : null; 30 | 31 | if (GTConfig.Instance.Enabled) 32 | { 33 | /// Apply 34 | SetRemoveBaseGameFilter(GTConfig.Instance.LevelSelection.RemoveBaseGameFilterButton); 35 | } 36 | } 37 | 38 | //////////////////////////////////////////////////////////////////////////// 39 | //////////////////////////////////////////////////////////////////////////// 40 | 41 | /// 42 | /// Set if we remove base game filter 43 | /// 44 | /// New state 45 | internal static void SetRemoveBaseGameFilter(bool p_Remove) 46 | { 47 | if (m_FilterButton == null || !m_FilterButton) 48 | return; 49 | 50 | m_FilterButton.SetActive(!p_Remove); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Patches/PMainMenuViewController.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using System; 3 | using System.Linq; 4 | using UnityEngine.UI; 5 | 6 | namespace BeatSaberPlus_GameTweaker.Patches 7 | { 8 | /// 9 | /// MainMenuViewController 10 | /// 11 | [HarmonyPatch(typeof(MainMenuViewController))] 12 | [HarmonyPatch("DidActivate", new Type[] { typeof(bool), typeof(bool), typeof(bool) })] 13 | public class PMainMenuViewController : MainMenuViewController 14 | { 15 | /// 16 | /// BeatMap editor button 17 | /// 18 | private static Button m_BeatMapEditorButton = null; 19 | /// 20 | /// Random music pack promo banner 21 | /// 22 | private static MusicPackPromoBanner m_MusicPackPromoBanner = null; 23 | 24 | //////////////////////////////////////////////////////////////////////////// 25 | //////////////////////////////////////////////////////////////////////////// 26 | 27 | /// 28 | /// DidActivate 29 | /// 30 | /// BeatMap editor button instance 31 | /// Promo banner instance 32 | internal static void Postfix(ref Button ____beatmapEditorButton, ref MusicPackPromoBanner ____musicPackPromoBanner) 33 | { 34 | if (m_BeatMapEditorButton != ____beatmapEditorButton) 35 | m_BeatMapEditorButton = ____beatmapEditorButton; 36 | 37 | if (m_MusicPackPromoBanner != ____musicPackPromoBanner) 38 | m_MusicPackPromoBanner = ____musicPackPromoBanner; 39 | 40 | if (GTConfig.Instance.Enabled) 41 | { 42 | /// Apply 43 | SetBeatMapEditorButtonDisabled(GTConfig.Instance.MainMenu.DisableEditorButtonOnMainMenu); 44 | SetRemovePackMusicPromoBanner(GTConfig.Instance.MainMenu.RemoveNewContentPromotional); 45 | } 46 | } 47 | 48 | //////////////////////////////////////////////////////////////////////////// 49 | //////////////////////////////////////////////////////////////////////////// 50 | 51 | /// 52 | /// Set BeatMap editor button disabled 53 | /// 54 | /// Is disabled 55 | internal static void SetBeatMapEditorButtonDisabled(bool p_Disabled) 56 | { 57 | if (m_BeatMapEditorButton == null || !m_BeatMapEditorButton) 58 | return; 59 | 60 | m_BeatMapEditorButton.interactable = !p_Disabled; 61 | } 62 | /// 63 | /// Set if Pack music promo banner should be hidden 64 | /// 65 | /// New state 66 | internal static void SetRemovePackMusicPromoBanner(bool p_Enabled) 67 | { 68 | if (m_MusicPackPromoBanner == null || !m_MusicPackPromoBanner) 69 | return; 70 | 71 | m_MusicPackPromoBanner.gameObject.SetActive(!p_Enabled); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Patches/PMenuLightsManager.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace BeatSaberPlus_GameTweaker.Patches 4 | { 5 | /// 6 | /// Preset replacer 7 | /// 8 | [HarmonyPatch(typeof(MenuLightsManager))] 9 | [HarmonyPatch(nameof(MenuLightsManager.SetColorPreset))] 10 | [HarmonyPriority(Priority.First)] 11 | public class PMenuLightsManager : MenuLightsManager 12 | { 13 | /// 14 | /// Prefix 15 | /// 16 | /// Preset data 17 | internal static void Prefix(ref MenuLightsPresetSO preset) 18 | => preset = Managers.CustomMenuLightManager.GetPresetForPatch(preset); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Patches/PMusicPackPromoBanner.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using System.Collections.Generic; 3 | 4 | namespace BeatSaberPlus_GameTweaker.Patches 5 | { 6 | /// 7 | /// MusicPackPromoBanner remover 8 | /// 9 | [HarmonyPatch(typeof(MusicPackPromoBanner))] 10 | [HarmonyPatch(nameof(MusicPackPromoBanner.Setup))] 11 | public class PMusicPackPromoBanner : MusicPackPromoBanner 12 | { 13 | /// 14 | /// MusicPackPromoBanner instance 15 | /// 16 | private static MusicPackPromoBanner m_Instance = null; 17 | /// 18 | /// Original states 19 | /// 20 | private static List m_OriginalStates = new List(); 21 | 22 | //////////////////////////////////////////////////////////////////////////// 23 | //////////////////////////////////////////////////////////////////////////// 24 | 25 | /// 26 | /// Prefix 27 | /// 28 | /// MusicPackPromoBanner instance 29 | internal static void Postfix(ref MusicPackPromoBanner __instance) 30 | { 31 | if (__instance != m_Instance) 32 | m_OriginalStates.Clear(); 33 | 34 | if (GTConfig.Instance.Enabled && m_OriginalStates.Count == 0) 35 | { 36 | /// Store instance 37 | m_Instance = __instance; 38 | 39 | /// Backup original states 40 | for (int l_I = 0; l_I < m_Instance.transform.childCount; ++l_I) 41 | m_OriginalStates.Add(m_Instance.transform.GetChild(l_I).gameObject.activeSelf); 42 | 43 | /// Apply 44 | SetEnabled(GTConfig.Instance.MainMenu.RemoveNewContentPromotional); 45 | } 46 | } 47 | 48 | //////////////////////////////////////////////////////////////////////////// 49 | //////////////////////////////////////////////////////////////////////////// 50 | 51 | /// 52 | /// Set if MusicPackPromoBanner should be hidden 53 | /// 54 | /// New state 55 | internal static void SetEnabled(bool p_Enabled) 56 | { 57 | if (m_Instance == null || !m_Instance) 58 | return; 59 | 60 | for (int l_I = 0; l_I < m_Instance.transform.childCount; ++l_I) 61 | m_Instance.transform.GetChild(l_I).gameObject.SetActive(p_Enabled ? false : (l_I < m_OriginalStates.Count ? m_OriginalStates[l_I] : false)); 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Patches/PNoteCutCoreEffectsSpawner.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace BeatSaberPlus_GameTweaker.Patches 4 | { 5 | /// 6 | /// Cut ribbon remover 7 | /// 8 | [HarmonyPatch(typeof(NoteCutCoreEffectsSpawner))] 9 | [HarmonyPatch(nameof(NoteCutCoreEffectsSpawner.Start))] 10 | public class PNoteCutCoreEffectsSpawner : NoteCutCoreEffectsSpawner 11 | { 12 | /// 13 | /// NoteCutParticlesEffect instance 14 | /// 15 | private static NoteCutParticlesEffect m_NoteCutParticlesEffect = null; 16 | 17 | //////////////////////////////////////////////////////////////////////////// 18 | //////////////////////////////////////////////////////////////////////////// 19 | 20 | /// 21 | /// Prefix 22 | /// 23 | /// NoteCutParticlesEffect instance 24 | internal static void Postfix(ref NoteCutParticlesEffect ____noteCutParticlesEffect) 25 | { 26 | /// Cache effect instance 27 | m_NoteCutParticlesEffect = ____noteCutParticlesEffect; 28 | 29 | if (GTConfig.Instance.Enabled) 30 | { 31 | /// Apply 32 | SetRemoveCutParticles(GTConfig.Instance.RemoveAllCutParticles); 33 | } 34 | } 35 | 36 | //////////////////////////////////////////////////////////////////////////// 37 | //////////////////////////////////////////////////////////////////////////// 38 | 39 | /// 40 | /// Set if the effect is enabled 41 | /// 42 | /// New state 43 | internal static void SetRemoveCutParticles(bool p_Enabled) 44 | { 45 | if (m_NoteCutParticlesEffect == null || !m_NoteCutParticlesEffect) 46 | return; 47 | 48 | m_NoteCutParticlesEffect.gameObject.SetActive(!p_Enabled); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Patches/PNoteDebrisSpawner.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace BeatSaberPlus_GameTweaker.Patches 4 | { 5 | /// 6 | /// Debris remover 7 | /// 8 | [HarmonyPatch(typeof(NoteDebrisSpawner))] 9 | [HarmonyPatch(nameof(NoteDebrisSpawner.SpawnDebris))] 10 | public class PNoteDebrisSpawner 11 | { 12 | /// 13 | /// Remove debris cache 14 | /// 15 | private static bool m_RemoveDebris = false; 16 | 17 | //////////////////////////////////////////////////////////////////////////// 18 | //////////////////////////////////////////////////////////////////////////// 19 | 20 | /// 21 | /// Prefix 22 | /// 23 | private static bool Prefix() => !m_RemoveDebris; 24 | 25 | //////////////////////////////////////////////////////////////////////////// 26 | //////////////////////////////////////////////////////////////////////////// 27 | 28 | /// 29 | /// Set from configuration 30 | /// 31 | public static void SetFromConfig() 32 | { 33 | m_RemoveDebris = GTConfig.Instance.Enabled && GTConfig.Instance.RemoveDebris; 34 | } 35 | /// 36 | /// Set temp config 37 | /// 38 | /// Should remove debris 39 | public static void SetTemp(bool p_RemoveDebris) 40 | { 41 | m_RemoveDebris = p_RemoveDebris; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Patches/PObstacleSaberSparkleEffectManager.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace BeatSaberPlus_GameTweaker.Patches 4 | { 5 | /// 6 | /// ObstacleSaberSparkleEffect remover 7 | /// 8 | [HarmonyPatch(typeof(ObstacleSaberSparkleEffectManager))] 9 | [HarmonyPatch(nameof(ObstacleSaberSparkleEffectManager.Start))] 10 | public class PObstacleSaberSparkleEffectManager : ObstacleSaberSparkleEffect 11 | { 12 | /// 13 | /// ObstacleSaberSparkleEffect instances 14 | /// 15 | private static ObstacleSaberSparkleEffect[] m_ObstacleSaberSparkleEffects = null; 16 | 17 | //////////////////////////////////////////////////////////////////////////// 18 | //////////////////////////////////////////////////////////////////////////// 19 | 20 | /// 21 | /// Prefix 22 | /// 23 | /// ObstacleSaberSparkleEffect instances 24 | internal static void Postfix(ref ObstacleSaberSparkleEffect[] ____effects) 25 | { 26 | m_ObstacleSaberSparkleEffects = ____effects; 27 | 28 | if (GTConfig.Instance.Enabled) 29 | { 30 | /// Apply 31 | SetRemoveObstacleParticles(GTConfig.Instance.RemoveObstacleParticles); 32 | } 33 | } 34 | 35 | //////////////////////////////////////////////////////////////////////////// 36 | //////////////////////////////////////////////////////////////////////////// 37 | 38 | /// 39 | /// Set if the effect is removed 40 | /// 41 | /// New state 42 | internal static void SetRemoveObstacleParticles(bool p_Enabled) 43 | { 44 | if (m_ObstacleSaberSparkleEffects == null || m_ObstacleSaberSparkleEffects.Length == 0) 45 | return; 46 | 47 | foreach (var l_Current in m_ObstacleSaberSparkleEffects) 48 | { 49 | if (!l_Current || !l_Current.gameObject) 50 | continue; 51 | 52 | l_Current.gameObject.SetActive(!p_Enabled); 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Patches/PPlayerHeightSettingsController.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using TMPro; 3 | 4 | namespace BeatSaberPlus_GameTweaker.Patches 5 | { 6 | /// 7 | /// PlayerHeightSettingsController remover 8 | /// 9 | [HarmonyPatch(typeof(PlayerHeightSettingsController))] 10 | [HarmonyPatch(nameof(PlayerHeightSettingsController.RefreshUI))] 11 | public class PPlayerHeightSettingsController : PlayerHeightSettingsController 12 | { 13 | /// 14 | /// Prefix 15 | /// 16 | /// Target text display 17 | /// Player height meters 18 | internal static void Postfix(ref TextMeshProUGUI ____text, ref float ____value) 19 | { 20 | if (GTConfig.Instance.Enabled) 21 | ____text.text = string.Format("{0:0.00}", ____value); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Patches/PSaberBurnMarkArea.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace BeatSaberPlus_GameTweaker.Patches 4 | { 5 | /// 6 | /// SaberBurnMarkArea remover 7 | /// 8 | [HarmonyPatch(typeof(SaberBurnMarkArea))] 9 | [HarmonyPatch(nameof(SaberBurnMarkArea.Start))] 10 | public class PSaberBurnMarkArea : SaberBurnMarkArea 11 | { 12 | /// 13 | /// SaberBurnMarkArea instance 14 | /// 15 | private static SaberBurnMarkArea m_SaberBurnMarkArea = null; 16 | 17 | //////////////////////////////////////////////////////////////////////////// 18 | //////////////////////////////////////////////////////////////////////////// 19 | 20 | /// 21 | /// Prefix 22 | /// 23 | /// SaberBurnMarkArea instance 24 | internal static void Postfix(ref SaberBurnMarkArea __instance) 25 | { 26 | m_SaberBurnMarkArea = __instance; 27 | 28 | if (GTConfig.Instance.Enabled) 29 | { 30 | /// Apply 31 | SetRemoveSaberBurnMarks(GTConfig.Instance.RemoveSaberBurnMarks); 32 | } 33 | } 34 | 35 | //////////////////////////////////////////////////////////////////////////// 36 | //////////////////////////////////////////////////////////////////////////// 37 | 38 | /// 39 | /// Set if the effect is removed 40 | /// 41 | /// New state 42 | internal static void SetRemoveSaberBurnMarks(bool p_Enabled) 43 | { 44 | if (m_SaberBurnMarkArea == null || !m_SaberBurnMarkArea) 45 | return; 46 | 47 | m_SaberBurnMarkArea.gameObject.SetActive(!p_Enabled); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Patches/PSaberBurnMarkSparkles.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace BeatSaberPlus_GameTweaker.Patches 4 | { 5 | /// 6 | /// SaberBurnMarkSparkles remover 7 | /// 8 | [HarmonyPatch(typeof(SaberBurnMarkSparkles))] 9 | [HarmonyPatch(nameof(SaberBurnMarkSparkles.Start))] 10 | public class PSaberBurnMarkSparkles : SaberBurnMarkSparkles 11 | { 12 | /// 13 | /// SaberBurnMarkSparkles instance 14 | /// 15 | private static SaberBurnMarkSparkles m_SaberBurnMarkSparkles = null; 16 | 17 | //////////////////////////////////////////////////////////////////////////// 18 | //////////////////////////////////////////////////////////////////////////// 19 | 20 | /// 21 | /// Prefix 22 | /// 23 | /// SaberBurnMarkSparkles instance 24 | internal static void Postfix(ref SaberBurnMarkSparkles __instance) 25 | { 26 | m_SaberBurnMarkSparkles = __instance; 27 | 28 | if (GTConfig.Instance.Enabled) 29 | { 30 | /// Apply 31 | SetRemoveSaberBurnMarkSparkles(GTConfig.Instance.RemoveSaberBurnMarkSparkles); 32 | } 33 | } 34 | 35 | //////////////////////////////////////////////////////////////////////////// 36 | //////////////////////////////////////////////////////////////////////////// 37 | 38 | /// 39 | /// Set if the effect is removed 40 | /// 41 | /// New state 42 | internal static void SetRemoveSaberBurnMarkSparkles(bool p_Enabled) 43 | { 44 | if (m_SaberBurnMarkSparkles == null || !m_SaberBurnMarkSparkles) 45 | return; 46 | 47 | m_SaberBurnMarkSparkles.gameObject.SetActive(!p_Enabled); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Patches/PSaberClashEffect.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using UnityEngine; 3 | 4 | namespace BeatSaberPlus_GameTweaker.Patches 5 | { 6 | /// 7 | /// SaberClashEffect remover 8 | /// 9 | [HarmonyPatch(typeof(SaberClashEffect))] 10 | [HarmonyPatch(nameof(SaberClashEffect.Start))] 11 | public class PSaberClashEffect : SaberClashEffect 12 | { 13 | /// 14 | /// SparkleParticleSystem instance 15 | /// 16 | private static ParticleSystem m_SparkleParticleSystem = null; 17 | /// 18 | /// GlowParticleSystem instance 19 | /// 20 | private static ParticleSystem m_GlowParticleSystem = null; 21 | 22 | //////////////////////////////////////////////////////////////////////////// 23 | //////////////////////////////////////////////////////////////////////////// 24 | 25 | /// 26 | /// Prefix 27 | /// 28 | /// SparkleParticleSystem instance 29 | /// GlowParticleSystem instance 30 | internal static void Postfix(ref ParticleSystem ____sparkleParticleSystem, ref ParticleSystem ____glowParticleSystem) 31 | { 32 | /// Cache effect instance 33 | m_SparkleParticleSystem = ____sparkleParticleSystem; 34 | m_GlowParticleSystem = ____glowParticleSystem; 35 | 36 | if (GTConfig.Instance.Enabled) 37 | { 38 | /// Apply 39 | SetRemoveClashEffects(GTConfig.Instance.RemoveSaberClashEffects); 40 | } 41 | } 42 | 43 | //////////////////////////////////////////////////////////////////////////// 44 | //////////////////////////////////////////////////////////////////////////// 45 | 46 | /// 47 | /// Set if the effect remover is enabled 48 | /// 49 | /// New state 50 | internal static void SetRemoveClashEffects(bool p_Enabled) 51 | { 52 | if (p_Enabled) 53 | { 54 | if (m_SparkleParticleSystem != null) m_SparkleParticleSystem?.Pause(); 55 | if (m_GlowParticleSystem != null) m_GlowParticleSystem?.Pause(); 56 | } 57 | else 58 | { 59 | if (m_SparkleParticleSystem != null) m_SparkleParticleSystem?.Play(); 60 | if (m_GlowParticleSystem != null) m_GlowParticleSystem?.Play(); 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Plugin.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using IPA; 3 | using System.Reflection; 4 | 5 | namespace BeatSaberPlus_GameTweaker 6 | { 7 | /// 8 | /// Main plugin class 9 | /// 10 | [Plugin(RuntimeOptions.SingleStartInit)] 11 | public class Plugin 12 | { 13 | /// 14 | /// Harmony ID for patches 15 | /// 16 | internal const string HarmonyID = "com.github.hardcpp.beatsaberplus_gametweaker"; 17 | 18 | //////////////////////////////////////////////////////////////////////////// 19 | //////////////////////////////////////////////////////////////////////////// 20 | 21 | /// 22 | /// Harmony patch holder 23 | /// 24 | private static Harmony m_Harmony; 25 | 26 | //////////////////////////////////////////////////////////////////////////// 27 | //////////////////////////////////////////////////////////////////////////// 28 | 29 | /// 30 | /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled). 31 | /// 32 | /// Logger instance 33 | [Init] 34 | public Plugin(IPA.Logging.Logger p_Logger) 35 | { 36 | /// Setup logger 37 | Logger.Instance = new CP_SDK.Logging.IPALogger(p_Logger); 38 | } 39 | 40 | //////////////////////////////////////////////////////////////////////////// 41 | //////////////////////////////////////////////////////////////////////////// 42 | 43 | /// 44 | /// On enable 45 | /// 46 | [OnEnable] 47 | public void OnEnable() 48 | { 49 | try 50 | { 51 | Logger.Instance.Debug("Applying Harmony patches."); 52 | 53 | /// Setup harmony 54 | m_Harmony = new Harmony(HarmonyID); 55 | m_Harmony.PatchAll(Assembly.GetExecutingAssembly()); 56 | } 57 | catch (System.Exception p_Exception) 58 | { 59 | Logger.Instance.Error("[Plugin.OnEnable] Error:"); 60 | Logger.Instance.Error(p_Exception); 61 | } 62 | } 63 | /// 64 | /// On BeatSaberPlus disable 65 | /// 66 | [OnDisable] 67 | public void OnDisable() 68 | { 69 | 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("BeatSaberPlus_GameTweaker")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("HardCPP")] 11 | [assembly: AssemblyProduct("BeatSaberPlus_GameTweaker")] 12 | [assembly: AssemblyCopyright("Copyright © HardCPP 2023")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("en")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("C1F6F190-4A2D-4C28-917B-9D2704E098F9")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("6.4.1")] 35 | [assembly: AssemblyFileVersion("6.4.1")] 36 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/Resources/Delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_GameTweaker/Resources/Delete.png -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/UI/SettingsLeftView.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK.XUI; 2 | using UnityEngine; 3 | 4 | namespace BeatSaberPlus_GameTweaker.UI 5 | { 6 | /// 7 | /// Settings left view 8 | /// 9 | internal sealed class SettingsLeftView : CP_SDK.UI.ViewController 10 | { 11 | private static readonly string s_InformationStr = "Game Tweaker" 12 | + "\n" + "This module allow you to customize your game experience, remove some boring base game features, and add new cool features/tweaks"; 13 | 14 | //////////////////////////////////////////////////////////////////////////// 15 | //////////////////////////////////////////////////////////////////////////// 16 | 17 | /// 18 | /// On view creation 19 | /// 20 | protected override sealed void OnViewCreation() 21 | { 22 | Templates.FullRectLayout( 23 | Templates.TitleBar("Information"), 24 | 25 | Templates.ScrollableInfos(50, 26 | XUIText.Make(s_InformationStr) 27 | .SetAlign(TMPro.TextAlignmentOptions.Left) 28 | ), 29 | 30 | Templates.ExpandedButtonsLine( 31 | XUIPrimaryButton.Make("Reset", OnResetButton) 32 | ), 33 | Templates.ExpandedButtonsLine( 34 | XUISecondaryButton.Make("Documentation", OnDocumentationButton) 35 | ) 36 | ) 37 | .SetBackground(true, null, true) 38 | .BuildUI(transform); 39 | } 40 | 41 | //////////////////////////////////////////////////////////////////////////// 42 | //////////////////////////////////////////////////////////////////////////// 43 | 44 | /// 45 | /// Reset button 46 | /// 47 | private void OnResetButton() 48 | { 49 | ShowConfirmationModal("Do you really want to reset\ngame tweaker configuration?", (p_Confirm) => 50 | { 51 | if (!p_Confirm) 52 | return; 53 | 54 | /// Reset config 55 | GTConfig.Instance.Reset(); 56 | GTConfig.Instance.Enabled = true; 57 | GTConfig.Instance.Save(); 58 | 59 | /// Refresh values 60 | SettingsMainView.Instance.RefreshSettings(); 61 | }); 62 | } 63 | 64 | //////////////////////////////////////////////////////////////////////////// 65 | //////////////////////////////////////////////////////////////////////////// 66 | 67 | /// 68 | /// Documentation button 69 | /// 70 | private void OnDocumentationButton() 71 | { 72 | ShowMessageModal("URL opened in your web browser."); 73 | Application.OpenURL(GameTweaker.Instance.DocumentationURL); 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_GameTweaker/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/beat-saber-modding-group/BSIPA-MetadataFileSchema/master/Schema.json", 3 | "id": "BeatSaberPlus_GameTweaker", 4 | "name": "BeatSaberPlus_GameTweaker", 5 | "author": "HardCPP", 6 | "version": "6.4.1", 7 | "description": "", 8 | "gameVersion": "1.40.0", 9 | "dependsOn": { 10 | "BSIPA": "^4.3.0", 11 | "ChatPlexSDK_BS": "^6.4.1" 12 | }, 13 | "links": { 14 | "project-home": "https://discord.chatplex.org", 15 | "donate": "https://donate.chatplex.org" 16 | } 17 | } -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/BSIPA.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using IPA; 3 | using System.Reflection; 4 | 5 | namespace BeatSaberPlus_MenuMusic 6 | { 7 | /// 8 | /// Main plugin class 9 | /// 10 | [Plugin(RuntimeOptions.SingleStartInit)] 11 | public class BSIPA 12 | { 13 | internal const string HarmonyID = "com.github.hardcpp.beatsaberplus_menumusic"; 14 | 15 | //////////////////////////////////////////////////////////////////////////// 16 | //////////////////////////////////////////////////////////////////////////// 17 | 18 | private static Harmony m_Harmony; 19 | 20 | //////////////////////////////////////////////////////////////////////////// 21 | //////////////////////////////////////////////////////////////////////////// 22 | 23 | /// 24 | /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled). 25 | /// 26 | /// Logger instance 27 | [Init] 28 | public BSIPA(IPA.Logging.Logger p_Logger) 29 | { 30 | /// Setup logger 31 | ChatPlexMod_MenuMusic.Logger.Instance = new CP_SDK.Logging.IPALogger(p_Logger); 32 | } 33 | 34 | //////////////////////////////////////////////////////////////////////////// 35 | //////////////////////////////////////////////////////////////////////////// 36 | 37 | /// 38 | /// On BeatSaberPlus enable 39 | /// 40 | [OnEnable] 41 | public void OnEnable() 42 | { 43 | try 44 | { 45 | ChatPlexMod_MenuMusic.Logger.Instance.Debug("Applying Harmony patches."); 46 | 47 | /// Setup harmony 48 | m_Harmony = new Harmony(HarmonyID); 49 | m_Harmony.PatchAll(Assembly.GetExecutingAssembly()); 50 | } 51 | catch (System.Exception p_Exception) 52 | { 53 | ChatPlexMod_MenuMusic.Logger.Instance.Error("[Plugin.OnEnabled] Error:"); 54 | ChatPlexMod_MenuMusic.Logger.Instance.Error(p_Exception); 55 | } 56 | } 57 | /// 58 | /// On BeatSaberPlus disable 59 | /// 60 | [OnDisable] 61 | public void OnDisable() 62 | { 63 | 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/BeatSaberPlus_MenuMusic.csproj.user: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_MenuMusic/BeatSaberPlus_MenuMusic.csproj.user -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Data/EMusicProviderType.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace ChatPlexMod_MenuMusic.Data 5 | { 6 | public static class MusicProviderType 7 | { 8 | public enum E 9 | { 10 | GameMusic, 11 | CustomMusic, 12 | //GamePlaylistMusic, 13 | } 14 | 15 | public static List S = new List() 16 | { 17 | "Game Music", 18 | "Custom Music", 19 | //"Game Playlist Music" 20 | }; 21 | 22 | public static int ValueCount => S.Count; 23 | 24 | public static int ToInt(string p_Str) 25 | => Mathf.Clamp(S.IndexOf(p_Str), 0, ValueCount - 1); 26 | public static int ToInt(E p_Enum) 27 | => Mathf.Clamp((int)p_Enum, 0, ValueCount - 1); 28 | 29 | public static E ToEnum(string p_Str) 30 | => (E)ToInt(p_Str); 31 | public static E ToEnum(int p_Int) 32 | => (E)Mathf.Clamp(p_Int, 0, ValueCount - 1); 33 | 34 | public static string ToStr(int p_Int) 35 | => S[Mathf.Clamp(p_Int, 0, ValueCount - 1)]; 36 | public static string ToStr(E p_Enum) 37 | => S[Mathf.Clamp((int)p_Enum, 0, ValueCount - 1)]; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Data/IMusicProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace ChatPlexMod_MenuMusic.Data 5 | { 6 | /// 7 | /// Music provider interface 8 | /// 9 | public abstract class IMusicProvider 10 | { 11 | public abstract MusicProviderType.E Type { get; } 12 | public abstract bool IsReady { get; } 13 | public abstract bool SupportPlayIt { get; } 14 | public abstract bool SupportAddToQueue { get; } 15 | public abstract List Musics { get; } 16 | 17 | //////////////////////////////////////////////////////////////////////////// 18 | //////////////////////////////////////////////////////////////////////////// 19 | 20 | /// 21 | /// Per game implementation of the Play It button 22 | /// 23 | /// Target music 24 | /// Source view controller 25 | public abstract void StartGameSpecificGamePlay(Music music, CP_SDK.UI.IViewController viewController); 26 | /// 27 | /// Per game implementation of the Add to queue button 28 | /// 29 | /// Target music 30 | /// Source view controller 31 | public abstract void AddToQueue(Music p_Music, CP_SDK.UI.IViewController viewController); 32 | /// 33 | /// Shuffle music collection 34 | /// 35 | public abstract void Shuffle(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Logger.cs: -------------------------------------------------------------------------------- 1 | namespace ChatPlexMod_MenuMusic 2 | { 3 | /// 4 | /// Logger instance holder 5 | /// 6 | internal class Logger 7 | { 8 | /// 9 | /// Logger instance 10 | /// 11 | internal static CP_SDK.Logging.ILogger Instance; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/MMConfig.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using UnityEngine; 4 | 5 | namespace ChatPlexMod_MenuMusic 6 | { 7 | internal class MMConfig : CP_SDK.Config.JsonConfig 8 | { 9 | [JsonProperty] internal bool Enabled = false; 10 | 11 | [JsonProperty, JsonConverter(typeof(StringEnumConverter))] 12 | internal Data.MusicProviderType.E MusicProvider = Data.MusicProviderType.E.GameMusic; 13 | 14 | [JsonProperty] internal bool ShowPlayer = true; 15 | 16 | [JsonProperty] internal bool StartSongFromBeginning = false; 17 | [JsonProperty] internal bool StartANewMusicOnSceneChange = true; 18 | [JsonProperty] internal bool LoopCurrentMusic = false; 19 | [JsonProperty] internal bool UseOnlyCustomMenuSongsFolder = false; 20 | [JsonProperty] internal float PlaybackVolume = 0.5f; 21 | [JsonProperty] internal string LastPlayingSongPath = ""; 22 | 23 | //////////////////////////////////////////////////////////////////////////// 24 | //////////////////////////////////////////////////////////////////////////// 25 | 26 | /// 27 | /// Get relative config path 28 | /// 29 | /// 30 | public override string GetRelativePath() 31 | => $"{CP_SDK.ChatPlexSDK.ProductName}Plus/MenuMusic/Config"; 32 | 33 | //////////////////////////////////////////////////////////////////////////// 34 | //////////////////////////////////////////////////////////////////////////// 35 | 36 | /// 37 | /// On config init 38 | /// 39 | /// On creation 40 | protected override void OnInit(bool p_OnCreation) 41 | { 42 | 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Patches/PSongPreviewPlayer.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace ChatPlexMod_MenuMusic.Patches 4 | { 5 | /// 6 | /// PauseController patcher 7 | /// 8 | [HarmonyPatch(typeof(SongPreviewPlayer))] 9 | [HarmonyPatch(nameof(SongPreviewPlayer.CrossfadeToNewDefault))] 10 | internal class PSongPreviewPlayer : PauseController 11 | { 12 | internal static bool Prefix() 13 | { 14 | if (MMConfig.Instance.Enabled) 15 | return false; ///< Skip original function 16 | 17 | return true; ///< Continue to original function 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/BackgroundMask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/BackgroundMask.png -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/CoverMask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/CoverMask.png -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/DefaultCover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/DefaultCover.png -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Glass.png -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Next.png -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Originals.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Originals.rar -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Pause.png -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Play.png -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Playlist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Playlist.png -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Prev.png -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Rand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Rand.png -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Sound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Resources/Sound.png -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/UI/SettingsLeftView.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK.XUI; 2 | using UnityEngine; 3 | 4 | namespace ChatPlexMod_MenuMusic.UI 5 | { 6 | /// 7 | /// Settings left view 8 | /// 9 | internal sealed class SettingsLeftView : CP_SDK.UI.ViewController 10 | { 11 | private static readonly string s_InformationStr = 12 | "Thanks to Lunikc for original idea" + "\n" + 13 | $"Custom music folder is: UserData/{CP_SDK.ChatPlexSDK.ProductName}Plus/MenuMusic/CustomMusic"; 14 | 15 | //////////////////////////////////////////////////////////////////////////// 16 | //////////////////////////////////////////////////////////////////////////// 17 | 18 | /// 19 | /// On view creation 20 | /// 21 | protected override sealed void OnViewCreation() 22 | { 23 | Templates.FullRectLayout( 24 | Templates.TitleBar("Information / Credits"), 25 | 26 | Templates.ScrollableInfos(50, 27 | XUIText.Make(s_InformationStr) 28 | .SetAlign(TMPro.TextAlignmentOptions.Left) 29 | ), 30 | 31 | Templates.ExpandedButtonsLine( 32 | XUIPrimaryButton.Make("Reset", OnResetButton), 33 | XUIPrimaryButton.Make("Reload", OnReloadButton) 34 | ), 35 | Templates.ExpandedButtonsLine( 36 | XUISecondaryButton.Make("Documentation", OnDocumentationButton) 37 | ) 38 | ) 39 | .SetBackground(true, null, true) 40 | .BuildUI(transform); 41 | } 42 | 43 | //////////////////////////////////////////////////////////////////////////// 44 | //////////////////////////////////////////////////////////////////////////// 45 | 46 | /// 47 | /// Reset button 48 | /// 49 | private void OnResetButton() 50 | { 51 | ShowConfirmationModal("Do you really want to reset\nall Menu Music settings?", (p_Confirm) => 52 | { 53 | if (!p_Confirm) 54 | return; 55 | 56 | MMConfig.Instance.Reset(); 57 | MMConfig.Instance.Enabled = true; 58 | MMConfig.Instance.Save(); 59 | 60 | SettingsMainView.Instance.OnResetButton(); 61 | 62 | OnReloadButton(); 63 | }); 64 | } 65 | /// 66 | /// Reload songs 67 | /// 68 | private void OnReloadButton() 69 | { 70 | MenuMusic.Instance.UpdateMusicProvider(); 71 | 72 | ShowMessageModal("Musics were reload!"); 73 | } 74 | 75 | //////////////////////////////////////////////////////////////////////////// 76 | //////////////////////////////////////////////////////////////////////////// 77 | 78 | /// 79 | /// Documentation button 80 | /// 81 | private void OnDocumentationButton() 82 | { 83 | ShowMessageModal("URL opened in your web browser."); 84 | Application.OpenURL(MenuMusic.Instance.DocumentationURL); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/ModulePresence.cs: -------------------------------------------------------------------------------- 1 | using BeatSaberPlus_ChatRequest; 2 | using System.Linq; 3 | 4 | namespace BeatSaberPlus_MenuMusic 5 | { 6 | internal class ModulePresence 7 | { 8 | private static CP_SDK.IModuleBase m_ChatRequest; 9 | 10 | //////////////////////////////////////////////////////////////////////////// 11 | //////////////////////////////////////////////////////////////////////////// 12 | 13 | internal static bool ChatRequest 14 | { 15 | get 16 | { 17 | if (m_ChatRequest == null) 18 | m_ChatRequest = CP_SDK.ChatPlexSDK.GetModules().FirstOrDefault(x => x.Name == "Chat Request"); 19 | 20 | return m_ChatRequest?.IsEnabled ?? false; 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("BeatSaberPlus_MenuMusic")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("HardCPP")] 11 | [assembly: AssemblyProduct("BeatSaberPlus_MenuMusic")] 12 | [assembly: AssemblyCopyright("Copyright © HardCPP 2023")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("en")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("BFE64437-FBB4-4002-863B-42DAFB451F86")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("6.4.1")] 35 | [assembly: AssemblyFileVersion("6.4.1")] 36 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_MenuMusic/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/beat-saber-modding-group/BSIPA-MetadataFileSchema/master/Schema.json", 3 | "id": "BeatSaberPlus_MenuMusic", 4 | "name": "BeatSaberPlus_MenuMusic", 5 | "author": "HardCPP", 6 | "version": "6.4.1", 7 | "description": "", 8 | "gameVersion": "1.40.0", 9 | "dependsOn": { 10 | "BSIPA": "^4.3.0", 11 | "ChatPlexSDK_BS": "^6.4.1" 12 | }, 13 | "links": { 14 | "project-home": "https://discord.chatplex.org", 15 | "donate": "https://donate.chatplex.org" 16 | } 17 | } -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_NoteTweaker/BeatSaberPlus_NoteTweaker.csproj.user: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_NoteTweaker/BeatSaberPlus_NoteTweaker.csproj.user -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_NoteTweaker/Logger.cs: -------------------------------------------------------------------------------- 1 | namespace BeatSaberPlus_NoteTweaker 2 | { 3 | /// 4 | /// Logger instance holder 5 | /// 6 | internal class Logger 7 | { 8 | /// 9 | /// Logger instance 10 | /// 11 | internal static CP_SDK.Logging.ILogger Instance; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_NoteTweaker/Patches/PSliderController.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK.Unity.Extensions; 2 | using HarmonyLib; 3 | using UnityEngine; 4 | 5 | namespace BeatSaberPlus_NoteTweaker.Patches 6 | { 7 | /// 8 | /// SliderController patch 9 | /// 10 | [HarmonyPatch(typeof(SliderController))] 11 | [HarmonyPatch(nameof(SliderController.Init))] 12 | public class PSliderController : SliderController 13 | { 14 | private static bool m_Enabled = false; 15 | private static float m_Opacity = 1.0f; 16 | 17 | //////////////////////////////////////////////////////////////////////////// 18 | //////////////////////////////////////////////////////////////////////////// 19 | 20 | /// 21 | /// Prefix 22 | /// 23 | /// Start color 24 | internal static void Postfix(ref Color ____initColor) 25 | { 26 | if (m_Enabled) 27 | ____initColor = ColorU.WithAlpha(____initColor, m_Opacity); 28 | } 29 | 30 | //////////////////////////////////////////////////////////////////////////// 31 | //////////////////////////////////////////////////////////////////////////// 32 | 33 | /// 34 | /// Set from configuration 35 | /// 36 | /// Reset on scene switch 37 | internal static void SetFromConfig(bool p_OnSceneSwitch) 38 | { 39 | m_Enabled = NTConfig.Instance.Enabled; 40 | m_Opacity = NTConfig.Instance.GetActiveProfile().ArcsIntensity; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_NoteTweaker/Patches/PSliderHapticFeedbackInteractionEffect.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace BeatSaberPlus_NoteTweaker.Patches 4 | { 5 | /// 6 | /// SliderHapticFeedbackInteractionEffect patch 7 | /// 8 | [HarmonyPatch(typeof(SliderHapticFeedbackInteractionEffect))] 9 | [HarmonyPatch("StartEffect")] 10 | public class PSliderHapticFeedbackInteractionEffect : SliderHapticFeedbackInteractionEffect 11 | { 12 | private static bool m_Enabled = false; 13 | private static bool m_Haptic = true; 14 | 15 | //////////////////////////////////////////////////////////////////////////// 16 | //////////////////////////////////////////////////////////////////////////// 17 | 18 | /// 19 | /// Prefix 20 | /// 21 | internal static bool Prefix() 22 | { 23 | /// Forward to base method 24 | if (!m_Enabled || m_Haptic) 25 | return true; 26 | 27 | /// Interrupt base method (Preventing behaviour enabling) 28 | return false; 29 | } 30 | 31 | //////////////////////////////////////////////////////////////////////////// 32 | //////////////////////////////////////////////////////////////////////////// 33 | 34 | /// 35 | /// Set from configuration 36 | /// 37 | /// Reset on scene switch 38 | internal static void SetFromConfig(bool p_OnSceneSwitch) 39 | { 40 | m_Enabled = NTConfig.Instance.Enabled; 41 | m_Haptic = NTConfig.Instance.GetActiveProfile().ArcsHaptics; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_NoteTweaker/Plugin.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using IPA; 3 | using System.Reflection; 4 | 5 | namespace BeatSaberPlus_NoteTweaker 6 | { 7 | /// 8 | /// Main plugin class 9 | /// 10 | [Plugin(RuntimeOptions.SingleStartInit)] 11 | public class Plugin 12 | { 13 | /// 14 | /// Harmony ID for patches 15 | /// 16 | internal const string HarmonyID = "com.github.hardcpp.beatsaberplus_notetweaker"; 17 | 18 | //////////////////////////////////////////////////////////////////////////// 19 | //////////////////////////////////////////////////////////////////////////// 20 | 21 | /// 22 | /// Harmony patch holder 23 | /// 24 | private static Harmony m_Harmony; 25 | 26 | //////////////////////////////////////////////////////////////////////////// 27 | //////////////////////////////////////////////////////////////////////////// 28 | 29 | /// 30 | /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled). 31 | /// 32 | /// Logger instance 33 | [Init] 34 | public Plugin(IPA.Logging.Logger p_Logger) 35 | { 36 | /// Setup logger 37 | Logger.Instance = new CP_SDK.Logging.IPALogger(p_Logger); 38 | } 39 | 40 | //////////////////////////////////////////////////////////////////////////// 41 | //////////////////////////////////////////////////////////////////////////// 42 | 43 | /// 44 | /// On enable 45 | /// 46 | [OnEnable] 47 | public void OnEnable() 48 | { 49 | try 50 | { 51 | Logger.Instance.Debug("Applying Harmony patches."); 52 | 53 | /// Setup harmony 54 | m_Harmony = new Harmony(HarmonyID); 55 | m_Harmony.PatchAll(Assembly.GetExecutingAssembly()); 56 | } 57 | catch (System.Exception p_Exception) 58 | { 59 | Logger.Instance.Error("[Plugin.OnEnable] Error:"); 60 | Logger.Instance.Error(p_Exception); 61 | } 62 | } 63 | /// 64 | /// On BeatSaberPlus disable 65 | /// 66 | [OnDisable] 67 | public void OnDisable() 68 | { 69 | 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_NoteTweaker/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("BeatSaberPlus_NoteTweaker")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("HardCPP")] 11 | [assembly: AssemblyProduct("BeatSaberPlus_NoteTweaker")] 12 | [assembly: AssemblyCopyright("Copyright © HardCPP 2023")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("en")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("DDBC9483-C077-4485-A720-D7DA3A76CA34")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("6.4.1")] 35 | [assembly: AssemblyFileVersion("6.4.1")] 36 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_NoteTweaker/UI/SettingsLeftView.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK.XUI; 2 | using UnityEngine; 3 | 4 | namespace BeatSaberPlus_NoteTweaker.UI 5 | { 6 | /// 7 | /// Settings left view 8 | /// 9 | internal sealed class SettingsLeftView : CP_SDK.UI.ViewController 10 | { 11 | private static readonly string s_InformationStr = 12 | "Note Tweaker" 13 | + "\n" + "This module allows you to customize the default notes"; 14 | 15 | //////////////////////////////////////////////////////////////////////////// 16 | //////////////////////////////////////////////////////////////////////////// 17 | 18 | /// 19 | /// On view creation 20 | /// 21 | protected override sealed void OnViewCreation() 22 | { 23 | Templates.FullRectLayout( 24 | Templates.TitleBar("Information"), 25 | 26 | Templates.ScrollableInfos(55, 27 | XUIText.Make(s_InformationStr) 28 | .SetAlign(TMPro.TextAlignmentOptions.Left) 29 | ), 30 | 31 | Templates.ExpandedButtonsLine( 32 | XUISecondaryButton.Make("Documentation", OnDocumentationButton) 33 | ) 34 | ) 35 | .SetBackground(true, null, true) 36 | .BuildUI(transform); 37 | } 38 | 39 | //////////////////////////////////////////////////////////////////////////// 40 | //////////////////////////////////////////////////////////////////////////// 41 | 42 | /// 43 | /// Documentation button 44 | /// 45 | private void OnDocumentationButton() 46 | { 47 | ShowMessageModal("URL opened in your web browser."); 48 | Application.OpenURL(NoteTweaker.Instance.DocumentationURL); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_NoteTweaker/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/beat-saber-modding-group/BSIPA-MetadataFileSchema/master/Schema.json", 3 | "id": "BeatSaberPlus_NoteTweaker", 4 | "name": "BeatSaberPlus_NoteTweaker", 5 | "author": "HardCPP", 6 | "version": "6.4.1", 7 | "description": "", 8 | "gameVersion": "1.40.0", 9 | "dependsOn": { 10 | "BSIPA": "^4.3.0", 11 | "ChatPlexSDK_BS": "^6.4.1" 12 | }, 13 | "links": { 14 | "project-home": "https://discord.chatplex.org", 15 | "donate": "https://donate.chatplex.org" 16 | } 17 | } -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongChartVisualizer/BSIPA.cs: -------------------------------------------------------------------------------- 1 | using IPA; 2 | 3 | namespace BeatSaberPlus_SongChartVisualizer 4 | { 5 | /// 6 | /// Main plugin class 7 | /// 8 | [Plugin(RuntimeOptions.SingleStartInit)] 9 | public class Plugin 10 | { 11 | /// 12 | /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled). 13 | /// 14 | /// Logger instance 15 | [Init] 16 | public Plugin(IPA.Logging.Logger p_Logger) 17 | { 18 | /// Setup logger 19 | ChatPlexMod_SongChartVisualizer.Logger.Instance = new CP_SDK.Logging.IPALogger(p_Logger); 20 | } 21 | 22 | //////////////////////////////////////////////////////////////////////////// 23 | //////////////////////////////////////////////////////////////////////////// 24 | 25 | /// 26 | /// On BeatSaberPlus enable 27 | /// 28 | [OnEnable] 29 | public void OnEnable() 30 | { 31 | 32 | } 33 | /// 34 | /// On BeatSaberPlus disable 35 | /// 36 | [OnDisable] 37 | public void OnDisable() 38 | { 39 | 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongChartVisualizer/BeatSaberPlus_SongChartVisualizer.csproj.user: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Modules/BeatSaberPlus_SongChartVisualizer/BeatSaberPlus_SongChartVisualizer.csproj.user -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongChartVisualizer/ChatPlexMod_SongChartVisualizer/Data/Graph.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ChatPlexMod_SongChartVisualizer.Data 4 | { 5 | /// 6 | /// Graph instance 7 | /// 8 | internal class Graph 9 | { 10 | internal GraphPoint[] Points; 11 | internal float SongDuration; 12 | internal float MinY; 13 | internal float MaxY; 14 | 15 | //////////////////////////////////////////////////////////////////////////// 16 | //////////////////////////////////////////////////////////////////////////// 17 | 18 | /// 19 | /// Constructor 20 | /// 21 | /// Song duration 22 | internal Graph(float p_SongDuration) 23 | { 24 | SongDuration = p_SongDuration; 25 | MinY = 0.0f; 26 | MaxY = 0.0f; 27 | } 28 | 29 | //////////////////////////////////////////////////////////////////////////// 30 | //////////////////////////////////////////////////////////////////////////// 31 | 32 | internal float SongTimeToProgress(float p_SongTime) 33 | => (p_SongTime / (SongDuration + 1)); 34 | internal int ProgressToIndexLow(float p_Progress) 35 | { 36 | var l_Index = (int)(p_Progress * (float)SongChartVisualizer.MaxPoints); 37 | return Mathf.Clamp(l_Index, 0, SongChartVisualizer.MaxPoints - 1); 38 | } 39 | internal float ProgressToIndexRelativeVirtual(float p_Progress) 40 | { 41 | var l_RelativeVirtual = p_Progress * (float)SongChartVisualizer.MaxPoints; 42 | return (float)l_RelativeVirtual - (int)l_RelativeVirtual; 43 | } 44 | internal int ProgressToIndexHi(float p_Progress) 45 | { 46 | var l_Index = (int)(p_Progress * (float)SongChartVisualizer.MaxPoints) + 1; 47 | return Mathf.Clamp(l_Index, 0, SongChartVisualizer.MaxPoints - 1); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongChartVisualizer/ChatPlexMod_SongChartVisualizer/Data/GraphPoint.cs: -------------------------------------------------------------------------------- 1 | namespace ChatPlexMod_SongChartVisualizer.Data 2 | { 3 | /// 4 | /// Graph point 5 | /// 6 | internal struct GraphPoint 7 | { 8 | public float X; 9 | public float Y; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongChartVisualizer/ChatPlexMod_SongChartVisualizer/Logger.cs: -------------------------------------------------------------------------------- 1 | namespace ChatPlexMod_SongChartVisualizer 2 | { 3 | /// 4 | /// Logger instance holder 5 | /// 6 | internal class Logger 7 | { 8 | /// 9 | /// Logger instance 10 | /// 11 | internal static CP_SDK.Logging.ILogger Instance; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongChartVisualizer/ChatPlexMod_SongChartVisualizer/SCVConfig.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using UnityEngine; 3 | 4 | namespace ChatPlexMod_SongChartVisualizer 5 | { 6 | /// 7 | /// Config class 8 | /// 9 | internal class SCVConfig : CP_SDK.Config.JsonConfig 10 | { 11 | [JsonProperty] internal bool Enabled = false; 12 | 13 | [JsonProperty] internal bool AlignWithFloor = true; 14 | [JsonProperty] internal bool ShowLockIcon = true; 15 | [JsonProperty] internal bool FollowEnvironementRotation = true; 16 | [JsonProperty] internal bool ShowNPSLegend = false; 17 | 18 | [JsonProperty] internal Color BackgroundColor = new Color(0.00f, 0.00f, 0.00f, 0.50f); 19 | [JsonProperty] internal Color CursorColor = new Color(1.00f, 0.03f, 0.00f, 1.00f); 20 | [JsonProperty] internal Color LineColor = new Color(0.00f, 0.85f, 0.91f, 0.50f); 21 | [JsonProperty] internal Color LegendColor = new Color(0.37f, 0.10f, 0.86f, 1.00f); 22 | [JsonProperty] internal Color DashLineColor = new Color(0.37f, 0.10f, 0.86f, 0.20f); 23 | 24 | [JsonProperty] internal Vector3 ChartStandardPosition = new Vector3( 0.0f, -0.4f, 2.25f); 25 | [JsonProperty] internal Vector3 ChartStandardRotation = new Vector3( 35.0f, 0.0f, 0.00f); 26 | 27 | [JsonProperty] internal Vector3 ChartRotatingPosition = new Vector3( 0.0f, 3.50f, 3.00f); 28 | [JsonProperty] internal Vector3 ChartRotatingRotation = new Vector3(-30.0f, 0.00f, 0.00f); 29 | 30 | //////////////////////////////////////////////////////////////////////////// 31 | //////////////////////////////////////////////////////////////////////////// 32 | 33 | /// 34 | /// Get relative config path 35 | /// 36 | /// 37 | public override string GetRelativePath() 38 | => $"{CP_SDK.ChatPlexSDK.ProductName}Plus/SongChartVisualizer/Config"; 39 | 40 | //////////////////////////////////////////////////////////////////////////// 41 | //////////////////////////////////////////////////////////////////////////// 42 | 43 | /// 44 | /// On config init 45 | /// 46 | /// On creation 47 | protected override void OnInit(bool p_OnCreation) 48 | { 49 | 50 | } 51 | 52 | //////////////////////////////////////////////////////////////////////////// 53 | //////////////////////////////////////////////////////////////////////////// 54 | 55 | /// 56 | /// Reset positions 57 | /// 58 | internal void ResetPosition() 59 | { 60 | ChartStandardPosition = new Vector3(0f, -0.4f, 2.25f); 61 | ChartStandardRotation = new Vector3(35f, 0.0f, 0.00f); 62 | 63 | ChartRotatingPosition = new Vector3(0f, 3.50f, 3.00f); 64 | ChartRotatingRotation = new Vector3(-30f, 0.00f, 0.00f); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongChartVisualizer/ChatPlexMod_SongChartVisualizer/UI/SettingsLeftView.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK.XUI; 2 | using UnityEngine; 3 | 4 | namespace ChatPlexMod_SongChartVisualizer.UI 5 | { 6 | /// 7 | /// Settings left view 8 | /// 9 | internal sealed class SettingsLeftView : CP_SDK.UI.ViewController 10 | { 11 | private static readonly string s_InformationStr = 12 | "Thanks to Shoko84 & Opzon for the original idea"; 13 | 14 | //////////////////////////////////////////////////////////////////////////// 15 | //////////////////////////////////////////////////////////////////////////// 16 | 17 | /// 18 | /// On view creation 19 | /// 20 | protected override sealed void OnViewCreation() 21 | { 22 | Templates.FullRectLayout( 23 | Templates.TitleBar("Information / Credits"), 24 | 25 | Templates.ScrollableInfos(50, 26 | XUIText.Make(s_InformationStr).SetAlign(TMPro.TextAlignmentOptions.Left) 27 | ), 28 | 29 | Templates.ExpandedButtonsLine( 30 | XUIPrimaryButton.Make("Reset", OnResetButton), 31 | XUIPrimaryButton.Make("Reset Position", OnResetPositionButton) 32 | ), 33 | Templates.ExpandedButtonsLine( 34 | XUISecondaryButton.Make("Documentation", OnDocumentationButton) 35 | ) 36 | ) 37 | .SetBackground(true, null, true) 38 | .BuildUI(transform); 39 | } 40 | 41 | //////////////////////////////////////////////////////////////////////////// 42 | //////////////////////////////////////////////////////////////////////////// 43 | 44 | /// 45 | /// Reset button 46 | /// 47 | private void OnResetButton() 48 | { 49 | ShowConfirmationModal("Do you really want to reset\nall SongChartVisualizer settings?", (p_Confirm) => 50 | { 51 | if (!p_Confirm) 52 | return; 53 | 54 | /// Reset settings 55 | SCVConfig.Instance.Reset(); 56 | SCVConfig.Instance.Enabled = true; 57 | SCVConfig.Instance.Save(); 58 | 59 | /// Update main view 60 | SettingsMainView.Instance.OnResetButton(); 61 | }); 62 | } 63 | /// 64 | /// Reset position button 65 | /// 66 | private void OnResetPositionButton() 67 | { 68 | ShowConfirmationModal("Do you really want to reset\nSongChartVisualizer position?", (p_Confirm) => 69 | { 70 | if (!p_Confirm) 71 | return; 72 | 73 | /// Reset settings 74 | SCVConfig.Instance.ResetPosition(); 75 | SCVConfig.Instance.Save(); 76 | 77 | /// Update main view 78 | SettingsMainView.Instance.OnResetButton(); 79 | }); 80 | } 81 | 82 | //////////////////////////////////////////////////////////////////////////// 83 | //////////////////////////////////////////////////////////////////////////// 84 | 85 | /// 86 | /// Documentation button 87 | /// 88 | private void OnDocumentationButton() 89 | { 90 | ShowMessageModal("URL opened in your web browser."); 91 | Application.OpenURL(SongChartVisualizer.Instance.DocumentationURL); 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongChartVisualizer/ChatPlexMod_SongChartVisualizer/UI/SettingsRightView.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK.XUI; 2 | 3 | namespace ChatPlexMod_SongChartVisualizer.UI 4 | { 5 | /// 6 | /// Settings right view 7 | /// 8 | internal sealed class SettingsRightView : CP_SDK.UI.ViewController 9 | { 10 | /// 11 | /// On view creation 12 | /// 13 | protected override sealed void OnViewCreation() 14 | { 15 | Templates.FullRectLayout( 16 | Templates.TitleBar("Preview"), 17 | 18 | XUIVSpacer.Make(65f) 19 | ) 20 | .SetBackground(true, null, true) 21 | .BuildUI(transform); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongChartVisualizer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("BeatSaberPlus_SongChartVisualizer")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("HardCPP")] 11 | [assembly: AssemblyProduct("BeatSaberPlus_SongChartVisualizer")] 12 | [assembly: AssemblyCopyright("Copyright © HardCPP 2023")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("en")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("07E42F20-AE5B-4BDA-8260-970191C61EB3")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("6.4.1")] 35 | [assembly: AssemblyFileVersion("6.4.1")] 36 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongChartVisualizer/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/beat-saber-modding-group/BSIPA-MetadataFileSchema/master/Schema.json", 3 | "id": "BeatSaberPlus_SongChartVisualizer", 4 | "name": "BeatSaberPlus_SongChartVisualizer", 5 | "author": "HardCPP", 6 | "version": "6.4.1", 7 | "description": "", 8 | "gameVersion": "1.40.0", 9 | "dependsOn": { 10 | "BSIPA": "^4.3.0", 11 | "ChatPlexSDK_BS": "^6.4.1" 12 | }, 13 | "links": { 14 | "project-home": "https://discord.chatplex.org", 15 | "donate": "https://donate.chatplex.org" 16 | } 17 | } -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongOverlay/Logger.cs: -------------------------------------------------------------------------------- 1 | namespace BeatSaberPlus_SongOverlay 2 | { 3 | /// 4 | /// Logger instance holder 5 | /// 6 | internal class Logger 7 | { 8 | /// 9 | /// Logger instance 10 | /// 11 | internal static CP_SDK.Logging.ILogger Instance; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongOverlay/Models/Event.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace BeatSaberPlus_SongOverlay.Models 5 | { 6 | [Serializable] 7 | public class Event 8 | { 9 | [JsonProperty] internal string _type = "event"; 10 | [JsonProperty] internal string _event = ""; 11 | 12 | [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] 13 | internal MapInfo mapInfoChanged = null; 14 | [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] 15 | internal string gameStateChanged = null; 16 | [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] 17 | internal Score scoreEvent = null; 18 | [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] 19 | internal float? pauseTime = null; 20 | [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] 21 | internal float? resumeTime = null; 22 | 23 | internal void FeedEvent() 24 | { 25 | if (mapInfoChanged != null) _event = "mapInfo"; 26 | if (gameStateChanged != null) _event = "gameState"; 27 | if (scoreEvent != null) _event = "score"; 28 | if (pauseTime.HasValue) _event = "pause"; 29 | if (resumeTime.HasValue) _event = "resume"; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongOverlay/Models/MapInfo.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace BeatSaberPlus_SongOverlay.Models 5 | { 6 | [Serializable] 7 | public class MapInfo 8 | { 9 | [JsonProperty] internal string level_id = ""; 10 | [JsonProperty] internal string name = "N/A"; 11 | [JsonProperty] internal string sub_name = "N/A"; 12 | [JsonProperty] internal string artist = "N/A"; 13 | [JsonProperty] internal string mapper = "N/A"; 14 | [JsonProperty] internal string characteristic = "N/A"; 15 | [JsonProperty] internal string difficulty = "N/A"; 16 | [JsonProperty] internal uint duration = 0; 17 | [JsonProperty] internal float BPM = 0; 18 | [JsonProperty] internal float PP = 0; 19 | [JsonProperty] internal string BSRKey = ""; 20 | [JsonProperty] internal string coverRaw = ""; 21 | [JsonProperty] internal float time = 0; 22 | [JsonProperty] internal float timeMultiplier = 0; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongOverlay/Models/Score.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace BeatSaberPlus_SongOverlay.Models 5 | { 6 | [Serializable] 7 | public class Score 8 | { 9 | [JsonProperty] internal float time = 0; 10 | [JsonProperty] internal uint score = 0; 11 | [JsonProperty] internal float accuracy = 0; 12 | [JsonProperty] internal uint combo = 0; 13 | [JsonProperty] internal uint missCount = 0; 14 | [JsonProperty] internal float currentHealth = 0; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongOverlay/Network/OverlaySession.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK_WebSocketSharp; 2 | using CP_SDK_WebSocketSharp.Server; 3 | 4 | namespace BeatSaberPlus_SongOverlay.Network 5 | { 6 | /// 7 | /// Web socket client session 8 | /// 9 | internal class OverlaySession : WebSocketBehavior 10 | { 11 | /// 12 | /// On connection open 13 | /// 14 | protected override void OnOpen() 15 | { 16 | OverlayServer.OnClientConnected(this); 17 | } 18 | /// 19 | /// On connection close 20 | /// 21 | /// 22 | protected override void OnClose(CloseEventArgs p_Event) 23 | { 24 | OverlayServer.OnClientDisconnected(this); 25 | } 26 | 27 | //////////////////////////////////////////////////////////////////////////// 28 | //////////////////////////////////////////////////////////////////////////// 29 | 30 | /// 31 | /// Send data to the client 32 | /// 33 | /// Data to send 34 | internal void SendData(string p_Data) 35 | { 36 | Send(p_Data); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongOverlay/Plugin.cs: -------------------------------------------------------------------------------- 1 | using IPA; 2 | 3 | namespace BeatSaberPlus_SongOverlay 4 | { 5 | /// 6 | /// Main plugin class 7 | /// 8 | [Plugin(RuntimeOptions.SingleStartInit)] 9 | public class Plugin 10 | { 11 | /// 12 | /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled). 13 | /// 14 | /// Logger instance 15 | [Init] 16 | public Plugin(IPA.Logging.Logger p_Logger) 17 | { 18 | /// Setup logger 19 | Logger.Instance = new CP_SDK.Logging.IPALogger(p_Logger); 20 | } 21 | 22 | //////////////////////////////////////////////////////////////////////////// 23 | //////////////////////////////////////////////////////////////////////////// 24 | 25 | /// 26 | /// On BeatSaberPlus enable 27 | /// 28 | [OnEnable] 29 | public void OnEnable() 30 | { 31 | 32 | } 33 | /// 34 | /// On BeatSaberPlus disable 35 | /// 36 | [OnDisable] 37 | public void OnDisable() 38 | { 39 | 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongOverlay/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("BeatSaberPlus_SongOverlay")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("HardCPP")] 11 | [assembly: AssemblyProduct("BeatSaberPlus_SongOverlay")] 12 | [assembly: AssemblyCopyright("Copyright © HardCPP 2023")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("en")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("193F6510-339A-472A-B5E2-9739A3567384")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("6.4.1")] 35 | [assembly: AssemblyFileVersion("6.4.1")] 36 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongOverlay/SOConfig.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace BeatSaberPlus_SongOverlay 4 | { 5 | /// 6 | /// Config class helper 7 | /// 8 | internal class SOConfig : CP_SDK.Config.JsonConfig 9 | { 10 | [JsonProperty] internal bool Enabled = true; 11 | 12 | //////////////////////////////////////////////////////////////////////////// 13 | //////////////////////////////////////////////////////////////////////////// 14 | 15 | /// 16 | /// Get relative config path 17 | /// 18 | /// 19 | public override string GetRelativePath() 20 | => $"{CP_SDK.ChatPlexSDK.ProductName}Plus/SongOverlay/Config"; 21 | 22 | //////////////////////////////////////////////////////////////////////////// 23 | //////////////////////////////////////////////////////////////////////////// 24 | 25 | /// 26 | /// On config init 27 | /// 28 | /// On creation 29 | protected override void OnInit(bool p_OnCreation) 30 | { 31 | 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongOverlay/UI/SettingsLeftView.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK.XUI; 2 | using UnityEngine; 3 | 4 | namespace BeatSaberPlus_SongOverlay.UI 5 | { 6 | /// 7 | /// Settings left view 8 | /// 9 | internal sealed class SettingsLeftView : CP_SDK.UI.ViewController 10 | { 11 | /// 12 | /// On view creation 13 | /// 14 | protected override sealed void OnViewCreation() 15 | { 16 | Templates.FullRectLayout( 17 | Templates.TitleBar("Information"), 18 | 19 | Templates.ScrollableInfos(55, 20 | XUIText.Make($"This module provide a server for Web based song overlays!") 21 | .SetAlign(TMPro.TextAlignmentOptions.Left) 22 | ), 23 | 24 | Templates.ExpandedButtonsLine( 25 | XUIPrimaryButton.Make("Documentation", OnDocumentationButton) 26 | ) 27 | ) 28 | .SetBackground(true, null, true) 29 | .BuildUI(transform); 30 | } 31 | 32 | //////////////////////////////////////////////////////////////////////////// 33 | //////////////////////////////////////////////////////////////////////////// 34 | 35 | /// 36 | /// Documentation button 37 | /// 38 | private void OnDocumentationButton() 39 | { 40 | ShowMessageModal("URL opened in your web browser."); 41 | Application.OpenURL(SongOverlay.Instance.DocumentationURL); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongOverlay/UI/SettingsMainView.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK.XUI; 2 | 3 | namespace BeatSaberPlus_SongOverlay.UI 4 | { 5 | /// 6 | /// Settings main view 7 | /// 8 | internal sealed class SettingsMainView : CP_SDK.UI.ViewController 9 | { 10 | /// 11 | /// On view creation 12 | /// 13 | protected override sealed void OnViewCreation() 14 | { 15 | Templates.FullRectLayoutMainView( 16 | Templates.TitleBar("Song Overlay - Settings"), 17 | 18 | XUIText.Make("No settings available yet...") 19 | .SetStyle(TMPro.FontStyles.Italic) 20 | .SetAlign(TMPro.TextAlignmentOptions.Midline), 21 | 22 | XUIVSpacer.Make(60f) 23 | ) 24 | .SetBackground(true, null, true) 25 | .BuildUI(transform); 26 | } 27 | /// 28 | /// On view deactivation 29 | /// 30 | protected sealed override void OnViewDeactivation() 31 | { 32 | SOConfig.Instance.Save(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Modules/BeatSaberPlus_SongOverlay/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/beat-saber-modding-group/BSIPA-MetadataFileSchema/master/Schema.json", 3 | "id": "BeatSaberPlus_SongOverlay", 4 | "name": "BeatSaberPlus_SongOverlay", 5 | "author": "HardCPP", 6 | "version": "6.4.1", 7 | "description": "BeatSaberPlus song overlay module.", 8 | "gameVersion": "1.40.0", 9 | "dependsOn": { 10 | "BSIPA": "^4.3.0", 11 | "ChatPlexSDK_BS": "^6.4.1" 12 | }, 13 | "links": { 14 | "project-home": "https://discord.chatplex.org", 15 | "donate": "https://donate.chatplex.org" 16 | } 17 | } -------------------------------------------------------------------------------- /Samples/BeatSaberPlus_ModuleTemplate/BeatSaberPlus_ModuleTemplate.csproj.user: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/Samples/BeatSaberPlus_ModuleTemplate/BeatSaberPlus_ModuleTemplate.csproj.user -------------------------------------------------------------------------------- /Samples/BeatSaberPlus_ModuleTemplate/Logger.cs: -------------------------------------------------------------------------------- 1 | namespace BeatSaberPlus_ModuleTemplate 2 | { 3 | /// 4 | /// Logger instance holder 5 | /// 6 | internal class Logger 7 | { 8 | /// 9 | /// Logger instance 10 | /// 11 | internal static CP_SDK.Logging.ILogger Instance; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Samples/BeatSaberPlus_ModuleTemplate/MTConfig.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace BeatSaberPlus_ModuleTemplate 4 | { 5 | /// 6 | /// Config class helper 7 | /// 8 | internal class MTConfig : CP_SDK.Config.JsonConfig 9 | { 10 | [JsonProperty] internal bool Enabled = true; 11 | [JsonProperty] internal bool TemplateSetting = false; 12 | 13 | //////////////////////////////////////////////////////////////////////////// 14 | //////////////////////////////////////////////////////////////////////////// 15 | 16 | /// 17 | /// Get relative config path 18 | /// 19 | /// 20 | public override string GetRelativePath() 21 | => $"{CP_SDK.ChatPlexSDK.ProductName}Plus/ModuleTemplate/Config"; 22 | 23 | //////////////////////////////////////////////////////////////////////////// 24 | //////////////////////////////////////////////////////////////////////////// 25 | 26 | /// 27 | /// On config init 28 | /// 29 | /// On creation 30 | protected override void OnInit(bool p_OnCreation) 31 | { 32 | 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Samples/BeatSaberPlus_ModuleTemplate/ModuleTemplate.cs: -------------------------------------------------------------------------------- 1 | namespace BeatSaberPlus_ModuleTemplate 2 | { 3 | /// 4 | /// Online instance 5 | /// 6 | internal class ModuleTemplate : CP_SDK.ModuleBase 7 | { 8 | public override CP_SDK.EIModuleBaseType Type => CP_SDK.EIModuleBaseType.Integrated; 9 | public override string Name => "Module Template"; 10 | public override string Description => "Hello world!"; 11 | public override bool UseChatFeatures => false; 12 | public override bool IsEnabled { get => MTConfig.Instance.Enabled; set { MTConfig.Instance.Enabled = value; MTConfig.Instance.Save(); } } 13 | public override CP_SDK.EIModuleBaseActivationType ActivationType => CP_SDK.EIModuleBaseActivationType.OnStart; 14 | 15 | //////////////////////////////////////////////////////////////////////////// 16 | //////////////////////////////////////////////////////////////////////////// 17 | 18 | private UI.SettingsMainView m_SettingsMainView = null; 19 | 20 | //////////////////////////////////////////////////////////////////////////// 21 | //////////////////////////////////////////////////////////////////////////// 22 | 23 | /// 24 | /// Disable the Module 25 | /// 26 | protected override void OnEnable() 27 | { 28 | /// Bind event 29 | CP_SDK_BS.Game.Logic.OnLevelStarted += Game_OnLevelStarted; 30 | } 31 | /// 32 | /// Enable the Module 33 | /// 34 | protected override void OnDisable() 35 | { 36 | /// Unbind event 37 | CP_SDK_BS.Game.Logic.OnLevelStarted -= Game_OnLevelStarted; 38 | } 39 | 40 | //////////////////////////////////////////////////////////////////////////// 41 | //////////////////////////////////////////////////////////////////////////// 42 | 43 | /// 44 | /// Get Module settings UI 45 | /// 46 | protected override (CP_SDK.UI.IViewController, CP_SDK.UI.IViewController, CP_SDK.UI.IViewController) GetSettingsViewControllersImplementation() 47 | { 48 | if (m_SettingsMainView == null) m_SettingsMainView = CP_SDK.UI.UISystem.CreateViewController(); 49 | 50 | return (m_SettingsMainView, null, null); 51 | } 52 | 53 | //////////////////////////////////////////////////////////////////////////// 54 | //////////////////////////////////////////////////////////////////////////// 55 | 56 | /// 57 | /// On level started 58 | /// 59 | /// Level data 60 | private void Game_OnLevelStarted(CP_SDK_BS.Game.LevelData p_LevelData) 61 | { 62 | var l_MapName = p_LevelData?.Data?.beatmapLevel?.songName ?? "?"; 63 | var l_PlatformName = p_LevelData?.Data?.targetEnvironmentInfo?.serializedName ?? "?"; 64 | 65 | Logger.Instance.Warning($"Map {l_MapName} started on platform {l_PlatformName}"); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Samples/BeatSaberPlus_ModuleTemplate/Plugin.cs: -------------------------------------------------------------------------------- 1 | using IPA; 2 | 3 | namespace BeatSaberPlus_ModuleTemplate 4 | { 5 | /// 6 | /// Main plugin class 7 | /// 8 | [Plugin(RuntimeOptions.SingleStartInit)] 9 | public class Plugin 10 | { 11 | /// 12 | /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled). 13 | /// 14 | /// Logger instance 15 | [Init] 16 | public Plugin(IPA.Logging.Logger p_Logger) 17 | { 18 | /// Setup logger 19 | Logger.Instance = new CP_SDK.Logging.IPALogger(p_Logger); 20 | } 21 | 22 | //////////////////////////////////////////////////////////////////////////// 23 | //////////////////////////////////////////////////////////////////////////// 24 | 25 | /// 26 | /// On BeatSaberPlus enable 27 | /// 28 | [OnEnable] 29 | public void OnEnable() 30 | { 31 | 32 | } 33 | /// 34 | /// On BeatSaberPlus disable 35 | /// 36 | [OnDisable] 37 | public void OnDisable() 38 | { 39 | 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Samples/BeatSaberPlus_ModuleTemplate/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("BeatSaberPlus_ModuleTemplate")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("HardCPP")] 11 | [assembly: AssemblyProduct("BeatSaberPlus_ModuleTemplate")] 12 | [assembly: AssemblyCopyright("Copyright © HardCPP 2023")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("en")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("9D1F098F-D633-4C4C-ACF6-8E6A0D89E588")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("6.4.1")] 35 | [assembly: AssemblyFileVersion("6.4.1")] 36 | -------------------------------------------------------------------------------- /Samples/BeatSaberPlus_ModuleTemplate/UI/SettingsMainView.cs: -------------------------------------------------------------------------------- 1 | using CP_SDK.XUI; 2 | 3 | namespace BeatSaberPlus_ModuleTemplate.UI 4 | { 5 | /// 6 | /// ModuleTemplate settings view controller 7 | /// 8 | internal sealed class SettingsMainView : CP_SDK.UI.ViewController 9 | { 10 | private XUIToggle m_TemplateSetting = null; 11 | 12 | //////////////////////////////////////////////////////////////////////////// 13 | //////////////////////////////////////////////////////////////////////////// 14 | 15 | /// 16 | /// On view creation 17 | /// 18 | protected override sealed void OnViewCreation() 19 | { 20 | Templates.FullRectLayoutMainView( 21 | Templates.TitleBar("Module Template | Settings"), 22 | 23 | XUIText.Make("Template setting"), 24 | XUIToggle.Make() 25 | .SetValue(MTConfig.Instance.TemplateSetting) 26 | .OnValueChanged((_) => OnSettingChanged()) 27 | .Bind(ref m_TemplateSetting) 28 | ) 29 | .SetBackground(true, null, true) 30 | .BuildUI(transform); 31 | } 32 | /// 33 | /// On view deactivation 34 | /// 35 | protected sealed override void OnViewDeactivation() 36 | { 37 | MTConfig.Instance.Save(); 38 | } 39 | 40 | //////////////////////////////////////////////////////////////////////////// 41 | //////////////////////////////////////////////////////////////////////////// 42 | 43 | /// 44 | /// On setting changed 45 | /// 46 | private void OnSettingChanged() 47 | { 48 | /// Update config 49 | MTConfig.Instance.TemplateSetting = m_TemplateSetting.Element.GetValue(); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Samples/BeatSaberPlus_ModuleTemplate/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/beat-saber-modding-group/BSIPA-MetadataFileSchema/master/Schema.json", 3 | "id": "BeatSaberPlus_ModuleTemplate", 4 | "name": "BeatSaberPlus_ModuleTemplate", 5 | "author": "HardCPP", 6 | "version": "6.4.1", 7 | "description": "", 8 | "gameVersion": "1.34.2", 9 | "dependsOn": { 10 | "BSIPA": "^4.3.0", 11 | "ChatPlexSDK_BS": "^6.4.1" 12 | }, 13 | "links": { 14 | "project-home": "https://discord.chatplex.org", 15 | "donate": "https://donate.chatplex.org" 16 | } 17 | } -------------------------------------------------------------------------------- /SwitchVersion.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardcpp/BeatSaberPlus/c32f1b218ccf006f193031961d605a4860eda729/SwitchVersion.ps1 --------------------------------------------------------------------------------