예제 #1
0
        /// <summary>
        /// </summary>
        private void CreateHeader()
        {
            HeaderContainer = new Sprite
            {
                Parent = ContentContainer,
                Size   = new ScalableVector2(ContentContainer.Width, 45),
                Tint   = ColorHelper.HexToColor($"#212121")
            };

            var headerFlag = new Sprite()
            {
                Parent = HeaderContainer,
                Size   = new ScalableVector2(5, HeaderContainer.Height),
                Tint   = Color.LightGray,
                Alpha  = 0
            };

            var headerText = new SpriteText(Fonts.Exo2Medium, "Options Menu", 16)
            {
                Parent    = HeaderContainer,
                Alignment = Alignment.MidLeft,
                X         = headerFlag.X + 15
            };

            var exitButton = new ImageButton(FontAwesome.Get(FontAwesomeIcon.fa_times), (sender, args) => DialogManager.Dismiss())
            {
                Parent    = HeaderContainer,
                Alignment = Alignment.MidRight,
                Size      = new ScalableVector2(25, 25)
            };

            exitButton.X -= exitButton.Width / 2f + 5;
        }
예제 #2
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            if (AudioEngine.Track != null)
            {
                if (AudioEngine.Track.IsPlaying)
                {
                    var pause = FontAwesome.Get(FontAwesomeIcon.fa_pause_symbol);

                    if (Image != pause)
                    {
                        Image = pause;
                    }
                }
                else if (AudioEngine.Track.IsStopped || AudioEngine.Track.IsPaused)
                {
                    var play = FontAwesome.Get(FontAwesomeIcon.fa_play_button);

                    if (Image != play)
                    {
                        Image = play;
                    }
                }
            }

            base.Update(gameTime);
        }
예제 #3
0
        /// <summary>
        ///     Creates tool buttons to the bottom right of the screen.
        /// </summary>
        private void CreateToolButtons()
        {
            const int targetY       = -5;
            const int animationTime = 1100;

            PowerButton = new ToolButton(FontAwesome.Get(FontAwesomeIcon.fa_power_button_off), (o, e) => DialogManager.Show(new QuitDialog()))
            {
                Alignment = Alignment.BotRight,
            };

            PowerButton.Y = PowerButton.Height;

            // Add Animation to move it up.
            PowerButton.Animations.Add(new Animation(AnimationProperty.Y, Easing.OutQuint,
                                                     PowerButton.Y, targetY, animationTime));

            MiddleContainer.AddContainedDrawable(PowerButton);

            // Create settings button
            SettingsButton = new ToolButton(FontAwesome.Get(FontAwesomeIcon.fa_settings), (o, e) => DialogManager.Show(new SettingsDialog()))
            {
                Parent     = MiddleContainer,
                Alignment  = Alignment.BotRight,
                Y          = PowerButton.Y,
                X          = PowerButton.X - PowerButton.Width - 5,
                Animations =
                {
                    new Animation(AnimationProperty.Y, Easing.OutQuint, PowerButton.Y, targetY, animationTime)
                }
            };

            MiddleContainer.AddContainedDrawable(SettingsButton);
        }
예제 #4
0
        /// <summary>
        ///     Creates the pause/resume control button.
        /// </summary>
        private void CreatePauseResumeButton()
        {
            PauseResumeButton = new JukeboxButton(FontAwesome.Get(FontAwesomeIcon.fa_pause_symbol))
            {
                Parent    = this,
                Alignment = Alignment.MidRight,
                Size      = new ScalableVector2(Height * 0.50f, Height * 0.50f),
                X         = NextButton.X - NextButton.Width - 10
            };

            PauseResumeButton.Clicked += (o, e) =>
            {
                SkinManager.Skin.SoundClick.CreateChannel().Play();

                if (AudioEngine.Track == null || AudioEngine.Track.IsDisposed)
                {
                    return;
                }

                if (AudioEngine.Track.IsStopped || AudioEngine.Track.IsPaused)
                {
                    AudioEngine.Track.Play();
                    PauseResumeButton.Image = FontAwesome.Get(FontAwesomeIcon.fa_pause_symbol);
                    ChangeDiscordPresenceToSongTitle();
                }
                else
                {
                    AudioEngine.Track.Pause();
                    PauseResumeButton.Image = FontAwesome.Get(FontAwesomeIcon.fa_play_button);
                    ChangeDiscordPresenceToIdle();
                }
            };
        }
