mudlet-map-renderer 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -116,7 +116,7 @@ export declare class KonvaRenderBackend implements InteractiveBackend {
116
116
  private applyPositionMarker;
117
117
  private clearCurrentRoomOverlay;
118
118
  private updateCurrentRoomOverlay;
119
- syncHighlight(roomId: number, color: string | undefined): void;
119
+ syncHighlight(roomId: number, colors: string[] | undefined): void;
120
120
  syncHighlights(): void;
121
121
  syncPaths(): void;
122
122
  private clearOverlayShapes;
@@ -99,7 +99,12 @@ export declare class MapRenderer {
99
99
  updatePositionMarker(roomId: number): void;
100
100
  clearPosition(): void;
101
101
  centerOn(roomId: number, instant?: boolean): void;
102
- renderHighlight(roomId: number, color: string): void;
102
+ /**
103
+ * Highlight a room. Pass a single colour for the classic ring/marker, or an
104
+ * array of colours to split the highlight into that many equal pie wedges
105
+ * (one colour each).
106
+ */
107
+ renderHighlight(roomId: number, color: string | string[]): void;
103
108
  removeHighlight(roomId: number): void;
104
109
  hasHighlight(roomId: number): boolean;
105
110
  clearHighlights(): void;
@@ -7,15 +7,19 @@ export type HighlightData = {
7
7
  /** For circle: radius. For rect: half-size. */
8
8
  size: number;
9
9
  cornerRadius: number;
10
- strokeColor: string;
10
+ /**
11
+ * One or more colours. A single colour draws the classic ring/marker; two
12
+ * or more split the highlight into that many equal pie wedges (one colour
13
+ * each).
14
+ */
15
+ colors: string[];
11
16
  strokeAlpha: number;
12
17
  strokeWidth: number;
13
- fillColor: string;
14
18
  fillAlpha: number;
15
19
  dash?: number[];
16
20
  dashEnabled: boolean;
17
21
  };
18
- export declare function computeHighlight(room: MapData.Room, color: string, settings: Settings): HighlightData;
22
+ export declare function computeHighlight(room: MapData.Room, color: string | string[], settings: Settings): HighlightData;
19
23
  export type PositionMarkerData = {
20
24
  shape: 'circle' | 'rect';
21
25
  cx: number;
@@ -62,6 +62,13 @@ export interface Paint {
62
62
  }
63
63
  /** True when `fill` is a gradient object rather than a colour string. */
64
64
  export declare function isGradientFill(fill: FillStyle | undefined): fill is LinearGradient | RadialGradient;
65
+ /**
66
+ * Resolve a paint's effective dash pattern. Returns the dash only when it is
67
+ * present AND not explicitly disabled (`dashEnabled === false` blanks it).
68
+ * Renderers call this so every shape kind — rect, circle, line — honours
69
+ * `dashEnabled` identically.
70
+ */
71
+ export declare function resolveDash(dash: number[] | undefined, dashEnabled: boolean | undefined): number[] | undefined;
65
72
  /**
66
73
  * Apply a camera-style affine (translate by world origin, scale uniformly,
67
74
  * translate by render offset) to a fill. Strings pass through unchanged.
@@ -6,6 +6,9 @@ import { Shape } from '../Shape';
6
6
  * a group) so the corner dashes line up cleanly — each side's dash pattern
7
7
  * starts fresh at the corner instead of wrapping continuously around the
8
8
  * perimeter (same approach as the backend renderer).
9
+ *
10
+ * When the highlight carries more than one colour the ring is split into that
11
+ * many equal pie wedges via {@link highlightWedgesToShape}.
9
12
  */
10
13
  export declare function highlightToShape(data: HighlightData): Shape;
11
14
  /** Build the player-position marker. */
@@ -129,10 +129,18 @@ export type HighlightStyle = {
129
129
  */
130
130
  dashEnabled: boolean;
131
131
  /**
132
- * When true, the highlight shape matches the current roomShape setting
133
- * (rectangle, circle, or roundedRectangle). When false, the highlight is always a circle.
132
+ * @deprecated Use {@link shape} instead. Only consulted when `shape` is
133
+ * `'match'` (or omitted): when true (the default) the highlight follows the
134
+ * current roomShape (rectangle / roundedRectangle / circle); when false it
135
+ * is always a circle.
134
136
  */
135
- matchRoomShape: boolean;
137
+ matchRoomShape?: boolean;
138
+ /**
139
+ * Outline shape of the highlight. `'match'` (the default when omitted)
140
+ * follows the current roomShape; the other values force that specific shape
141
+ * regardless of the room's shape.
142
+ */
143
+ shape?: 'match' | 'rectangle' | 'roundedRectangle' | 'circle';
136
144
  };
137
145
  /**
138
146
  * Settings for map rendering.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mudlet-map-renderer",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "url": "https://github.com/Delwing/mudlet-map-renderer"