27
27
#pragma warning disable 0169 , 0414 , 0649
28
28
internal sealed class ConfigurationManagerAttributes
29
29
{
30
- /// <summary>
31
- /// Should the setting be shown as a percentage (only use with value range settings).
32
- /// </summary>
33
- public bool ? ShowRangeAsPercent ;
30
+ /// <summary>
31
+ /// Should the setting be shown as a percentage (only use with value range settings).
32
+ /// </summary>
33
+ public bool ? ShowRangeAsPercent ;
34
34
35
- /// <summary>
36
- /// Custom setting editor (OnGUI code that replaces the default editor provided by ConfigurationManager).
37
- /// See below for a deeper explanation. Using a custom drawer will cause many of the other fields to do nothing.
38
- /// </summary>
39
- public System . Action < BepInEx . Configuration . ConfigEntryBase > CustomDrawer ;
35
+ /// <summary>
36
+ /// Custom setting editor (OnGUI code that replaces the default editor provided by ConfigurationManager).
37
+ /// See below for a deeper explanation. Using a custom drawer will cause many of the other fields to do nothing.
38
+ /// </summary>
39
+ public System . Action < BepInEx . Configuration . ConfigEntryBase > CustomDrawer ;
40
40
41
- /// <summary>
42
- /// Custom setting editor that allows polling keyboard input with the Input (or UnityInput) class.
43
- /// Use either CustomDrawer or CustomHotkeyDrawer, using both at the same time leads to undefined behaviour.
44
- /// </summary>
45
- public CustomHotkeyDrawerFunc CustomHotkeyDrawer ;
41
+ /// <summary>
42
+ /// Custom setting editor that allows polling keyboard input with the Input (or UnityInput) class.
43
+ /// Use either CustomDrawer or CustomHotkeyDrawer, using both at the same time leads to undefined behaviour.
44
+ /// </summary>
45
+ public CustomHotkeyDrawerFunc CustomHotkeyDrawer ;
46
46
47
- /// <summary>
48
- /// Custom setting draw action that allows polling keyboard input with the Input class.
49
- /// Note: Make sure to focus on your UI control when you are accepting input so user doesn't type in the search box or in another setting (best to do this on every frame).
50
- /// If you don't draw any selectable UI controls You can use `GUIUtility.keyboardControl = -1;` on every frame to make sure that nothing is selected.
51
- /// </summary>
52
- /// <example>
53
- /// CustomHotkeyDrawer = (ConfigEntryBase setting, ref bool isEditing) =>
54
- /// {
55
- /// if (isEditing)
56
- /// {
57
- /// // Make sure nothing else is selected since we aren't focusing on a text box with GUI.FocusControl.
58
- /// GUIUtility.keyboardControl = -1;
59
- ///
60
- /// // Use Input.GetKeyDown and others here, remember to set isEditing to false after you're done!
61
- /// // It's best to check Input.anyKeyDown and set isEditing to false immediately if it's true,
62
- /// // so that the input doesn't have a chance to propagate to the game itself.
63
- ///
64
- /// if (GUILayout.Button("Stop"))
65
- /// isEditing = false;
66
- /// }
67
- /// else
68
- /// {
69
- /// if (GUILayout.Button("Start"))
70
- /// isEditing = true;
71
- /// }
72
- ///
73
- /// // This will only be true when isEditing is true and you hold any key
74
- /// GUILayout.Label("Any key pressed: " + Input.anyKey);
75
- /// }
76
- /// </example>
77
- /// <param name="setting">
78
- /// Setting currently being set (if available).
79
- /// </param>
80
- /// <param name="isCurrentlyAcceptingInput">
81
- /// Set this ref parameter to true when you want the current setting drawer to receive Input events.
82
- /// The value will persist after being set, use it to see if the current instance is being edited.
83
- /// Remember to set it to false after you are done!
84
- /// </param>
85
- public delegate void CustomHotkeyDrawerFunc ( BepInEx . Configuration . ConfigEntryBase setting , ref bool isCurrentlyAcceptingInput ) ;
47
+ /// <summary>
48
+ /// Custom setting draw action that allows polling keyboard input with the Input class.
49
+ /// Note: Make sure to focus on your UI control when you are accepting input so user doesn't type in the search box or in another setting (best to do this on every frame).
50
+ /// If you don't draw any selectable UI controls You can use `GUIUtility.keyboardControl = -1;` on every frame to make sure that nothing is selected.
51
+ /// </summary>
52
+ /// <example>
53
+ /// CustomHotkeyDrawer = (ConfigEntryBase setting, ref bool isEditing) =>
54
+ /// {
55
+ /// if (isEditing)
56
+ /// {
57
+ /// // Make sure nothing else is selected since we aren't focusing on a text box with GUI.FocusControl.
58
+ /// GUIUtility.keyboardControl = -1;
59
+ ///
60
+ /// // Use Input.GetKeyDown and others here, remember to set isEditing to false after you're done!
61
+ /// // It's best to check Input.anyKeyDown and set isEditing to false immediately if it's true,
62
+ /// // so that the input doesn't have a chance to propagate to the game itself.
63
+ ///
64
+ /// if (GUILayout.Button("Stop"))
65
+ /// isEditing = false;
66
+ /// }
67
+ /// else
68
+ /// {
69
+ /// if (GUILayout.Button("Start"))
70
+ /// isEditing = true;
71
+ /// }
72
+ ///
73
+ /// // This will only be true when isEditing is true and you hold any key
74
+ /// GUILayout.Label("Any key pressed: " + Input.anyKey);
75
+ /// }
76
+ /// </example>
77
+ /// <param name="setting">
78
+ /// Setting currently being set (if available).
79
+ /// </param>
80
+ /// <param name="isCurrentlyAcceptingInput">
81
+ /// Set this ref parameter to true when you want the current setting drawer to receive Input events.
82
+ /// The value will persist after being set, use it to see if the current instance is being edited.
83
+ /// Remember to set it to false after you are done!
84
+ /// </param>
85
+ public delegate void CustomHotkeyDrawerFunc ( BepInEx . Configuration . ConfigEntryBase setting , ref bool isCurrentlyAcceptingInput ) ;
86
86
87
- /// <summary>
88
- /// Show this setting in the settings screen at all? If false, don't show.
89
- /// </summary>
90
- public bool ? Browsable ;
87
+ /// <summary>
88
+ /// Show this setting in the settings screen at all? If false, don't show.
89
+ /// </summary>
90
+ public bool ? Browsable ;
91
91
92
- /// <summary>
93
- /// Category the setting is under. Null to be directly under the plugin.
94
- /// </summary>
95
- public string Category ;
92
+ /// <summary>
93
+ /// Category the setting is under. Null to be directly under the plugin.
94
+ /// </summary>
95
+ public string Category ;
96
96
97
- /// <summary>
98
- /// If set, a "Default" button will be shown next to the setting to allow resetting to default.
99
- /// </summary>
100
- public object DefaultValue ;
97
+ /// <summary>
98
+ /// If set, a "Default" button will be shown next to the setting to allow resetting to default.
99
+ /// </summary>
100
+ public object DefaultValue ;
101
101
102
- /// <summary>
103
- /// Force the "Reset" button to not be displayed, even if a valid DefaultValue is available.
104
- /// </summary>
105
- public bool ? HideDefaultButton ;
102
+ /// <summary>
103
+ /// Force the "Reset" button to not be displayed, even if a valid DefaultValue is available.
104
+ /// </summary>
105
+ public bool ? HideDefaultButton ;
106
106
107
- /// <summary>
108
- /// Force the setting name to not be displayed. Should only be used with a <see cref="CustomDrawer"/> to get more space.
109
- /// Can be used together with <see cref="HideDefaultButton"/> to gain even more space.
110
- /// </summary>
111
- public bool ? HideSettingName ;
107
+ /// <summary>
108
+ /// Force the setting name to not be displayed. Should only be used with a <see cref="CustomDrawer"/> to get more space.
109
+ /// Can be used together with <see cref="HideDefaultButton"/> to gain even more space.
110
+ /// </summary>
111
+ public bool ? HideSettingName ;
112
112
113
- /// <summary>
114
- /// Optional description shown when hovering over the setting.
115
- /// Not recommended, provide the description when creating the setting instead.
116
- /// </summary>
117
- public string Description ;
113
+ /// <summary>
114
+ /// Optional description shown when hovering over the setting.
115
+ /// Not recommended, provide the description when creating the setting instead.
116
+ /// </summary>
117
+ public string Description ;
118
118
119
- /// <summary>
120
- /// Name of the setting.
121
- /// </summary>
122
- public string DispName ;
119
+ /// <summary>
120
+ /// Name of the setting.
121
+ /// </summary>
122
+ public string DispName ;
123
123
124
- /// <summary>
125
- /// Order of the setting on the settings list relative to other settings in a category.
126
- /// 0 by default, higher number is higher on the list.
127
- /// </summary>
128
- public int ? Order ;
124
+ /// <summary>
125
+ /// Order of the setting on the settings list relative to other settings in a category.
126
+ /// 0 by default, higher number is higher on the list.
127
+ /// </summary>
128
+ public int ? Order ;
129
129
130
- /// <summary>
131
- /// Only show the value, don't allow editing it.
132
- /// </summary>
133
- public bool ? ReadOnly ;
130
+ /// <summary>
131
+ /// Only show the value, don't allow editing it.
132
+ /// </summary>
133
+ public bool ? ReadOnly ;
134
134
135
- /// <summary>
136
- /// If true, don't show the setting by default. User has to turn on showing advanced settings or search for it.
137
- /// </summary>
138
- public bool ? IsAdvanced ;
135
+ /// <summary>
136
+ /// If true, don't show the setting by default. User has to turn on showing advanced settings or search for it.
137
+ /// </summary>
138
+ public bool ? IsAdvanced ;
139
139
140
- /// <summary>
141
- /// Custom converter from setting type to string for the built-in editor textboxes.
142
- /// </summary>
143
- public System . Func < object , string > ObjToStr ;
140
+ /// <summary>
141
+ /// Custom converter from setting type to string for the built-in editor textboxes.
142
+ /// </summary>
143
+ public System . Func < object , string > ObjToStr ;
144
144
145
- /// <summary>
146
- /// Custom converter from string to setting type for the built-in editor textboxes.
147
- /// </summary>
148
- public System . Func < string , object > StrToObj ;
145
+ /// <summary>
146
+ /// Custom converter from string to setting type for the built-in editor textboxes.
147
+ /// </summary>
148
+ public System . Func < string , object > StrToObj ;
149
149
}
0 commit comments