예제 #5
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="view"></param>
        /// <param name="container"></param>
        public CurrentlySearchingInterface(DownloadScreenView view, DownloadScrollContainer container)
        {
            View             = view;
            Size             = new ScalableVector2(container.Width - 4, 100);
            Tint             = Color.Black;
            Alpha            = 0.85f;
            SetChildrenAlpha = false;

            Icon = new Sprite
            {
                Parent    = this,
                Alignment = Alignment.TopLeft,
                Image     = FontAwesome.Get(FontAwesomeIcon.fa_magnifying_glass),
                Size      = new ScalableVector2(18, 18),
                Y         = 18,
            };

            Header = new SpriteText(Fonts.Exo2SemiBold, "Searching For Mapsets...", 14)
            {
                Parent    = Icon,
                Alignment = Alignment.MidLeft,
                X         = Icon.Width + 10
            };

            Icon.X = Width / 2f - Header.Width / 2f - 10 - Icon.Width / 2f;

            CreateLoadingWheel();
            View.SearchBox.IsSearching.ValueChanged += OnIsSearchingValueChanged;
        }
        /// <summary>
        ///     Creates dots for the individual hit differences.
        /// </summary>
        private void CreateDots()
        {
            // Exit if we don't have any dots to draw.
            if (FilteredStats.Count == 0)
            {
                return;
            }

            // Return if the graph isn't wide enough.
            if (Width < DotSize)
            {
                return;
            }

            // Create a sprite for every dot.
            foreach (var breakdown in FilteredStats)
            {
                // ReSharper disable once ObjectCreationAsStatement
                new Sprite
                {
                    Parent    = this,
                    Tint      = SkinManager.Skin.Keys[GameMode.Keys4].JudgeColors[breakdown.Judgement],
                    Size      = new ScalableVector2(DotSize, DotSize),
                    Image     = FontAwesome.Get(FontAwesomeIcon.fa_circle),
                    X         = (int)TimeToX(breakdown.SongPosition) - (int)(DotSize / 2),
                    Y         = (int)HitDifferenceToY(breakdown.HitDifference),
                    Alignment = Alignment.MidLeft,
                };
            }
        }
예제 #7
0
        public MultiplayerEndGameWaitTime()
        {
            Image            = UserInterface.WaitingPanel;
            Size             = new ScalableVector2(450, 134);
            Alpha            = 0;
            SetChildrenAlpha = true;

            Icon = new Sprite
            {
                Parent    = this,
                Alignment = Alignment.TopCenter,
                Image     = FontAwesome.Get(FontAwesomeIcon.fa_information_button),
                Y         = 18,
                Size      = new ScalableVector2(24, 24)
            };

            // ReSharper disable once ObjectCreationAsStatement
            var text = new SpriteTextBitmap(FontsBitmap.AllerRegular, "Waiting for other players to finish!")
            {
                Parent    = this,
                FontSize  = 20,
                Y         = Icon.Y + Icon.Height + 10,
                Alignment = Alignment.TopCenter
            };

            LoadingWheel = new Sprite()
            {
                Parent    = this,
                Size      = new ScalableVector2(40, 40),
                Image     = UserInterface.LoadingWheel,
                Alignment = Alignment.TopCenter,
                Y         = text.Y + text.Height + 10
            };
        }
