Super Sexy Properties Panel

Properties panel now allows nested lists with foldouts, item selection and click callbacks
Properties Panel UI has a new look
Refactored lambdas in control module code into methods for readability
This commit is contained in:
hyperion51 2020-05-31 03:10:11 +01:00
commit 50a8059ed4
43 changed files with 894 additions and 916 deletions

View file

@ -2,6 +2,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Reflection;
using System.Text.RegularExpressions;
using LiteNetLib;
@ -47,6 +48,16 @@ public static class Extensions
"$1 $2"
);
}
public static string SignificantDigits(this float d, int digits=10)
{
int magnitude = (d == 0.0f) ? 0 : (int)Math.Floor(Math.Log10(Math.Abs(d))) + 1;
digits -= magnitude;
if (digits < 0)
digits = 0;
string fmt = "f" + digits.ToString();
return d.ToString(fmt);
}
private static Random? _random;
private static Random Random => (Random) (_random ?? (_random = new Random((uint) (DateTime.Now.Ticks%uint.MaxValue))));