/// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="sprite"></param>
        /// <param name="name"></param>
        /// <param name="initialValue"></param>
        public EditorMetadataTextbox(Drawable sprite, string name, string initialValue, Action <string> saveValue) : base(sprite, name, initialValue, saveValue)
        {
            Textbox = new Textbox(new ScalableVector2(240, Height * 0.70f), Fonts.SourceSansProSemiBold, 13, InitialValue)
            {
                Parent          = this,
                X               = -10,
                Alignment       = Alignment.MidRight,
                Tint            = Color.Transparent,
                AllowSubmission = false
            };

            Textbox.AddBorder(Color.LightGray, 2);
        }
        /// <summary>
        ///     Creates the textbox to search for users.
        /// </summary>
        private void CreateSearchTextbox()
        {
            SearchTextbox = new Textbox(new ScalableVector2(150, TextSearch.Height), Fonts.Exo2Regular, 8)
            {
                Parent    = TextSearch,
                X         = TextSearch.Width + 5,
                Alignment = Alignment.MidLeft,
                Tint      = Color.Black,
                Alpha     = 0.25f,
                Cursor    = { Y = 5 },
            };

            SearchTextbox.AddBorder(Color.White, 2);

            SearchTextbox.StoppedTypingActionCalltime = 100;
            SearchTextbox.OnStoppedTyping            += text => Overlay.OnlineUserList?.FilterUsers(text);
        }
        /// <summary>
        ///     Creates the textbox to search for mapsets.
        /// </summary>
        private void CreateSearchBox()
        {
            SearchBox = new Textbox(new ScalableVector2(518, 30), Fonts.Exo2Bold, 13)
            {
                Parent          = TextSearch,
                Position        = new ScalableVector2(TextSearch.Width + 5, 0),
                Alignment       = Alignment.MidLeft,
                Tint            = Colors.DarkGray,
                Alpha           = 0.75f,
                AllowSubmission = false,
                RawText         = SelectScreen.PreviousSearchTerm,
                InputText       =
                {
                    Tint = Color.White,
                    Text = SelectScreen.PreviousSearchTerm
                },
                StoppedTypingActionCalltime = 300,
                OnStoppedTyping             = (text) =>
                {
                    SelectScreen.PreviousSearchTerm = text;

                    var selectScreen = View.Screen as SelectScreen;

                    lock (selectScreen.AvailableMapsets)
                    {
                        selectScreen.AvailableMapsets = MapsetHelper.OrderMapsetsByConfigValue(
                            MapsetHelper.SearchMapsets(MapManager.Mapsets, text));

                        View.MapsetScrollContainer.InitializeWithNewSets();
                        UpdateMapsetsFoundText();
                    }
                }
            };

            SearchBox.AddBorder(Colors.MainAccent);

            var searchIcon = new Sprite()
            {
                Parent    = SearchBox,
                Alignment = Alignment.MidRight,
                X         = -15,
                Image     = FontAwesome.Get(FontAwesomeIcon.fa_magnifying_glass),
                Size      = new ScalableVector2(15, 15)
            };
        }
Beispiel #4
0
        /// <summary>
        ///     Creates the Textbox sprite.
        /// </summary>
        private void CreateTextbox()
        {
            Textbox = new Textbox(new ScalableVector2(1100, Height * 0.60f), Fonts.Exo2Regular,
                                  13, "", "Type to send a message", OnTextboxSubmit)
            {
                Parent        = this,
                Alignment     = Alignment.MidLeft,
                X             = 10,
                Image         = UserInterface.BlankBox,
                Tint          = Color.Black,
                Alpha         = 0.35f,
                AlwaysFocused = true,
                MaxCharacters = 2000
            };

            Textbox.InputText.Y = 8;
            Textbox.Cursor.Y   += Textbox.InputText.Y;
            Textbox.AddBorder(Color.White, 2);
        }
Beispiel #5
0
        /// <summary>
        /// </summary>
        /// <param name="width"></param>
        /// <param name="label"></param>
        public LabelledTextbox(float width, string label)
        {
            Size  = new ScalableVector2(width, 62);
            Alpha = 0;

            Label = new SpriteTextBitmap(FontsBitmap.GothamRegular, label)
            {
                Parent   = this,
                FontSize = 17
            };

            Textbox = new Textbox(new ScalableVector2(width, 30), Fonts.SourceSansProSemiBold, 13)
            {
                Parent = this,
                Y      = Label.Y + Label.Height + 14,
                Image  = UserInterface.SelectSearchBackground
            };

            Textbox.AddBorder(Color.White, 2);
        }