예제 #8
0
파일: HitErrorBar.cs 프로젝트: jaydn/Quaver
        /// <inheritdoc />
        /// <summary>
        ///   Ctor -
        /// </summary>
        /// <param name="type"></param>
        /// <param name="size"></param>
        public HitErrorBar(ScalableVector2 size)
        {
            Size = size;

            MiddleLine = new Sprite()
            {
                Size      = new ScalableVector2(2, 0, 0, 1),
                Alignment = Alignment.MidCenter,
                Parent    = this
            };

            // Create the object pool and initialize all of the sprites.
            LineObjectPool = new List <Sprite>();
            for (var i = 0; i < PoolSize; i++)
            {
                LineObjectPool.Add(new Sprite()
                {
                    Parent    = this,
                    Size      = new ScalableVector2(4, 0, 0, 1),
                    Alignment = Alignment.MidCenter,
                    Alpha     = 0
                });
            }

            // Create the hit chevron.
            LastHitCheveron = new Sprite()
            {
                Parent    = this,
                Alignment = Alignment.MidCenter,
                Alpha     = 1,
                Image     = FontAwesome.Get(FontAwesomeIcon.fa_caret_down),
                Y         = -Height - 3,
                Size      = new ScalableVector2(8, 8)
            };
        }
        /// <summary>
        /// </summary>
        private void CreateDeleteButton() => DeleteButton = new JukeboxButton(FontAwesome.Get(FontAwesomeIcon.fa_times),
                                                                              (sender, args) =>
        {
            if (SelectedLayerIndex.Value == 0)
            {
                NotificationManager.Show(NotificationLevel.Error, "You cannot delete the default layer!");
                return;
            }

            // Show them a confirmation dialog if objects are contained inside of the layer.
            if (Screen.WorkingMap.HitObjects.Any(x => x.EditorLayer == SelectedLayerIndex.Value))
            {
                DialogManager.Show(new EditorLayerDeleteConfirmationDialog(Screen.Ruleset as EditorRulesetKeys,
                                                                           ScrollContainer.AvailableItems[SelectedLayerIndex.Value]));

                return;
            }

            Screen.Ruleset.ActionManager.RemoveLayer(Screen.WorkingMap, this, ScrollContainer.AvailableItems[SelectedLayerIndex.Value]);
        })
        {
            Parent    = HeaderBackground,
            Alignment = Alignment.MidRight,
            Size      = new ScalableVector2(20, 20),
            Tint      = Color.Crimson,
            X         = -8
        };
예제 #10
0
        /// <summary>
        /// </summary>
        private void CreateReturnButton() => ReturnButton = new JukeboxButton(FontAwesome.Get(FontAwesomeIcon.fa_long_arrow_pointing_to_the_right),
                                                                              (sender, args) =>
        {
            if (string.IsNullOrWhiteSpace(NameTextbox.RawText))
            {
                NotificationManager.Show(NotificationLevel.Error, "Your layer name must not be empty ");
                return;
            }

            var selectedLayer = View.LayerCompositor.ScrollContainer.AvailableItems[View.LayerCompositor.SelectedLayerIndex.Value];
            var colorString   = $"{SelectedColor.Tint.R},{SelectedColor.Tint.G},{SelectedColor.Tint.B}";

            // Only change/add add an action if it was actually changed.
            if (NameTextbox.RawText != selectedLayer.Name || selectedLayer.ColorRgb != colorString && selectedLayer.ColorRgb != null)
            {
                Screen.Ruleset.ActionManager.EditLayer(View.LayerCompositor, selectedLayer, NameTextbox.RawText, colorString);
            }

            Screen.ActiveLayerInterface.Value = EditorLayerInterface.Composition;
        })
        {
            Parent    = HeaderBackground,
            Alignment = Alignment.MidRight,
            Size      = new ScalableVector2(20, 20),
            Tint      = Color.White,
            X         = -8
        };
예제 #11
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="dialog"></param>
        /// <param name="name"></param>
        /// <param name="bindable"></param>
        public SettingsBool(SettingsDialog dialog, string name, Bindable <bool> bindable) : base(dialog, name)
        {
            Bindable = bindable;

            Selector = new HorizontalSelector(new List <string>
            {
                "No",
                "Yes",
            }, new ScalableVector2(200, 26), Fonts.Exo2Medium, 13, FontAwesome.Get(FontAwesomeIcon.fa_chevron_pointing_to_the_left),
                                              FontAwesome.Get(FontAwesomeIcon.fa_right_chevron),
                                              new ScalableVector2(30, 22), 5, OnSelectorChanged, Convert.ToInt32(Bindable.Value))
            {
                Parent           = this,
                Alignment        = Alignment.MidRight,
                Tint             = Color.Transparent,
                SelectedItemText =
                {
                    Tint                          = Color.White,
                    UsePreviousSpriteBatchOptions = true
                },
                ButtonSelectLeft =
                {
                    UsePreviousSpriteBatchOptions = true
                },
                ButtonSelectRight =
                {
                    UsePreviousSpriteBatchOptions = true
                }
            };

            Selector.X -= 68;

            Bindable.ValueChanged += OnBindableValueChanged;
        }
