From ff9c23830a700f03f3c0bb9082bf19351cde351d Mon Sep 17 00:00:00 2001 From: HardCPP Date: Fri, 16 Aug 2024 05:32:08 +0200 Subject: [PATCH] V6.3.0 --- ChatPlexSDK-BS | 2 +- .../BeatSaberPlus_Chat.csproj | 11 +- .../BeatSaberPlus_Chat.csproj.user | Bin 658 -> 598 bytes .../Components/ChatMessageText.cs | 16 +- .../Extensions/EnhancedFontInfo.cs | 4 +- .../UI/PollFloatingPanelView.cs | 30 +-- .../UI/PredictionFloatingPanelView.cs | 98 ++++++--- .../Utils/ChatMessageBuilder.cs | 9 +- .../Properties/AssemblyInfo.cs | 4 +- Modules/BeatSaberPlus_Chat/manifest.json | 6 +- .../BeatSaberPlus_ChatEmoteRain.csproj | 1 - .../BeatSaberPlus_ChatEmoteRain.csproj.user | Bin 658 -> 598 bytes .../ChatEmoteRain.cs | 36 +--- .../Resources/PreviewMaterial.bundle | Bin 22998 -> 0 bytes .../Properties/AssemblyInfo.cs | 4 +- .../BeatSaberPlus_ChatEmoteRain/manifest.json | 6 +- .../BeatSaber/Actions/GamePlay.cs | 4 + .../BeatSaber/Events/LevelEnded.cs | 9 +- .../BeatSaber/Events/LevelPaused.cs | 13 +- .../BeatSaber/Events/LevelResumed.cs | 13 +- .../BeatSaber/Events/LevelStarted.cs | 14 +- .../BeatSaberPlus_ChatIntegrations.csproj | 22 +- ...BeatSaberPlus_ChatIntegrations.csproj.user | Bin 658 -> 598 bytes .../Actions/OBS.cs | 203 ++++++++++++------ .../Actions/Twitch.cs | 21 +- .../ChatIntegrations.cs | 10 +- .../Conditions/OBS.cs | 17 +- .../Events/ChatPointsReward.cs | 12 +- .../Properties/AssemblyInfo.cs | 4 +- .../manifest.json | 6 +- .../BeatSaberPlus_ChatRequest.csproj | 16 +- .../BeatSaberPlus_ChatRequest.csproj.user | Bin 658 -> 598 bytes .../BeatSaberPlus_ChatRequest/ChatRequest.cs | 67 +++--- .../ChatRequest_Commands.cs | 7 +- .../ChatRequest_Logic.cs | 4 + .../Properties/AssemblyInfo.cs | 4 +- .../UI/ManagerMainView.cs | 51 ++--- .../BeatSaberPlus_ChatRequest/manifest.json | 6 +- .../BeatSaberPlus_GameTweaker.csproj | 30 ++- .../BeatSaberPlus_GameTweaker.csproj.user | Bin 658 -> 598 bytes .../Components/FPFCEscape.cs | 6 +- .../BeatSaberPlus_GameTweaker/GameTweaker.cs | 4 + .../Patches/PLevelListTableCell.cs | 6 +- .../Patches/PMusicPackPromoBanner.cs | 66 ++++++ .../Patches/PPlayerSettingsPanelController.cs | 8 +- .../Patches/PPromoViewController.cs | 4 +- .../Properties/AssemblyInfo.cs | 4 +- .../BeatSaberPlus_GameTweaker/manifest.json | 6 +- .../BeatSaberPlus_MenuMusic.csproj | 20 +- .../BeatSaberPlus_MenuMusic.csproj.user | Bin 658 -> 598 bytes .../Data/GameMusicProvider.cs | 28 ++- .../ChatPlexMod_MenuMusic/MenuMusic.cs | 2 +- .../Properties/AssemblyInfo.cs | 4 +- Modules/BeatSaberPlus_MenuMusic/manifest.json | 6 +- .../BeatSaberPlus_NoteTweaker.csproj | 16 +- .../BeatSaberPlus_NoteTweaker.csproj.user | Bin 658 -> 598 bytes .../Patches/PBurstSliderGameNoteController.cs | 29 ++- .../Patches/PColorNoteVisuals.cs | 53 +++-- .../Patches/PGameNoteController.cs | 29 ++- .../Properties/AssemblyInfo.cs | 4 +- .../BeatSaberPlus_NoteTweaker/manifest.json | 6 +- .../BeatSaberPlus_SongChartVisualizer.csproj | 15 +- ...tSaberPlus_SongChartVisualizer.csproj.user | Bin 658 -> 598 bytes .../SongChartVisualizer.cs | 17 +- .../Properties/AssemblyInfo.cs | 4 +- .../manifest.json | 6 +- .../BeatSaberPlus_SongOverlay.csproj | 13 +- .../Network/OverlayServer.cs | 20 ++ .../Properties/AssemblyInfo.cs | 4 +- .../BeatSaberPlus_SongOverlay/manifest.json | 6 +- 70 files changed, 704 insertions(+), 442 deletions(-) delete mode 100644 Modules/BeatSaberPlus_ChatEmoteRain/ChatPlexMod_ChatEmoteRain/Resources/PreviewMaterial.bundle create mode 100644 Modules/BeatSaberPlus_GameTweaker/Patches/PMusicPackPromoBanner.cs diff --git a/ChatPlexSDK-BS b/ChatPlexSDK-BS index 2f3f673..54c5096 160000 --- a/ChatPlexSDK-BS +++ b/ChatPlexSDK-BS @@ -1 +1 @@ -Subproject commit 2f3f673ce0344d8e9ade17809d84465f0acad662 +Subproject commit 54c50963f480a18e52def12cc95ac569b0ea4269 diff --git a/Modules/BeatSaberPlus_Chat/BeatSaberPlus_Chat.csproj b/Modules/BeatSaberPlus_Chat/BeatSaberPlus_Chat.csproj index c40fcc9..f876971 100644 --- a/Modules/BeatSaberPlus_Chat/BeatSaberPlus_Chat.csproj +++ b/Modules/BeatSaberPlus_Chat/BeatSaberPlus_Chat.csproj @@ -24,14 +24,14 @@ true false bin\Debug\ - TRACE;DEBUG;BEATSABER;BEATSABER_1_29_4_OR_NEWER + TRACE;DEBUG;BEATSABER;BEATSABER_1_35_0_OR_NEWER prompt 4 true bin\Release\ - BEATSABER;BEATSABER_1_29_4_OR_NEWER + BEATSABER;BEATSABER_1_35_0_OR_NEWER prompt 4 @@ -52,10 +52,13 @@ + + $(BeatSaberDir)\Beat Saber_Data\Managed\DataModels.dll + False + $(BeatSaberDir)\Libs\Newtonsoft.Json.dll False - False @@ -88,12 +91,10 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.TextCoreModule.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.TextRenderingModule.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.UI.dll diff --git a/Modules/BeatSaberPlus_Chat/BeatSaberPlus_Chat.csproj.user b/Modules/BeatSaberPlus_Chat/BeatSaberPlus_Chat.csproj.user index 2bcbd9547e2dbf3c9b1de50a0ed26cffe2f0a25e..3fd52f1dec15af8e7e99f5b7788a2f6723814834 100644 GIT binary patch delta 27 jcmbQldW~g61S4|*gVp5ejK=K74CV}a3`UbLG9Cl~XQT&R delta 95 zcmcb{GKqCV1f#tRgB3#zLoh=LLn=ceLoS04LncEKLlKZS&8DTd1=G86z|F;Fa- kAs?tR7f9w!j%GCGHe#@3&|@%Uuwl@jY|AJ;c?;tr0P6%4ssI20 diff --git a/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/Components/ChatMessageText.cs b/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/Components/ChatMessageText.cs index ac9329a..a8f0dcf 100644 --- a/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/Components/ChatMessageText.cs +++ b/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/Components/ChatMessageText.cs @@ -39,7 +39,7 @@ internal class ChatMessageText : TextMeshProUGUI /// /// Images to add /// - private List<(Vector3, CP_SDK.Unity.EnhancedImage)> m_ImagesToAdd; + private List<(Vector3, CP_SDK.Unity.EnhancedImage, float)> m_ImagesToAdd; //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// @@ -99,7 +99,7 @@ internal class ChatMessageText : TextMeshProUGUI defaultCapacity: 10 ); - m_ImagesToAdd = new List<(Vector3, CP_SDK.Unity.EnhancedImage)>(20); + m_ImagesToAdd = new List<(Vector3, CP_SDK.Unity.EnhancedImage, float)>(20); } //////////////////////////////////////////////////////////////////////////// @@ -166,7 +166,7 @@ public override void Rebuild(CanvasUpdate p_UpdateType) if (FontInfo == null || !FontInfo.TryGetImageInfo(l_Character, out var l_ImageInfo)) continue; - m_ImagesToAdd.Add((l_CharacterInfo.topLeft, l_ImageInfo)); + m_ImagesToAdd.Add((l_CharacterInfo.topLeft, l_ImageInfo, l_CharacterInfo.scale)); } CP_SDK.Unity.MTMainThreadInvoker.Enqueue(() => RebuildImagesInternal()); @@ -195,8 +195,6 @@ private void RebuildImagesInternal() if (!this) return; - var l_ScaleFactor = (float)((double)m_currentFontSize / (double)m_currentFontAsset.faceInfo.pointSize * (double)m_currentFontAsset.faceInfo.scale * (m_isOrthographic ? 1.0 : 0.1f)); - var l_LocalScale = new Vector3(l_ScaleFactor * 1.08f, l_ScaleFactor * 1.08f, l_ScaleFactor * 1.08f); var l_ImagesToAddCount = m_ImagesToAdd.Count; var l_AlreadyAllocated = m_CurrentImages.Count; var l_Iterator = 0; @@ -228,9 +226,9 @@ private void RebuildImagesInternal() } var l_RectTransform = l_Image.rectTransform; - l_RectTransform.localScale = l_LocalScale; + l_RectTransform.localScale = Vector3.one * l_Infos.Item3; l_RectTransform.sizeDelta = new Vector2(l_Infos.Item2.Width, l_Infos.Item2.Height); - l_RectTransform.localPosition = l_Infos.Item1 - new Vector3(0, l_Infos.Item2.Height * l_ScaleFactor * 0.558f / 2); + l_RectTransform.localPosition = l_Infos.Item1 - new Vector3(0, l_Infos.Item2.Height * l_Infos.Item3 * 0.558f / 2); } /// Allocate @@ -251,9 +249,9 @@ private void RebuildImagesInternal() } var l_RectTransform = l_Image.rectTransform; - l_RectTransform.localScale = l_LocalScale; + l_RectTransform.localScale = Vector3.one * l_Infos.Item3; l_RectTransform.sizeDelta = new Vector2(l_Infos.Item2.Width, l_Infos.Item2.Height); - l_RectTransform.localPosition = l_Infos.Item1 - new Vector3(0, l_Infos.Item2.Height * l_ScaleFactor * 0.558f / 2); + l_RectTransform.localPosition = l_Infos.Item1 - new Vector3(0, l_Infos.Item2.Height * l_Infos.Item3 * 0.558f / 2); m_CurrentImages.Add(l_Image); } diff --git a/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/Extensions/EnhancedFontInfo.cs b/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/Extensions/EnhancedFontInfo.cs index 60e4a9c..b942bee 100644 --- a/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/Extensions/EnhancedFontInfo.cs +++ b/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/Extensions/EnhancedFontInfo.cs @@ -141,9 +141,9 @@ internal bool TryRegisterImageInfo(CP_SDK.Unity.EnhancedImage p_ImageInfo, out u var l_Glypth = new Glyph(l_ReplaceCharacter, new GlyphMetrics(0, 0, 0, 0, p_ImageInfo.Width), new GlyphRect(0, 0, 0, 0)); -#if BEATSABER && !BEATSABER_1_29_4_OR_NEWER +#if BEATSABER && !BEATSABER_1_35_0_OR_NEWER Font.characterLookupTable.Add(l_ReplaceCharacter, new TMP_Character(l_ReplaceCharacter, l_Glypth)); -#elif BEATSABER_1_29_4_OR_NEWER || UNITY_TESTING || SYNTHRIDERS || AUDIOTRIP || BOOMBOX || DANCEDASH +#elif BEATSABER_1_35_0_OR_NEWER || UNITY_TESTING || SYNTHRIDERS || AUDIOTRIP || BOOMBOX || DANCEDASH Font.characterLookupTable.Add(l_ReplaceCharacter, new TMP_Character(l_ReplaceCharacter, Font, l_Glypth)); #else #error Missing game implementation diff --git a/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/UI/PollFloatingPanelView.cs b/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/UI/PollFloatingPanelView.cs index d819ff1..3749efe 100644 --- a/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/UI/PollFloatingPanelView.cs +++ b/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/UI/PollFloatingPanelView.cs @@ -169,8 +169,8 @@ private IXUIElement BuildOption(Sprite p_WhiteSprite, int p_Index) private void Update() { if (m_LastPoll != null - && m_LastPoll.status != CP_SDK.Chat.Models.Twitch.Helix_Poll.Status.ARCHIVED - && m_LastPoll.status != CP_SDK.Chat.Models.Twitch.Helix_Poll.Status.INVALID) + && m_LastPoll.status != CP_SDK.Chat.Models.Twitch.EHelix_PollStatus.ARCHIVED + && m_LastPoll.status != CP_SDK.Chat.Models.Twitch.EHelix_PollStatus.INVALID) { if (m_CurrentPollStart < 0) { @@ -203,8 +203,8 @@ private void HelixAPI_OnActivePollChanged(CP_SDK.Chat.Models.Twitch.Helix_Poll p if ((p_Poll?.id ?? null) != (m_LastPoll?.id ?? null)) { if (p_Poll != null - && p_Poll.status != CP_SDK.Chat.Models.Twitch.Helix_Poll.Status.ARCHIVED - && p_Poll.status != CP_SDK.Chat.Models.Twitch.Helix_Poll.Status.INVALID) + && p_Poll.status != CP_SDK.Chat.Models.Twitch.EHelix_PollStatus.ARCHIVED + && p_Poll.status != CP_SDK.Chat.Models.Twitch.EHelix_PollStatus.INVALID) { CurrentScreen?.gameObject?.SetActive(true); @@ -217,8 +217,8 @@ private void HelixAPI_OnActivePollChanged(CP_SDK.Chat.Models.Twitch.Helix_Poll p for (int l_I = 0; l_I < p_Poll.choices.Count && l_I < m_ProgressBars.Length; ++l_I) l_TotalVotes += p_Poll.choices[l_I].votes; - if ( p_Poll.status == CP_SDK.Chat.Models.Twitch.Helix_Poll.Status.TERMINATED - || p_Poll.status == CP_SDK.Chat.Models.Twitch.Helix_Poll.Status.COMPLETED) + if ( p_Poll.status == CP_SDK.Chat.Models.Twitch.EHelix_PollStatus.TERMINATED + || p_Poll.status == CP_SDK.Chat.Models.Twitch.EHelix_PollStatus.COMPLETED) { var l_Sorted = p_Poll.choices.OrderByDescending(x => x.votes).ToArray(); @@ -247,8 +247,8 @@ private void HelixAPI_OnActivePollChanged(CP_SDK.Chat.Models.Twitch.Helix_Poll p m_CurrentPollStart = Time.realtimeSinceStartup - Mathf.Abs((float)(l_UTCNow - l_UTCStart).TotalSeconds); m_CurrentPollEnd = m_CurrentPollStart + p_Poll.duration; - if ( p_Poll.status == CP_SDK.Chat.Models.Twitch.Helix_Poll.Status.TERMINATED - || p_Poll.status == CP_SDK.Chat.Models.Twitch.Helix_Poll.Status.COMPLETED) + if ( p_Poll.status == CP_SDK.Chat.Models.Twitch.EHelix_PollStatus.TERMINATED + || p_Poll.status == CP_SDK.Chat.Models.Twitch.EHelix_PollStatus.COMPLETED) m_CurrentPollEnd = Time.realtimeSinceStartup; } else @@ -262,8 +262,8 @@ private void HelixAPI_OnActivePollChanged(CP_SDK.Chat.Models.Twitch.Helix_Poll p for (var l_I = 0; l_I < p_Poll.choices.Count && l_I < m_ProgressBars.Length; ++l_I) l_TotalVotes += p_Poll.choices[l_I].votes; - if ( p_Poll.status == CP_SDK.Chat.Models.Twitch.Helix_Poll.Status.TERMINATED - || p_Poll.status == CP_SDK.Chat.Models.Twitch.Helix_Poll.Status.COMPLETED) + if ( p_Poll.status == CP_SDK.Chat.Models.Twitch.EHelix_PollStatus.TERMINATED + || p_Poll.status == CP_SDK.Chat.Models.Twitch.EHelix_PollStatus.COMPLETED) { var l_Sorted = p_Poll.choices.OrderByDescending(x => x.votes).ToArray(); @@ -277,13 +277,13 @@ private void HelixAPI_OnActivePollChanged(CP_SDK.Chat.Models.Twitch.Helix_Poll p } } - if ( p_Poll.status == CP_SDK.Chat.Models.Twitch.Helix_Poll.Status.TERMINATED - || p_Poll.status == CP_SDK.Chat.Models.Twitch.Helix_Poll.Status.COMPLETED) + if ( p_Poll.status == CP_SDK.Chat.Models.Twitch.EHelix_PollStatus.TERMINATED + || p_Poll.status == CP_SDK.Chat.Models.Twitch.EHelix_PollStatus.COMPLETED) m_CurrentPollEnd = Time.realtimeSinceStartup; - if ( p_Poll.status == CP_SDK.Chat.Models.Twitch.Helix_Poll.Status.ARCHIVED - || p_Poll.status == CP_SDK.Chat.Models.Twitch.Helix_Poll.Status.INVALID - || p_Poll.status == CP_SDK.Chat.Models.Twitch.Helix_Poll.Status.MODERATED) + if ( p_Poll.status == CP_SDK.Chat.Models.Twitch.EHelix_PollStatus.ARCHIVED + || p_Poll.status == CP_SDK.Chat.Models.Twitch.EHelix_PollStatus.INVALID + || p_Poll.status == CP_SDK.Chat.Models.Twitch.EHelix_PollStatus.MODERATED) CurrentScreen?.gameObject?.SetActive(false); } diff --git a/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/UI/PredictionFloatingPanelView.cs b/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/UI/PredictionFloatingPanelView.cs index a4bcdc7..05358ca 100644 --- a/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/UI/PredictionFloatingPanelView.cs +++ b/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/UI/PredictionFloatingPanelView.cs @@ -175,16 +175,16 @@ private void Update() { if (m_LastPrediction != null) { - var l_HasExpired = (m_LastPrediction.status == CP_SDK.Chat.Models.Twitch.Helix_Prediction.Status.RESOLVED + var l_HasExpired = (m_LastPrediction.status == CP_SDK.Chat.Models.Twitch.EHelix_PredictionStatus.RESOLVED && m_WindowEnd < Time.realtimeSinceStartup) - || m_LastPrediction.status == CP_SDK.Chat.Models.Twitch.Helix_Prediction.Status.CANCELED; + || m_LastPrediction.status == CP_SDK.Chat.Models.Twitch.EHelix_PredictionStatus.CANCELED; if (l_HasExpired) CurrentScreen?.gameObject?.SetActive(false); else { - if (m_LastPrediction.status == CP_SDK.Chat.Models.Twitch.Helix_Prediction.Status.ACTIVE - || m_LastPrediction.status == CP_SDK.Chat.Models.Twitch.Helix_Prediction.Status.RESOLVED) + if (m_LastPrediction.status == CP_SDK.Chat.Models.Twitch.EHelix_PredictionStatus.ACTIVE + || m_LastPrediction.status == CP_SDK.Chat.Models.Twitch.EHelix_PredictionStatus.RESOLVED) { if (m_WindowStart < 0) { @@ -226,10 +226,15 @@ private void OnLockButton() m_LockButton.SetInteractable(false); - m_TwitchService.HelixAPI.EndPrediction(m_LastPrediction.id, CP_SDK.Chat.Models.Twitch.Helix_Prediction.Status.LOCKED, null, (_, x) => - { - HelixAPI_OnActivePredictionChanged(x); - }); + m_TwitchService.HelixAPI.EndPrediction( + new CP_SDK.Chat.Models.Twitch.Helix_EndPrediction_Query(m_LastPrediction.id, CP_SDK.Chat.Models.Twitch.EHelix_PredictionStatus.LOCKED, null), + (p_Status, x, p_Error) => + { + Logger.Instance.Error(p_Status.ToString()); + Logger.Instance.Error(p_Error); + HelixAPI_OnActivePredictionChanged(x); + } + ); }); } /// @@ -245,11 +250,14 @@ private void OnPickBlueButton() m_PickButtonBlue.SetInteractable(false); m_PickButtonPink.SetInteractable(false); - var l_Winner = m_LastPrediction.outcomes.FirstOrDefault(x => x.color == CP_SDK.Chat.Models.Twitch.Helix_Prediction.Color.BLUE)?.id ?? null; - m_TwitchService.HelixAPI.EndPrediction(m_LastPrediction.id, CP_SDK.Chat.Models.Twitch.Helix_Prediction.Status.RESOLVED, l_Winner, (_, x) => - { - HelixAPI_OnActivePredictionChanged(x); - }); + var l_Winner = m_LastPrediction.outcomes.FirstOrDefault(x => x.color == CP_SDK.Chat.Models.Twitch.EHelix_PredictionColor.BLUE)?.id ?? null; + m_TwitchService.HelixAPI.EndPrediction( + new CP_SDK.Chat.Models.Twitch.Helix_EndPrediction_Query(m_LastPrediction.id, CP_SDK.Chat.Models.Twitch.EHelix_PredictionStatus.RESOLVED, l_Winner), + (_, x, __) => + { + HelixAPI_OnActivePredictionChanged(x); + } + ); }); } /// @@ -265,11 +273,14 @@ private void OnPickPinkButton() m_PickButtonBlue.SetInteractable(false); m_PickButtonPink.SetInteractable(false); - var l_Winner = m_LastPrediction.outcomes.FirstOrDefault(x => x.color == CP_SDK.Chat.Models.Twitch.Helix_Prediction.Color.PINK)?.id ?? null; - m_TwitchService.HelixAPI.EndPrediction(m_LastPrediction.id, CP_SDK.Chat.Models.Twitch.Helix_Prediction.Status.RESOLVED, l_Winner, (_, x) => - { - HelixAPI_OnActivePredictionChanged(x); - }); + var l_Winner = m_LastPrediction.outcomes.FirstOrDefault(x => x.color == CP_SDK.Chat.Models.Twitch.EHelix_PredictionColor.PINK)?.id ?? null; + m_TwitchService.HelixAPI.EndPrediction( + new CP_SDK.Chat.Models.Twitch.Helix_EndPrediction_Query(m_LastPrediction.id, CP_SDK.Chat.Models.Twitch.EHelix_PredictionStatus.RESOLVED, l_Winner), + (_, x, __) => + { + HelixAPI_OnActivePredictionChanged(x); + } + ); }); } /// @@ -283,10 +294,14 @@ private void OnCancelButton() return; m_CancelButton.SetInteractable(false); - m_TwitchService.HelixAPI.EndPrediction(m_LastPrediction.id, CP_SDK.Chat.Models.Twitch.Helix_Prediction.Status.CANCELED, null, (_, x) => - { - HelixAPI_OnActivePredictionChanged(x); - }); + + m_TwitchService.HelixAPI.EndPrediction( + new CP_SDK.Chat.Models.Twitch.Helix_EndPrediction_Query(m_LastPrediction.id, CP_SDK.Chat.Models.Twitch.EHelix_PredictionStatus.CANCELED, null), + (_, x, __) => + { + HelixAPI_OnActivePredictionChanged(x); + } + ); }); } @@ -301,9 +316,9 @@ private void HelixAPI_OnActivePredictionChanged(CP_SDK.Chat.Models.Twitch.Helix_ { if (p_Prediction != null) { - var l_HasExpired = (p_Prediction.status == CP_SDK.Chat.Models.Twitch.Helix_Prediction.Status.RESOLVED + var l_HasExpired = (p_Prediction.status == CP_SDK.Chat.Models.Twitch.EHelix_PredictionStatus.RESOLVED && (p_Prediction.ended_at?.AddSeconds(60) < DateTime.UtcNow)) - || p_Prediction.status == CP_SDK.Chat.Models.Twitch.Helix_Prediction.Status.CANCELED; + || p_Prediction.status == CP_SDK.Chat.Models.Twitch.EHelix_PredictionStatus.CANCELED; if (l_HasExpired) { @@ -387,26 +402,49 @@ private void HelixAPI_OnActivePredictionChanged(CP_SDK.Chat.Models.Twitch.Helix_ m_Ratios.SetText(l_Ratios); m_Votees.SetText(l_Votees); - m_LockButtonFrame.SetActive(p_Prediction.status == CP_SDK.Chat.Models.Twitch.Helix_Prediction.Status.ACTIVE); + m_LockButtonFrame.SetActive(p_Prediction.status == CP_SDK.Chat.Models.Twitch.EHelix_PredictionStatus.ACTIVE); - m_PickButtonFrame.SetActive(p_Prediction.status == CP_SDK.Chat.Models.Twitch.Helix_Prediction.Status.LOCKED - || p_Prediction.status == CP_SDK.Chat.Models.Twitch.Helix_Prediction.Status.RESOLVED); + m_PickButtonFrame.SetActive(p_Prediction.status == CP_SDK.Chat.Models.Twitch.EHelix_PredictionStatus.LOCKED + || p_Prediction.status == CP_SDK.Chat.Models.Twitch.EHelix_PredictionStatus.RESOLVED); - m_CancelButton.SetInteractable(p_Prediction.status != CP_SDK.Chat.Models.Twitch.Helix_Prediction.Status.RESOLVED); + m_CancelButton.SetInteractable(p_Prediction.status != CP_SDK.Chat.Models.Twitch.EHelix_PredictionStatus.RESOLVED); m_WindowStart = Time.realtimeSinceStartup - Mathf.Abs((float)(DateTime.UtcNow - p_Prediction.created_at).TotalSeconds); m_WindowEnd = m_WindowStart + p_Prediction.prediction_window; - if (p_Prediction.status == CP_SDK.Chat.Models.Twitch.Helix_Prediction.Status.LOCKED) + if (p_Prediction.status == CP_SDK.Chat.Models.Twitch.EHelix_PredictionStatus.ACTIVE) + { + m_PickButtonBlue.SetInteractable(false); + m_PickButtonPink.SetInteractable(false); + + m_LockButton.SetInteractable(true); + } + else if (p_Prediction.status == CP_SDK.Chat.Models.Twitch.EHelix_PredictionStatus.LOCKED) + { + m_PickButtonBlue.SetInteractable(true); + m_PickButtonPink.SetInteractable(true); + + m_LockButton.SetInteractable(false); + m_TimeProgressBar.SetBackgroundFillAmount(0.0f); - else if (p_Prediction.status == CP_SDK.Chat.Models.Twitch.Helix_Prediction.Status.RESOLVED) + } + else if (p_Prediction.status == CP_SDK.Chat.Models.Twitch.EHelix_PredictionStatus.RESOLVED) { m_PickButtonBlue.SetInteractable(false); m_PickButtonPink.SetInteractable(false); + m_LockButton.SetInteractable(false); + m_WindowStart = Time.realtimeSinceStartup; m_WindowEnd = Time.realtimeSinceStartup + 60f; } + else + { + m_PickButtonBlue.SetInteractable(false); + m_PickButtonPink.SetInteractable(false); + + m_LockButton.SetInteractable(false); + } m_LastPrediction = p_Prediction; }); diff --git a/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/Utils/ChatMessageBuilder.cs b/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/Utils/ChatMessageBuilder.cs index f6a36a8..f4a99e8 100644 --- a/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/Utils/ChatMessageBuilder.cs +++ b/Modules/BeatSaberPlus_Chat/ChatPlexMod_Chat/Utils/ChatMessageBuilder.cs @@ -90,7 +90,7 @@ public static async Task BuildMessage(IChatMessage p_Message, Extensions Logger.Instance.Warning($"Failed to prepare some/all images for msg \"{p_Message.Message}\"!"); /// Replace all instances of <;> with a zero-width non-breaking character - StringBuilder l_StringBuilder = new StringBuilder(p_Message.Message).Replace("<", "<\u200B").Replace(">", "\u200B>"); + StringBuilder l_StringBuilder = new StringBuilder(p_Message.Message).Replace("<", "<\u200B").Replace("<​\u200B3", "<3").Replace(">", "\u200B>").Replace("\r", "").Replace("\n", ""); if (p_Message.Emotes != null) { @@ -131,6 +131,9 @@ public static async Task BuildMessage(IChatMessage p_Message, Extensions } } + if (p_Message.IsGiganticEmote) + l_StringBuilder.Insert(0, "\n"); + /// System messages get a grayish color to differentiate them from normal messages in chat, and do not receive a username/badge prefix if (p_Message.IsSystemMessage) { @@ -170,8 +173,8 @@ public static async Task BuildMessage(IChatMessage p_Message, Extensions } } } - - return l_StringBuilder.Replace("\r", "").Replace("\n", "").ToString(); + Logger.Instance.Error(l_StringBuilder.ToString()); + return l_StringBuilder.ToString(); } catch (Exception p_Exception) { diff --git a/Modules/BeatSaberPlus_Chat/Properties/AssemblyInfo.cs b/Modules/BeatSaberPlus_Chat/Properties/AssemblyInfo.cs index ba6189c..046bb19 100644 --- a/Modules/BeatSaberPlus_Chat/Properties/AssemblyInfo.cs +++ b/Modules/BeatSaberPlus_Chat/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("6.2.2")] -[assembly: AssemblyFileVersion("6.2.2")] +[assembly: AssemblyVersion("6.3.0")] +[assembly: AssemblyFileVersion("6.3.0")] diff --git a/Modules/BeatSaberPlus_Chat/manifest.json b/Modules/BeatSaberPlus_Chat/manifest.json index b308344..0f48bbd 100644 --- a/Modules/BeatSaberPlus_Chat/manifest.json +++ b/Modules/BeatSaberPlus_Chat/manifest.json @@ -3,12 +3,12 @@ "id": "BeatSaberPlus_Chat", "name": "BeatSaberPlus_Chat", "author": "HardCPP", - "version": "6.2.2", + "version": "6.3.0", "description": "", - "gameVersion": "1.34.2", + "gameVersion": "1.37.1", "dependsOn": { "BSIPA": "^4.3.0", - "ChatPlexSDK_BS": "^6.2.2" + "ChatPlexSDK_BS": "^6.3.0" }, "links": { "project-home": "https://discord.chatplex.org", diff --git a/Modules/BeatSaberPlus_ChatEmoteRain/BeatSaberPlus_ChatEmoteRain.csproj b/Modules/BeatSaberPlus_ChatEmoteRain/BeatSaberPlus_ChatEmoteRain.csproj index fccac77..1e98ee3 100644 --- a/Modules/BeatSaberPlus_ChatEmoteRain/BeatSaberPlus_ChatEmoteRain.csproj +++ b/Modules/BeatSaberPlus_ChatEmoteRain/BeatSaberPlus_ChatEmoteRain.csproj @@ -109,7 +109,6 @@ - diff --git a/Modules/BeatSaberPlus_ChatEmoteRain/BeatSaberPlus_ChatEmoteRain.csproj.user b/Modules/BeatSaberPlus_ChatEmoteRain/BeatSaberPlus_ChatEmoteRain.csproj.user index 2bcbd9547e2dbf3c9b1de50a0ed26cffe2f0a25e..3fd52f1dec15af8e7e99f5b7788a2f6723814834 100644 GIT binary patch delta 27 jcmbQldW~g61S4|*gVp5ejK=K74CV}a3`UbLG9Cl~XQT&R delta 95 zcmcb{GKqCV1f#tRgB3#zLoh=LLn=ceLoS04LncEKLlKZS&8DTd1=G86z|F;Fa- kAs?tR7f9w!j%GCGHe#@3&|@%Uuwl@jY|AJ;c?;tr0P6%4ssI20 diff --git a/Modules/BeatSaberPlus_ChatEmoteRain/ChatPlexMod_ChatEmoteRain/ChatEmoteRain.cs b/Modules/BeatSaberPlus_ChatEmoteRain/ChatPlexMod_ChatEmoteRain/ChatEmoteRain.cs index bc07bd1..ef16274 100644 --- a/Modules/BeatSaberPlus_ChatEmoteRain/ChatPlexMod_ChatEmoteRain/ChatEmoteRain.cs +++ b/Modules/BeatSaberPlus_ChatEmoteRain/ChatPlexMod_ChatEmoteRain/ChatEmoteRain.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Reflection; using UnityEngine; using EmitterConfig = CP_SDK.Unity.Components.EnhancedImageParticleEmitter.EmitterConfig; @@ -60,8 +59,6 @@ protected override void OnEnable() if (!Directory.Exists(CUSTOM_RAIN_PATH)) Directory.CreateDirectory(CUSTOM_RAIN_PATH); - LoadAssets(); - m_MenuManager = new GameObject("[ChatPlexMod_ChatEmoteRain.MenuManager]").AddComponent(); m_PlayingManager = new GameObject("[ChatPlexMod_ChatEmoteRain.PlayingManager]").AddComponent(); @@ -107,9 +104,6 @@ protected override void OnDisable() CP_SDK.UI.UISystem.DestroyUI(ref m_SettingsMainView); CP_SDK.UI.UISystem.DestroyUI(ref m_SettingsRightView); - /// Unload assets - UnloadAssets(); - /// Unload SubRain emotes m_SubRainTextures.Clear(); @@ -192,9 +186,9 @@ internal void OnSettingsChanged() internal void UpdateTemplateFor(CP_SDK.EGenericScene p_Scene) { if (p_Scene == CP_SDK.EGenericScene.Menu) - m_MenuManager.Configure(POOL_SIZE_PER_SCENE, CERConfig.Instance.MenuEmitters, m_PreviewMaterial, CERConfig.Instance.MenuSize, CERConfig.Instance.MenuSpeed, CERConfig.Instance.EmoteDelay); + m_MenuManager.Configure(POOL_SIZE_PER_SCENE, CERConfig.Instance.MenuEmitters, CERConfig.Instance.MenuSize, CERConfig.Instance.MenuSpeed, CERConfig.Instance.EmoteDelay); else if (p_Scene == CP_SDK.EGenericScene.Playing) - m_PlayingManager.Configure(POOL_SIZE_PER_SCENE, CERConfig.Instance.SongEmitters, m_PreviewMaterial, CERConfig.Instance.SongSize, CERConfig.Instance.SongSpeed, CERConfig.Instance.EmoteDelay); + m_PlayingManager.Configure(POOL_SIZE_PER_SCENE, CERConfig.Instance.SongEmitters, CERConfig.Instance.SongSize, CERConfig.Instance.SongSpeed, CERConfig.Instance.EmoteDelay); } internal void SetTemplatesPreview(CP_SDK.EGenericScene p_Scene, bool p_Enabled, EmitterConfig p_Focus) { @@ -205,32 +199,6 @@ internal void SetTemplatesPreview(CP_SDK.EGenericScene p_Scene, bool p_Enabled, //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// - /// - /// Load assets - /// - private void LoadAssets() - { - m_PreviewMateralAssetBundle = AssetBundle.LoadFromMemory( - CP_SDK.Misc.Resources.FromRelPath(Assembly.GetExecutingAssembly(), "ChatPlexMod_ChatEmoteRain.Resources.PreviewMaterial.bundle") - ); - - m_PreviewMaterial = m_PreviewMateralAssetBundle.LoadAsset("PreviewMaterial"); - } - /// - /// Unload assets - /// - private void UnloadAssets() - { - if (m_PreviewMateralAssetBundle == null) - return; - - m_PreviewMateralAssetBundle.Unload(true); - m_PreviewMateralAssetBundle = null; - } - - //////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////// - /// /// Load SubRain emotes /// diff --git a/Modules/BeatSaberPlus_ChatEmoteRain/ChatPlexMod_ChatEmoteRain/Resources/PreviewMaterial.bundle b/Modules/BeatSaberPlus_ChatEmoteRain/ChatPlexMod_ChatEmoteRain/Resources/PreviewMaterial.bundle deleted file mode 100644 index df454a1294afa661052f21c7dd1fcbef35eb7432..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22998 zcmbTee|!|x)%btz{Men{o!!~ZY_gl|k6DrsLWtP_0RjftkWB~}NK67oMA`gUNH8QZ z*+{@>7fcluHEL9_v__4JiX~cFsbXD~T2vlOYpk@Tb!(}mEo~P>#WpqHbB4!0e*XRP zdgVRm-gD;8ojZ5VJ@?*O)^v5mwpBF%{xi-i8YmioImNRV7L^puS-5dF<>J4qe}yQ= zziaTX0{_18&kqb{tL0pTd7um>$RU<5)GQ<{|zZ3xJ(DVMbgEKp)5O-r}=E zVCS6R4h7&G@bG)g@}Q}Jm*SmZ4nX`$%-W29>%k`k;06YG8F0S^i>IcVm=G1jd5_uA%^wJ zlu)$lmzGdz3jh}fH3Cdi;vj2wf&<}C!+VP}wJQ#qifNxS&dhP}rN@~=N`eq)z6`v8 zDFQxM5;E~(K6e6-N$_VTfrTL3$YCY2@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|*W+r|mw%1+?==I9w7q z!Z~*vQ(d;iamjs5N^rJDtNG|Msd1T5f;&GJBMy4F23E<5@wYS5;&0QpIgql-7y;CP zh8r*fezpF#eB>QLdRsdBc2QLtPS}0LZyP%^1zapW^=@!yAoWAR9D6&6Ta#d1YU&L* z-{FN4rZ|P~C`0#Jm15!8^QlgMTFR^(zB^6(BxT0Q?1dk%8M&)?=(gV-{b4N!kG4iz5J890>jFaZo+KI!QQ|md*g_Y{tW-1fdI9qK; zOp0*J<=T=XChV@s;I3bcuX*H6`A2*Ge?R)vyn8@7VtRIw6<7S9*X}*dF(qNTTs+O; z!r*0^@t7$fLSm|0DHFCRXSdE&nx4b|r}m=Fo~ghM7VUi4f)(BH&#Q9(y>RJ6{}}%0 zwEgEt9>>0LJZxz=TojHkK6!XgrgHJR z8QNE|+aa~2>ez6H7hJb( zZ>GAXY`dS&M@PI(khcl3Y3%u-Ieo#NKL&&%vTetBw z)5O1Rm+)ydj)Vno;O=lTuwi*kZ9~J=^_5jMl@+V}=LG!bq^c^gp`os_VognXeKmf_ zS5$_ZH3I%3>#${CzI1q+-E#bip5ErJKKx0~)IAt~c6j(x1Ge4U47>Z}!2zWZJ7}m9 zM{1Klu&cs)U>o3A*48I#kh@iemu4w@wwho)SSD_Sx!?(%T|Y4CBGzf>hxCrNkl+;Le}^3c2D1Zp;x3j13;~z*Tpt$r(<-`Hxao<_Knq sdIJlVGafuKReVcI87?wuH0)OaHdbpGnFIP*f&Q9P#>vhI^dJZT05qZ%hyVZp diff --git a/Modules/BeatSaberPlus_ChatEmoteRain/Properties/AssemblyInfo.cs b/Modules/BeatSaberPlus_ChatEmoteRain/Properties/AssemblyInfo.cs index 1465992..581e870 100644 --- a/Modules/BeatSaberPlus_ChatEmoteRain/Properties/AssemblyInfo.cs +++ b/Modules/BeatSaberPlus_ChatEmoteRain/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("6.2.2")] -[assembly: AssemblyFileVersion("6.2.2")] +[assembly: AssemblyVersion("6.3.0")] +[assembly: AssemblyFileVersion("6.3.0")] diff --git a/Modules/BeatSaberPlus_ChatEmoteRain/manifest.json b/Modules/BeatSaberPlus_ChatEmoteRain/manifest.json index fa7e19a..79b601f 100644 --- a/Modules/BeatSaberPlus_ChatEmoteRain/manifest.json +++ b/Modules/BeatSaberPlus_ChatEmoteRain/manifest.json @@ -3,12 +3,12 @@ "id": "BeatSaberPlus_ChatEmoteRain", "name": "BeatSaberPlus_ChatEmoteRain", "author": "HardCPP", - "version": "6.2.2", + "version": "6.3.0", "description": "", - "gameVersion": "1.34.2", + "gameVersion": "1.37.1", "dependsOn": { "BSIPA": "^4.3.0", - "ChatPlexSDK_BS": "^6.2.2" + "ChatPlexSDK_BS": "^6.3.0" }, "links": { "project-home": "https://discord.chatplex.org", diff --git a/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Actions/GamePlay.cs b/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Actions/GamePlay.cs index 3244bbf..c0bd405 100644 --- a/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Actions/GamePlay.cs +++ b/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Actions/GamePlay.cs @@ -464,7 +464,11 @@ public override IEnumerator Eval(ChatPlexMod_ChatIntegrations.Models.EventContex bool l_Failed = true; if (CP_SDK_BS.Game.Logic.ActiveScene == CP_SDK_BS.Game.Logic.ESceneType.Playing) { +#if BEATSABER_1_35_0_OR_NEWER + var l_Level = CP_SDK_BS.Game.Logic.LevelData?.Data?.beatmapKey.difficulty; +#else var l_Level = CP_SDK_BS.Game.Logic.LevelData?.Data?.difficultyBeatmap?.difficulty; +#endif var l_Effects = l_Level == BeatmapDifficulty.ExpertPlus ? CP_SDK_BS.Game.Logic.LevelData?.Data?.playerSpecificSettings?.environmentEffectsFilterExpertPlusPreset : CP_SDK_BS.Game.Logic.LevelData?.Data?.playerSpecificSettings?.environmentEffectsFilterDefaultPreset; diff --git a/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Events/LevelEnded.cs b/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Events/LevelEnded.cs index d10f8f1..4988275 100644 --- a/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Events/LevelEnded.cs +++ b/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Events/LevelEnded.cs @@ -97,14 +97,21 @@ protected override sealed void BuildProvidedValues(ChatPlexMod_ChatIntegrations. Int64 l_HitCount = l_LevelCompletionData.Results.goodCutsCount; Int64 l_MissCount = l_NoteCount - l_HitCount; float l_Accuracy = (float)System.Math.Round(100.0f * CP_SDK_BS.Game.Levels.GetAccuracy(l_LevelCompletionData.MaxMultipliedScore, l_LevelCompletionData.Results.multipliedScore), 2); +#if BEATSABER_1_35_0_OR_NEWER + string l_GameMode = l_LevelCompletionData.Data.beatmapKey.beatmapCharacteristic.serializedName; + string l_Difficulty = l_LevelCompletionData.Data.beatmapKey.difficulty.Name(); + string l_SongName = l_LevelCompletionData.Data.beatmapLevel.allMappers.FirstOrDefault() + " - " + l_LevelCompletionData.Data.beatmapLevel.songName; +#else string l_GameMode = l_LevelCompletionData.Data.difficultyBeatmap.parentDifficultyBeatmapSet.beatmapCharacteristic.serializedName; string l_Difficulty = l_LevelCompletionData.Data.difficultyBeatmap.difficulty.Name(); + string l_SongName = l_LevelCompletionData.Data.difficultyBeatmap.level.songAuthorName + " - " + l_LevelCompletionData.Data.difficultyBeatmap.level.songName; +#endif p_Context.AddValue(EValueType.Integer, "NoteCount", (Int64?)l_NoteCount); p_Context.AddValue(EValueType.Integer, "HitCount", (Int64?)l_HitCount); p_Context.AddValue(EValueType.Integer, "MissCount", (Int64?)l_MissCount); p_Context.AddValue(EValueType.Floating, "Accuracy", (float?)l_Accuracy); - p_Context.AddValue(EValueType.String, "SongName", l_LevelCompletionData.Data.difficultyBeatmap.level.songAuthorName + " - " + l_LevelCompletionData.Data.difficultyBeatmap.level.songName); + p_Context.AddValue(EValueType.String, "SongName", l_SongName); p_Context.AddValue(EValueType.String, "Difficulty", l_GameMode + " - " + l_Difficulty); } } diff --git a/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Events/LevelPaused.cs b/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Events/LevelPaused.cs index b37aae9..f9b1808 100644 --- a/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Events/LevelPaused.cs +++ b/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Events/LevelPaused.cs @@ -86,10 +86,17 @@ protected override sealed bool CanBeExecuted(ChatPlexMod_ChatIntegrations.Models protected override sealed void BuildProvidedValues(ChatPlexMod_ChatIntegrations.Models.EventContext p_Context) { var l_LevelData = p_Context.CustomData as CP_SDK_BS.Game.LevelData; - var l_GameMode = l_LevelData.Data.difficultyBeatmap.parentDifficultyBeatmapSet.beatmapCharacteristic.serializedName; - var l_Difficulty = l_LevelData.Data.difficultyBeatmap.difficulty.Name(); +#if BEATSABER_1_35_0_OR_NEWER + string l_GameMode = l_LevelData.Data.beatmapKey.beatmapCharacteristic.serializedName; + string l_Difficulty = l_LevelData.Data.beatmapKey.difficulty.Name(); + string l_SongName = l_LevelData.Data.beatmapLevel.allMappers.FirstOrDefault() + " - " + l_LevelData.Data.beatmapLevel.songName; +#else + string l_GameMode = l_LevelData.Data.difficultyBeatmap.parentDifficultyBeatmapSet.beatmapCharacteristic.serializedName; + string l_Difficulty = l_LevelData.Data.difficultyBeatmap.difficulty.Name(); + string l_SongName = l_LevelData.Data.difficultyBeatmap.level.songAuthorName + " - " + l_LevelData.Data.difficultyBeatmap.level.songName; +#endif - p_Context.AddValue(EValueType.String, "SongName", l_LevelData.Data.difficultyBeatmap.level.songAuthorName + " - " + l_LevelData.Data.difficultyBeatmap.level.songName); + p_Context.AddValue(EValueType.String, "SongName", l_SongName); p_Context.AddValue(EValueType.String, "Difficulty", l_GameMode + " - " + l_Difficulty); } } diff --git a/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Events/LevelResumed.cs b/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Events/LevelResumed.cs index d52d003..6657c46 100644 --- a/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Events/LevelResumed.cs +++ b/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Events/LevelResumed.cs @@ -86,10 +86,17 @@ protected override sealed bool CanBeExecuted(ChatPlexMod_ChatIntegrations.Models protected override sealed void BuildProvidedValues(ChatPlexMod_ChatIntegrations.Models.EventContext p_Context) { var l_LevelData = p_Context.CustomData as CP_SDK_BS.Game.LevelData; - var l_GameMode = l_LevelData.Data.difficultyBeatmap.parentDifficultyBeatmapSet.beatmapCharacteristic.serializedName; - var l_Difficulty = l_LevelData.Data.difficultyBeatmap.difficulty.Name(); +#if BEATSABER_1_35_0_OR_NEWER + string l_GameMode = l_LevelData.Data.beatmapKey.beatmapCharacteristic.serializedName; + string l_Difficulty = l_LevelData.Data.beatmapKey.difficulty.Name(); + string l_SongName = l_LevelData.Data.beatmapLevel.allMappers.FirstOrDefault() + " - " + l_LevelData.Data.beatmapLevel.songName; +#else + string l_GameMode = l_LevelData.Data.difficultyBeatmap.parentDifficultyBeatmapSet.beatmapCharacteristic.serializedName; + string l_Difficulty = l_LevelData.Data.difficultyBeatmap.difficulty.Name(); + string l_SongName = l_LevelData.Data.difficultyBeatmap.level.songAuthorName + " - " + l_LevelData.Data.difficultyBeatmap.level.songName; +#endif - p_Context.AddValue(EValueType.String, "SongName", l_LevelData.Data.difficultyBeatmap.level.songAuthorName + " - " + l_LevelData.Data.difficultyBeatmap.level.songName); + p_Context.AddValue(EValueType.String, "SongName", l_SongName); p_Context.AddValue(EValueType.String, "Difficulty", l_GameMode + " - " + l_Difficulty); } } diff --git a/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Events/LevelStarted.cs b/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Events/LevelStarted.cs index 8b56683..e080444 100644 --- a/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Events/LevelStarted.cs +++ b/Modules/BeatSaberPlus_ChatIntegrations/BeatSaber/Events/LevelStarted.cs @@ -86,10 +86,16 @@ protected override sealed bool CanBeExecuted(ChatPlexMod_ChatIntegrations.Models protected override sealed void BuildProvidedValues(ChatPlexMod_ChatIntegrations.Models.EventContext p_Context) { var l_LevelData = p_Context.CustomData as CP_SDK_BS.Game.LevelData; - var l_GameMode = l_LevelData.Data.difficultyBeatmap.parentDifficultyBeatmapSet.beatmapCharacteristic.serializedName; - var l_Difficulty = l_LevelData.Data.difficultyBeatmap.difficulty.Name(); - - p_Context.AddValue(EValueType.String, "SongName", l_LevelData.Data.difficultyBeatmap.level.songAuthorName + " - " + l_LevelData.Data.difficultyBeatmap.level.songName); +#if BEATSABER_1_35_0_OR_NEWER + string l_GameMode = l_LevelData.Data.beatmapKey.beatmapCharacteristic.serializedName; + string l_Difficulty = l_LevelData.Data.beatmapKey.difficulty.Name(); + string l_SongName = l_LevelData.Data.beatmapLevel.allMappers.FirstOrDefault() + " - " + l_LevelData.Data.beatmapLevel.songName; +#else + string l_GameMode = l_LevelData.Data.difficultyBeatmap.parentDifficultyBeatmapSet.beatmapCharacteristic.serializedName; + string l_Difficulty = l_LevelData.Data.difficultyBeatmap.difficulty.Name(); + string l_SongName = l_LevelData.Data.difficultyBeatmap.level.songAuthorName + " - " + l_LevelData.Data.difficultyBeatmap.level.songName; +#endif + p_Context.AddValue(EValueType.String, "SongName", l_SongName); p_Context.AddValue(EValueType.String, "Difficulty", l_GameMode + " - " + l_Difficulty); } } diff --git a/Modules/BeatSaberPlus_ChatIntegrations/BeatSaberPlus_ChatIntegrations.csproj b/Modules/BeatSaberPlus_ChatIntegrations/BeatSaberPlus_ChatIntegrations.csproj index b96a4c3..35b806a 100644 --- a/Modules/BeatSaberPlus_ChatIntegrations/BeatSaberPlus_ChatIntegrations.csproj +++ b/Modules/BeatSaberPlus_ChatIntegrations/BeatSaberPlus_ChatIntegrations.csproj @@ -24,15 +24,14 @@ true false bin\Debug\ - DEBUG;TRACE + TRACE;DEBUG;BEATSABER_1_35_0_OR_NEWER prompt 4 true bin\Release\ - - + BEATSABER_1_35_0_OR_NEWER prompt 4 @@ -56,42 +55,37 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\BeatmapCore.dll False - False $(BeatSaberDir)\Plugins\Camera2.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\Colors.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\Core.dll False - False + + + $(BeatSaberDir)\Beat Saber_Data\Managed\DataModels.dll $(BeatSaberDir)\Beat Saber_Data\Managed\GameplayCore.dll False - False - False $(BeatSaberDir)\Libs\Hive.Versioning.dll - False + False $(BeatSaberDir)\Beat Saber_Data\Managed\HMRendering.dll False - False $(BeatSaberDir)\Libs\Newtonsoft.Json.dll False - False @@ -123,7 +117,6 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.AudioModule.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.CoreModule.dll @@ -132,7 +125,6 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.TextRenderingModule.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.UI.dll @@ -141,12 +133,10 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.UnityWebRequestModule.dll False - False diff --git a/Modules/BeatSaberPlus_ChatIntegrations/BeatSaberPlus_ChatIntegrations.csproj.user b/Modules/BeatSaberPlus_ChatIntegrations/BeatSaberPlus_ChatIntegrations.csproj.user index 2bcbd9547e2dbf3c9b1de50a0ed26cffe2f0a25e..3fd52f1dec15af8e7e99f5b7788a2f6723814834 100644 GIT binary patch delta 27 jcmbQldW~g61S4|*gVp5ejK=K74CV}a3`UbLG9Cl~XQT&R delta 95 zcmcb{GKqCV1f#tRgB3#zLoh=LLn=ceLoS04LncEKLlKZS&8DTd1=G86z|F;Fa- kAs?tR7f9w!j%GCGHe#@3&|@%Uuwl@jY|AJ;c?;tr0P6%4ssI20 diff --git a/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Actions/OBS.cs b/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Actions/OBS.cs index 0edbd0d..5f3adb1 100644 --- a/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Actions/OBS.cs +++ b/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Actions/OBS.cs @@ -251,7 +251,7 @@ protected override void OnUIPlaceholderTestButton() return; } - OBSService.StartStreaming(); + OBSService.StartStream(); } //////////////////////////////////////////////////////////////////////////// @@ -266,7 +266,7 @@ public override IEnumerator Eval(Models.EventContext p_Context) yield break; } - OBSService.StartStreaming(); + OBSService.StartStream(); yield return null; } @@ -390,7 +390,7 @@ public override IEnumerator Eval(Models.EventContext p_Context) l_Result = l_Result.Replace(l_Key, l_ReplaceValue); } - OBSService.SetRecordFilenameFormat(l_Result); + OBSService.SetProfileParameter_Output_FilenameFormatting(l_Result); yield return null; } @@ -459,7 +459,7 @@ protected override void OnUIPlaceholderTestButton() return; } - OBSService.StopStreaming(); + OBSService.StopStream(); } //////////////////////////////////////////////////////////////////////////// @@ -474,7 +474,7 @@ public override IEnumerator Eval(Models.EventContext p_Context) yield break; } - OBSService.StopStreaming(); + OBSService.StopStream(); yield return null; } @@ -502,7 +502,7 @@ public override sealed void BuildUI(Transform p_Parent) var l_Choices = new List() { "None" }; if (OBSService.Status == OBSService.EStatus.Connected) - l_Choices.AddRange(OBSService.Scenes.Keys); + l_Choices.AddRange(OBSService.Scenes.Values.Select(x => x.sceneName)); else { XUIElements = new IXUIElement[] @@ -527,7 +527,7 @@ public override sealed void BuildUI(Transform p_Parent) XUIElements = new IXUIElement[] { - XUIText.Make("Dummy event to execute"), + XUIText.Make(Description), XUIDropdown.Make().SetOptions(l_Choices).SetValue(l_Selected) .OnValueChanged((_, __) => OnSettingChanged()).Bind(ref m_Scene), @@ -554,7 +554,7 @@ private void OnSettingChanged() //////////////////////////////////////////////////////////////////////////// private void OnSelectActiveSceneButton() - => m_Scene.SetValue(OBSService.ActiveScene?.name); + => m_Scene.SetValue(OBSService.ActiveProgramScene?.sceneName); private void OnTestButton() { if (OBSService.Status != OBSService.EStatus.Connected) @@ -563,8 +563,8 @@ private void OnTestButton() return; } - if (OBSService.Scenes.TryGetValue(Model.SceneName, out var l_Scene)) - l_Scene.SetAsPreview(); + if (OBSService.TryGetSceneByName(Model.SceneName, out var l_Scene)) + l_Scene.SetCurrentPreview(); else CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_SwitchPreviewToScene Scene:{Model.SceneName} not found!"); } @@ -581,8 +581,8 @@ public override IEnumerator Eval(Models.EventContext p_Context) yield break; } - if (OBSService.Scenes.TryGetValue(Model.SceneName, out var l_Scene)) - l_Scene.SetAsPreview(); + if (OBSService.TryGetSceneByName(Model.SceneName, out var l_Scene)) + l_Scene.SetCurrentPreview(); else { p_Context.HasActionFailed = true; @@ -615,7 +615,7 @@ public override sealed void BuildUI(Transform p_Parent) var l_Choices = new List() { "None" }; if (OBSService.Status == OBSService.EStatus.Connected) - l_Choices.AddRange(OBSService.Scenes.Keys); + l_Choices.AddRange(OBSService.Scenes.Values.Select(x => x.sceneName)); else { XUIElements = new IXUIElement[] @@ -640,7 +640,7 @@ public override sealed void BuildUI(Transform p_Parent) XUIElements = new IXUIElement[] { - XUIText.Make("Dummy event to execute"), + XUIText.Make(Description), XUIDropdown.Make().SetOptions(l_Choices).SetValue(l_Selected) .OnValueChanged((_, __) => OnSettingChanged()).Bind(ref m_Scene), @@ -667,7 +667,7 @@ private void OnSettingChanged() //////////////////////////////////////////////////////////////////////////// private void OnSelectActiveSceneButton() - => m_Scene.SetValue(OBSService.ActiveScene?.name); + => m_Scene.SetValue(OBSService.ActiveProgramScene?.sceneName); private void OnTestButton() { if (OBSService.Status != OBSService.EStatus.Connected) @@ -676,8 +676,8 @@ private void OnTestButton() return; } - if (OBSService.Scenes.TryGetValue(Model.SceneName, out var l_Scene)) - l_Scene.SwitchTo(); + if (OBSService.TryGetSceneByName(Model.SceneName, out var l_Scene)) + l_Scene.SetCurrentProgram(); else CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_SwitchToScene Scene:{Model.SceneName} not found!"); } @@ -694,8 +694,8 @@ public override IEnumerator Eval(Models.EventContext p_Context) yield break; } - if (OBSService.Scenes.TryGetValue(Model.SceneName, out var l_Scene)) - l_Scene.SwitchTo(); + if (OBSService.TryGetSceneByName(Model.SceneName, out var l_Scene)) + l_Scene.SetCurrentProgram(); else { p_Context.HasActionFailed = true; @@ -838,7 +838,7 @@ public override sealed void BuildUI(Transform p_Parent) var l_SelectedScene = "None"; if (OBSService.Status == OBSService.EStatus.Connected) - l_SceneChoices.AddRange(OBSService.Scenes.Keys.ToList()); + l_SceneChoices.AddRange(OBSService.Scenes.Values.Select(x => x.sceneName)); for (int l_I = 0; l_I < l_SceneChoices.Count; ++l_I) { @@ -913,19 +913,18 @@ private void RebuildSourceList() if (OBSService.Status == OBSService.EStatus.Connected) { - if (!OBSService.Scenes.TryGetValue(Model.SceneName, out var l_Scene)) + if (!OBSService.TryGetSceneByName(Model.SceneName, out var l_Scene)) { - CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_ToggleSource Scene:{Model.SceneName} not found!"); + if (Model.SceneName != "None") + CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_ToggleSource Scene:{Model.SceneName} not found!"); + return; } - for (int l_I = 0;l_I < l_Scene.sources.Count; ++l_I) + for (int l_I = 0;l_I < l_Scene.sceneItems.Count; ++l_I) { - var l_Source = l_Scene.sources[l_I]; - l_SourceChoices.Add(l_Source.name); - - for (int l_Y = 0; l_Y < l_Source.groupChildren.Count; ++l_Y) - l_SourceChoices.Add(l_Source.groupChildren[l_Y].name); + var l_Source = l_Scene.sceneItems[l_I]; + l_SourceChoices.Add(l_Source.sourceName); } } else @@ -948,8 +947,8 @@ private void RebuildSourceList() private void OnSelectActiveSceneButton() { - Model.SceneName = OBSService.ActiveScene?.name; - m_Scene.SetValue(OBSService.ActiveScene?.name); + Model.SceneName = OBSService.ActiveProgramScene?.sceneName; + m_Scene.SetValue(OBSService.ActiveProgramScene?.sceneName); } private void OnTestButton() { @@ -959,11 +958,19 @@ private void OnTestButton() return; } - CP_SDK.OBS.Models.Source l_Source = null; - if (OBSService.Scenes.TryGetValue(Model.SceneName, out var l_Scene) && (l_Source = l_Scene.GetSourceByName(Model.SourceName)) != null) - l_Source.SetVisible(Model.ChangeType == Enums.Toggle.E.Toggle ? !l_Source.render : (Model.ChangeType == Enums.Toggle.E.Enable ? true : false)); - else - CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_ToggleSource Scene:{Model.SceneName} not found!"); + if (!OBSService.TryGetSceneByName(Model.SceneName, out var l_Scene)) + { + if (Model.SceneName != "None") + CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_ToggleSource Scene:{Model.SceneName} not found!"); + + return; + } + + var l_Source = l_Scene.GetSourceItemByName(Model.SourceName); + if (l_Source != null) + l_Source.SetEnabled(Model.ChangeType == Enums.Toggle.E.Toggle ? !l_Source.sceneItemEnabled : (Model.ChangeType == Enums.Toggle.E.Enable ? true : false)); + else if (Model.SourceName != "None") + CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_ToggleSource Source:{Model.SourceName} not found!"); } //////////////////////////////////////////////////////////////////////////// @@ -978,13 +985,25 @@ public override IEnumerator Eval(Models.EventContext p_Context) yield break; } - CP_SDK.OBS.Models.Source l_Source = null; - if (OBSService.Scenes.TryGetValue(Model.SceneName, out var l_Scene) && (l_Source = l_Scene.GetSourceByName(Model.SourceName)) != null) - l_Source.SetVisible(Model.ChangeType == Enums.Toggle.E.Toggle ? !l_Source.render : (Model.ChangeType == Enums.Toggle.E.Enable ? true : false)); + if (!OBSService.TryGetSceneByName(Model.SceneName, out var l_Scene)) + { + p_Context.HasActionFailed = true; + + if (Model.SceneName != "None") + CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_ToggleSource Scene:{Model.SceneName} not found!"); + + yield return null; + } + + var l_Source = l_Scene.GetSourceItemByName(Model.SourceName); + if (l_Source != null) + l_Source.SetEnabled(Model.ChangeType == Enums.Toggle.E.Toggle ? !l_Source.sceneItemEnabled : (Model.ChangeType == Enums.Toggle.E.Enable ? true : false)); else { p_Context.HasActionFailed = true; - CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_ToggleSource Scene:{Model.SceneName} not found!"); + + if (Model.SourceName != "None") + CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_ToggleSource Source:{Model.SceneName} not found!"); } yield return null; @@ -1028,7 +1047,7 @@ public override sealed void BuildUI(Transform p_Parent) var l_SelectedScene = "None"; if (OBSService.Status == OBSService.EStatus.Connected) - l_SceneChoices.AddRange(OBSService.Scenes.Keys.ToList()); + l_SceneChoices.AddRange(OBSService.Scenes.Values.Select(x => x.sceneName)); for (int l_I = 0; l_I < l_SceneChoices.Count; ++l_I) { @@ -1103,19 +1122,18 @@ private void RebuildSourceList() if (OBSService.Status == OBSService.EStatus.Connected) { - if (!OBSService.Scenes.TryGetValue(Model.SceneName, out var l_Scene)) + if (!OBSService.TryGetSceneByName(Model.SceneName, out var l_Scene)) { - CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_ToggleSourceAudio Scene:{Model.SceneName} not found!"); + if (Model.SceneName != "None") + CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_ToggleSourceAudio Scene:{Model.SceneName} not found!"); + return; } - for (int l_I = 0;l_I < l_Scene.sources.Count; ++l_I) + for (int l_I = 0;l_I < l_Scene.sceneItems.Count; ++l_I) { - var l_Source = l_Scene.sources[l_I]; - l_SourceChoices.Add(l_Source.name); - - for (int l_Y = 0; l_Y < l_Source.groupChildren.Count; ++l_Y) - l_SourceChoices.Add(l_Source.groupChildren[l_Y].name); + var l_Source = l_Scene.sceneItems[l_I]; + l_SourceChoices.Add(l_Source.sourceName); } } else @@ -1138,8 +1156,8 @@ private void RebuildSourceList() private void OnSelectActiveSceneButton() { - Model.SceneName = OBSService.ActiveScene?.name; - m_Scene.SetValue(OBSService.ActiveScene?.name); + Model.SceneName = OBSService.ActiveProgramScene?.sceneName; + m_Scene.SetValue(OBSService.ActiveProgramScene?.sceneName); } private void OnTestButton() { @@ -1149,11 +1167,24 @@ private void OnTestButton() return; } - CP_SDK.OBS.Models.Source l_Source = null; - if (OBSService.Scenes.TryGetValue(Model.SceneName, out var l_Scene) && (l_Source = l_Scene.GetSourceByName(Model.SourceName)) != null) - l_Source.SetMuted(Model.ChangeType == Enums.Toggle.E.Toggle ? !l_Source.render : (Model.ChangeType == Enums.Toggle.E.Enable ? true : false)); - else - CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_ToggleSourceAudio Scene:{Model.SceneName} not found!"); + if (!OBSService.TryGetSceneByName(Model.SceneName, out var l_Scene)) + { + if (Model.SceneName != "None") + CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_ToggleSourceAudio Scene:{Model.SceneName} not found!"); + + return; + } + + var l_Source = l_Scene.GetSourceItemByName(Model.SourceName); + if (l_Source != null) + { + if (Model.ChangeType == Enums.Toggle.E.Toggle) + l_Source.ToggleMute(); + else + l_Source.SetMuted(Model.ChangeType == Enums.Toggle.E.Enable ? true : false); + } + else if (Model.SourceName != "None") + CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_ToggleSourceAudio Source:{Model.SourceName} not found!"); } //////////////////////////////////////////////////////////////////////////// @@ -1168,13 +1199,30 @@ public override IEnumerator Eval(Models.EventContext p_Context) yield break; } - CP_SDK.OBS.Models.Source l_Source = null; - if (OBSService.Scenes.TryGetValue(Model.SceneName, out var l_Scene) && (l_Source = l_Scene.GetSourceByName(Model.SourceName)) != null) - l_Source.SetMuted(Model.ChangeType == Enums.Toggle.E.Toggle ? !l_Source.render : (Model.ChangeType == Enums.Toggle.E.Enable ? true : false)); + if (!OBSService.TryGetSceneByName(Model.SceneName, out var l_Scene)) + { + p_Context.HasActionFailed = true; + + if (Model.SceneName != "None") + CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_ToggleSourceAudio Scene:{Model.SceneName} not found!"); + + yield return null; + } + + var l_Source = l_Scene.GetSourceItemByName(Model.SourceName); + if (l_Source != null) + { + if (Model.ChangeType == Enums.Toggle.E.Toggle) + l_Source.ToggleMute(); + else + l_Source.SetMuted(Model.ChangeType == Enums.Toggle.E.Enable ? true : false); + } else { p_Context.HasActionFailed = true; - CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_ToggleSourceAudio Scene:{Model.SceneName} not found!"); + + if (Model.SourceName != "None") + CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_ToggleSourceAudio Source:{Model.SourceName} not found!"); } yield return null; @@ -1206,7 +1254,7 @@ public override sealed void BuildUI(Transform p_Parent) var l_SelectedTransition = "None"; if (OBSService.Status == OBSService.EStatus.Connected) - l_TransitionChoices.AddRange(OBSService.Transitions.ToList()); + l_TransitionChoices.AddRange(OBSService.Transitions.Values.Select(x => x.transitionName)); else { XUIElements = new IXUIElement[] @@ -1288,14 +1336,23 @@ private void OnTestButton() return; } + var l_Transition = null as CP_SDK.OBS.Models.Transition; + if (Model.OverrideTransition && !OBSService.TryGetTransitionByName(Model.Transition, out l_Transition)) + { + if (Model.Transition != "None") + CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_Transition Transition:{Model.Transition} not found!"); + + return; + } + if (Model.OverrideDuration && Model.OverrideTransition) - OBSService.PreviewTransitionToScene(Model.Duration, Model.Transition); + OBSService.CustomStudioModeTransition(Model.Duration, l_Transition); else if (Model.OverrideDuration) - OBSService.PreviewTransitionToScene(Model.Duration); + OBSService.CustomStudioModeTransition(Model.Duration); else if (Model.OverrideTransition) - OBSService.PreviewTransitionToScene(-1, Model.Transition); + OBSService.CustomStudioModeTransition(-1, l_Transition); else - OBSService.PreviewTransitionToScene(); + OBSService.CustomStudioModeTransition(); } //////////////////////////////////////////////////////////////////////////// @@ -1310,15 +1367,25 @@ public override IEnumerator Eval(Models.EventContext p_Context) yield break; } + var l_Transition = null as CP_SDK.OBS.Models.Transition; + if (Model.OverrideTransition && !OBSService.TryGetTransitionByName(Model.Transition, out l_Transition)) + { + p_Context.HasActionFailed = true; + + if (Model.Transition != "None") + CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage($"ChatIntegrations: Event:{Event.GenericModel.Name} Action:OBS_Transition Transition:{Model.Transition} not found!"); + + yield return null; + } if (Model.OverrideDuration && Model.OverrideTransition) - OBSService.PreviewTransitionToScene(Model.Duration, Model.Transition); + OBSService.CustomStudioModeTransition(Model.Duration, l_Transition); else if (Model.OverrideDuration) - OBSService.PreviewTransitionToScene(Model.Duration); + OBSService.CustomStudioModeTransition(Model.Duration); else if (Model.OverrideTransition) - OBSService.PreviewTransitionToScene(-1, Model.Transition); + OBSService.CustomStudioModeTransition(-1, l_Transition); else - OBSService.PreviewTransitionToScene(); + OBSService.CustomStudioModeTransition(); yield return null; } diff --git a/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Actions/Twitch.cs b/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Actions/Twitch.cs index c174f5b..cf26594 100644 --- a/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Actions/Twitch.cs +++ b/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Actions/Twitch.cs @@ -130,7 +130,7 @@ public override IEnumerator Eval(Models.EventContext p_Context) if (l_TwitchService != null) { var l_HelixAPI = (l_TwitchService as CP_SDK.Chat.Services.Twitch.TwitchService).HelixAPI; - l_HelixAPI.CreateMarker(l_Message, null); + l_HelixAPI.CreateMarker(new CP_SDK.Chat.Models.Twitch.Helix_CreateMarker_Query(l_Message), null); } yield return null; @@ -155,14 +155,17 @@ public override IEnumerator Eval(Models.EventContext p_Context) if (l_TwitchService != null) { var l_HelixAPI = (l_TwitchService as CP_SDK.Chat.Services.Twitch.TwitchService).HelixAPI; - l_HelixAPI.CreateClip((p_Status, p_Result) => - { - if (p_Status != CP_SDK.Chat.Services.Twitch.TwitchHelixResult.OK) - return; - - try { System.IO.File.AppendAllLines($"{CP_SDK.ChatPlexSDK.ProductName}Plus_TwitchClips.txt", new List() { p_Result?.edit_url ?? "invalid" }); } - catch { } - }); + l_HelixAPI.CreateClip( + new CP_SDK.Chat.Models.Twitch.Helix_CreateClip_Query(), + (p_Status, p_Result, p_Error) => + { + if (p_Status != CP_SDK.Chat.Services.Twitch.EHelixResult.OK) + return; + + try { System.IO.File.AppendAllLines($"{CP_SDK.ChatPlexSDK.ProductName}Plus_TwitchClips.txt", new List() { p_Result?.edit_url ?? "invalid" }); } + catch { } + } + ); } yield return null; diff --git a/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/ChatIntegrations.cs b/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/ChatIntegrations.cs index 0d309e9..6092bfc 100644 --- a/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/ChatIntegrations.cs +++ b/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/ChatIntegrations.cs @@ -13,11 +13,11 @@ namespace ChatPlexMod_ChatIntegrations /// public partial class ChatIntegrations : CP_SDK.ModuleBase { - public static string s_DATABASE_FILE => Path.Combine(CIConfig.Instance.DataLocation, "Database.json"); - public static string s_EXPORT_PATH => Path.Combine(CIConfig.Instance.DataLocation, "Export/"); - public static string s_IMPORT_PATH => Path.Combine(CIConfig.Instance.DataLocation, "Import/"); - public static string s_EMOTE_RAIN_ASSETS_PATH => Path.Combine(CIConfig.Instance.DataLocation, "Assets/EmoteRain/"); - public static string s_SOUND_CLIPS_ASSETS_PATH => Path.Combine(CIConfig.Instance.DataLocation, "Assets/SoundClips/"); + public static string s_DATABASE_FILE => Path.Combine(CIConfig.Instance.DataLocation, "Database.json").Replace("\\", "/"); + public static string s_EXPORT_PATH => Path.Combine(CIConfig.Instance.DataLocation, "Export/").Replace("\\", "/"); + public static string s_IMPORT_PATH => Path.Combine(CIConfig.Instance.DataLocation, "Import/").Replace("\\", "/"); + public static string s_EMOTE_RAIN_ASSETS_PATH => Path.Combine(CIConfig.Instance.DataLocation, "Assets/EmoteRain/").Replace("\\", "/"); + public static string s_SOUND_CLIPS_ASSETS_PATH => Path.Combine(CIConfig.Instance.DataLocation, "Assets/SoundClips/").Replace("\\", "/"); //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// diff --git a/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Conditions/OBS.cs b/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Conditions/OBS.cs index 373e18c..d403c51 100644 --- a/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Conditions/OBS.cs +++ b/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Conditions/OBS.cs @@ -1,5 +1,6 @@ using CP_SDK.XUI; using System.Collections.Generic; +using System.Linq; using UnityEngine; using OBSService = CP_SDK.OBS.Service; @@ -174,7 +175,7 @@ public override sealed void BuildUI(Transform p_Parent) var l_Selected = "None"; if (OBSService.Status == OBSService.EStatus.Connected) - l_Choices.AddRange(OBSService.Scenes.Keys); + l_Choices.AddRange(OBSService.Scenes.Values.Select(x => x.sceneName)); else CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage("ChatIntegrations: Condition failed, not connected to OBS!"); @@ -217,8 +218,8 @@ private void OnSettingChanged() private void OnSelectActiveSceneButton() { - Model.SceneName = OBSService.ActiveScene?.name; - m_Dropdown.SetValue(OBSService.ActiveScene?.name); + Model.SceneName = OBSService.ActiveProgramScene?.sceneName; + m_Dropdown.SetValue(OBSService.ActiveProgramScene?.sceneName); } //////////////////////////////////////////////////////////////////////////// @@ -232,7 +233,7 @@ public override bool Eval(Models.EventContext p_Context) return false; } - return OBSService.ActiveScene?.name == Model.SceneName; + return OBSService.ActiveProgramScene?.sceneName == Model.SceneName; } } @@ -258,7 +259,7 @@ public override sealed void BuildUI(Transform p_Parent) var l_Selected = "None"; if (OBSService.Status == OBSService.EStatus.Connected) - l_Choices.AddRange(OBSService.Scenes.Keys); + l_Choices.AddRange(OBSService.Scenes.Values.Select(x => x.sceneName)); else CP_SDK.Chat.Service.Multiplexer?.InternalBroadcastSystemMessage("ChatIntegrations: Condition failed, not connected to OBS!"); @@ -301,8 +302,8 @@ private void OnSettingChanged() private void OnSelectActiveSceneButton() { - Model.SceneName = OBSService.ActiveScene?.name; - m_Dropdown.SetValue(OBSService.ActiveScene?.name); + Model.SceneName = OBSService.ActiveProgramScene?.sceneName; + m_Dropdown.SetValue(OBSService.ActiveProgramScene?.sceneName); } //////////////////////////////////////////////////////////////////////////// @@ -316,7 +317,7 @@ public override bool Eval(Models.EventContext p_Context) return false; } - return !(OBSService.ActiveScene?.name == Model.SceneName); + return !(OBSService.ActiveProgramScene?.sceneName == Model.SceneName); } } } diff --git a/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Events/ChatPointsReward.cs b/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Events/ChatPointsReward.cs index 767582b..858d766 100644 --- a/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Events/ChatPointsReward.cs +++ b/Modules/BeatSaberPlus_ChatIntegrations/ChatPlexMod_ChatIntegrations/Events/ChatPointsReward.cs @@ -217,7 +217,7 @@ public override void OnSuccess(Models.EventContext p_Context) if (l_TwitchHelix != null) { - var l_URL = $"https://api.twitch.tv/helix/channel_points/custom_rewards/redemptions?broadcaster_id={l_TwitchHelix.BroadcasterID}&reward_id={Model.RewardID}&id={p_Context.PointsEvent.TransactionID}"; + var l_URL = $"https://api.twitch.tv/helix/channel_points/custom_rewards/redemptions?broadcaster_id={l_TwitchHelix.BroadcasterUserID}&reward_id={Model.RewardID}&id={p_Context.PointsEvent.TransactionID}"; var l_Content = new JObject() { ["status"] = "FULFILLED", @@ -240,7 +240,7 @@ public override sealed void OnEventFailed(Models.EventContext p_Context) if (l_TwitchHelix != null) { - var l_URL = $"https://api.twitch.tv/helix/channel_points/custom_rewards/redemptions?broadcaster_id={l_TwitchHelix.BroadcasterID}&reward_id={Model.RewardID}&id={p_Context.PointsEvent.TransactionID}"; + var l_URL = $"https://api.twitch.tv/helix/channel_points/custom_rewards/redemptions?broadcaster_id={l_TwitchHelix.BroadcasterUserID}&reward_id={Model.RewardID}&id={p_Context.PointsEvent.TransactionID}"; var l_Content = new JObject() { ["status"] = "CANCELED", @@ -268,7 +268,7 @@ public override sealed void OnDisable() if (l_TwitchHelix != null) { - var l_URL = $"https://api.twitch.tv/helix/channel_points/custom_rewards?broadcaster_id={l_TwitchHelix.BroadcasterID}&id={Model.RewardID}"; + var l_URL = $"https://api.twitch.tv/helix/channel_points/custom_rewards?broadcaster_id={l_TwitchHelix.BroadcasterUserID}&id={Model.RewardID}"; var l_Content = new JObject() { ["is_enabled"] = false @@ -330,7 +330,7 @@ private void CreateOrUpdateReward() { var l_TwitchService = CP_SDK.Chat.Service.Multiplexer.Services.FirstOrDefault(x => x is CP_SDK.Chat.Services.Twitch.TwitchService); var l_TwitchHelix = l_TwitchService != null ? (l_TwitchService as CP_SDK.Chat.Services.Twitch.TwitchService).HelixAPI : null; - var l_URL = $"https://api.twitch.tv/helix/channel_points/custom_rewards?broadcaster_id={l_TwitchHelix.BroadcasterID}&id={Model.RewardID}"; + var l_URL = $"https://api.twitch.tv/helix/channel_points/custom_rewards?broadcaster_id={l_TwitchHelix.BroadcasterUserID}&id={Model.RewardID}"; if (l_TwitchHelix != null) l_TwitchHelix.WebClient.GetAsync(l_URL, CancellationToken.None, CreateOrUpdateReward_Callback, true); @@ -344,7 +344,7 @@ private void CreateOrUpdateReward_Callback(CP_SDK.Network.WebResponse p_GetReply var l_TwitchService = CP_SDK.Chat.Service.Multiplexer.Services.FirstOrDefault(x => x is CP_SDK.Chat.Services.Twitch.TwitchService); var l_TwitchHelix = l_TwitchService != null ? (l_TwitchService as CP_SDK.Chat.Services.Twitch.TwitchService).HelixAPI : null; var l_ShouldCreate = p_GetReply == null || !p_GetReply.IsSuccessStatusCode; - var l_URL = $"https://api.twitch.tv/helix/channel_points/custom_rewards?broadcaster_id={l_TwitchHelix.BroadcasterID}"; + var l_URL = $"https://api.twitch.tv/helix/channel_points/custom_rewards?broadcaster_id={l_TwitchHelix.BroadcasterUserID}"; if (l_ShouldCreate) { @@ -456,7 +456,7 @@ private void DeleteReward() if (l_TwitchHelix != null) { - var l_URL = $"https://api.twitch.tv/helix/channel_points/custom_rewards?broadcaster_id={l_TwitchHelix.BroadcasterID}&id={Model.RewardID}"; + var l_URL = $"https://api.twitch.tv/helix/channel_points/custom_rewards?broadcaster_id={l_TwitchHelix.BroadcasterUserID}&id={Model.RewardID}"; l_TwitchHelix.WebClient.DeleteAsync(l_URL, CancellationToken.None, null, true); } diff --git a/Modules/BeatSaberPlus_ChatIntegrations/Properties/AssemblyInfo.cs b/Modules/BeatSaberPlus_ChatIntegrations/Properties/AssemblyInfo.cs index cef4eb3..ce6a2a6 100644 --- a/Modules/BeatSaberPlus_ChatIntegrations/Properties/AssemblyInfo.cs +++ b/Modules/BeatSaberPlus_ChatIntegrations/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("6.2.2")] -[assembly: AssemblyFileVersion("6.2.2")] \ No newline at end of file +[assembly: AssemblyVersion("6.3.0")] +[assembly: AssemblyFileVersion("6.3.0")] \ No newline at end of file diff --git a/Modules/BeatSaberPlus_ChatIntegrations/manifest.json b/Modules/BeatSaberPlus_ChatIntegrations/manifest.json index 0822265..31c4925 100644 --- a/Modules/BeatSaberPlus_ChatIntegrations/manifest.json +++ b/Modules/BeatSaberPlus_ChatIntegrations/manifest.json @@ -3,12 +3,12 @@ "id": "BeatSaberPlus_ChatIntegrations", "name": "BeatSaberPlus_ChatIntegrations", "author": "HardCPP", - "version": "6.2.2", + "version": "6.3.0", "description": "", - "gameVersion": "1.34.2", + "gameVersion": "1.37.1", "dependsOn": { "BSIPA": "^4.3.0", - "ChatPlexSDK_BS": "^6.2.2" + "ChatPlexSDK_BS": "^6.3.0" }, "loadAfter": [ "BeatSaberPlus_Chat", diff --git a/Modules/BeatSaberPlus_ChatRequest/BeatSaberPlus_ChatRequest.csproj b/Modules/BeatSaberPlus_ChatRequest/BeatSaberPlus_ChatRequest.csproj index 1a23f86..ee081f5 100644 --- a/Modules/BeatSaberPlus_ChatRequest/BeatSaberPlus_ChatRequest.csproj +++ b/Modules/BeatSaberPlus_ChatRequest/BeatSaberPlus_ChatRequest.csproj @@ -24,15 +24,14 @@ true false bin\Debug\ - DEBUG;TRACE + TRACE;DEBUG;BEATSABER_1_35_0_OR_NEWER prompt 4 true bin\Release\ - - + BEATSABER_1_35_0_OR_NEWER prompt 4 @@ -55,16 +54,15 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\BGLib.AppFlow.dll + False - - $(BeatSaberDir)\Libs\Newtonsoft.Json.dll + + $(BeatSaberDir)\Beat Saber_Data\Managed\DataModels.dll False - False - - $(BeatSaberDir)\Plugins\SongCore.dll + + $(BeatSaberDir)\Libs\Newtonsoft.Json.dll False - False diff --git a/Modules/BeatSaberPlus_ChatRequest/BeatSaberPlus_ChatRequest.csproj.user b/Modules/BeatSaberPlus_ChatRequest/BeatSaberPlus_ChatRequest.csproj.user index 2bcbd9547e2dbf3c9b1de50a0ed26cffe2f0a25e..3fd52f1dec15af8e7e99f5b7788a2f6723814834 100644 GIT binary patch delta 27 jcmbQldW~g61S4|*gVp5ejK=K74CV}a3`UbLG9Cl~XQT&R delta 95 zcmcb{GKqCV1f#tRgB3#zLoh=LLn=ceLoS04LncEKLlKZS&8DTd1=G86z|F;Fa- kAs?tR7f9w!j%GCGHe#@3&|@%Uuwl@jY|AJ;c?;tr0P6%4ssI20 diff --git a/Modules/BeatSaberPlus_ChatRequest/ChatRequest.cs b/Modules/BeatSaberPlus_ChatRequest/ChatRequest.cs index 90d2cd9..df7aac7 100644 --- a/Modules/BeatSaberPlus_ChatRequest/ChatRequest.cs +++ b/Modules/BeatSaberPlus_ChatRequest/ChatRequest.cs @@ -224,45 +224,46 @@ private void OnSceneChange(CP_SDK_BS.Game.Logic.ESceneType p_Scene) { try { - if (CP_SDK_BS.Game.Logic.LevelData != null - && CP_SDK_BS.Game.Logic.LevelData?.Data != null - && CP_SDK_BS.Game.Logic.LevelData?.Data.difficultyBeatmap != null) +#if BEATSABER_1_35_0_OR_NEWER + var l_CurrentMap = CP_SDK_BS.Game.Logic.LevelData?.Data?.beatmapLevel; + var l_Mapper = l_CurrentMap.allMappers.FirstOrDefault()?.Replace(".", " . "); +#else + var l_CurrentMap = CP_SDK_BS.Game.Logic.LevelData?.Data?.difficultyBeatmap?.level; + var l_Mapper = l_CurrentMap.levelAuthorName.Replace(".", " . "); +#endif + + if (m_LastPlayingLevel != l_CurrentMap) { - var l_CurrentMap = CP_SDK_BS.Game.Logic.LevelData?.Data.difficultyBeatmap; + m_LastPlayingLevel = l_CurrentMap; + m_LastPlayingLevelResponse = CRConfig.Instance.SafeMode2 ? "" : l_CurrentMap.songName.Replace(".", " . ") + " by " + l_Mapper; - if (m_LastPlayingLevel != l_CurrentMap.level) + if (CP_SDK_BS.Game.Levels.LevelID_IsCustom(l_CurrentMap.levelID) && CP_SDK_BS.Game.Levels.TryGetHashFromLevelID(l_CurrentMap.levelID, out var l_Hash)) { - m_LastPlayingLevel = l_CurrentMap.level; - m_LastPlayingLevelResponse = CRConfig.Instance.SafeMode2 ? "" : l_CurrentMap.level.songName.Replace(".", " . ") + " by " + l_CurrentMap.level.levelAuthorName.Replace(".", " . "); + var l_CachedEntry = null as Data.SongEntry; - if (l_CurrentMap.level is CustomBeatmapLevel - && l_CurrentMap.level.levelID.StartsWith("custom_level_")) + lock (SongHistory) + l_CachedEntry = SongHistory.Where(x => x.BeatSaver_Map != null && x.BeatSaver_Map.SelectMapVersion().hash.ToUpper() == l_Hash).FirstOrDefault(); + + if (l_CachedEntry == null) { - var l_Hash = l_CurrentMap.level.levelID.Substring("custom_level_".Length).ToLower(); - if (l_Hash != "") + CP_SDK_BS.Game.BeatMapsClient.GetOnlineByHash(l_Hash, (p_Valid, p_BeatMap) => { - var l_CachedEntry = null as Data.SongEntry; - - lock (SongHistory) - l_CachedEntry = SongHistory.Where(x => x.BeatSaver_Map != null && x.BeatSaver_Map.SelectMapVersion().hash.ToLower() == l_Hash).FirstOrDefault(); - - if (l_CachedEntry == null) - { - CP_SDK_BS.Game.BeatMapsClient.GetOnlineByHash(l_Hash, (p_Valid, p_BeatMap) => - { - if ( !p_Valid - || p_BeatMap == null - || l_CurrentMap.level != (CP_SDK_BS.Game.Logic.LevelData?.Data?.difficultyBeatmap?.level ?? null)) - return; - - m_LastPlayingLevelResponse += " https://beatsaver.com/maps/" + p_BeatMap.id; - }); - } - else - { - m_LastPlayingLevelResponse += " https://beatsaver.com/maps/" + l_CachedEntry.BeatSaver_Map.id; - } - } + if ( !p_Valid + || p_BeatMap == null +#if BEATSABER_1_35_0_OR_NEWER + || l_CurrentMap != (CP_SDK_BS.Game.Logic.LevelData?.Data?.beatmapLevel ?? null) +#else + || l_CurrentMap != (CP_SDK_BS.Game.Logic.LevelData?.Data?.difficultyBeatmap?.level ?? null) +#endif + ) + return; + + m_LastPlayingLevelResponse += " https://beatsaver.com/maps/" + p_BeatMap.id; + }); + } + else + { + m_LastPlayingLevelResponse += " https://beatsaver.com/maps/" + l_CachedEntry.BeatSaver_Map.id; } } } diff --git a/Modules/BeatSaberPlus_ChatRequest/ChatRequest_Commands.cs b/Modules/BeatSaberPlus_ChatRequest/ChatRequest_Commands.cs index d7f47f1..fa2c4cc 100644 --- a/Modules/BeatSaberPlus_ChatRequest/ChatRequest_Commands.cs +++ b/Modules/BeatSaberPlus_ChatRequest/ChatRequest_Commands.cs @@ -336,7 +336,12 @@ private void Command_Link(IChatService p_Service, IChatMessage p_Message, string string l_Response = ""; if (CP_SDK_BS.Game.Logic.LevelData == null || CP_SDK_BS.Game.Logic.LevelData?.Data == null - || CP_SDK_BS.Game.Logic.LevelData?.Data.difficultyBeatmap == null) +#if BEATSABER_1_35_0_OR_NEWER + || CP_SDK_BS.Game.Logic.LevelData?.Data.beatmapLevel == null +#else + || CP_SDK_BS.Game.Logic.LevelData?.Data.difficultyBeatmap == null +#endif + ) { if (m_LastPlayingLevelResponse == "") l_Response = CRConfig.Instance.Commands.LinkCommand_NoSong; diff --git a/Modules/BeatSaberPlus_ChatRequest/ChatRequest_Logic.cs b/Modules/BeatSaberPlus_ChatRequest/ChatRequest_Logic.cs index 4e44430..f2e6267 100644 --- a/Modules/BeatSaberPlus_ChatRequest/ChatRequest_Logic.cs +++ b/Modules/BeatSaberPlus_ChatRequest/ChatRequest_Logic.cs @@ -38,7 +38,11 @@ public int SongQueueCount { get private ConcurrentBag m_RequestedThisSession = new ConcurrentBag(); private DateTime m_LastQueueCommandTime = DateTime.Now; +#if BEATSABER_1_35_0_OR_NEWER + private BeatmapLevel m_LastPlayingLevel = null; +#else private IBeatmapLevel m_LastPlayingLevel = null; +#endif private string m_LastPlayingLevelResponse = ""; //////////////////////////////////////////////////////////////////////////// diff --git a/Modules/BeatSaberPlus_ChatRequest/Properties/AssemblyInfo.cs b/Modules/BeatSaberPlus_ChatRequest/Properties/AssemblyInfo.cs index 2606c77..af638c6 100644 --- a/Modules/BeatSaberPlus_ChatRequest/Properties/AssemblyInfo.cs +++ b/Modules/BeatSaberPlus_ChatRequest/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("6.2.2")] -[assembly: AssemblyFileVersion("6.2.2")] +[assembly: AssemblyVersion("6.3.0")] +[assembly: AssemblyFileVersion("6.3.0")] diff --git a/Modules/BeatSaberPlus_ChatRequest/UI/ManagerMainView.cs b/Modules/BeatSaberPlus_ChatRequest/UI/ManagerMainView.cs index 075ad93..8b6c194 100644 --- a/Modules/BeatSaberPlus_ChatRequest/UI/ManagerMainView.cs +++ b/Modules/BeatSaberPlus_ChatRequest/UI/ManagerMainView.cs @@ -22,7 +22,11 @@ internal class ManagerMainView CP_SDK_BS.UI.Data.SongListController, IProgress { - private static CustomPreviewBeatmapLevel m_SongToSelectAfterDismiss = null; +#if BEATSABER_1_35_0_OR_NEWER + private static BeatmapLevel m_SongToSelectAfterDismiss = null; +#else + private static IPreviewBeatmapLevel m_SongToSelectAfterDismiss = null; +#endif //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// @@ -310,8 +314,11 @@ private void OnSongSelected(IListItem p_SelectedItem) /// Set selected song m_SelectedSong = l_SongEntry; - var l_LocalSong = SongCore.Loader.GetLevelByHash(m_SelectedSong.BeatSaver_Map.SelectMapVersion().hash); - if (l_LocalSong != null && SongCore.Loader.CustomLevels.ContainsKey(l_LocalSong.customLevelPath)) +#if BEATSABER_1_35_0_OR_NEWER + if (CP_SDK_BS.Game.Levels.TryGetBeatmapLevelForHash(m_SelectedSong.BeatSaver_Map.SelectMapVersion().hash, out _)) +#else + if (CP_SDK_BS.Game.Levels.TryGetPreviewBeatmapLevelForLevelID(m_SelectedSong.BeatSaver_Map.SelectMapVersion().hash, out _)) +#endif m_SongInfo_Detail.SetPrimaryButtonText("Play"); else m_SongInfo_Detail.SetPrimaryButtonText("Download"); @@ -389,8 +396,11 @@ private void PlaySong() try { - var l_LocalSong = SongCore.Loader.GetLevelByHash(m_SelectedSong.BeatSaver_Map.SelectMapVersion().hash); - if (l_LocalSong != null && SongCore.Loader.CustomLevels.ContainsKey(l_LocalSong.customLevelPath)) +#if BEATSABER_1_35_0_OR_NEWER + if (CP_SDK_BS.Game.Levels.TryGetBeatmapLevelForHash(m_SelectedSong.BeatSaver_Map.SelectMapVersion().hash, out var l_LocalSong)) +#else + if (CP_SDK_BS.Game.Levels.TryGetPreviewBeatmapLevelForLevelID(m_SelectedSong.BeatSaver_Map.SelectMapVersion().hash, out var l_LocalSong)) +#endif { ChatRequest.Instance.DequeueSong(m_SelectedSong, true); @@ -419,12 +429,7 @@ private void PlaySong() if (p_IsSuccess) { m_SongReloadingExpectedPath = p_SongReloadingExpectedPath; - - CP_SDK.Unity.MTMainThreadInvoker.Enqueue(() => - { - SongCore.Loader.SongsLoadedEvent += OnDownloadedSongLoaded; - SongCore.Loader.Instance.RefreshSongs(false); - }); + CP_SDK_BS.Game.Levels.ReloadSongs(false, OnDownloadedSongLoaded); } else { @@ -481,29 +486,17 @@ private void OnBlacklistButtonPressed() /// /// Loader instance /// All loaded songs - private void OnDownloadedSongLoaded(SongCore.Loader p_Loader, ConcurrentDictionary p_Maps) + private void OnDownloadedSongLoaded() { - /// Remove callback - SongCore.Loader.SongsLoadedEvent -= OnDownloadedSongLoaded; - /// Avoid refresh if not active view anymore if (!CanBeUpdated) return; - var l_LocalSong = SongCore.Loader.GetLevelByHash(m_SelectedSong.BeatSaver_Map.SelectMapVersion().hash); - if (l_LocalSong == null) - { - foreach (var l_Current in p_Maps) - { - if (!l_Current.Value.customLevelPath.ToLower().Contains(m_SongReloadingExpectedPath.ToLower())) - continue; - - l_LocalSong = l_Current.Value; - break; - } - } - - if (l_LocalSong == null || l_LocalSong.levelID.Replace("custom_level_", "").ToLower() != m_SelectedSong.BeatSaver_Map.SelectMapVersion().hash) +#if BEATSABER_1_35_0_OR_NEWER + if (!CP_SDK_BS.Game.Levels.TryGetBeatmapLevelForHash(m_SelectedSong.BeatSaver_Map.SelectMapVersion().hash, out var l_LocalSong)) +#else + if (!CP_SDK_BS.Game.Levels.TryGetPreviewBeatmapLevelForLevelID(m_SelectedSong.BeatSaver_Map.SelectMapVersion().hash, out var l_LocalSong)) +#endif { CloseLoadingModal(); ShowMessageModal("An error occurred while downloading this map.\nDownloaded song doesn't match."); diff --git a/Modules/BeatSaberPlus_ChatRequest/manifest.json b/Modules/BeatSaberPlus_ChatRequest/manifest.json index 5471884..6a0d564 100644 --- a/Modules/BeatSaberPlus_ChatRequest/manifest.json +++ b/Modules/BeatSaberPlus_ChatRequest/manifest.json @@ -3,12 +3,12 @@ "id": "BeatSaberPlus_ChatRequest", "name": "BeatSaberPlus_ChatRequest", "author": "HardCPP", - "version": "6.2.2", + "version": "6.3.0", "description": "", - "gameVersion": "1.34.2", + "gameVersion": "1.37.1", "dependsOn": { "BSIPA": "^4.3.0", - "ChatPlexSDK_BS": "^6.2.2" + "ChatPlexSDK_BS": "^6.3.0" }, "links": { "project-home": "https://discord.chatplex.org", diff --git a/Modules/BeatSaberPlus_GameTweaker/BeatSaberPlus_GameTweaker.csproj b/Modules/BeatSaberPlus_GameTweaker/BeatSaberPlus_GameTweaker.csproj index 4ffe819..1d7f8cf 100644 --- a/Modules/BeatSaberPlus_GameTweaker/BeatSaberPlus_GameTweaker.csproj +++ b/Modules/BeatSaberPlus_GameTweaker/BeatSaberPlus_GameTweaker.csproj @@ -24,15 +24,14 @@ true false bin\Debug\ - DEBUG;TRACE + TRACE;DEBUG;BEATSABER_1_35_0_OR_NEWER prompt 4 true bin\Release\ - - + BEATSABER_1_35_0_OR_NEWER prompt 4 @@ -56,53 +55,49 @@ $(BeatSaberDir)\Libs\0Harmony.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\BeatmapCore.dll False - False + + + $(BeatSaberDir)\Beat Saber_Data\Managed\BGLib.Polyglot.dll + False $(BeatSaberDir)\Beat Saber_Data\Managed\BGLib.UnityExtension.dll + False $(BeatSaberDir)\Beat Saber_Data\Managed\Colors.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\Core.dll False - False + + + $(BeatSaberDir)\Beat Saber_Data\Managed\DataModels.dll $(BeatSaberDir)\Beat Saber_Data\Managed\GameplayCore.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\HMLib.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\HMRendering.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\Menu.CommonLib.dll + False $(BeatSaberDir)\Libs\Newtonsoft.Json.dll False - False - - - $(BeatSaberDir)\Beat Saber_Data\Managed\Polyglot.dll - False - False @@ -132,12 +127,10 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.InputLegacyModule.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.ParticleSystemModule.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.UI.dll @@ -168,6 +161,7 @@ + diff --git a/Modules/BeatSaberPlus_GameTweaker/BeatSaberPlus_GameTweaker.csproj.user b/Modules/BeatSaberPlus_GameTweaker/BeatSaberPlus_GameTweaker.csproj.user index 2bcbd9547e2dbf3c9b1de50a0ed26cffe2f0a25e..3fd52f1dec15af8e7e99f5b7788a2f6723814834 100644 GIT binary patch delta 27 jcmbQldW~g61S4|*gVp5ejK=K74CV}a3`UbLG9Cl~XQT&R delta 95 zcmcb{GKqCV1f#tRgB3#zLoh=LLn=ceLoS04LncEKLlKZS&8DTd1=G86z|F;Fa- kAs?tR7f9w!j%GCGHe#@3&|@%Uuwl@jY|AJ;c?;tr0P6%4ssI20 diff --git a/Modules/BeatSaberPlus_GameTweaker/Components/FPFCEscape.cs b/Modules/BeatSaberPlus_GameTweaker/Components/FPFCEscape.cs index 0e946b0..d1c09cc 100644 --- a/Modules/BeatSaberPlus_GameTweaker/Components/FPFCEscape.cs +++ b/Modules/BeatSaberPlus_GameTweaker/Components/FPFCEscape.cs @@ -1,4 +1,8 @@ -using Polyglot; +#if BEATSABER_1_35_0_OR_NEWER +using BGLib.Polyglot; +#else +using Polyglot; +#endif using System.Linq; using TMPro; using UnityEngine; diff --git a/Modules/BeatSaberPlus_GameTweaker/GameTweaker.cs b/Modules/BeatSaberPlus_GameTweaker/GameTweaker.cs index dba6035..53cde4d 100644 --- a/Modules/BeatSaberPlus_GameTweaker/GameTweaker.cs +++ b/Modules/BeatSaberPlus_GameTweaker/GameTweaker.cs @@ -124,7 +124,11 @@ internal void UpdatePatches(bool p_ForceDisable) } catch (System.Exception p_PatchException) { Logger.Instance.Error("[GameTweaker] Error on updating PMainMenuViewController"); Logger.Instance.Error(p_PatchException); } /// Apply new content promotional settings try { +#if BEATSABER_1_35_0_OR_NEWER + Patches.PMusicPackPromoBanner.SetEnabled(!p_ForceDisable && GTConfig.Instance.MainMenu.RemoveNewContentPromotional); +#else Patches.PPromoViewController.SetEnabled(!p_ForceDisable && GTConfig.Instance.MainMenu.RemoveNewContentPromotional); +#endif } catch (System.Exception p_PatchException) { Logger.Instance.Error("[GameTweaker] Error on updating PPromoViewController"); Logger.Instance.Error(p_PatchException); } /// Apply player settings try { diff --git a/Modules/BeatSaberPlus_GameTweaker/Patches/PLevelListTableCell.cs b/Modules/BeatSaberPlus_GameTweaker/Patches/PLevelListTableCell.cs index 970f391..b772434 100644 --- a/Modules/BeatSaberPlus_GameTweaker/Patches/PLevelListTableCell.cs +++ b/Modules/BeatSaberPlus_GameTweaker/Patches/PLevelListTableCell.cs @@ -1,7 +1,6 @@ using CP_SDK.Unity.Extensions; using HarmonyLib; using TMPro; -using UnityEngine; namespace BeatSaberPlus_GameTweaker.Patches { @@ -12,8 +11,13 @@ public class PLevelListTableCell /// /// DidActivate /// +#if BEATSABER_1_35_0_OR_NEWER + internal static void Postfix(BeatmapLevel level, bool isFavorite, + ref TextMeshProUGUI ____songNameText) +#else internal static void Postfix(IPreviewBeatmapLevel level, bool isFavorite, ref TextMeshProUGUI ____songNameText) +#endif { if (GTConfig.Instance.LevelSelection.HighlightEnabled) { diff --git a/Modules/BeatSaberPlus_GameTweaker/Patches/PMusicPackPromoBanner.cs b/Modules/BeatSaberPlus_GameTweaker/Patches/PMusicPackPromoBanner.cs new file mode 100644 index 0000000..05992bf --- /dev/null +++ b/Modules/BeatSaberPlus_GameTweaker/Patches/PMusicPackPromoBanner.cs @@ -0,0 +1,66 @@ +#if BEATSABER_1_35_0_OR_NEWER +using HarmonyLib; +using System.Collections.Generic; + +namespace BeatSaberPlus_GameTweaker.Patches +{ + /// + /// MusicPackPromoBanner remover + /// + [HarmonyPatch(typeof(MusicPackPromoBanner))] + [HarmonyPatch(nameof(MusicPackPromoBanner.Setup))] + public class PMusicPackPromoBanner : MusicPackPromoBanner + { + /// + /// MusicPackPromoBanner instance + /// + private static MusicPackPromoBanner m_Instance = null; + /// + /// Original states + /// + private static List m_OriginalStates = new List(); + + //////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////// + + /// + /// Prefix + /// + /// MusicPackPromoBanner instance + internal static void Postfix(ref MusicPackPromoBanner __instance) + { + if (__instance != m_Instance) + m_OriginalStates.Clear(); + + if (GTConfig.Instance.Enabled && m_OriginalStates.Count == 0) + { + /// Store instance + m_Instance = __instance; + + /// Backup original states + for (int l_I = 0; l_I < m_Instance.transform.childCount; ++l_I) + m_OriginalStates.Add(m_Instance.transform.GetChild(l_I).gameObject.activeSelf); + + /// Apply + SetEnabled(GTConfig.Instance.MainMenu.RemoveNewContentPromotional); + } + } + + //////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////// + + /// + /// Set if MusicPackPromoBanner should be hidden + /// + /// New state + internal static void SetEnabled(bool p_Enabled) + { + if (m_Instance == null || !m_Instance) + return; + + for (int l_I = 0; l_I < m_Instance.transform.childCount; ++l_I) + m_Instance.transform.GetChild(l_I).gameObject.SetActive(p_Enabled ? false : (l_I < m_OriginalStates.Count ? m_OriginalStates[l_I] : false)); + } + } +} +#endif \ No newline at end of file diff --git a/Modules/BeatSaberPlus_GameTweaker/Patches/PPlayerSettingsPanelController.cs b/Modules/BeatSaberPlus_GameTweaker/Patches/PPlayerSettingsPanelController.cs index 06ab8cc..b6df8e2 100644 --- a/Modules/BeatSaberPlus_GameTweaker/Patches/PPlayerSettingsPanelController.cs +++ b/Modules/BeatSaberPlus_GameTweaker/Patches/PPlayerSettingsPanelController.cs @@ -1,6 +1,10 @@ -using CP_SDK.Unity.Extensions; -using HarmonyLib; +#if BEATSABER_1_35_0_OR_NEWER +using BGLib.Polyglot; +#else using Polyglot; +#endif +using CP_SDK.Unity.Extensions; +using HarmonyLib; using System; using System.Collections.Generic; using TMPro; diff --git a/Modules/BeatSaberPlus_GameTweaker/Patches/PPromoViewController.cs b/Modules/BeatSaberPlus_GameTweaker/Patches/PPromoViewController.cs index ca96814..01b37d7 100644 --- a/Modules/BeatSaberPlus_GameTweaker/Patches/PPromoViewController.cs +++ b/Modules/BeatSaberPlus_GameTweaker/Patches/PPromoViewController.cs @@ -1,4 +1,5 @@ -using HarmonyLib; +#if !BEATSABER_1_35_0_OR_NEWER +using HarmonyLib; using System.Collections.Generic; namespace BeatSaberPlus_GameTweaker.Patches @@ -62,3 +63,4 @@ internal static void SetEnabled(bool p_Enabled) } } } +#endif \ No newline at end of file diff --git a/Modules/BeatSaberPlus_GameTweaker/Properties/AssemblyInfo.cs b/Modules/BeatSaberPlus_GameTweaker/Properties/AssemblyInfo.cs index aa9f643..f839dc2 100644 --- a/Modules/BeatSaberPlus_GameTweaker/Properties/AssemblyInfo.cs +++ b/Modules/BeatSaberPlus_GameTweaker/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("6.2.2")] -[assembly: AssemblyFileVersion("6.2.2")] +[assembly: AssemblyVersion("6.3.0")] +[assembly: AssemblyFileVersion("6.3.0")] diff --git a/Modules/BeatSaberPlus_GameTweaker/manifest.json b/Modules/BeatSaberPlus_GameTweaker/manifest.json index 9b06be6..c837552 100644 --- a/Modules/BeatSaberPlus_GameTweaker/manifest.json +++ b/Modules/BeatSaberPlus_GameTweaker/manifest.json @@ -3,12 +3,12 @@ "id": "BeatSaberPlus_GameTweaker", "name": "BeatSaberPlus_GameTweaker", "author": "HardCPP", - "version": "6.2.2", + "version": "6.3.0", "description": "", - "gameVersion": "1.34.2", + "gameVersion": "1.37.1", "dependsOn": { "BSIPA": "^4.3.0", - "ChatPlexSDK_BS": "^6.2.2" + "ChatPlexSDK_BS": "^6.3.0" }, "links": { "project-home": "https://discord.chatplex.org", diff --git a/Modules/BeatSaberPlus_MenuMusic/BeatSaberPlus_MenuMusic.csproj b/Modules/BeatSaberPlus_MenuMusic/BeatSaberPlus_MenuMusic.csproj index 317ab16..4b79237 100644 --- a/Modules/BeatSaberPlus_MenuMusic/BeatSaberPlus_MenuMusic.csproj +++ b/Modules/BeatSaberPlus_MenuMusic/BeatSaberPlus_MenuMusic.csproj @@ -24,14 +24,14 @@ true false bin\Debug\ - TRACE;DEBUG;BEATSABER + TRACE;DEBUG;BEATSABER;BEATSABER_1_35_0_OR_NEWER prompt 4 true bin\Release\ - BEATSABER + BEATSABER;BEATSABER_1_35_0_OR_NEWER prompt 4 @@ -52,21 +52,17 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + $(BeatSaberDir)\Beat Saber_Data\Managed\DataModels.dll + False + $(BeatSaberDir)\Libs\Newtonsoft.Json.dll False - False $(BeatSaberDir)\Plugins\SongCore.dll False - False @@ -89,7 +85,6 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.AudioModule.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.CoreModule.dll @@ -98,7 +93,6 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.TextRenderingModule.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.UI.dll @@ -111,12 +105,10 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.UnityWebRequestModule.dll False - False diff --git a/Modules/BeatSaberPlus_MenuMusic/BeatSaberPlus_MenuMusic.csproj.user b/Modules/BeatSaberPlus_MenuMusic/BeatSaberPlus_MenuMusic.csproj.user index 2bcbd9547e2dbf3c9b1de50a0ed26cffe2f0a25e..3fd52f1dec15af8e7e99f5b7788a2f6723814834 100644 GIT binary patch delta 27 jcmbQldW~g61S4|*gVp5ejK=K74CV}a3`UbLG9Cl~XQT&R delta 95 zcmcb{GKqCV1f#tRgB3#zLoh=LLn=ceLoS04LncEKLlKZS&8DTd1=G86z|F;Fa- kAs?tR7f9w!j%GCGHe#@3&|@%Uuwl@jY|AJ;c?;tr0P6%4ssI20 diff --git a/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Data/GameMusicProvider.cs b/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Data/GameMusicProvider.cs index accc256..1fa0f15 100644 --- a/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Data/GameMusicProvider.cs +++ b/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/Data/GameMusicProvider.cs @@ -48,7 +48,11 @@ public GameMusicProvider() public override bool StartGameSpecificGamePlay(Music p_Music) { #if BEATSABER - var l_CustomPreviewBeatmapLevel = null as CustomPreviewBeatmapLevel; +#if BEATSABER_1_35_0_OR_NEWER + var l_BeatmapLevel = null as BeatmapLevel; +#else + var l_BeatmapLevel = null as CustomPreviewBeatmapLevel; +#endif try { if (p_Music != null) @@ -60,7 +64,11 @@ public override bool StartGameSpecificGamePlay(Music p_Music) if (l_RelativeFolder.Contains("/")) l_RelativeFolder = l_RelativeFolder.Substring(0, l_RelativeFolder.LastIndexOf("/")); - l_CustomPreviewBeatmapLevel = SongCore.Loader.CustomLevels.Where(x => x.Value.customLevelPath.Contains(l_RelativeFolder)).Select(x => x.Value).FirstOrDefault(); +#if BEATSABER_1_35_0_OR_NEWER + l_BeatmapLevel = SongCore.Loader.CustomLevels.Where(x => x.Key.Contains(l_RelativeFolder)).Select(x => x.Value).FirstOrDefault(); +#else + l_BeatmapLevel = SongCore.Loader.CustomLevels.Where(x => x.Value.customLevelPath.Contains(l_RelativeFolder)).Select(x => x.Value).FirstOrDefault(); +#endif } } } @@ -69,10 +77,10 @@ public override bool StartGameSpecificGamePlay(Music p_Music) } - if (l_CustomPreviewBeatmapLevel == null) + if (l_BeatmapLevel == null) return false; - CP_SDK_BS.Game.LevelSelection.FilterToSpecificSong(l_CustomPreviewBeatmapLevel); + CP_SDK_BS.Game.LevelSelection.FilterToSpecificSong(l_BeatmapLevel); return true; #else #error Missing game implementation @@ -107,14 +115,26 @@ private IEnumerator Coroutine_LoadGameSongs() foreach (var l_Current in SongCore.Loader.CustomLevels) { +#if BEATSABER_1_35_0_OR_NEWER + if (!(l_Current.Value.previewMediaData is FileSystemPreviewMediaData l_FileSystemPreviewMediaData)) + continue; + + var l_Extension = Path.GetExtension(l_FileSystemPreviewMediaData._previewAudioClipPath).ToLower(); +#else var l_Extension = Path.GetExtension(l_Current.Value.standardLevelInfoSaveData.songFilename).ToLower(); +#endif if (l_Extension != ".egg" && l_Extension != ".ogg") continue; m_Musics.Add(new Music( this, +#if BEATSABER_1_35_0_OR_NEWER + l_FileSystemPreviewMediaData._previewAudioClipPath, + l_FileSystemPreviewMediaData._coverSpritePath, +#else Path.Combine("Beat Saber_Data\\CustomLevels\\", l_Current.Value.customLevelPath, l_Current.Value.standardLevelInfoSaveData.songFilename), Path.Combine("Beat Saber_Data\\CustomLevels\\", l_Current.Value.customLevelPath, l_Current.Value.standardLevelInfoSaveData.coverImageFilename), +#endif l_Current.Value.songName, l_Current.Value.songAuthorName )); diff --git a/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/MenuMusic.cs b/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/MenuMusic.cs index 7b5cb02..0dbbd86 100644 --- a/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/MenuMusic.cs +++ b/Modules/BeatSaberPlus_MenuMusic/ChatPlexMod_MenuMusic/MenuMusic.cs @@ -296,7 +296,7 @@ private IEnumerator CreateFloatingPlayer_Coroutine() var l_Waiter = new WaitForSeconds(0.25f); while (true) { - l_ScreenContainer = Resources.FindObjectsOfTypeAll().FirstOrDefault(x => x.name == "ScreenContainer" && x.activeInHierarchy); + l_ScreenContainer = Resources.FindObjectsOfTypeAll().FirstOrDefault(x => x.name == "ScreenContainer" && x.activeInHierarchy && x.transform.parent?.parent?.name == "UI"); if (l_ScreenContainer != null && l_ScreenContainer) break; diff --git a/Modules/BeatSaberPlus_MenuMusic/Properties/AssemblyInfo.cs b/Modules/BeatSaberPlus_MenuMusic/Properties/AssemblyInfo.cs index aa56571..1aa59e4 100644 --- a/Modules/BeatSaberPlus_MenuMusic/Properties/AssemblyInfo.cs +++ b/Modules/BeatSaberPlus_MenuMusic/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("6.2.2")] -[assembly: AssemblyFileVersion("6.2.2")] +[assembly: AssemblyVersion("6.3.0")] +[assembly: AssemblyFileVersion("6.3.0")] diff --git a/Modules/BeatSaberPlus_MenuMusic/manifest.json b/Modules/BeatSaberPlus_MenuMusic/manifest.json index 9931380..f75ca7f 100644 --- a/Modules/BeatSaberPlus_MenuMusic/manifest.json +++ b/Modules/BeatSaberPlus_MenuMusic/manifest.json @@ -3,12 +3,12 @@ "id": "BeatSaberPlus_MenuMusic", "name": "BeatSaberPlus_MenuMusic", "author": "HardCPP", - "version": "6.2.2", + "version": "6.3.0", "description": "", - "gameVersion": "1.34.2", + "gameVersion": "1.37.1", "dependsOn": { "BSIPA": "^4.3.0", - "ChatPlexSDK_BS": "^6.2.2" + "ChatPlexSDK_BS": "^6.3.0" }, "links": { "project-home": "https://discord.chatplex.org", diff --git a/Modules/BeatSaberPlus_NoteTweaker/BeatSaberPlus_NoteTweaker.csproj b/Modules/BeatSaberPlus_NoteTweaker/BeatSaberPlus_NoteTweaker.csproj index 405b97f..3645ad7 100644 --- a/Modules/BeatSaberPlus_NoteTweaker/BeatSaberPlus_NoteTweaker.csproj +++ b/Modules/BeatSaberPlus_NoteTweaker/BeatSaberPlus_NoteTweaker.csproj @@ -56,48 +56,45 @@ $(BeatSaberDir)\Libs\0Harmony.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\BeatmapCore.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\BGLib.AppFlow.dll + False $(BeatSaberDir)\Beat Saber_Data\Managed\BGLib.UnityExtension.dll + False $(BeatSaberDir)\Beat Saber_Data\Managed\Colors.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\Core.dll False - False + + + $(BeatSaberDir)\Beat Saber_Data\Managed\DataModels.dll $(BeatSaberDir)\Beat Saber_Data\Managed\GameplayCore.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\HMLib.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\HMRendering.dll False - False $(BeatSaberDir)\Libs\Newtonsoft.Json.dll False - False @@ -123,12 +120,10 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.PhysicsModule.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.TextRenderingModule.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.UI.dll @@ -137,7 +132,6 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\Zenject.dll False - False diff --git a/Modules/BeatSaberPlus_NoteTweaker/BeatSaberPlus_NoteTweaker.csproj.user b/Modules/BeatSaberPlus_NoteTweaker/BeatSaberPlus_NoteTweaker.csproj.user index 2bcbd9547e2dbf3c9b1de50a0ed26cffe2f0a25e..3fd52f1dec15af8e7e99f5b7788a2f6723814834 100644 GIT binary patch delta 27 jcmbQldW~g61S4|*gVp5ejK=K74CV}a3`UbLG9Cl~XQT&R delta 95 zcmcb{GKqCV1f#tRgB3#zLoh=LLn=ceLoS04LncEKLlKZS&8DTd1=G86z|F;Fa- kAs?tR7f9w!j%GCGHe#@3&|@%Uuwl@jY|AJ;c?;tr0P6%4ssI20 diff --git a/Modules/BeatSaberPlus_NoteTweaker/Patches/PBurstSliderGameNoteController.cs b/Modules/BeatSaberPlus_NoteTweaker/Patches/PBurstSliderGameNoteController.cs index 1e64ece..427488d 100644 --- a/Modules/BeatSaberPlus_NoteTweaker/Patches/PBurstSliderGameNoteController.cs +++ b/Modules/BeatSaberPlus_NoteTweaker/Patches/PBurstSliderGameNoteController.cs @@ -12,6 +12,7 @@ public class PBurstSliderGameNoteController : GameNoteController { private static bool m_Enabled = false; private static bool m_TempEnabled = false; + private static bool m_WasTempEnabled = false; private static Vector3 m_NoteScale; private static Vector3 m_NoteInvScale; private static Vector3 m_TempNoteScale; @@ -28,16 +29,30 @@ public class PBurstSliderGameNoteController : GameNoteController /// BoxCuttableBySaber instance internal static void Postfix(ref BurstSliderGameNoteController __instance, ref BoxCuttableBySaber[] ____bigCuttableBySaberList, ref BoxCuttableBySaber[] ____smallCuttableBySaberList) { - if (!m_Enabled && !m_TempEnabled) + if (!m_Enabled && !m_TempEnabled && !m_WasTempEnabled) return; - __instance.gameObject.transform.localScale = m_TempEnabled ? m_TempNoteScale : m_NoteScale; + var l_NoteScale = m_NoteScale; + var l_NoteInvScale = m_NoteInvScale; + + if (m_TempEnabled) + { + l_NoteScale = m_TempNoteScale; + l_NoteInvScale = m_TempNoteInvScale; + } + else if (m_WasTempEnabled) + { + l_NoteScale = Vector3.one; + l_NoteInvScale = Vector3.one; + } + + __instance.gameObject.transform.localScale = l_NoteScale; for (int l_I = 0; l_I < ____bigCuttableBySaberList.Length; ++l_I) - ____bigCuttableBySaberList[l_I].transform.localScale = m_TempEnabled ? m_TempNoteInvScale : m_NoteInvScale; + ____bigCuttableBySaberList[l_I].transform.localScale = l_NoteInvScale; for (int l_I = 0; l_I < ____smallCuttableBySaberList.Length; ++l_I) - ____smallCuttableBySaberList[l_I].transform.localScale = m_TempEnabled ? m_TempNoteInvScale : m_NoteInvScale; + ____smallCuttableBySaberList[l_I].transform.localScale = l_NoteInvScale; } //////////////////////////////////////////////////////////////////////////// @@ -57,7 +72,10 @@ internal static void SetFromConfig(bool p_OnSceneSwitch) m_NoteInvScale = (1f / l_NoteScale) * Vector3.one; if (p_OnSceneSwitch) + { m_TempEnabled = false; + m_WasTempEnabled = false; + } } /// /// Set temp config @@ -74,6 +92,9 @@ public static void SetTemp(bool p_Enabled, float p_Scale) m_TempEnabled = p_Enabled; m_TempNoteScale = (p_Scale) * Vector3.one; m_TempNoteInvScale = (1f / (p_Scale))* Vector3.one; + + if (p_Enabled) + m_WasTempEnabled = true; } //////////////////////////////////////////////////////////////////////////// diff --git a/Modules/BeatSaberPlus_NoteTweaker/Patches/PColorNoteVisuals.cs b/Modules/BeatSaberPlus_NoteTweaker/Patches/PColorNoteVisuals.cs index 82e7ed4..a6023bf 100644 --- a/Modules/BeatSaberPlus_NoteTweaker/Patches/PColorNoteVisuals.cs +++ b/Modules/BeatSaberPlus_NoteTweaker/Patches/PColorNoteVisuals.cs @@ -12,25 +12,27 @@ namespace BeatSaberPlus_NoteTweaker.Patches [HarmonyPatch(nameof(ColorNoteVisuals.HandleNoteControllerDidInit))] public class PColorNoteVisuals : ColorNoteVisuals { - private static bool m_Enabled = false; - private static bool m_BlockColorsEnabled = false; - private static Vector3 m_ArrowScale; - private static Vector3 m_ArrowGlowScale; - private static bool m_OverrideArrowColors; - private static float m_ArrowAlpha; - private static Color m_LeftArrowColor; - private static Color m_RightArrowColor; - private static bool m_CircleEnabled; - private static bool m_CircleForceEnabled; - private static Vector3 m_CircleScale; - private static Vector3 m_BurstCircleScale; - private static Vector3 m_PrecisionCircleScale; - private static bool m_OverrideDotColors; - private static float m_DotAlpha; - private static Color m_LeftCircleColor; - private static Color m_RightCircleColor; - private static Color m_LeftBlockColor; - private static Color m_RightBlockColor; + private static ColorManager m_ColorManager; + + private static bool m_Enabled = false; + private static bool m_BlockColorsEnabled = false; + private static Vector3 m_ArrowScale; + private static Vector3 m_ArrowGlowScale; + private static bool m_OverrideArrowColors; + private static float m_ArrowAlpha; + private static Color m_LeftArrowColor; + private static Color m_RightArrowColor; + private static bool m_CircleEnabled; + private static bool m_CircleForceEnabled; + private static Vector3 m_CircleScale; + private static Vector3 m_BurstCircleScale; + private static Vector3 m_PrecisionCircleScale; + private static bool m_OverrideDotColors; + private static float m_DotAlpha; + private static Color m_LeftCircleColor; + private static Color m_RightCircleColor; + private static Color m_LeftBlockColor; + private static Color m_RightBlockColor; //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// @@ -55,6 +57,8 @@ internal static void Postfix(ColorNoteVisuals __instance, ref MeshRenderer[] ____circleMeshRenderers, ref MaterialPropertyBlockController[] ____materialPropertyBlockControllers) { + m_ColorManager = ____colorManager; + var l_ColorType = ____noteController.noteData.colorType; if (m_BlockColorsEnabled) @@ -187,5 +191,16 @@ internal static void SetDotColorsFromConfig(NTConfig._Profile p_Profile) m_LeftCircleColor = NTConfig.Instance.Enabled ? p_Profile.DotsLColor : new Color(0.659f, 0.125f, 0.125f, 1.000f); m_RightCircleColor = NTConfig.Instance.Enabled ? p_Profile.DotsRColor : new Color(0.125f, 0.392f, 0.659f, 1.000f); } + + //////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////// + + public static Color? GetColorForSaber(SaberType p_Type) + { + if (m_ColorManager != null) + return m_ColorManager.ColorForSaberType(p_Type); + + return null; + } } } diff --git a/Modules/BeatSaberPlus_NoteTweaker/Patches/PGameNoteController.cs b/Modules/BeatSaberPlus_NoteTweaker/Patches/PGameNoteController.cs index bc360a9..ea2536f 100644 --- a/Modules/BeatSaberPlus_NoteTweaker/Patches/PGameNoteController.cs +++ b/Modules/BeatSaberPlus_NoteTweaker/Patches/PGameNoteController.cs @@ -12,6 +12,7 @@ public class PGameNoteController : GameNoteController { private static bool m_Enabled = false; private static bool m_TempEnabled = false; + private static bool m_WasTempEnabled = false; private static Vector3 m_NoteScale; private static Vector3 m_NoteInvScale; private static Vector3 m_TempNoteScale; @@ -28,18 +29,30 @@ public class PGameNoteController : GameNoteController /// BoxCuttableBySaber instance internal static void Postfix(ref GameNoteController __instance, ref BoxCuttableBySaber[] ____bigCuttableBySaberList, ref BoxCuttableBySaber[] ____smallCuttableBySaberList) { - if (!m_Enabled && !m_TempEnabled) + if (!m_Enabled && !m_TempEnabled && !m_WasTempEnabled) return; - __instance.transform.localScale = m_TempEnabled ? m_TempNoteScale : m_NoteScale; + var l_NoteScale = m_NoteScale; + var l_NoteInvScale = m_NoteInvScale; - var l_BoxScale = m_TempEnabled ? m_TempNoteInvScale : m_NoteInvScale; + if (m_TempEnabled) + { + l_NoteScale = m_TempNoteScale; + l_NoteInvScale = m_TempNoteInvScale; + } + else if (m_WasTempEnabled) + { + l_NoteScale = Vector3.one; + l_NoteInvScale = Vector3.one; + } + + __instance.transform.localScale = l_NoteScale; for (int l_I = 0; l_I < ____bigCuttableBySaberList.Length; ++l_I) - ____bigCuttableBySaberList[l_I].transform.localScale = l_BoxScale; + ____bigCuttableBySaberList[l_I].transform.localScale = l_NoteInvScale; for (int l_I = 0; l_I < ____smallCuttableBySaberList.Length; ++l_I) - ____smallCuttableBySaberList[l_I].transform.localScale = l_BoxScale; + ____smallCuttableBySaberList[l_I].transform.localScale = l_NoteInvScale; } //////////////////////////////////////////////////////////////////////////// @@ -59,7 +72,10 @@ internal static void SetFromConfig(bool p_OnSceneSwitch) m_NoteInvScale = (1f / l_NoteScale) * Vector3.one; if (p_OnSceneSwitch) + { m_TempEnabled = false; + m_WasTempEnabled = false; + } } /// /// Set temp config @@ -76,6 +92,9 @@ public static void SetTemp(bool p_Enabled, float p_Scale) m_TempEnabled = p_Enabled; m_TempNoteScale = (p_Scale) * Vector3.one; m_TempNoteInvScale = (1f / (p_Scale))* Vector3.one; + + if (p_Enabled) + m_WasTempEnabled = true; } //////////////////////////////////////////////////////////////////////////// diff --git a/Modules/BeatSaberPlus_NoteTweaker/Properties/AssemblyInfo.cs b/Modules/BeatSaberPlus_NoteTweaker/Properties/AssemblyInfo.cs index cc0059e..d98a063 100644 --- a/Modules/BeatSaberPlus_NoteTweaker/Properties/AssemblyInfo.cs +++ b/Modules/BeatSaberPlus_NoteTweaker/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("6.2.2")] -[assembly: AssemblyFileVersion("6.2.2")] +[assembly: AssemblyVersion("6.3.0")] +[assembly: AssemblyFileVersion("6.3.0")] diff --git a/Modules/BeatSaberPlus_NoteTweaker/manifest.json b/Modules/BeatSaberPlus_NoteTweaker/manifest.json index 34545a0..06cd178 100644 --- a/Modules/BeatSaberPlus_NoteTweaker/manifest.json +++ b/Modules/BeatSaberPlus_NoteTweaker/manifest.json @@ -3,12 +3,12 @@ "id": "BeatSaberPlus_NoteTweaker", "name": "BeatSaberPlus_NoteTweaker", "author": "HardCPP", - "version": "6.2.2", + "version": "6.3.0", "description": "", - "gameVersion": "1.34.2", + "gameVersion": "1.37.1", "dependsOn": { "BSIPA": "^4.3.0", - "ChatPlexSDK_BS": "^6.2.2" + "ChatPlexSDK_BS": "^6.3.0" }, "links": { "project-home": "https://discord.chatplex.org", diff --git a/Modules/BeatSaberPlus_SongChartVisualizer/BeatSaberPlus_SongChartVisualizer.csproj b/Modules/BeatSaberPlus_SongChartVisualizer/BeatSaberPlus_SongChartVisualizer.csproj index 1c05543..23cc425 100644 --- a/Modules/BeatSaberPlus_SongChartVisualizer/BeatSaberPlus_SongChartVisualizer.csproj +++ b/Modules/BeatSaberPlus_SongChartVisualizer/BeatSaberPlus_SongChartVisualizer.csproj @@ -24,14 +24,14 @@ true false bin\Debug\ - TRACE;DEBUG;BEATSABER + TRACE;DEBUG;BEATSABER;BEATSABER_1_35_0_OR_NEWER prompt 4 true bin\Release\ - BEATSABER + BEATSABER;BEATSABER_1_35_0_OR_NEWER prompt 4 @@ -49,22 +49,22 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\BeatmapCore.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\Colors.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\Core.dll False - False + + + $(BeatSaberDir)\Beat Saber_Data\Managed\DataModels.dll + False $(BeatSaberDir)\Libs\Newtonsoft.Json.dll False - False @@ -87,7 +87,6 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.AudioModule.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.CoreModule.dll @@ -96,12 +95,10 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.PhysicsModule.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.TextRenderingModule.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.UI.dll diff --git a/Modules/BeatSaberPlus_SongChartVisualizer/BeatSaberPlus_SongChartVisualizer.csproj.user b/Modules/BeatSaberPlus_SongChartVisualizer/BeatSaberPlus_SongChartVisualizer.csproj.user index 2bcbd9547e2dbf3c9b1de50a0ed26cffe2f0a25e..3fd52f1dec15af8e7e99f5b7788a2f6723814834 100644 GIT binary patch delta 27 jcmbQldW~g61S4|*gVp5ejK=K74CV}a3`UbLG9Cl~XQT&R delta 95 zcmcb{GKqCV1f#tRgB3#zLoh=LLn=ceLoS04LncEKLlKZS&8DTd1=G86z|F;Fa- kAs?tR7f9w!j%GCGHe#@3&|@%Uuwl@jY|AJ;c?;tr0P6%4ssI20 diff --git a/Modules/BeatSaberPlus_SongChartVisualizer/ChatPlexMod_SongChartVisualizer/SongChartVisualizer.cs b/Modules/BeatSaberPlus_SongChartVisualizer/ChatPlexMod_SongChartVisualizer/SongChartVisualizer.cs index c06482e..c12645d 100644 --- a/Modules/BeatSaberPlus_SongChartVisualizer/ChatPlexMod_SongChartVisualizer/SongChartVisualizer.cs +++ b/Modules/BeatSaberPlus_SongChartVisualizer/ChatPlexMod_SongChartVisualizer/SongChartVisualizer.cs @@ -237,12 +237,16 @@ private IEnumerator PrepareFloatingPanel() } var l_TransformedBeatmapData = CP_SDK_BS.Game.Logic.LevelData?.Data?.transformedBeatmapData; - var l_DifficultyBeatmap = CP_SDK_BS.Game.Logic.LevelData?.Data?.difficultyBeatmap; - var l_SongDuration = l_DifficultyBeatmap?.level?.beatmapLevelData?.audioClip?.length ?? -1f; +#if BEATSABER_1_35_0_OR_NEWER + var l_AudioClip = CP_SDK_BS.Game.Logic.LevelData?.Data?.songAudioClip; +#else + var l_AudioClip = CP_SDK_BS.Game.Logic.LevelData?.Data?.difficultyBeatmap?.level?.beatmapLevelData?.audioClip; +#endif + var l_SongDuration = l_AudioClip?.length ?? -1f; - if (l_TransformedBeatmapData == null - || l_DifficultyBeatmap == null - || l_SongDuration == -1f) + if (l_TransformedBeatmapData == null + || l_AudioClip == null + || l_SongDuration == -1f) { yield break; } @@ -306,6 +310,9 @@ private IEnumerator PrepareFloatingPanel() #endif m_ChartFloatingPanelView.SetRotationFollow(m_RootTransform, l_RotationFollow); + + if (!l_RotationFollow && m_RootTransform) + m_RootTransform.localRotation = Quaternion.identity; } /// /// When the floating panel is moved diff --git a/Modules/BeatSaberPlus_SongChartVisualizer/Properties/AssemblyInfo.cs b/Modules/BeatSaberPlus_SongChartVisualizer/Properties/AssemblyInfo.cs index f54209b..cba5bb3 100644 --- a/Modules/BeatSaberPlus_SongChartVisualizer/Properties/AssemblyInfo.cs +++ b/Modules/BeatSaberPlus_SongChartVisualizer/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("6.2.2")] -[assembly: AssemblyFileVersion("6.2.2")] +[assembly: AssemblyVersion("6.3.0")] +[assembly: AssemblyFileVersion("6.3.0")] diff --git a/Modules/BeatSaberPlus_SongChartVisualizer/manifest.json b/Modules/BeatSaberPlus_SongChartVisualizer/manifest.json index 1d23548..2d187b0 100644 --- a/Modules/BeatSaberPlus_SongChartVisualizer/manifest.json +++ b/Modules/BeatSaberPlus_SongChartVisualizer/manifest.json @@ -3,12 +3,12 @@ "id": "BeatSaberPlus_SongChartVisualizer", "name": "BeatSaberPlus_SongChartVisualizer", "author": "HardCPP", - "version": "6.2.2", + "version": "6.3.0", "description": "", - "gameVersion": "1.34.2", + "gameVersion": "1.37.1", "dependsOn": { "BSIPA": "^4.3.0", - "ChatPlexSDK_BS": "^6.2.2" + "ChatPlexSDK_BS": "^6.3.0" }, "links": { "project-home": "https://discord.chatplex.org", diff --git a/Modules/BeatSaberPlus_SongOverlay/BeatSaberPlus_SongOverlay.csproj b/Modules/BeatSaberPlus_SongOverlay/BeatSaberPlus_SongOverlay.csproj index 06aae46..f288537 100644 --- a/Modules/BeatSaberPlus_SongOverlay/BeatSaberPlus_SongOverlay.csproj +++ b/Modules/BeatSaberPlus_SongOverlay/BeatSaberPlus_SongOverlay.csproj @@ -24,15 +24,14 @@ true false bin\Debug\ - DEBUG;TRACE + TRACE;DEBUG;BEATSABER_1_35_0_OR_NEWER prompt 4 true bin\Release\ - - + BEATSABER_1_35_0_OR_NEWER prompt 4 @@ -56,17 +55,18 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\BeatmapCore.dll False - False + + + $(BeatSaberDir)\Beat Saber_Data\Managed\DataModels.dll + False $(BeatSaberDir)\Beat Saber_Data\Managed\GameplayCore.dll False - False $(BeatSaberDir)\Libs\Newtonsoft.Json.dll False - False @@ -92,7 +92,6 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.ImageConversionModule.dll False - False $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.UI.dll diff --git a/Modules/BeatSaberPlus_SongOverlay/Network/OverlayServer.cs b/Modules/BeatSaberPlus_SongOverlay/Network/OverlayServer.cs index d3977bd..1c4546b 100644 --- a/Modules/BeatSaberPlus_SongOverlay/Network/OverlayServer.cs +++ b/Modules/BeatSaberPlus_SongOverlay/Network/OverlayServer.cs @@ -273,6 +273,25 @@ private static void Logic_OnSceneChange(CP_SDK_BS.Game.Logic.ESceneType p_Scene) var l_WorkingMapInfo = m_MapInfoEvent.mapInfoChanged; var l_CoverTask = null as Task; +#if BEATSABER_1_35_0_OR_NEWER + if (l_WorkingMapInfo.level_id != l_Map.Data.beatmapLevel.levelID) + { + try { l_CoverTask = l_Map.Data.beatmapLevel.previewMediaData.GetCoverSpriteAsync(CancellationToken.None); } catch { } + + l_WorkingMapInfo.level_id = l_Map.Data.beatmapLevel.levelID; + l_WorkingMapInfo.name = l_Map.Data.beatmapLevel.songName; + l_WorkingMapInfo.sub_name = l_Map.Data.beatmapLevel.songSubName; + l_WorkingMapInfo.artist = l_Map.Data.beatmapLevel.songAuthorName; + l_WorkingMapInfo.mapper = l_Map.Data.beatmapLevel.allMappers.FirstOrDefault(); + l_WorkingMapInfo.duration = (uint)(l_Map.Data.beatmapLevel.songDuration * 1000f); + l_WorkingMapInfo.BPM = l_Map.Data.beatmapLevel.beatsPerMinute; + l_WorkingMapInfo.PP = 0f; + l_WorkingMapInfo.BSRKey = ""; + } + + l_WorkingMapInfo.characteristic = l_Map.Data.beatmapKey.beatmapCharacteristic.serializedName.ToString(); + l_WorkingMapInfo.difficulty = l_Map.Data.beatmapKey.difficulty.ToString(); +#else if (l_WorkingMapInfo.level_id != l_Map.Data.previewBeatmapLevel.levelID) { try { l_CoverTask = l_Map.Data.previewBeatmapLevel.GetCoverImageAsync(CancellationToken.None); } catch { } @@ -290,6 +309,7 @@ private static void Logic_OnSceneChange(CP_SDK_BS.Game.Logic.ESceneType p_Scene) l_WorkingMapInfo.characteristic = l_Map.Data.difficultyBeatmap.parentDifficultyBeatmapSet.beatmapCharacteristic.serializedName.ToString(); l_WorkingMapInfo.difficulty = l_Map.Data.difficultyBeatmap.difficulty.ToString(); +#endif CP_SDK.Unity.MTCoroutineStarter.Start(Coroutine_WaitForGameplayReady(l_Map.Type, l_CoverTask)); } diff --git a/Modules/BeatSaberPlus_SongOverlay/Properties/AssemblyInfo.cs b/Modules/BeatSaberPlus_SongOverlay/Properties/AssemblyInfo.cs index ec810be..279a127 100644 --- a/Modules/BeatSaberPlus_SongOverlay/Properties/AssemblyInfo.cs +++ b/Modules/BeatSaberPlus_SongOverlay/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("6.2.2")] -[assembly: AssemblyFileVersion("6.2.2")] +[assembly: AssemblyVersion("6.3.0")] +[assembly: AssemblyFileVersion("6.3.0")] diff --git a/Modules/BeatSaberPlus_SongOverlay/manifest.json b/Modules/BeatSaberPlus_SongOverlay/manifest.json index 33dd1bf..6f9727d 100644 --- a/Modules/BeatSaberPlus_SongOverlay/manifest.json +++ b/Modules/BeatSaberPlus_SongOverlay/manifest.json @@ -3,12 +3,12 @@ "id": "BeatSaberPlus_SongOverlay", "name": "BeatSaberPlus_SongOverlay", "author": "HardCPP", - "version": "6.2.2", + "version": "6.3.0", "description": "BeatSaberPlus song overlay module.", - "gameVersion": "1.34.2", + "gameVersion": "1.37.1", "dependsOn": { "BSIPA": "^4.3.0", - "ChatPlexSDK_BS": "^6.2.2" + "ChatPlexSDK_BS": "^6.3.0" }, "links": { "project-home": "https://discord.chatplex.org",