12
12
using VRCOSC . Game . ChatBox ;
13
13
using VRCOSC . Game . ChatBox . Clips ;
14
14
using VRCOSC . Game . ChatBox . Serialisation . V1 ;
15
+ using VRCOSC . Game . Config ;
15
16
using VRCOSC . Game . OSC . VRChat ;
16
17
using VRCOSC . Game . Serialisation ;
17
18
using VRCOSC . Game . Util ;
@@ -41,6 +42,7 @@ public bool SendEnabled
41
42
public readonly Dictionary < string , Dictionary < string , ClipEventMetadata > > EventMetadata = new ( ) ;
42
43
public Bindable < int > SendDelay { get ; private set ; } = null ! ;
43
44
private VRChatOscClient oscClient = null ! ;
45
+ private VRCOSCConfigManager configManager = null ! ;
44
46
private SerialisationManager serialisationManager = null ! ;
45
47
46
48
public readonly Dictionary < ( string , string ) , string ? > VariableValues = new ( ) ;
@@ -61,10 +63,11 @@ public bool SendEnabled
61
63
private DateTimeOffset nextValidTime ;
62
64
private bool isClear ;
63
65
64
- public void Initialise ( Storage storage , AppManager appManager , VRChatOscClient oscClient , Bindable < int > sendDelay )
66
+ public void Initialise ( Storage storage , AppManager appManager , VRCOSCConfigManager configManager , VRChatOscClient oscClient , Bindable < int > sendDelay )
65
67
{
66
68
this . appManager = appManager ;
67
69
this . oscClient = oscClient ;
70
+ this . configManager = configManager ;
68
71
SendDelay = sendDelay ;
69
72
serialisationManager = new SerialisationManager ( ) ;
70
73
serialisationManager . RegisterSerialiser ( 1 , new TimelineSerialiser ( storage , appManager ) ) ;
@@ -147,15 +150,20 @@ public Clip CreateClip()
147
150
148
151
public void Update ( )
149
152
{
150
- if ( sendAllowed && ! CurrentWorldExtractor . IsCurrentWorldBlacklisted )
153
+ if ( ! sendAllowed ) return ;
154
+
155
+ if ( CurrentWorldExtractor . IsCurrentWorldBlacklisted && configManager . Get < bool > ( VRCOSCSetting . ChatboxWorldBlock ) )
151
156
{
152
- appManager . ModuleManager . ChatBoxUpdate ( ) ;
157
+ if ( ! isClear ) Clear ( ) ;
158
+ return ;
159
+ }
153
160
154
- Clips . ForEach ( clip => clip . Update ( ) ) ;
155
- TriggeredEvents . Clear ( ) ;
161
+ appManager . ModuleManager . ChatBoxUpdate ( ) ;
156
162
157
- evaluateClips ( ) ;
158
- }
163
+ Clips . ForEach ( clip => clip . Update ( ) ) ;
164
+ TriggeredEvents . Clear ( ) ;
165
+
166
+ evaluateClips ( ) ;
159
167
}
160
168
161
169
public void Teardown ( )
0 commit comments