예제 #12
0
파일: ChatBadge.cs 프로젝트: jaydn/Quaver
        /// <summary>
        ///     Gets a chat badge icon based on user groups.
        /// </summary>
        /// <param name="groups"></param>
        /// <returns></returns>
        public static Texture2D GetIcon(UserGroups groups)
        {
            if (groups.HasFlag(UserGroups.Developer))
            {
                return(FontAwesome.Get(FontAwesomeIcon.fa_code));
            }

            // Bot
            if (groups.HasFlag(UserGroups.Bot))
            {
                return(FontAwesome.Get(FontAwesomeIcon.fa_open_wrench_tool_silhouette));
            }

            // Admin
            if (groups.HasFlag(UserGroups.Admin))
            {
                return(FontAwesome.Get(FontAwesomeIcon.fa_legal_hammer));
            }

            if (groups.HasFlag(UserGroups.Moderator))
            {
                return(FontAwesome.Get(FontAwesomeIcon.fa_ban_circle_symbol));
            }

            return(null);
        }
예제 #13
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="dialog"></param>
        /// <param name="name"></param>
        /// <param name="bindable"></param>
        public SettingsSlider(SettingsDialog dialog, string name, BindableInt bindable, Func <int, string> display = null) : base(dialog, name)
        {
            Display  = display ?? (x => x.ToString());
            Bindable = bindable;
            bindable.ValueChanged += OnValueChanged;

            Value = new SpriteText(Fonts.Exo2Medium, Display(bindable.Value), 13)
            {
                Parent    = this,
                Alignment = Alignment.MidRight,
                X         = -30,
                UsePreviousSpriteBatchOptions = true
            };

            var slider = new Slider(bindable, Vector2.One, FontAwesome.Get(FontAwesomeIcon.fa_circle))
            {
                Parent    = this,
                Alignment = Alignment.MidRight,
                X         = -110,
                UsePreviousSpriteBatchOptions = true,
                Width        = 330,
                Height       = 2,
                ProgressBall =
                {
                    UsePreviousSpriteBatchOptions = true
                }
            };
        }
예제 #14
0
        public SpectatorCount()
        {
            SetChildrenVisibility = true;

            Eye = new Sprite
            {
                Parent = this,
                Size   = new ScalableVector2(20, 20),
                Image  = FontAwesome.Get(FontAwesomeIcon.fa_eye_open),
                SetChildrenVisibility = true
            };

            SpectatorsText = new SpriteTextBitmap(FontsBitmap.GothamRegular,
                                                  $" ")
            {
                Parent    = Eye,
                Alignment = Alignment.MidLeft,
                FontSize  = 14,
                X         = Eye.X + Eye.Width + 10
            };

            UpdateSpectatorText();

            Size = new ScalableVector2(Eye.X + Eye.Width + 10 + SpectatorsText.Width, SpectatorsText.Height);

            OnlineManager.Client.OnSpectatorJoined += OnSpectatorJoined;
            OnlineManager.Client.OnSpectatorLeft   += OnSpectatorLeft;
        }
예제 #15
0
파일: Jukebox.cs 프로젝트: nobbele/Quaver
        /// <summary>
        ///     Creates the restart button
        /// </summary>
        private void CreateRestartButton()
        {
            RestartButton = new JukeboxButton(FontAwesome.Get(FontAwesomeIcon.fa_undo_arrow))
            {
                Parent    = this,
                Alignment = Alignment.MidRight,
                Size      = new ScalableVector2(Height * 0.50f, Height * 0.50f),
                X         = PauseResumeButton.X - PauseResumeButton.Width - 10,
            };

            RestartButton.Clicked += (o, e) =>
            {
                SkinManager.Skin.SoundClick.CreateChannel().Play();

                try
                {
                    AudioEngine.LoadCurrentTrack();

                    if (AudioEngine.Track != null)
                    {
                        lock (AudioEngine.Track)
                            AudioEngine.Track?.Play();
                    }

                    PauseResumeButton.Image = FontAwesome.Get(FontAwesomeIcon.fa_pause_symbol);
                }
                catch (Exception)
                {
                    Logger.Error($"Failed to load track", LogType.Runtime);
                }
            };
        }
예제 #16
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="dialog"></param>
        /// <param name="name"></param>
        /// <param name="bindable"></param>
        public SettingsSlider(SettingsDialog dialog, string name, BindableInt bindable) : base(dialog, name)
        {
            Bindable = bindable;
            bindable.ValueChanged += OnValueChanged;

            Value = new SpriteText(Fonts.Exo2Medium, $"{bindable.Value.ToString()}", 13)
            {
                Parent    = this,
                Alignment = Alignment.MidRight,
                X         = -30,
                UsePreviousSpriteBatchOptions = true
            };

            var slider = new Slider(bindable, Vector2.One, FontAwesome.Get(FontAwesomeIcon.fa_circle))
            {
                Parent    = this,
                Alignment = Alignment.MidRight,
                X         = -90,
                UsePreviousSpriteBatchOptions = true,
                Width        = 350,
                Height       = 2,
                ProgressBall =
                {
                    UsePreviousSpriteBatchOptions = true
                }
            };
        }