Beispiel #6
0
        /// <summary>
        /// </summary>
        private void CreateSearchBox()
        {
            SearchBox = new Textbox(new ScalableVector2(Width - 30, 30), Fonts.Exo2SemiBold, 14, "", "", null, OnStoppedTyping)
            {
                Parent    = this,
                Alignment = Alignment.TopLeft,
                X         = TextSearch.X,
                Y         = TextSearch.Y + TextSearch.Height + 5,
                Tint      = Colors.DarkGray,
            };

            SearchBox.AddBorder(Colors.MainAccent, 2);

            var magnifyingGlass = new Sprite
            {
                Parent    = SearchBox,
                Alignment = Alignment.MidRight,
                X         = -10,
                Size      = new ScalableVector2(15, 15),
                Image     = FontAwesome.Get(FontAwesomeIcon.fa_magnifying_glass)
            };
        }
        /// <summary>
        /// </summary>
        private void CreateNameTextbox()
        {
            TextLayerName = new SpriteTextBitmap(FontsBitmap.AllerRegular, "Layer Name")
            {
                Parent   = this,
                X        = 10,
                Y        = HeaderBackground.Y + HeaderBackground.Height + 10,
                FontSize = 16
            };

            var selectedLayer = View?.LayerCompositor.ScrollContainer.AvailableItems[View.LayerCompositor.SelectedLayerIndex.Value];

            NameTextbox = new Textbox(new ScalableVector2(Width - 20, 26),
                                      Fonts.Exo2SemiBold, 13, selectedLayer?.Name)
            {
                Parent          = this,
                X               = TextLayerName.X,
                Y               = TextLayerName.Y + TextLayerName.Height + 10,
                Tint            = Color.Transparent,
                AllowSubmission = false
            };

            NameTextbox.AddBorder(Color.White, 2);
        }
Beispiel #8
0
        public sealed override void CreateContent()
        {
            ContainingBox = new Sprite()
            {
                Parent    = Container,
                Size      = new ScalableVector2(WindowManager.Width, 200),
                Alignment = Alignment.MidCenter,
                Tint      = Color.Black,
                Alpha     = 0.95f
            };

            var line = new Sprite()
            {
                Parent = ContainingBox,
                Size   = new ScalableVector2(ContainingBox.Width, 1),
                Tint   = Colors.MainAccent
            };

            Header = new SpriteText(Fonts.Exo2Bold, $"Rename Judgement Window Preset", 20)
            {
                Parent    = ContainingBox,
                Alignment = Alignment.TopCenter,
                Y         = 25
            };

            TextContent = new SpriteText(Fonts.Exo2SemiBold,
                                         "Choose a new name for your judgement window preset", 14)
            {
                Parent    = ContainingBox,
                Alignment = Alignment.TopCenter,
                Y         = Header.Y + Header.Height + 5
            };

            Textbox = new Textbox(new ScalableVector2(400, 40), Fonts.Exo2SemiBold, 16, Windows.Name)
            {
                Parent    = ContainingBox,
                Alignment = Alignment.TopCenter,
                Y         = TextContent.Y + 35,
                Alpha     = 0,
                InputText =
                {
                    Alignment = Alignment.MidLeft
                },
                Cursor =
                {
                    Alignment = Alignment.MidLeft
                }
            };

            Textbox.AddBorder(Colors.MainAccent, 2);
            Textbox.OnSubmit += (e) =>
            {
                Windows.Name = e;
                JudgementWindowsDatabaseCache.Update(Windows);

                var windows = WindowContainer.Pool.Find(x => x.Item == Windows);

                if (windows != null)
                {
                    var w = (DrawableJudgementWindows)windows;
                    w.Name.Text = e;
                }

                DialogManager.Dismiss(this);
            };
        }
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        public sealed override void CreateContent()
        {
            var background = new Sprite
            {
                Parent           = this,
                Alignment        = Alignment.MidCenter,
                Tint             = Color.Black,
                Size             = new ScalableVector2(WindowManager.Width, 150),
                Alpha            = 0,
                SetChildrenAlpha = true
            };

            background.FadeTo(1, Easing.Linear, 150);

            // ReSharper disable once ObjectCreationAsStatement
            new Wobble.Graphics.Sprites.Sprite
            {
                Parent = background,
                Size   = new ScalableVector2(Width, 2),
                Tint   = Colors.MainAccent,
                Alpha  = 0
            };

            var icon = new Sprite
            {
                Parent    = background,
                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, "Please enter the password to join this multiplayer game.")
            {
                Parent    = background,
                FontSize  = 20,
                Y         = icon.Y + icon.Height + 15,
                Alignment = Alignment.TopCenter,
                Alpha     = 1
            };

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

            PasswordBox = new Textbox(new ScalableVector2(392, 36), Fonts.SourceSansProSemiBold, 13, "", "Enter Password",
                                      (pw) =>
            {
                if (pw.Length == 0)
                {
                    NotificationManager.Show(NotificationLevel.Error, "You need to enter a valid password");
                    return;
                }

                DialogManager.Dismiss(this);
                DialogManager.Show(new JoiningGameDialog(JoiningGameDialogType.Joining));

                ThreadScheduler.RunAfter(() => OnlineManager.Client.JoinGame(Game, pw), 800);
            })
            {
                Parent        = background,
                Alignment     = Alignment.TopCenter,
                Y             = text.Y + text.Height + 15,
                Image         = UserInterface.SelectSearchBackground,
                Alpha         = 0.65f,
                AlwaysFocused = true
            };

            PasswordBox.InputText.Alignment = Alignment.MidLeft;
            PasswordBox.Cursor.Alignment    = Alignment.MidLeft;
            PasswordBox.AddBorder(Color.White, 2);
        }