예제 #1
0
        /// <summary>
        /// Event called from dropdown context when a menu iten has been selected.
        /// </summary>
        private void OnDropdownSelection(DropdownData data)
        {
            if (mapsetForDropdown == null)
            {
                return;
            }

            int action = (int)data.ExtraData;

            switch (action)
            {
            case SongDeleteAction:
                bool   preferUnicode = PreferUnicode.Value;
                string artist        = mapsetForDropdown.Metadata.GetArtist(preferUnicode);
                string title         = mapsetForDropdown.Metadata.GetTitle(preferUnicode);
                // Confirm with the user first.
                var dialogModel = OverlayNavigator.Show <DialogOverlay>().Model;
                dialogModel.SetMessage($"Are you sure you want to delete this mapset?\n{artist} - {title}");
                dialogModel.AddConfirmCancel(
                    onConfirm: () => MapManager.DeleteMapset(mapsetForDropdown)
                    );
                break;

            case SongOffsetAction:
                var offsetsModel = OverlayNavigator.Show <OffsetsOverlay>().Model;
                offsetsModel.SetMap(mapsetForDropdown);
                break;
            }
        }
예제 #2
0
 /// <summary>
 /// Navigates away toward game screen.
 /// </summary>
 public void NavigateToGame()
 {
     ScreenNavigator.Hide <PrepareScreen>();
     OverlayNavigator.Show <GameLoadOverlay>().Model.StartLoad(new GameParameter()
     {
         Map = SelectedMap.Value,
     });
 }
예제 #3
0
        /// <summary>
        /// Shows the dialog overlay.
        /// </summary>
        private void ShowDialogOverlay()
        {
            var overlay = OverlayNavigator.Show <DialogOverlay>();

            // Hide the pause overlay when the dialog closes.
            overlay.OnHide += OnDialogOverlayHide;

            dialogModel = overlay.Model;
        }
예제 #4
0
        /// <summary>
        /// Event called on selecting offset option.
        /// </summary>
        private void OnOffsetOption()
        {
            // Show the offset overlay.
            OffsetsOverlay overlay = OverlayNavigator.Show <OffsetsOverlay>();

            // Bind temporary hide event listener to overlay.
            EventBinder <Action> closeBinder = new EventBinder <Action>(
                e => overlay.OnHide += e,
                e => overlay.OnHide -= e
                );

            closeBinder.IsOneTime = true;

            // Show pause overlay once the offset overlay has been closed.
            closeBinder.SetHandler(() => OverlayNavigator.Show <PauseOverlay>());
        }
예제 #5
0
        /// <summary>
        /// Shows the home menu overlay.
        /// </summary>
        public void ShowHomeMenuOverlay()
        {
            if (isHomeMenuShown.Value)
            {
                return;
            }

            var homeMenuOverlay = OverlayNavigator.Show <HomeMenuOverlay>();

            if (homeMenuOverlay != null)
            {
                isHomeMenuShown.Value = true;
                BgOverlay.Color       = Color.gray;

                homeMenuOverlay.OnHide += OnHomeMenuHide;
            }
        }
예제 #6
0
        /// <summary>
        /// Returns the appropriate menu overlay for the specified type.
        /// </summary>
        private INavigationView GetMenuFor(MenuType type)
        {
            switch (type)
            {
            case MenuType.Music: return(OverlayNavigator.Show <MusicMenuOverlay>());

            case MenuType.Notification: return(OverlayNavigator.Show <NotificationMenuOverlay>());

            case MenuType.Profile: return(OverlayNavigator.Show <ProfileMenuOverlay>());

            case MenuType.Mode: return(OverlayNavigator.Show <ModeMenuOverlay>());

            case MenuType.Quick: return(OverlayNavigator.Show <QuickMenuOverlay>());

            case MenuType.Settings: return(OverlayNavigator.Show <SettingsMenuOverlay>());
            }
            return(null);
        }
예제 #7
0
        public void InvokePause()
        {
            if (IsPaused)
            {
                return;
            }
            if (GameProcessor.CurrentTime < 0f)
            {
                return;
            }
            if (MusicController.IsPlaying)
            {
                MusicController.Pause();
            }

            var pauseOverlay = OverlayNavigator.Show <PauseOverlay>();

            IsPaused = true;
            OnPause?.Invoke();
        }
예제 #8
0
        /// <summary>
        /// Shows the map actions dialog overlay.
        /// </summary>
        public void ShowMapActions(IOriginalMap map)
        {
            if (map == null)
            {
                Logger.LogWarning("Attempted to show map actions for a null map.");
                return;
            }

            var dialogModel = OverlayNavigator.Show <DialogOverlay>().Model;

            dialogModel.SetMessage($"Select an action for the version ({map.Detail.Version})");
            dialogModel.AddOption(new DialogOption()
            {
                Callback = () => OnMapActionDelete(map),
                Label    = "Delete",
                Color    = ColorPreset.Warning
            });
            dialogModel.AddOption(new DialogOption()
            {
                Label = "Cancel",
                Color = ColorPreset.Negative
            });
        }
 /// <summary>
 /// Navigates away to the next view.
 /// </summary>
 public void NavigateToNext()
 {
     OverlayNavigator.Show <SystemOverlay>();
     OverlayNavigator.Show <BackgroundOverlay>();
     ScreenNavigator.Show <HomeScreen>();
 }
 private IEnumerator AssignSettingsData()
 {
     overlay = OverlayNavigator.Show<SettingsMenuOverlay>();
     overlay.Model.SetSettingsData(settingsData);
     yield break;
 }
예제 #11
0
 /// <summary>
 /// Shows the offset overlay for current selection.
 /// </summary>
 public void ShowOffset() => OverlayNavigator.Show <OffsetsOverlay>();