Ejemplo n.º 1
0
        internal static void middle()
        {
            var _xpv = BeatSaberUI.CreateViewController <MainViewController>();

            middleScreen.SetRootViewController(_xpv, animationType: AnimationType.In);
            middleScreen.enabled = true;
        }
Ejemplo n.º 2
0
        internal static void Previews()
        {
            var _lv = BeatSaberUI.CreateViewController <LeftPreviewViewController>();
            var _mv = BeatSaberUI.CreateViewController <MiddlePreviewViewController>();
            var _rv = BeatSaberUI.CreateViewController <RightPreviewViewController>();

            PLS.SetRootViewController(_lv, animationType: AnimationType.In);
            PLS.enabled    = true;
            PLS.HandleSide = FloatingScreen.Side.Bottom;
            PMS.SetRootViewController(_mv, animationType: AnimationType.In);
            PMS.enabled    = true;
            PMS.HandleSide = FloatingScreen.Side.Bottom;
            PRS.SetRootViewController(_rv, animationType: AnimationType.In);
            PRS.enabled    = true;
            PRS.HandleSide = FloatingScreen.Side.Bottom;
        }
Ejemplo n.º 3
0
        internal static void yeet()
        {
            var _xpv = BeatSaberUI.CreateViewController <XPScreen>();

            xpFloatingScreen.SetRootViewController(_xpv, animationType: AnimationType.None);
            xpFloatingScreen.transform.SetParent(BaseGameUiHandler.Instance.GetUIParent());
        }
Ejemplo n.º 4
0
        private static IEnumerator SetGoodRateChart_Process()
        {
            yield return(new WaitForEndOfFrame());

            Log.Write("SetFloatingDisplay Start");

            Vector3 ChartStandardLevelPosition = new Vector3(0, 0.25f, 2.25f); /* Original: 0, -0.4, 2.25 */
            Vector3 ChartStandardLevelRotation = new Vector3(35, 0, 0);

            var pos = ChartStandardLevelPosition;
            var rot = Quaternion.Euler(ChartStandardLevelRotation);

            floatingScreenForScore = FloatingScreen.CreateFloatingScreen(new Vector2(105, 65), false, pos, rot);

            floatingScreenForScore.SetRootViewController(BeatSaberUI.CreateViewController <GoodRateViewController>(), true);

            Image image = floatingScreenForScore.GetComponent <Image>();

            image.enabled = false;

            GraphContainer graph = floatingScreenForScore.gameObject.AddComponent <GraphContainer>();

            floatingScreenForScore.rootViewController.gameObject.SetActive(false);
            graph.gameObject.SetActive(false);
        }
Ejemplo n.º 5
0
        public void ShowJoinRequest(User user)
        {
            FloatingScreen screen = FloatingScreen.CreateFloatingScreen(new Vector2(100, 50), true, new Vector3(0f, 0.9f, 2.4f), Quaternion.Euler(30f, 0f, 0f));

            DiscordAskToJoinView discordView = BeatSaberUI.CreateViewController <DiscordAskToJoinView>();

            discordView.user = user;

            screen.SetRootViewController(discordView, false);
        }
Ejemplo n.º 6
0
 public MusicPlayer(HierarchyManager hierarchyManager)
 {
     _screenSystem    = hierarchyManager.GetField <ScreenSystem, HierarchyManager>("_screenSystem");
     _floatingScreen  = FloatingScreen.CreateFloatingScreen(new Vector2(120f, 35f), false, Vector3.zero, Quaternion.identity);
     _musicPlayerView = BeatSaberUI.CreateViewController <MusicPlayerView>();
     _floatingScreen.SetRootViewController(_musicPlayerView, true);
     _floatingScreen.transform.SetParent(_screenSystem.transform, false);
     _floatingScreen.transform.localPosition = new Vector3(-2.08f, 2.8f, 1.45f);
     _floatingScreen.transform.localRotation = Quaternion.Euler(new Vector3(335f, 300f, 0f));
 }
Ejemplo n.º 7
0
        public void ShowInvite(User user, Activity activity)
        {
            FloatingScreen screen = FloatingScreen.CreateFloatingScreen(new Vector2(100, 50), true, new Vector3(0f, 0.9f, 2.4f), Quaternion.Euler(30f, 0f, 0f));

            DiscordInviteResponseView discordView = BeatSaberUI.CreateViewController <DiscordInviteResponseView>();

            discordView.user     = user;
            discordView.activity = activity;

            screen.SetRootViewController(discordView, false);
        }
