11using System . Diagnostics ;
22using System . Numerics ;
33using System . Runtime . CompilerServices ;
4+ using System . Security . Cryptography . X509Certificates ;
45using System . Text ;
56
67namespace modularDollyCam
@@ -24,6 +25,8 @@ public partial class MainForm : Form
2425 private Vector3 targetPosition ;
2526
2627 private string mapHeader ;
28+ private string theaterTime ;
29+ public float startSync ;
2730
2831 private void SetupDataGridView ( )
2932 {
@@ -77,6 +80,15 @@ public async Task MoveCamera()
7780 {
7881 int . TryParse ( StartDelayTextbox . Text , out int delaySeconds ) ;
7982
83+ if ( timesyncCheckbox . Checked == true )
84+ {
85+ while ( true )
86+ {
87+ float time = memory . ReadFloat ( theaterTime ) ;
88+ if ( time >= startSync ) break ;
89+ }
90+ }
91+
8092 if ( delaySeconds > 0 )
8193 {
8294 await Task . Delay ( delaySeconds * 1000 ) ;
@@ -225,5 +237,19 @@ public async Task getPlayerList()
225237 trackListCombo . Items . Add ( result ) ;
226238 }
227239 }
240+
241+ public async Task getCurrentTime ( )
242+ {
243+ while ( true )
244+ {
245+ float time = memory . ReadFloat ( theaterTime ) ;
246+ TimeSpan timeSpan = TimeSpan . FromSeconds ( time ) ;
247+ string formattedTime = timeSpan . ToString ( @"hh\:mm\:ss\:fff" ) ;
248+
249+ CurrentTimeTextbox . Text = formattedTime ;
250+
251+ await Task . Delay ( 1 ) ;
252+ }
253+ }
228254 }
229255}
0 commit comments