/// <summary> /// Stores the new factory values into the menu factory container. /// </summary> /// <typeparam name="T"><see cref="AMenuValue" /> to contain into the factory value container</typeparam> /// <param name="value">Standard build for the constructor</param> /// <returns></returns> public static bool CreateFactory <T>(AMenuValue value) where T : AMenuValue { if (!DefaultMenuValueByType.ContainsKey(typeof(T))) { DefaultMenuValueByType.Add(typeof(T), () => value); return(true); } return(false); }
/// <summary> /// Disables all. /// </summary> /// <param name="except">The except.</param> public void DisableAll(AMenuValue except) { var i = Items.Where(s => s.ValueAsObject as AMenuValue != except); foreach (var abs in i.Select(x => x.ValueAsObject as AMenuValue)) { if (abs is MenuBool) { (abs as MenuBool).Value = false; } else if (abs is MenuKeyBind) { (abs as MenuKeyBind).Active = false; } } }
/// <summary> /// Extracts the specified component. /// </summary> /// <param name="component">The component.</param> public override void Extract(AMenuValue component) { }
/// <summary> /// Extracts the specified component. /// </summary> /// <param name="component">The component.</param> public override void Extract(AMenuValue component) { Value = ((MenuBool)component).Value; }
/// <summary> /// Extracts the specified value. /// </summary> /// <param name="value">The value.</param> public override void Extract(AMenuValue value) { Value = ((MenuSlider)value).Value; }
/// <summary> /// Extracts the specified value. /// </summary> /// <param name="value">The value.</param> public override void Extract(AMenuValue value) { var keybind = ((MenuKeyBind)value); Key = keybind.Key; }