Exemplo n.º 1
0
 public ItemSelector(CustomizeMenu.MPBodyMenu parent, string title, int max)
 {
     Parent     = parent;
     Title      = title;
     Type       = MenuItemHorizontalSelectorType.Number;
     wrapAround = true;
     minState   = 0;
     maxState   = max;
     state      = 0;
     Value      = state;
     OnChange   = SetNewAppearance;
 }
Exemplo n.º 2
0
 public ItemSlider(CustomizeMenu.MPBodyMenu parent, string title)
 {
     Parent     = parent;
     Title      = title;
     Type       = MenuItemHorizontalSelectorType.NumberAndBar;
     wrapAround = false;
     minState   = 0.0f;
     maxState   = 1.0f;
     stepSize   = 0.05f;
     state      = 0.5f;
     Value      = state;
     OnChange   = SetNewAppearance;
 }
Exemplo n.º 3
0
        public ItemSlider(CustomizeMenu.MPBodyMenu parent, string title, float min, float max, float defaultValue, float increment)
        {
            if (min >= max)
            {
                throw new Exception("Min value cannot be bigger or equal to max value");
            }
            if (((max - min) / increment) % 1.0f != 0.0f)
            {
                throw new Exception("Min-max range must be wholly divisible by given increment value");
            }

            Parent     = parent;
            Title      = title;
            Type       = MenuItemHorizontalSelectorType.NumberAndBar;
            wrapAround = true;
            minState   = min;
            maxState   = max;
            stepSize   = increment;
            state      = MathUtil.Clamp(defaultValue, min, max);
            Value      = state;
            OnChange   = SetNewAppearance;
        }