Esempio n. 1
0
 internal OptionHandle(AddonOption addon) => Addon = addon;
Esempio n. 2
0
 /// <summary>
 ///     Adds a new Entry to the Rules dialog that sets a <see cref="float" /> value.
 /// </summary>
 /// <param name="key">The key used in the save file. Will be automatically prefixed with your Mod Identifier.</param>
 /// <param name="target">The type(s) of pawns this option will apply to.</param>
 /// <param name="label">The label of the widget displayed.</param>
 /// <param name="tooltip">The tooltip displayed for the widget.</param>
 /// <param name="defaultValue">This is the default value if <see paramref="allowedInPreset" /> is false or no default rules exist when a pawn is first given rules.</param>
 /// <param name="allowedInPreset">If set to false it cannot be used in a preset.</param>
 /// <returns>Returns a handle for this option.</returns>
 public OptionHandle <float> AddEntry(string key, OptionTarget target, string label, string tooltip, float defaultValue, bool allowedInPreset = true) => AddonOption.Add(this, key, target, OptionWidget.TextEntry, label, tooltip, defaultValue, allowedInPreset);
Esempio n. 3
0
 /// <summary>
 ///     Adds a new Button to the Rules dialog that sets a <see cref="string" /> value. Buttons require <see cref="OptionHandle.OnButtonClick" /> to be used to set the value.
 /// </summary>
 /// <param name="key">The key used in the save file. Will be automatically prefixed with your Mod Identifier.</param>
 /// <param name="target">The type(s) of pawns this option will apply to.</param>
 /// <param name="label">The label of the widget displayed.</param>
 /// <param name="tooltip">The tooltip displayed for the widget.</param>
 /// <param name="defaultValue">This is the default value if <see paramref="allowedInPreset" /> is false or no default rules exist when a pawn is first given rules.</param>
 /// <param name="allowedInPreset">If set to false it cannot be used in a preset.</param>
 /// <returns>Returns a handle for this option.</returns>
 public OptionHandle <string> AddButton(string key, OptionTarget target, string label, string tooltip, string defaultValue, bool allowedInPreset = true) => AddonOption.Add(this, key, target, OptionWidget.Button, label, tooltip, defaultValue, allowedInPreset);
Esempio n. 4
0
 /// <summary>
 ///     Adds a new Toggle to the Rules dialog that sets a <see cref="bool" />.
 /// </summary>
 /// <param name="key">The key used in the save file. Will be automatically prefixed with your Mod Identifier.</param>
 /// <param name="target">The type(s) of pawns this option will apply to.</param>
 /// <param name="label">The label of the widget displayed.</param>
 /// <param name="tooltip">The tooltip displayed for the widget.</param>
 /// <param name="defaultValue">This is the default value if <see paramref="allowedInPreset" /> is false or no default rules exist when a pawn is first given rules.</param>
 /// <param name="allowedInPreset">If set to false it cannot be used in a preset.</param>
 /// <returns>Returns a handle for this option.</returns>
 public OptionHandle <bool> AddToggle(string key, OptionTarget target, string label, string tooltip, bool defaultValue, bool allowedInPreset = true) => AddonOption.Add(this, key, target, OptionWidget.Checkbox, label, tooltip, defaultValue, allowedInPreset);