예제 #17
0
 /// <summary>
 /// </summary>
 private void CreateMenuHeader()
 {
     MenuHeader = new MenuHeader(FontAwesome.Get(FontAwesomeIcon.fa_gamepad_console), "score", "results",
                                 "View in-depth results of a play", ColorHelper.HexToColor("#69acc5"))
     {
         Parent = Container
     };
 }
예제 #18
0
 /// <summary>
 /// </summary>
 private void CreateMenuHeader()
 {
     Header = new MenuHeader(FontAwesome.Get(FontAwesomeIcon.fa_download_to_storage_drive), "Download", "Maps",
                             "Download new maps to play", Colors.MainAccent)
     {
         Parent    = Container,
         Alignment = Alignment.TopLeft
     };
 }
예제 #19
0
 /// <summary>
 /// </summary>
 private void CreateActivatedSprite() => ActivatedSprite = new Sprite
 {
     Parent    = this,
     Alignment = Alignment.MidRight,
     X         = -12,
     Size      = new ScalableVector2(16, 16),
     Image     = FontAwesome.Get(FontAwesomeIcon.fa_remove_symbol),
     Tint      = Color.Crimson
 };
예제 #20
0
 /// <summary>
 /// </summary>
 private void CreateHeader()
 {
     Header = new MenuHeader(FontAwesome.Get(FontAwesomeIcon.fa_gamepad_console), "Song", "Select",
                             "Select a map to play", Colors.MainAccent)
     {
         Parent    = Container,
         Alignment = Alignment.TopLeft
     };
 }
예제 #21
0
        /// <summary>
        /// </summary>
        private void CreateRightSideButtons()
        {
            const int padding = 50;

            ButtonPlayTest = new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_play_sign), "Test Play", padding, Alignment.MidRight)
            {
                Parent    = this,
                Alignment = Alignment.MidRight,
                Size      = new ScalableVector2(18, 18),
                X         = -ButtonPlayPauseTrack.X,
            };

            ButtonPlayTest.Clicked += (o, e) =>
            {
                var game   = GameBase.Game as QuaverGame;
                var screen = game?.CurrentScreen as EditorScreen;

                // ReSharper disable once SwitchStatementMissingSomeCases
                screen?.GoPlayTest();
            };

            ButtonBeatSnap = new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_align_justify), "Change Beat Snap", padding, Alignment.MidRight)
            {
                Parent    = this,
                Alignment = Alignment.MidRight,
                Size      = new ScalableVector2(18, 18),
                X         = ButtonPlayTest.X - ButtonPlayTest.Width - 20
            };

            ButtonBeatSnap.Clicked += (o, e) =>
            {
                var game   = GameBase.Game as QuaverGame;
                var screen = game?.CurrentScreen as EditorScreen;

                // ReSharper disable once SwitchStatementMissingSomeCases
                screen?.ChangeBeatSnap(Direction.Forward);
            };

            ButtonScrollDirection = new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_exchange_arrows), "Change Scroll Direction",
                                                            padding, Alignment.MidRight)
            {
                Parent    = this,
                Alignment = Alignment.MidRight,
                Size      = new ScalableVector2(18, 18),
                X         = ButtonBeatSnap.X - ButtonBeatSnap.Width - 20
            };

            ButtonScrollDirection.Clicked += (o, e) =>
            {
                var game    = GameBase.Game as QuaverGame;
                var screen  = game?.CurrentScreen as EditorScreen;
                var ruleset = screen?.Ruleset as EditorRulesetKeys;
                //cruleset?.ToggleScrollDirection();
                NotificationManager.Show(NotificationLevel.Warning, "Not implemented yet");
            };
        }
 /// <summary>
 /// </summary>
 private void CreatePasswordLock() => PasswordLock = new Sprite
 {
     Parent    = this,
     Alignment = Alignment.TopRight,
     Position  = new ScalableVector2(-12, 12),
     Size      = new ScalableVector2(20, 20),
     Alpha     = Item.HasPassword ? 0.75f : 0.30f,
     Tint      = Colors.SecondaryAccent,
     Image     = FontAwesome.Get(FontAwesomeIcon.fa_padlock)
 };
