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);
        }
Esempio n. 2
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);
        }