Ejemplo n.º 8
0
        public void Initialize()
        {
            _floatingScreen = FloatingScreen.CreateFloatingScreen(new Vector2(150f, 50f), false, _clockSettings.Position, Quaternion.Euler(_clockSettings.Rotation));
            _floatingScreen.GetComponent <VRGraphicRaycaster>().SetField("_physicsRaycaster", _physicsRaycasterWithCache);
            //_floatingScreen.GetComponent<Image>().enabled = false;
            _floatingScreen.SetRootViewController(_basicClockView, HMUI.ViewController.AnimationType.Out);

            _disabled = !_clockSettings.Enabled;
            _clockSettings.MarkDirty();
            ClockController_DateUpdated(DateTime.Now);
            _clockController.DateUpdated += ClockController_DateUpdated;
        }
 public void ShowMuteWindow()
 {
     if (MuteButtonScreen == null)
     {
         MuteButtonScreen = CreateFloatingScreen();
         MuteButtonWindow = BeatSaberUI.CreateViewController <MuteButtonWindow>();
         MuteButtonWindow.ParentCoordinator = this;
         MuteButtonScreen.SetRootViewController(MuteButtonWindow, HMUI.ViewController.AnimationType.None);
         AttachEvents();
     }
     MuteButtonScreen.gameObject.SetActive(true);
     MuteButtonWindow.UpdateMutebtnText();
 }
Ejemplo n.º 10
0
        private static IEnumerator SetDiaryButton_Process()
        {
            yield return(new WaitForEndOfFrame());

            Log.Write("SetDiaryButton Start");

            var        screenSystem = Resources.FindObjectsOfTypeAll <ScreenSystem>()[0];
            Vector3    pos          = screenSystem.rightScreen.gameObject.transform.position;
            Quaternion rot          = screenSystem.rightScreen.gameObject.transform.rotation;

            floatingScreenForDiaryButton = FloatingScreen.CreateFloatingScreen(new Vector2(40, 15), false, pos + new Vector3(1.65f, -0.82f, 0f), rot);

            floatingScreenForDiaryButton.SetRootViewController(BeatSaberUI.CreateViewController <DiaryButtonController>(), true);
        }
Ejemplo n.º 11
0
 public static void CreateUI(StatTrakData statTrak)
 {
     if (!Screen)
     {
         SelectedStatTrak = statTrak;
         Screen           = FloatingScreen.CreateFloatingScreen(new Vector2(100, 20), false, new Vector3(1.75f, 0.5f, 1f), Quaternion.Euler(0, 60, 0));
         ViewController   = BeatSaberUI.CreateViewController <StatTrakViewController>();
         Screen.SetRootViewController(ViewController, HMUI.ViewController.AnimationType.None);
     }
     else
     {
         DestroyUI(statTrak);
         CreateUI(statTrak);
     }
 }
Ejemplo n.º 12
0
        private void SetupScreens()
        {
            if (_chatScreen == null)
            {
                var screenSize = new Vector2(ChatWidth, ChatHeight);
                _chatScreen = FloatingScreen.CreateFloatingScreen(screenSize, true, ChatPosition, Quaternion.identity, 0f, true);
                var rectMask2D = _chatScreen.GetComponent <RectMask2D>();
                if (rectMask2D)
                {
                    Destroy(rectMask2D);
                }

                _chatContainer = new GameObject("chatContainer");
                _chatContainer.transform.SetParent(_chatScreen.transform, false);
                _chatContainer.AddComponent <RectMask2D>().rectTransform.sizeDelta = screenSize;

                var canvas = _chatScreen.GetComponent <Canvas>();
                canvas.sortingOrder = 3;

                _chatScreen.SetRootViewController(this, AnimationType.None);
                _rootGameObject = new GameObject();
                DontDestroyOnLoad(_rootGameObject);

                _chatMoverMaterial       = Instantiate(BeatSaberUtils.UINoGlowMaterial);
                _chatMoverMaterial.color = Color.clear;

                var renderer = _chatScreen.handle.gameObject.GetComponent <Renderer>();
                renderer.material             = _chatMoverMaterial;
                renderer.material.mainTexture = _chatMoverMaterial.mainTexture;

                _chatScreen.transform.SetParent(_rootGameObject.transform);
                _chatScreen.ScreenRotation = Quaternion.Euler(ChatRotation);

                _bg                      = _chatScreen.GetComponentInChildren <ImageView>();
                _bg.material             = Instantiate(_bg.material);
                _bg.material.mainTexture = BeatSaberUtils.UINoGlowMaterial.mainTexture;
                _bg.color                = BackgroundColor;

                AddToVRPointer();
                UpdateChatUI();
            }
        }
