@@ -24,19 +24,56 @@ public enum HealthBarForecastGrowthDirection
2424 /// One forecast overlay segment for a creature health bar.
2525 /// </summary>
2626 /// <param name="Amount">HP amount represented by this segment.</param>
27- /// <param name="Color">Overlay tint.</param>
27+ /// <param name="Color">
28+ /// Lethal HP label theming; also used as the forecast nine-patch <see cref="CanvasItem.SelfModulate" /> when
29+ /// <see cref="OverlaySelfModulate" /> is null.
30+ /// </param>
2831 /// <param name="Direction">Which edge the segment grows from.</param>
2932 /// <param name="Order">
3033 /// Lower values are rendered earlier in the chain.
3134 /// For <see cref="HealthBarForecastGrowthDirection.FromRight" />, earlier segments stay closer to the current HP
3235 /// edge; for <see cref="HealthBarForecastGrowthDirection.FromLeft" />, earlier segments stay closer to the empty
3336 /// edge.
3437 /// </param>
38+ /// <param name="OverlayMaterial">
39+ /// Optional Godot material (e.g. shader like vanilla doom). When null, only <see cref="Color" /> tint applies.
40+ /// </param>
41+ /// <param name="OverlaySelfModulate">
42+ /// Optional <see cref="CanvasItem.SelfModulate" /> for the forecast nine-patch. When null, <see cref="Color" /> is
43+ /// used
44+ /// for both overlay tint and lethal HP label; when set, <see cref="Color" /> is still used for lethal label theming.
45+ /// </param>
3546 public readonly record struct HealthBarForecastSegment (
3647 int Amount ,
3748 Color Color ,
3849 HealthBarForecastGrowthDirection Direction ,
39- int Order = 0 ) ;
50+ int Order ,
51+ Material ? OverlayMaterial ,
52+ Color ? OverlaySelfModulate = null )
53+ {
54+ /// <summary>
55+ /// Initializes a segment without overlay material or separate overlay modulate.
56+ /// </summary>
57+ public HealthBarForecastSegment ( int amount , Color color , HealthBarForecastGrowthDirection direction ,
58+ int order = 0 )
59+ : this ( amount , color , direction , order , null , null )
60+ {
61+ }
62+
63+ /// <summary>
64+ /// Initializes a segment with an optional <see cref="OverlayMaterial" /> and default overlay modulate.
65+ /// </summary>
66+ // ReSharper disable once RedundantOverload.Global
67+ public HealthBarForecastSegment (
68+ int amount ,
69+ Color color ,
70+ HealthBarForecastGrowthDirection direction ,
71+ int order ,
72+ Material ? overlayMaterial )
73+ : this ( amount , color , direction , order , overlayMaterial , null )
74+ {
75+ }
76+ }
4077
4178 /// <summary>
4279 /// Helpers for common turn-relative ordering of forecast segments.
@@ -74,6 +111,9 @@ public static class HealthBarForecastRegistry
74111 /// <summary>
75112 /// Registers or replaces a forecast provider for <paramref name="modId" />.
76113 /// </summary>
114+ /// <typeparam name="TSource">Concrete <see cref="IHealthBarForecastSource" /> with a parameterless constructor.</typeparam>
115+ /// <param name="modId">Owning mod identifier.</param>
116+ /// <param name="sourceId">Optional unique id; defaults to the type full name.</param>
77117 public static void Register < TSource > ( string modId , string ? sourceId = null )
78118 where TSource : IHealthBarForecastSource , new ( )
79119 {
@@ -83,6 +123,9 @@ public static void Register<TSource>(string modId, string? sourceId = null)
83123 /// <summary>
84124 /// Registers or replaces a forecast source instance for <paramref name="modId" />.
85125 /// </summary>
126+ /// <param name="modId">Owning mod identifier.</param>
127+ /// <param name="sourceId">Unique id for this source within the mod.</param>
128+ /// <param name="source">Provider instance.</param>
86129 public static void Register (
87130 string modId ,
88131 string sourceId ,
@@ -106,6 +149,9 @@ public static void Register(
106149 /// <summary>
107150 /// Removes a previously registered provider.
108151 /// </summary>
152+ /// <param name="modId">Mod identifier used at registration.</param>
153+ /// <param name="sourceId">Source id used at registration.</param>
154+ /// <returns><see langword="true" /> if an entry was removed.</returns>
109155 public static bool Unregister ( string modId , string sourceId )
110156 {
111157 ArgumentException . ThrowIfNullOrWhiteSpace ( modId ) ;
@@ -117,6 +163,10 @@ public static bool Unregister(string modId, string sourceId)
117163 }
118164 }
119165
166+ /// <summary>
167+ /// Collects segments from powers implementing <see cref="IHealthBarForecastSource" /> and registered providers.
168+ /// </summary>
169+ /// <param name="creature">Creature whose bar is being evaluated.</param>
120170 internal static IReadOnlyList < RegisteredHealthBarForecastSegment > GetSegments ( Creature creature )
121171 {
122172 ArgumentNullException . ThrowIfNull ( creature ) ;
@@ -176,6 +226,11 @@ where segment.Amount > 0
176226 }
177227 }
178228
229+ /// <summary>
230+ /// Segment plus a sequence key for stable ordering when <see cref="HealthBarForecastSegment.Order" /> ties.
231+ /// </summary>
232+ /// <param name="Segment">Forecast data.</param>
233+ /// <param name="SequenceOrder">Monotonic key (powers first, then registered sources).</param>
179234 internal readonly record struct RegisteredHealthBarForecastSegment (
180235 HealthBarForecastSegment Segment ,
181236 long SequenceOrder ) ;
0 commit comments