Skip to content

Commit

Permalink
Allow health and accessibility modules through the blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
VolcanicArts committed Feb 20, 2024
1 parent bfb8a96 commit 42f8828
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions VRCOSC.Game/Managers/ChatBoxManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public bool SendEnabled
private DateTimeOffset nextValidTime;
private bool isClear;

private List<string> worldBlacklistModuleBlocklist = new() { "afktrackermodule", "clockmodule", "countermodule", "exchangeratemodule", "hardwarestatsmodule", "mediamodule", "openvrstatisticsmodule", "openvrcontrollerstatisticsmodule", "tickertapemodule", "timermodule", "weathermodule" };

public void Initialise(Storage storage, AppManager appManager, VRCOSCConfigManager configManager, VRChatOscClient oscClient, Bindable<int> sendDelay)
{
this.appManager = appManager;
Expand Down Expand Up @@ -152,12 +154,6 @@ public void Update()
{
if (!sendAllowed) return;

if (CurrentWorldExtractor.IsCurrentWorldBlacklisted && configManager.Get<bool>(VRCOSCSetting.ChatboxWorldBlock))
{
if (!isClear) Clear();
return;
}

appManager.ModuleManager.ChatBoxUpdate();

Clips.ForEach(clip => clip.Update());
Expand Down Expand Up @@ -199,6 +195,19 @@ public void SetTimelineLength(TimeSpan newTime)
private void evaluateClips()
{
var validClip = getValidClip();

if (CurrentWorldExtractor.IsCurrentWorldBlacklisted && configManager.Get<bool>(VRCOSCSetting.ChatboxWorldBlock) && validClip is not null)
{
var blockedFromSending = validClip.AssociatedModules.Any(moduleId => worldBlacklistModuleBlocklist.Contains(moduleId));

if (blockedFromSending)
{
handleClip(null);
nextValidTime += TimeSpan.FromMilliseconds(SendDelay.Value);
return;
}
}

handleClip(validClip);
nextValidTime += TimeSpan.FromMilliseconds(SendDelay.Value);
}
Expand Down

0 comments on commit 42f8828

Please sign in to comment.