private void load(TextureStore textures, APIController api, Storage store)
        {
            ProjectName.Text               = onlineProject.Name;
            ProjectDescription.Text        = onlineProject.Description;
            ImageContainer.Add(loadingIcon = new SpriteIcon
            {
                Size             = new Vector2(.7f),
                RelativeSizeAxes = Axes.Both,
                FillMode         = FillMode.Fit,
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                Icon             = FontAwesome.Solid.Spinner,
            });
            Schedule(async() =>  //ToDo: ????
            {
                var texture = await textures.GetAsync(@$ "https://gamestogo.company/api/Games/DownloadFile/{onlineProject.Image}");

                Schedule(() =>
                {
                    ProjectImage.Texture = texture;
                    loadingIcon.FadeOut();
                });
            });

            BottomContainer.Add(new SpriteText
            {
                Font = new FontUsage(size: SMALL_TEXT_SIZE),
                Text = @"Este juego ya fue publicado!",
            });

            var userRequest = new GetUserRequest(onlineProject.Creator.ID);

            userRequest.Success += user => UsernameBox.Text = @$ "De {user.Username} (Ultima vez editado {onlineProject.DateTimeLastEdited:dd/MM/yyyy HH:mm})";
            api.Queue(userRequest);
        }
Exemplo n.º 2
0
        protected override void OnRoomChanged()
        {
            base.OnRoomChanged();

            if (Room == null)
            {
                return;
            }

            const double fade_time = 50;

            if (User.State == MultiplayerUserState.Ready)
            {
                readyMark.FadeIn(fade_time);
            }
            else
            {
                readyMark.FadeOut(fade_time);
            }

            if (Room.Host?.Equals(User) == true)
            {
                crown.FadeIn(fade_time);
            }
            else
            {
                crown.FadeOut(fade_time);
            }
        }
Exemplo n.º 3
0
        protected override void OnRoomUpdated()
        {
            base.OnRoomUpdated();

            if (Room == null)
            {
                return;
            }

            const double fade_time = 50;

            var ruleset = rulesets.GetRuleset(Room.Settings.RulesetID).CreateInstance();

            var currentModeRank = User.User?.RulesetsStatistics?.GetValueOrDefault(ruleset.ShortName)?.GlobalRank;

            userRankText.Text = currentModeRank != null ? $"#{currentModeRank.Value:N0}" : string.Empty;

            userStateDisplay.UpdateStatus(User.State, User.BeatmapAvailability);

            if (Room.Host?.Equals(User) == true)
            {
                crown.FadeIn(fade_time);
            }
            else
            {
                crown.FadeOut(fade_time);
            }

            // If the mods are updated at the end of the frame, the flow container will skip a reflow cycle: https://github.com/ppy/osu-framework/issues/4187
            // This looks particularly jarring here, so re-schedule the update to that start of our frame as a fix.
            Schedule(() => userModsDisplay.Current.Value = User.Mods.Select(m => m.ToMod(ruleset)).ToList());
        }
Exemplo n.º 4
0
        protected override void OnRoomUpdated()
        {
            base.OnRoomUpdated();

            if (Room == null)
            {
                return;
            }

            const double fade_time = 50;

            userStateDisplay.Status = User.State;

            if (Room.Host?.Equals(User) == true)
            {
                crown.FadeIn(fade_time);
            }
            else
            {
                crown.FadeOut(fade_time);
            }

            // If the mods are updated at the end of the frame, the flow container will skip a reflow cycle: https://github.com/ppy/osu-framework/issues/4187
            // This looks particularly jarring here, so re-schedule the update to that start of our frame as a fix.
            Schedule(() =>
            {
                var ruleset = rulesets.GetRuleset(Room.Settings.RulesetID).CreateInstance();
                userModsDisplay.Current.Value = User.Mods.Select(m => m.ToMod(ruleset)).ToList();
            });
        }
Exemplo n.º 5
0
            private void updateVisibility()
            {
                switch (Selected.Value)
                {
                case true:
                    activeIcon.FadeIn(transform_duration, transform_easing);
                    iconContainer.FadeIn(transform_duration, transform_easing);
                    layoutContainer.ResizeWidthTo(tagSelection.TagSize + 3, transform_duration, transform_easing);
                    break;

                case false when IsHovered:
                    activeIcon.FadeOut(transform_duration, transform_easing);
                    iconContainer.FadeIn(transform_duration, transform_easing);
                    layoutContainer.ResizeWidthTo(tagSelection.TagSize + 3, transform_duration, transform_easing);
                    break;

                case false when !IsHovered:
                    activeIcon.FadeOut(transform_duration, transform_easing);
                    iconContainer.FadeOut(transform_duration, transform_easing);
                    layoutContainer.ResizeWidthTo(0, transform_duration, transform_easing);
                    break;
                }
            }
