|
|
|
@ -16,6 +16,7 @@ public partial class MinigameController : Node2D
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public required T value;
|
|
|
|
public required T value;
|
|
|
|
public float proportion = 1f;
|
|
|
|
public float proportion = 1f;
|
|
|
|
|
|
|
|
public string text = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public enum DoubleHitHandling
|
|
|
|
public enum DoubleHitHandling
|
|
|
|
@ -45,6 +46,15 @@ public partial class MinigameController : Node2D
|
|
|
|
regions.Last().proportion = proportion;
|
|
|
|
regions.Last().proportion = proportion;
|
|
|
|
return this;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Builder<T> RegionWithText(string text)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (regions.Count == 0)
|
|
|
|
|
|
|
|
throw new InvalidOperationException("No region to set text for");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
regions.Last().text = text;
|
|
|
|
|
|
|
|
return this;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// general settings
|
|
|
|
// general settings
|
|
|
|
public Builder<T> WithDoubleHitHandling(DoubleHitHandling handling)
|
|
|
|
public Builder<T> WithDoubleHitHandling(DoubleHitHandling handling)
|
|
|
|
@ -151,7 +161,7 @@ public partial class MinigameController : Node2D
|
|
|
|
var normalisedAngleEnd = (regionSum + region.proportion) / totalRegionProportion;
|
|
|
|
var normalisedAngleEnd = (regionSum + region.proportion) / totalRegionProportion;
|
|
|
|
var normalAngles = new Vector2(normalisedAngleStart, normalisedAngleEnd);
|
|
|
|
var normalAngles = new Vector2(normalisedAngleStart, normalisedAngleEnd);
|
|
|
|
|
|
|
|
|
|
|
|
regionVisual.Setup(normalAngles, _baseRegionColor.RandomHue());
|
|
|
|
regionVisual.Setup(normalAngles, _baseRegionColor.RandomHue(),region.text);
|
|
|
|
|
|
|
|
|
|
|
|
regionSum += region.proportion;
|
|
|
|
regionSum += region.proportion;
|
|
|
|
|
|
|
|
|
|
|
|
|