upload
This commit is contained in:
commit
1c7a8cf25f
579 files changed
+83196
No files matched your search
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
|
||||
namespace VibranceHud;
|
||||
|
||||
public static class DriverVibranceIntent
|
||||
{
|
||||
public static int? For(bool userChoseAVibrance, int vibrance, int baseline, bool effectSuspended)
|
||||
{
|
||||
if (!userChoseAVibrance)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (effectSuspended)
|
||||
{
|
||||
if (!IsARealBaseline(baseline))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return baseline;
|
||||
}
|
||||
return Clamp(vibrance);
|
||||
}
|
||||
|
||||
private static bool IsARealBaseline(int baseline)
|
||||
{
|
||||
if (baseline >= 0)
|
||||
{
|
||||
return baseline <= 100;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static int Clamp(int level)
|
||||
{
|
||||
return Math.Clamp(level, 0, 100);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user