Ejemplo n.º 13
0
 private void SetupScreens()
 {
     if (_chatScreen == null)
     {
         _chatScreen = FloatingScreen.CreateFloatingScreen(new Vector2(ChatWidth, ChatHeight), true, ChatPosition, Quaternion.Euler(ChatRotation));
         var canvas = _chatScreen.GetComponent <Canvas>();
         canvas.sortingOrder = 3;
         _chatScreen.SetRootViewController(this, true);
         _rootGameObject = new GameObject();
         DontDestroyOnLoad(_rootGameObject);
         _chatMoverMaterial       = Instantiate(BeatSaberUtils.UINoGlowMaterial);
         _chatMoverMaterial.color = Color.clear;
         var renderer = _chatScreen.handle.gameObject.GetComponent <Renderer>();
         renderer.material = _chatMoverMaterial;
         _chatScreen.transform.SetParent(_rootGameObject.transform);
         _bg          = _chatScreen.gameObject.GetComponent <UnityEngine.UI.Image>();
         _bg.material = Instantiate(BeatSaberUtils.UINoGlowMaterial);
         _bg.color    = BackgroundColor;
         AddToVRPointer();
     }
 }
Ejemplo n.º 14
0
        public void ShowTeamSelection()
        {
            FloatingScreen screen = FloatingScreen.CreateFloatingScreen(new Vector2(100, 50), false, new Vector3(0f, 0.9f, 2.4f), Quaternion.Euler(30f, 0f, 0f));

            screen.SetRootViewController(_teamSelection, false);
        }
        public void Initialize()
        {
            var is360Level = _beatmapData.spawnRotationEventsCount > 0;
            var pos        = is360Level ? _config.Chart360LevelPosition : _config.ChartStandardLevelPosition;
            var rot        = is360Level
                                ? Quaternion.Euler(_config.Chart360LevelRotation)
                                : Quaternion.Euler(_config.ChartStandardLevelRotation);

            _floatingScreen = FloatingScreen.CreateFloatingScreen(_config.ChartSize, false, pos, rot, curvatureRadius: 0f, hasBackground: _config.HasBackground);
            _floatingScreen.SetRootViewController(this, AnimationType.None);
            _floatingScreen.name = nameof(SongChartVisualizer);

            if (_config.HasBackground)
            {
                var imageView = _floatingScreen.GetComponentInChildren <ImageView>();
                imageView.material = _assetLoader.UINoGlowMaterial;
                imageView.color    = _config.CombinedBackgroundColor;

                transform.SetParent(imageView.transform);
            }

            if (_audioTimeSyncController.songLength < 0)
            {
                _shouldNotRunTick = true;
                return;
            }

            // _siraLog.Debug($"There are {_beatmapData.beatmapObjectsData.Count(x => x.beatmapObjectType == BeatmapObjectType.Note)} notes");
            // _siraLog.Debug($"There are {_beatmapData.beatmapLinesData.Count} lines");

            _npsSections = GetNpsSections(_beatmapData);
#if DEBUG
            for (var i = 0; i < _npsSections.Count; i++)
            {
                var npsInfos = _npsSections[i];
                _siraLog.Debug($"Nps at section {i + 1}: {npsInfos.Nps} (from [{npsInfos.FromTime}] to [{npsInfos.ToTime}])");
            }
#endif

            _siraLog.Debug("Loading assetbundle..");
            var assembly = Assembly.GetExecutingAssembly();
            using (var stream = assembly.GetManifestResourceStream("SongChartVisualizer.UI.linegraph"))
            {
                _assetBundle = AssetBundle.LoadFromStream(stream);
            }

            if (!_assetBundle)
            {
                _siraLog.Warn("Failed to load AssetBundle! The chart will not work properly..");
            }
            else
            {
                var prefab = _assetBundle.LoadAsset <GameObject>("LineGraph");
                var sprite = _assetBundle.LoadAsset <Sprite>("Circle");
                var go     = Instantiate(prefab, transform);

                go.transform.Translate(0.04f, 0, 0);
                _windowGraph = go.AddComponent <WindowGraph>();
                _windowGraph.circleSprite          = sprite;
                _windowGraph.transform.localScale /= 10;
                var npsValues = _npsSections.Select(info => info.Nps).ToList();
                _windowGraph.ShowGraph(npsValues, false, linkColor: _config.LineColor);

                _currentSectionIdx = 0;
                _currentSection    = _npsSections[_currentSectionIdx];

                CreateSelfCursor(_config.PointerColor);

                if (_config.PeakWarning)
                {
                    var highestValue = _npsSections.Max(info => info.Nps);
                    _hardestSectionIdx = _npsSections.FindIndex(info => Math.Abs(info.Nps - highestValue) < 0.001f);
                    PrepareWarningText();

                    FadeInTextIfNeeded();
                }
            }
        }