Exemplo n.º 1
0
        public OptionSlider(OsuString title, BindableDouble value, string unit = null, bool immediatelyAdjust = true)
        {
            this.value = value;
            localValue = value.Value;

            this.unit = unit;

            this.immediatelyAdjust = immediatelyAdjust;

            value.ValueChanged += value_ValueChanged;

            string text = LocalisationManager.GetString(title);

            header = new pText(text, 12, Vector2.Zero, 1, true, Color.White);
            spriteManager.Add(header);

            Size = header.MeasureText();

            Slider = new pSliderBar(spriteManager, value.MinValue, value.MaxValue, value.Value, new Vector2(Size.X + 5, Size.Y / 2), (int)(ELEMENT_SIZE - Size.X - 5));
            Slider.OnValueChanged += Slider_ValueChanged;

            Slider.KeyboardControl          = true;
            Slider.KeyboardControlIncrement = value is BindableInt ? 1 : 0.01;

            addKeyword(text);
            addKeyword(title.ToString());
            updateUnit();
        }
Exemplo n.º 2
0
        public OptionDropdown(OsuString title, IEnumerable <pDropdownItem> items = null, HasObjectValue binding = null, EventHandler onChange = null)
        {
            this.binding = binding;

            ValueChangedObservable changeObservation = binding as ValueChangedObservable;

            if (changeObservation != null)
            {
                changeObservation.ValueChanged += changeObservation_ValueChanged;
            }

            string text   = LocalisationManager.GetString(title);
            pText  header = new pText(text, 12, Vector2.Zero, 1, true, Color.White);

            spriteManager.Add(header);

            Size = header.MeasureText() + new Vector2(5, 0);

            Dropdown = new pDropdown(spriteManager, String.Empty, new Vector2(Size.X, 0), ELEMENT_SIZE - Size.X, 1)
            {
                ColumnLimit = 10
            };
            Dropdown.OnSelect         += Dropdown_OnSelect;
            Dropdown.OnDisplayChanged += Dropdown_OnDisplayChanged;

            Dropdown.SpriteMainBox.ClickRequiresConfirmation = true;

            if (onChange != null)
            {
                Dropdown.OnSelect += onChange;
            }

            if (items != null)
            {
                foreach (pDropdownItem i in items)
                {
                    Dropdown.AddOption(i);
                    addKeyword(i.Text);
                }
            }

            if (binding != null)
            {
                Dropdown.SetSelected(binding.ObjectValue, true);
            }


            addKeyword(text);
            addKeyword(title.ToString());
        }
Exemplo n.º 3
0
        public OptionCategory(OsuString titleString, FontAwesome icon = FontAwesome.circle)
        {
            Icon = icon;

            addKeyword(icon.ToString());
            addKeyword(titleString.ToString());

            Title = LocalisationManager.GetString(titleString);
            addKeyword(Title);

            headerText = new pText(Title.ToUpper(), 24, Vector2.Zero, 0, true, SkinManager.NEW_SKIN_COLOUR_SECONDARY)
            {
                Alpha      = 0.4f,
                Origin     = Origins.TopRight,
                Field      = Fields.TopRight,
                TextShadow = false,
            };

            spriteManager.Add(headerText);

            Size = new Vector2(0, 10);

            addKeyword(Title);
        }
Exemplo n.º 4
0
 public OptionTextbox(OsuString title, bool passwordBox = false)
     : this(LocalisationManager.GetString(title), passwordBox)
 {
     addKeyword(title.ToString());
 }
Exemplo n.º 5
0
		// Token: 0x06001CB8 RID: 7352
		// RVA: 0x000179E7 File Offset: 0x00015BE7
		public Class391(OsuString osuString_0, Color color_0, EventHandler eventHandler_1) : this(Class41.GetString(osuString_0), color_0, eventHandler_1)
		{
			base.method_8(osuString_0.ToString());
		}
Exemplo n.º 6
0
 public OptionButton(OsuString title, Color colour, EventHandler onClick = null)
     : this(LocalisationManager.GetString(title), colour, onClick)
 {
     addKeyword(title.ToString());
 }
Exemplo n.º 7
0
 // Token: 0x06001CCC RID: 7372
 // RVA: 0x00017B91 File Offset: 0x00015D91
 public Class395(OsuString osuString_0)
     : this(Class41.GetString(osuString_0))
 {
     base.method_8(osuString_0.ToString());
 }
Exemplo n.º 8
0
 // Token: 0x06001D4F RID: 7503
 // RVA: 0x00018232 File Offset: 0x00016432
 public Class400(OsuString osuString_0, bool bool_1)
     : this(Class41.GetString(osuString_0), bool_1)
 {
     base.method_8(osuString_0.ToString());
 }
Exemplo n.º 9
0
 internal OptionCheckbox(OsuString title, BindableBool binding, EventHandler onChange = null)
     : this(LocalisationManager.GetString(title), LocalisationManager.GetString(title + 1), binding, onChange)
 {
     addKeyword(title.ToString());
 }
Exemplo n.º 10
0
 public OptionSection(OsuString title, IEnumerable <string> keywords = null)
     : this(LocalisationManager.GetString(title), keywords)
 {
     addKeyword(title.ToString());
 }