Exemplo n.º 6
0
        /// <summary>
        /// Updates the arrows from the selector, depending of whether there are other roms available.
        /// </summary>
        private void updateSelection(ValueChangedEvent <int> selection)
        {
            selectSample?.Play();

            selectionLeft.FadeIn(FADE_TIME, EASING);
            selectionRight.FadeIn(FADE_TIME, EASING);

            if (selection.NewValue == this.selection.MaxValue)
            {
                selectionRight.FadeOut(FADE_TIME, EASING);
            }

            if (selection.NewValue == 0)
            {
                selectionLeft.FadeOut(FADE_TIME, EASING);
            }
        }
Exemplo n.º 7
0
        private void load(TextureStore textures)
        {
            ButtonFlowContainer.Add(editButton = new IconButton(FontAwesome.Solid.Download, Colour4.SkyBlue, true, Colour4.PowderBlue));

            BottomContainer.Add(new SpriteText
            {
                Font = new FontUsage(size: SMALL_TEXT_SIZE),
                Text = @"Este proyecto está en el servidor, descargalo para editarlo!",
            });

            ImageContainer.Add(loadingIcon = new SpriteIcon
            {
                Size             = new Vector2(.7f),
                RelativeSizeAxes = Axes.Both,
                FillMode         = FillMode.Fit,
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                Icon             = FontAwesome.Solid.Spinner,
            });

            editButton.Enabled.Value = false;
            loadingIcon.RotateTo(0).Then().RotateTo(360, 1500).Loop();

            ProjectName.Text         = onlineProject.Name;
            ProjectDescription.Text  = onlineProject.Description;
            editButton.Enabled.Value = true;
            Schedule(async() =>
            {
                var texture = await textures.GetAsync(@$ "https://gamestogo.company/api/Games/DownloadFile/{onlineProject.Image}");

                Schedule(() =>
                {
                    ProjectImage.Texture = texture;
                    loadingIcon.FadeOut();
                });
            });

            editButton.Action += downloadProject;

            var userRequest = new GetUserRequest(onlineProject.Creator.ID);

            userRequest.Success += user => UsernameBox.Text = @$ "De {user.Username} (Ultima vez editado {onlineProject.DateTimeLastEdited:dd/MM/yyyy HH:mm}) Estado: {onlineProject.Status.GetDescription()}";
            api.Queue(userRequest);
        }
Exemplo n.º 8
0
        public IconButton(IconUsage buttonIcon, Colour4 buttonColour = default, bool progressAction = false, Colour4 progressColour = default, Colour4 backgroundColour = default)
        {
            this.buttonIcon       = buttonIcon;
            this.backgroundColour = backgroundColour == default ? new Colour4(100, 100, 100, 255) : backgroundColour;
            this.buttonColour     = buttonColour == default ? new Colour4(100, 100, 100, 255) : buttonColour;
            this.progressColour   = progressColour == default ? new Colour4(80, 80, 80, 255) : progressColour;

            if (!progressAction)
            {
                return;
            }

            Action += () =>
            {
                Enabled.Value = false;
                loadingIcon.FadeIn(100);
                icon.FadeOut(100);
                fadeToWait();
            };
        }
Exemplo n.º 9
0
        protected override void OnRoomUpdated()
        {
            base.OnRoomUpdated();

            if (Room == null)
            {
                return;
            }

            const double fade_time = 50;

            userStateDisplay.Status = User.State;

            if (Room.Host?.Equals(User) == true)
            {
                crown.FadeIn(fade_time);
            }
            else
            {
                crown.FadeOut(fade_time);
            }
        }
Exemplo n.º 10
0
 protected override void OnHoverLost(HoverLostEvent e)
 {
     base.OnHoverLost(e);
     hoverIcon.FadeOut(duration, Easing.OutQuint);
     this.FadeColour(Color4.White, duration, Easing.OutQuint);
 }
Exemplo n.º 11
0
 protected override void OnHoverLost(Framework.Input.InputState state)
 {
     handle.FadeOut(fade_duration);
 }