@@ -78,7 +78,7 @@ protected override void OnEnable()
7878 CP_SDK . ChatPlexSDK . OnGenericSceneChange += ChatPlexSDK_OnGenericSceneChange ;
7979
8080 /// If we are already in menu scene, activate
81- if ( CP_SDK . ChatPlexSDK . ActiveGenericScene == CP_SDK . ChatPlexSDK . EGenericScene . Menu )
81+ if ( CP_SDK . ChatPlexSDK . ActiveGenericScene == CP_SDK . EGenericScene . Menu )
8282 ChatPlexSDK_OnGenericSceneChange ( CP_SDK . ChatPlexSDK . ActiveGenericScene ) ;
8383
8484 if ( ! m_ChatCoreAcquired )
@@ -227,16 +227,22 @@ private void ChatPlexSDK_OnGenericMenuSceneLoaded()
227227 /// When the active scene is changed
228228 /// </summary>
229229 /// <param name="p_SceneType"></param>
230- private void ChatPlexSDK_OnGenericSceneChange ( CP_SDK . ChatPlexSDK . EGenericScene p_SceneType )
230+ private void ChatPlexSDK_OnGenericSceneChange ( CP_SDK . EGenericScene p_SceneType )
231231 {
232232 if ( m_RootTransform )
233233 m_RootTransform . transform . localScale = Vector3 . one ;
234234
235- if ( p_SceneType == CP_SDK . ChatPlexSDK . EGenericScene . Menu )
235+ if ( p_SceneType == CP_SDK . EGenericScene . Menu )
236236 UpdateButton ( ) ;
237237
238238 if ( m_ChatFloatingPanel == null ) CreateFloatingPanels ( ) ;
239239 else UpdateFloatingPanels ( ) ;
240+
241+ #if DANCEDASH
242+ var l_Player = Component . FindObjectsOfType < GameObject > ( ) . FirstOrDefault ( x => x . activeSelf && x . transform . parent == null && x . name == "Player" ) ;
243+ if ( l_Player )
244+ m_RootTransform . position = l_Player . transform . position ;
245+ #endif
240246 }
241247 /// <summary>
242248 /// When the floating window is moved
@@ -291,7 +297,7 @@ private IEnumerator CreateButtonCoroutine()
291297 yield return l_Waiter ;
292298 }
293299
294- m_ModerationButton = BeatSaberPlus . SDK . UI . Button . Create ( l_LevelSelectionNavigationController . transform , "Chat\n Moderation" , ( ) => UI . ModerationViewFlowCoordinator . Instance ( ) . Present ( ) , null ) ;
300+ m_ModerationButton = CP_SDK_BS . UI . Button . Create ( l_LevelSelectionNavigationController . transform , "Chat\n Moderation" , ( ) => UI . ModerationViewFlowCoordinator . Instance ( ) . Present ( ) , null ) ;
295301 m_ModerationButton . transform . localPosition = new Vector3 ( 72.50f , 27.00f , 2.60f ) ;
296302 m_ModerationButton . transform . localScale = new Vector3 ( 0.65f , 0.50f , 0.65f ) ;
297303 m_ModerationButton . transform . SetAsFirstSibling ( ) ;
@@ -309,7 +315,7 @@ private IEnumerator CreateButtonCoroutine()
309315 UpdateButton ( ) ;
310316
311317 m_CreateButtonCoroutine = null ;
312- #elif UNITY_TESTING || SYNTHRIDERS || AUDIOTRIP || BOOMBOX
318+ #elif UNITY_TESTING || SYNTHRIDERS || AUDIOTRIP || BOOMBOX || DANCEDASH
313319 yield return null ;
314320#else
315321#error Missing game implementation
@@ -326,7 +332,7 @@ internal void UpdateButton()
326332#if BEATSABER
327333 m_ModerationButton . transform . localPosition = new Vector3 ( 72.50f , 27.00f , 2.60f ) ;
328334 m_ModerationButton . transform . localScale = new Vector3 ( 0.65f , 0.50f , 0.65f ) ;
329- #elif UNITY_TESTING || SYNTHRIDERS || AUDIOTRIP || BOOMBOX
335+ #elif UNITY_TESTING || SYNTHRIDERS || AUDIOTRIP || BOOMBOX || DANCEDASH
330336#else
331337#error Missing game implementation
332338#endif
@@ -362,15 +368,15 @@ private void CreateFloatingPanels()
362368 m_ChatFloatingPanel . SetRadius ( 0 ) ;
363369 m_ChatFloatingPanel . SetViewController ( m_ChatFloatingPanelView ) ;
364370 m_ChatFloatingPanel . OnRelease ( OnFloatingWindowMoved ) ;
365- m_ChatFloatingPanel . SetSceneTransform ( CP_SDK . ChatPlexSDK . EGenericScene . Menu , CConfig . Instance . MenuChatPosition , CConfig . Instance . MenuChatRotation ) ;
366- m_ChatFloatingPanel . SetSceneTransform ( CP_SDK . ChatPlexSDK . EGenericScene . Menu , CConfig . Instance . PlayingChatPosition , CConfig . Instance . PlayingChatRotation ) ;
367- m_ChatFloatingPanel . OnSceneRelease ( CP_SDK . ChatPlexSDK . EGenericScene . Menu , ( p_LocalPosition , p_LocalRotation ) =>
371+ m_ChatFloatingPanel . SetSceneTransform ( CP_SDK . EGenericScene . Menu , CConfig . Instance . MenuChatPosition , CConfig . Instance . MenuChatRotation ) ;
372+ m_ChatFloatingPanel . SetSceneTransform ( CP_SDK . EGenericScene . Menu , CConfig . Instance . PlayingChatPosition , CConfig . Instance . PlayingChatRotation ) ;
373+ m_ChatFloatingPanel . OnSceneRelease ( CP_SDK . EGenericScene . Menu , ( p_LocalPosition , p_LocalRotation ) =>
368374 {
369375 CConfig . Instance . MenuChatPosition = p_LocalPosition ;
370376 CConfig . Instance . MenuChatRotation = p_LocalRotation ;
371377 CConfig . Instance . Save ( ) ;
372378 } ) ;
373- m_ChatFloatingPanel . OnSceneRelease ( CP_SDK . ChatPlexSDK . EGenericScene . Playing , ( p_LocalPosition , p_LocalRotation ) =>
379+ m_ChatFloatingPanel . OnSceneRelease ( CP_SDK . EGenericScene . Playing , ( p_LocalPosition , p_LocalRotation ) =>
374380 {
375381 CConfig . Instance . PlayingChatPosition = p_LocalPosition ;
376382 CConfig . Instance . PlayingChatRotation = p_LocalRotation ;
@@ -480,10 +486,10 @@ internal void UpdateFloatingPanels()
480486 m_ChatFloatingPanel . SetSize ( CConfig . Instance . ChatSize ) ;
481487 m_ChatFloatingPanel . SetAlignWithFloor ( CConfig . Instance . AlignWithFloor ) ;
482488 m_ChatFloatingPanel . SetBackgroundColor ( CConfig . Instance . BackgroundColor ) ;
483- m_ChatFloatingPanel . SetSceneTransform ( CP_SDK . ChatPlexSDK . EGenericScene . Menu , CConfig . Instance . MenuChatPosition , CConfig . Instance . MenuChatRotation ) ;
484- m_ChatFloatingPanel . SetSceneTransform ( CP_SDK . ChatPlexSDK . EGenericScene . Playing , CConfig . Instance . PlayingChatPosition , CConfig . Instance . PlayingChatRotation ) ;
489+ m_ChatFloatingPanel . SetSceneTransform ( CP_SDK . EGenericScene . Menu , CConfig . Instance . MenuChatPosition , CConfig . Instance . MenuChatRotation ) ;
490+ m_ChatFloatingPanel . SetSceneTransform ( CP_SDK . EGenericScene . Playing , CConfig . Instance . PlayingChatPosition , CConfig . Instance . PlayingChatRotation ) ;
485491
486- if ( CP_SDK . ChatPlexSDK . ActiveGenericScene == CP_SDK . ChatPlexSDK . EGenericScene . Menu )
492+ if ( CP_SDK . ChatPlexSDK . ActiveGenericScene == CP_SDK . EGenericScene . Menu )
487493 m_ChatFloatingPanel . SetGearIcon ( CConfig . Instance . ReverseChatOrder ? CP_SDK . UI . Components . CFloatingPanel . ECorner . BottomLeft : CP_SDK . UI . Components . CFloatingPanel . ECorner . TopLeft ) ;
488494 else
489495 m_ChatFloatingPanel . SetGearIcon ( CP_SDK . UI . Components . CFloatingPanel . ECorner . None ) ;
@@ -495,11 +501,11 @@ internal void UpdateFloatingPanels()
495501
496502 /// Prepare data for level with rotations
497503#if BEATSABER
498- var l_Is360Level = BeatSaberPlus . SDK . Game . Logic . LevelData ? . Data ? . transformedBeatmapData ? . spawnRotationEventsCount > 0 ;
504+ var l_Is360Level = CP_SDK_BS . Game . Logic . LevelData ? . Data ? . transformedBeatmapData ? . spawnRotationEventsCount > 0 ;
499505 var l_RotationRef = l_Is360Level ? Resources . FindObjectsOfTypeAll < FlyingGameHUDRotation > ( ) . FirstOrDefault ( ) ? . gameObject : null as GameObject ;
500506#elif SYNTHRIDERS
501507 var l_RotationRef = Resources . FindObjectsOfTypeAll < GameObject > ( ) . FirstOrDefault ( x => x . name == "[Score & Misc]" ) ;
502- #elif UNITY_TESTING || AUDIOTRIP || BOOMBOX
508+ #elif UNITY_TESTING || AUDIOTRIP || BOOMBOX || DANCEDASH
503509 var l_RotationRef = null as GameObject ;
504510#else
505511#error Missing game implementation
0 commit comments