Rewrite property panel to adapt to ruleset config.

This commit is contained in:
2023-07-27 22:07:20 +08:00
parent 9b091a0084
commit bc51a45df8
39 changed files with 825 additions and 298 deletions

View File

@@ -0,0 +1,18 @@
using System;
namespace Cryville.Crtr.Config {
public class PVPNumber : PVPNumberBase {
protected override void OnValueUpdated() {
base.OnValueUpdated();
if (Range != null && Range.Length == 2) {
var min = (double)Range[0];
var max = (double)Range[1];
SetRatio((float)((Convert.ToDouble(RawValue) - min) / (max - min)));
}
}
protected override double GetValue(double ratio, float deltaTime, double min, double max) {
// if (LogarithmicMode) throw new NotImplementedException();
return (1 - ratio) * min + ratio * max;
}
}
}