SHA256
Merge branch 'main' into audio
This commit is contained in:
2 files changed
+8
-20
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MelonLoader;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
@@ -46,11 +47,8 @@ namespace ADOFAIRenderer.Data
|
||||
/// </summary>
|
||||
public void SetupValidation()
|
||||
{
|
||||
foreach (var kvp in _fields)
|
||||
foreach (var (fieldName, entry) in _fields)
|
||||
{
|
||||
var fieldName = kvp.Key;
|
||||
var entry = kvp.Value;
|
||||
|
||||
var field = _rootVisualElement.Q<DoubleField>(fieldName);
|
||||
if (field == null)
|
||||
{
|
||||
@@ -68,13 +66,9 @@ namespace ADOFAIRenderer.Data
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var limit in limits)
|
||||
if (limits.Any(limit => !limit.Validate(evt.newValue, out _)))
|
||||
{
|
||||
if (!limit.Validate(evt.newValue, out _))
|
||||
{
|
||||
field.SetValueWithoutNotify(evt.previousValue);
|
||||
return;
|
||||
}
|
||||
field.SetValueWithoutNotify(evt.previousValue);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MelonLoader;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
@@ -46,11 +47,8 @@ namespace ADOFAIRenderer.Data
|
||||
/// </summary>
|
||||
public void SetupValidation()
|
||||
{
|
||||
foreach (var kvp in _fields)
|
||||
foreach (var (fieldName, entry) in _fields)
|
||||
{
|
||||
var fieldName = kvp.Key;
|
||||
var entry = kvp.Value;
|
||||
|
||||
var field = _rootVisualElement.Q<IntegerField>(fieldName);
|
||||
if (field == null)
|
||||
{
|
||||
@@ -68,13 +66,9 @@ namespace ADOFAIRenderer.Data
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var limit in limits)
|
||||
if (limits.Any(limit => !limit.Validate(evt.newValue, out _)))
|
||||
{
|
||||
if (!limit.Validate(evt.newValue, out _))
|
||||
{
|
||||
field.SetValueWithoutNotify(evt.previousValue);
|
||||
return;
|
||||
}
|
||||
field.SetValueWithoutNotify(evt.previousValue);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user