Skip to content

Commit ce8e744

Browse files
committed
WIP
1 parent 47224ba commit ce8e744

24 files changed

Lines changed: 4259 additions & 2147 deletions

API.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- [SubtitleManager.IsLocked(): bool](#subtitlemanagerislocked-bool)
1111
- [SubtitleManager.IsPrivilegedUser(): bool](#subtitlemanagerisprivilegeduser-bool)
1212
- [SubtitleManager.IsSyncedURL(): bool](#subtitlemanagerissyncedurl-bool)
13-
- [SubtitleManager.LoadTranslationFile(TextAsset): void](#subtitlemanagerloadtranslationfiletextasset-void)
13+
- [SubtitleManager.LoadStringsFile(TextAsset): void](#subtitlemanagerloadstringsfiletextasset-void)
1414
- [SubtitleManager.ProcessInput(string): void](#subtitlemanagerprocessinputstring-void)
1515
- [SubtitleManager.ProcessURLInput(VRCUrl): void](#subtitlemanagerprocessurlinputvrcurl-void)
1616
- [SubtitleManager.RegisterCallbackReceiver(UdonSharpBehaviour): void](#subtitlemanagerregistercallbackreceiverudonsharpbehaviour-void)
@@ -19,7 +19,9 @@
1919
- [SubtitleManager.SetLocal(bool): void](#subtitlemanagersetlocalbool-void)
2020
- [SubtitleManager.SetLocked(bool): void](#subtitlemanagersetlockedbool-void)
2121
- [SubtitleManager.SetTimeOffset(float): void](#subtitlemanagersettimeoffsetfloat-void)
22+
- [SubtitleManager.SetOverlayHandler(SubtitleOverlayHandler): void](#subtitlemanagersetoverlayhandlersubtitleoverlayhandler-void)
2223
- [SubtitleManager.SetVideoPlayers(BaseVRCVideoPlayer\[\]): void](#subtitlemanagersetvideoplayersbasevrcvideoplayer-void)
24+
- [SubtitleManager.SynchronizeSettings(SubtitleControlHandler|null): void](#subtitlemanagersynchronizesettingssubtitlecontrolhandlernull-void)
2325
- [SubtitleManager.SynchronizeSubtitles(): void](#subtitlemanagersynchronizesubtitles-void)
2426
- [SubtitleManager.UnregisterCallbackReceiver(UdonSharpBehaviour): void](#subtitlemanagerunregistercallbackreceiverudonsharpbehaviour-void)
2527
- [SubtitleControlHandler](#subtitlecontrolhandler)
@@ -99,10 +101,10 @@ Check if URL was synced or not
99101

100102
- If this returns `false` and `SubtitleManager.IsSynchronized()` is `true` then subtitles from pasted text are used
101103

102-
### SubtitleManager.LoadTranslationFile(TextAsset): void
104+
### SubtitleManager.LoadStringsFile(TextAsset): void
103105

104106
Load translation from JSON file (hardcoded status messages only).
105-
You can also assign a file to `SubtitleManager.translationFile` variable in the inspector which will be loaded on start.
107+
You can also assign a file to `SubtitleManager.stringsFile` variable in the inspector which will be loaded on start.
106108
_You will have to use a 3rd-party tool to translate the interface part of the prefab._
107109

108110
<details>
@@ -182,6 +184,7 @@ public class CallbackReceiver : UdonSharpBehaviour
182184
| `OnUSharpVideoSubtitlesLockChange` | Lock state has changed (on/off) |
183185
| `OnUSharpVideoSubtitlesTimeOffsetChange` | Time offset value has changed |
184186
| `OnUSharpVideoSubtitlesVideoPlayerChange` | Video player reference has changed |
187+
| `OnUSharpVideoSubtitlesOverlayChange` | Overlay handler reference has changed |
185188
| `OnUSharpVideoSubtitlesOwnershipChange` | Owner has changed |
186189
| `OnUSharpVideoSubtitlesSettingsUpdate` | User has changed any setting (called by `SubtitleControlHandler` and `SetTimeOffset()`) |
187190

@@ -210,14 +213,23 @@ Change lock state, must be executed by the Master
210213

211214
### SubtitleManager.SetTimeOffset(float): void
212215

213-
Set time offset value
216+
Set time offset value
217+
You should also call `SubtitleManager.SynchronizeSettings()` after to push the changes to the UI
218+
219+
### SubtitleManager.SetOverlayHandler(SubtitleOverlayHandler): void
220+
221+
Set overlay handler to use
214222

215223
### SubtitleManager.SetVideoPlayers(BaseVRCVideoPlayer[]): void
216224

217225
Use this to change the video player references that the subtitles are synced with
218226

219227
- Does nothing when using **USharpVideo**
220228

229+
### SubtitleManager.SynchronizeSettings(SubtitleControlHandler|null): void
230+
231+
Use this to update settings on all connected instances of `SubtitleControlHandler`
232+
221233
### SubtitleManager.SynchronizeSubtitles(): void
222234

223235
Re-synchronizes the subtitles globally, only the person who loaded them can do this (or the master after the synchronization is finished) - this can change when that person leaves the instance or lock state changes - check the `SubtitleManager.gameObject` owner in this case
@@ -254,6 +266,8 @@ Toggle settings popup, use this to show and hide the popup using separate button
254266

255267
### Styling methods
256268

269+
You should call `SubtitleManager.SynchronizeSettings()` after making styling changes on the overlay to push the changes to the UI
270+
257271
<details>
258272
<summary>List of styling methods</summary>
259273

0 commit comments

Comments
 (0)