diff --git a/Modules/BeatSaberPlus_ChatRequest/CRConfig.cs b/Modules/BeatSaberPlus_ChatRequest/CRConfig.cs index 38f5056..bee874d 100644 --- a/Modules/BeatSaberPlus_ChatRequest/CRConfig.cs +++ b/Modules/BeatSaberPlus_ChatRequest/CRConfig.cs @@ -166,7 +166,7 @@ internal enum EPermission internal EPermission RemoveCommandPermissions = EPermission.Moderators; [JsonProperty] internal bool RemoveCommandEnabled = true; [JsonProperty] internal string RemoveCommand = "remove"; - [JsonProperty] internal string RemoveCommand_OK = $"@$UserName (bsr $BSRKey) $SongName / $LevelAuthorName request by @RequesterName is removed from queue!"; + [JsonProperty] internal string RemoveCommand_OK = $"@$UserName (bsr $BSRKey) $SongName / $LevelAuthorName request by @$RequesterName is removed from queue!"; [JsonProperty] internal string RemoveCommand_NotFound = $"@$UserName No song in queue found with the key or username \"$Subject\"!"; [JsonProperty, JsonConverter(typeof(StringEnumConverter))] @@ -279,6 +279,9 @@ protected override void OnInit(bool p_OnCreation) if (Commands != null && !Commands.LinkCommand_CurrentSong.Contains("$SongLink")) Commands.LinkCommand_CurrentSong += " $SongLink"; + + if (Commands != null && Commands.RemoveCommand_OK.Contains("@RequesterName")) + Commands.RemoveCommand_OK = Commands.RemoveCommand_OK.Replace("@RequesterName", "@$RequesterName"); } } } diff --git a/Modules/BeatSaberPlus_ChatRequest/ChatRequest.cs b/Modules/BeatSaberPlus_ChatRequest/ChatRequest.cs index 55932d8..39f536c 100644 --- a/Modules/BeatSaberPlus_ChatRequest/ChatRequest.cs +++ b/Modules/BeatSaberPlus_ChatRequest/ChatRequest.cs @@ -231,6 +231,8 @@ private void OnSceneChange(CP_SDK_BS.Game.Logic.ESceneType p_Scene) else m_LastPlayingLevelResponse = $"{l_CurrentMap.songName} by {l_Mapper}"; + m_LastPlayingLevelResponseLink = ""; + if (CP_SDK_BS.Game.Levels.LevelID_IsCustom(l_CurrentMap.levelID) && CP_SDK_BS.Game.Levels.TryGetHashFromLevelID(l_CurrentMap.levelID, out var l_Hash)) { var l_CachedEntry = null as Models.SongEntry; diff --git a/Modules/BeatSaberPlus_ChatRequest/ChatRequest_Logic.cs b/Modules/BeatSaberPlus_ChatRequest/ChatRequest_Logic.cs index f771e8a..90cf01d 100644 --- a/Modules/BeatSaberPlus_ChatRequest/ChatRequest_Logic.cs +++ b/Modules/BeatSaberPlus_ChatRequest/ChatRequest_Logic.cs @@ -91,13 +91,6 @@ public void AddToQueueFromBSRKey( l_ForceAllow = true; } - /// Check if already requested - if (!asModAdd && m_RequestedThisSessionID.Contains(bsrKey.ToLower())) - { - callback?.Invoke(new Models.AddToQueueResult(Models.EAddToQueueResult.AlreadyRequestedThisSession, bsrKey)); - return; - } - /// Check if allow listed or blocklisted if (!asModAdd && !l_ForceAllow) { @@ -128,6 +121,13 @@ public void AddToQueueFromBSRKey( l_RateLimit.CurrentRequestCount = SongQueue.Where(x => x.RequesterName == requester.UserName).Count(); } + /// Check if already requested + if (!asModAdd && m_RequestedThisSessionID.Contains(bsrKey.ToLower())) + { + callback?.Invoke(new Models.AddToQueueResult(Models.EAddToQueueResult.AlreadyRequestedThisSession, bsrKey)); + return; + } + /// Handle limits and title prefix if (requester != null) { @@ -203,13 +203,6 @@ public void AddToQueueFromBeatmapLevel( l_ForceAllow = true; } - /// Check if already requested - if (!asModAdd && m_RequestedThisSessionHash.Contains(l_LevelHash)) - { - callback?.Invoke(new Models.AddToQueueResult(Models.EAddToQueueResult.AlreadyRequestedThisSession, l_LevelHash)); - return; - } - /// Check if allow listed or blocklisted if (!asModAdd && !l_ForceAllow) { @@ -240,6 +233,13 @@ public void AddToQueueFromBeatmapLevel( l_RateLimit.CurrentRequestCount = SongQueue.Where(x => x.RequesterName == requester.UserName).Count(); } + /// Check if already requested + if (!asModAdd && m_RequestedThisSessionHash.Contains(l_LevelHash)) + { + callback?.Invoke(new Models.AddToQueueResult(Models.EAddToQueueResult.AlreadyRequestedThisSession, l_LevelHash)); + return; + } + /// Handle limits and title prefix if (requester != null) { @@ -576,6 +576,8 @@ public void ToggleQueueStatus() if (UI.ManagerLeftView.CanBeUpdated) UI.ManagerLeftView.Instance.UpdateQueueStatus(); + if (UI.ManagerMainView.CanBeUpdated) + UI.ManagerMainView.Instance.RebuiltTitle(); }); } ///