示例#1
0
文件: Footer.cs 项目: Tiller431/yes
        /// <param name="button">Button to be added.</param>
        public void AddButton(FooterButton button)
        {
            button.Hovered   = updateModeLight;
            button.HoverLost = updateModeLight;

            buttons.Add(button);
        }
示例#2
0
文件: Footer.cs 项目: Tiller431/yes
        /// <param name="button">THe button to be added.</param>
        /// <param name="overlay">The <see cref="OverlayContainer"/> to be toggled by this button.</param>
        public void AddButton(FooterButton button, OverlayContainer overlay)
        {
            overlays.Add(overlay);
            button.Action = () => showOverlay(overlay);

            AddButton(button);
        }
示例#3
0
文件: Footer.cs 项目: Azyyyyyy/osu
        /// <param name="button">The button to be added.</param>
        /// <param name="overlay">The <see cref="OverlayContainer"/> to be toggled by this button.</param>
        public void AddButton(FooterButton button, OverlayContainer overlay)
        {
            if (overlay != null)
            {
                overlays.Add(overlay);
                button.Action = () => showOverlay(overlay);
            }

            button.Hovered   = updateModeLight;
            button.HoverLost = updateModeLight;

            buttons.Add(button);
        }
示例#4
0
        public void AddButton(string text, Color4 colour, Action action)
        {
            var button = new FooterButton
            {
                Text             = text,
                Height           = play_song_select_button_height,
                Width            = play_song_select_button_width,
                SelectedColour   = colour,
                DeselectedColour = colour.Opacity(0.5f),
            };

            button.Hovered   = () => updateModeLight(button);
            button.HoverLost = () => updateModeLight();
            button.Action    = action;
            buttons.Add(button);
        }
示例#5
0
        /// <param name="text">Text on the button.</param>
        /// <param name="colour">Colour of the button.</param>
        /// <param name="hotkey">Hotkey of the button.</param>
        /// <param name="action">Action the button does.</param>
        /// <param name="depth">
        /// <para>Higher depth to be put on the left, and lower to be put on the right.</para>
        /// <para>Notice this is different to <see cref="Options.BeatmapOptionsOverlay"/>!</para>
        /// </param>
        public void AddButton(string text, Color4 colour, Action action, Key?hotkey = null, float depth = 0)
        {
            var button = new FooterButton
            {
                Text             = text,
                Height           = play_song_select_button_height,
                Width            = play_song_select_button_width,
                Depth            = depth,
                SelectedColour   = colour,
                DeselectedColour = colour.Opacity(0.5f),
                Hotkey           = hotkey,
                Hovered          = updateModeLight,
                HoverLost        = updateModeLight,
                Action           = action,
            };

            buttons.Add(button);
            buttons.SetLayoutPosition(button, -depth);
        }
示例#6
0
 private void updateModeLight(FooterButton button = null)
 {
     modeLight.FadeColour(button?.SelectedColour ?? Color4.Transparent, TRANSITION_LENGTH, EasingTypes.OutQuint);
 }