mirror of
https://github.com/9ParsonsB/Pulsar.git
synced 2025-06-30 16:23:41 -04:00
observatory herald (#30)
* WIP: initial commit for observatory herald * Plugin error handling refactor * make error window non-modal * tidy up plugin error handling * first pass for basic herald functionality * corrections for linux env * Use FNV hash directly instead of managing through dictionary/index file * resolve audio queuing issue, switch to personal NetCoreAudio fork * merge cleanup * add enable setting, populate defaults * framework xml doc update * Adjust settings, add style selection, replace locale with demonym in dropdown list. * Test is position is on screen before saving/loading. * use a default that's actually in the list
This commit is contained in:
@ -6,15 +6,26 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Observatory.Framework
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies text to display as the name of the setting in the UI instead of the property name.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
|
||||
public class SettingDisplayName : Attribute
|
||||
{
|
||||
private string name;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies text to display as the name of the setting in the UI instead of the property name.
|
||||
/// </summary>
|
||||
/// <param name="name">Name to display</param>
|
||||
public SettingDisplayName(string name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Accessor to get/set displayed name.
|
||||
/// </summary>
|
||||
public string DisplayName
|
||||
{
|
||||
get => name;
|
||||
@ -22,18 +33,63 @@ namespace Observatory.Framework
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the property should not be displayed to the user in the UI.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
|
||||
public class SettingIgnore : Attribute
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates numeric properly should use a slider control instead of a numeric textbox with roller.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
|
||||
public class SettingNumericUseSlider : Attribute
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// Specify backing value used by Dictionary<string, object> to indicate selected option.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
|
||||
public class SettingBackingValue : Attribute
|
||||
{
|
||||
private string property;
|
||||
|
||||
/// <summary>
|
||||
/// Specify backing value used by Dictionary<string, object> to indicate selected option.
|
||||
/// </summary>
|
||||
/// <param name="property">Property name for backing value.</param>
|
||||
public SettingBackingValue(string property)
|
||||
{
|
||||
this.property = property;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Accessor to get/set backing value property name.
|
||||
/// </summary>
|
||||
public string BackingProperty
|
||||
{
|
||||
get => property;
|
||||
set => property = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specify bounds for numeric inputs.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
|
||||
public class SettingNumericBounds : Attribute
|
||||
{
|
||||
private double minimum;
|
||||
private double maximum;
|
||||
private double increment;
|
||||
|
||||
/// <summary>
|
||||
/// Specify bounds for numeric inputs.
|
||||
/// </summary>
|
||||
/// <param name="minimum">Minimum allowed value.</param>
|
||||
/// <param name="maximum">Maximum allowed value.</param>
|
||||
/// <param name="increment">Increment between allowed values in slider/roller inputs.</param>
|
||||
public SettingNumericBounds(double minimum, double maximum, double increment = 1.0)
|
||||
{
|
||||
this.minimum = minimum;
|
||||
@ -41,16 +97,27 @@ namespace Observatory.Framework
|
||||
this.increment = increment;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Minimum allowed value.
|
||||
/// </summary>
|
||||
public double Minimum
|
||||
{
|
||||
get => minimum;
|
||||
set => minimum = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Maxunyn allowed value.
|
||||
/// </summary>
|
||||
public double Maximum
|
||||
{
|
||||
get => maximum;
|
||||
set => maximum = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Increment between allowed values in slider/roller inputs.
|
||||
/// </summary>
|
||||
public double Increment
|
||||
{
|
||||
get => increment;
|
||||
|
Reference in New Issue
Block a user