예제 #23
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        public sealed override void CreateContent()
        {
            var container = new Sprite()
            {
                Parent           = this,
                Image            = UserInterface.WaitingPanel,
                Alignment        = Alignment.MidCenter,
                Size             = new ScalableVector2(450, 134),
                Alpha            = 1,
                SetChildrenAlpha = true,
            };

            Icon = new Sprite
            {
                Parent    = container,
                Alignment = Alignment.TopCenter,
                Image     = FontAwesome.Get(FontAwesomeIcon.fa_information_button),
                Y         = 18,
                Size      = new ScalableVector2(24, 24)
            };

            string str;

            switch (Type)
            {
            case JoiningGameDialogType.Joining:
                str = "Joining multiplayer game. Please wait...";
                break;

            case JoiningGameDialogType.Creating:
                str = "Creating multiplayer game. Please wait...";
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            // ReSharper disable once ObjectCreationAsStatement
            var text = new SpriteTextBitmap(FontsBitmap.AllerRegular, str)
            {
                Parent    = container,
                FontSize  = 20,
                Y         = Icon.Y + Icon.Height + 10,
                Alignment = Alignment.TopCenter
            };

            LoadingWheel = new Sprite()
            {
                Parent    = container,
                Size      = new ScalableVector2(40, 40),
                Image     = UserInterface.LoadingWheel,
                Alignment = Alignment.TopCenter,
                Y         = text.Y + text.Height + 10
            };
        }
예제 #24
0
        /// <summary>
        /// </summary>
        private void CreateHeader()
        {
            Header = new MenuHeader(FontAwesome.Get(FontAwesomeIcon.fa_group_profile_users), "MULTIPLAYER", "LOBBY",
                                    "find or create an online match", Colors.MainAccent)
            {
                Parent = Container
            };

            Header.Y = -Header.Height;
            Header.MoveToY(0, Easing.OutQuint, 600);
        }
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        public EditorNavigationBarMain(EditorScreen screen) : base(new List <EditorControlButton>
        {
            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_arrow_pointing_to_left), "Back To Menu (ESC)", -48, Alignment.BotLeft,
                                    (o, e) => screen.HandleKeyPressEscape()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_plus_black_symbol), "New Map", -48, Alignment.BotLeft,
                                    (o, e) => screen.CreateNewDifficulty()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_undo_arrow), "Undo (CTRL+Z)", -48, Alignment.BotLeft,
                                    (o, e) => screen.Ruleset.ActionManager.Undo()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_refresh_arrow), "Redo (CTRL+Y)", -48, Alignment.BotLeft,
                                    (o, e) => screen.Ruleset.ActionManager.Redo()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_text_file), "Edit Metadata (F1)", -48, Alignment.BotLeft,
                                    (o, e) => screen.OpenMetadataDialog()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_time), "Timing Setup (F2)", -48, Alignment.BotLeft,
                                    (o, e) => NotificationManager.Show(NotificationLevel.Warning, "Not implemented yet")),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_dashboard), "Edit Scroll Velocities (F3)", -48, Alignment.BotLeft,
                                    (o, e) => screen.OpenScrollVelocityDialog()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_music_note_black_symbol), "Set Audio Preview Time (F4)", -48, Alignment.BotLeft,
                                    (o, e) => screen.ChangePreviewTime((int)AudioEngine.Track.Time)),
        }, new List <EditorControlButton>
        {
            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_settings), "Open Options Menu (CTRL+O)", -48, Alignment.BotRight,
                                    (o, e) =>
            {
                if (DialogManager.Dialogs.Count > 0)
                    return;

                DialogManager.Show(new SettingsDialog());
            }),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_earth_globe), "Visit Mapset Page (CTRL+T)", -48, Alignment.BotRight,
                                    (o, e) => MapManager.Selected.Value.VisitMapsetPage()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_cloud_storage_uploading_option), "Upload Mapset (CTRL+U)", -48, Alignment.BotRight,
                                    (o, e) => screen.UploadMapset()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_archive_black_box), "Export Mapset (CTRL+E)", -48, Alignment.BotRight,
                                    (o, e) => EditorScreen.ExportToZip()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_save_file_option), "Save File (CTRL+S)", -48, Alignment.BotRight,
                                    (o, e) => screen.Save()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_file), "Edit .qua File (CTRL+Q)", -48, Alignment.BotRight,
                                    (o, e) => MapManager.Selected.Value.OpenFile()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_open_folder), "Open Mapset Folder (CTRL+W)", -48, Alignment.BotRight,
                                    (o, e) => MapManager.Selected.Value.OpenFolder()),
        }) => Screen = screen;
