Exemplo n.º 1
0
        private void InitializeAdditionalScreens(bool forceReinit = false)
        {
            if (!PluginConfig.DisableSearch || !PluginConfig.DisableFilters)
            {
                Logger.log.Debug("Creating button panel");
                ButtonPanel.instance.Setup(forceReinit);
            }
            else
            {
                Logger.log.Debug("Disabling button panel");
                if (ButtonPanel.IsSingletonAvailable)
                {
                    ButtonPanel.instance.DisablePanel();
                }
            }

            ButtonPanel.instance.SearchButtonPressed      -= SearchButtonPressed;
            ButtonPanel.instance.FilterButtonPressed      -= FilterButtonPressed;
            ButtonPanel.instance.ClearFilterButtonPressed -= ClearButtonPressed;

            ButtonPanel.instance.SearchButtonPressed      += SearchButtonPressed;
            ButtonPanel.instance.FilterButtonPressed      += FilterButtonPressed;
            ButtonPanel.instance.ClearFilterButtonPressed += ClearButtonPressed;

            _bottomScreen = new BottomScreen();
            _bottomScreen.SortButtonPressed        += SortButtonPressed;
            _bottomScreen.QuickFilterApplied       += ApplyQuickFilterPressed;
            _bottomScreen.ReportIssueButtonPressed += ReportButtonPressed;

            _uiAdditions = LevelSelectionNavigationController.gameObject.AddComponent <SongListUIAdditions>();
            _uiAdditions.ConfirmDeleteButtonPressed += ConfirmDeleteButtonPressed;

            LevelSelectionNavigationController.didActivateEvent += delegate(bool firstActivation, ViewController.ActivationType activationType)
            {
                if (ButtonPanel.IsSingletonAvailable)
                {
                    ButtonPanel.instance.ShowPanel();
                }
                _bottomScreen.ShowScreen();
            };
            LevelSelectionNavigationController.didDeactivateEvent += delegate(ViewController.DeactivationType deactivationType)
            {
                if (ButtonPanel.IsSingletonAvailable)
                {
                    ButtonPanel.instance.HidePanel();
                }
                _bottomScreen.HideScreen();
            };
        }
 private void Awake()
 {
     Instance = this;
 }