예제 #26
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            ButtonPlayPauseTrack.Image = FontAwesome.Get(AudioEngine.Track.IsPlaying
                ? FontAwesomeIcon.fa_pause_symbol : FontAwesomeIcon.fa_play_button);

            UpdateAudioTimeText();
            TimeProgressBar.Bindable.Value = AudioEngine.Track.Time;
            HandleProgressBarDragging();

            base.Update(gameTime);
        }
예제 #27
0
        /// <summary>
        /// </summary>
        private void CreateHeader()
        {
            Header = new MenuHeader(FontAwesome.Get(FontAwesomeIcon.fa_earth_globe), "MULTIPLAYER", "GAME",
                                    "play a match in real-time with others", Colors.MainAccent)
            {
                Parent = Container
            };

            Header.Y = -Header.Height;
            Header.MoveToY(0, Easing.OutQuint, 600);
        }
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        public OffsetCalibratorTip()
        {
            Tint             = Color.Black;
            Size             = new ScalableVector2(WindowManager.Width, 100);
            Alpha            = 0;
            SetChildrenAlpha = true;

            FadeTo(0.85f, Easing.Linear, 400);
            Animations.Add(new Animation(AnimationProperty.Wait, Easing.Linear, 0, 1, 2000));

            // ReSharper disable once ObjectCreationAsStatement
            new Sprite
            {
                Parent = this,
                Size   = new ScalableVector2(Width, 2),
                Tint   = Colors.MainAccent
            };

            Icon = new Sprite
            {
                Parent    = this,
                Alignment = Alignment.TopCenter,
                Image     = FontAwesome.Get(FontAwesomeIcon.fa_information_button),
                Y         = 18,
                Size      = new ScalableVector2(24, 24)
            };

            // ReSharper disable once ObjectCreationAsStatement
            var text = new SpriteTextBitmap(FontsBitmap.AllerRegular, "Play through the map, and at the end, a new global audio offset will be suggested to you.")
            {
                Parent    = this,
                FontSize  = 20,
                Y         = Icon.Y + Icon.Height + 15,
                Alignment = Alignment.TopCenter
            };

            // ReSharper disable once ObjectCreationAsStatement
            new Sprite
            {
                Parent    = this,
                Size      = new ScalableVector2(Width, 2),
                Tint      = Colors.MainAccent,
                Alignment = Alignment.BotLeft
            };

            ThreadScheduler.RunAfter(() =>
            {
                ClearAnimations();
                text.Visible = false;
                FadeTo(0, Easing.Linear, 200);
            }, 3500);
        }
예제 #29
0
 /// <summary>
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnSelectedHitsoundsChanged(object sender, BindableValueChangedEventArgs <HitSounds> e)
 {
     if (e.Value.HasFlag(Hitsounds))
     {
         ActivatedSprite.Image = FontAwesome.Get(FontAwesomeIcon.fa_check_sign_in_a_rounded_black_square);
         ActivatedSprite.Tint  = Color.LimeGreen;
     }
     else
     {
         ActivatedSprite.Image = FontAwesome.Get(FontAwesomeIcon.fa_remove_symbol);
         ActivatedSprite.Tint  = Color.Crimson;
     }
 }
 /// <summary>
 /// </summary>
 private void CreateAddButton() => AddButton = new JukeboxButton(FontAwesome.Get(FontAwesomeIcon.fa_plus_black_symbol),
                                                                 (sender, args) => Screen.Ruleset.ActionManager.AddLayer(Screen.WorkingMap, this,
                                                                                                                         new EditorLayerInfo
 {
     Name = $"Layer {ScrollContainer.AvailableItems.Count}"
 }))
 {
     Parent    = HeaderBackground,
     Alignment = Alignment.MidRight,
     Size      = new ScalableVector2(20, 20),
     Tint      = Color.LimeGreen,
     X         = DeleteButton.X - DeleteButton.Width - 10
 };