@league-of-foundry-developers/foundry-vtt-types 9.255.3 → 9.268.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.
- package/README.md +5 -4
- package/package.json +3 -2
- package/src/foundry/common/data/data.mjs/index.d.ts +0 -1
- package/src/foundry/common/utils/helpers.mjs.d.ts +1 -0
- package/src/foundry/foundry.js/application.d.ts +0 -1
- package/src/foundry/foundry.js/applications/chatPopout.d.ts +1 -1
- package/src/foundry/foundry.js/applications/compendium.d.ts +20 -11
- package/src/foundry/foundry.js/applications/controlsReference.d.ts +17 -2
- package/src/foundry/foundry.js/applications/filePicker.d.ts +67 -75
- package/src/foundry/foundry.js/applications/formApplication.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/avConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +2 -4
- package/src/foundry/foundry.js/applications/formApplications/{entitySheetConfig.d.ts → documentSheetConfig.d.ts} +36 -19
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +1 -4
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +2 -4
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardConfig.d.ts +51 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfig.d.ts +88 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfigs/cardsHand.d.ts +20 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfigs/cardsPile.d.ts +20 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfigs/index.d.ts +2 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/combatantConfig.d.ts +2 -4
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/folderConfig.d.ts +17 -11
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +3 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/itemSheet.d.ts +3 -9
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/journalSheet.d.ts +10 -12
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/macroConfig.d.ts +4 -5
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +2 -6
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +1 -4
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +8 -12
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +2 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistSoundConfig.d.ts +1 -4
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +10 -11
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +28 -15
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +3 -6
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/userConfig.d.ts +1 -4
- package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +17 -21
- package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +40 -7
- package/src/foundry/foundry.js/applications/formApplications/index.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/moduleManagement.d.ts +10 -24
- package/src/foundry/foundry.js/applications/formApplications/permissionConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +15 -3
- package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +23 -16
- package/src/foundry/foundry.js/applications/formApplications/{defaultTokenConfig.d.ts → tokenConfigs/defaultTokenConfig.d.ts} +29 -16
- package/src/foundry/foundry.js/applications/formApplications/tokenConfigs/index.d.ts +1 -0
- package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +22 -15
- package/src/foundry/foundry.js/applications/index.d.ts +1 -0
- package/src/foundry/foundry.js/applications/invitationLinks.d.ts +25 -10
- package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +65 -38
- package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +17 -3
- package/src/foundry/foundry.js/applications/sidebarTabs/settings.d.ts +19 -16
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/actorDirectory.d.ts +0 -3
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/journalDirectory.d.ts +4 -18
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/macroDirectory.d.ts +2 -8
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +38 -5
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/sceneDirectory.d.ts +6 -0
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +3 -1
- package/src/foundry/foundry.js/applications/supportDetails.d.ts +78 -0
- package/src/foundry/foundry.js/clientDocuments/cards.d.ts +8 -0
- package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +87 -49
- package/src/foundry/foundry.js/clientDocuments/folder.d.ts +2 -6
- package/src/foundry/foundry.js/clientDocuments/playlistSound.d.ts +6 -0
- package/src/foundry/foundry.js/collections/documentCollections/worldCollection.d.ts +2 -2
- package/src/foundry/foundry.js/config.d.ts +21 -21
- package/src/foundry/foundry.js/contextMenu.d.ts +37 -28
- package/src/foundry/foundry.js/game.d.ts +2 -2
- package/src/foundry/foundry.js/pixi/containers/canvasLayer.d.ts +2 -1
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/controlsLayer.d.ts +49 -48
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayer.d.ts +51 -40
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/lightingLayer.d.ts +63 -20
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayer.d.ts +0 -3
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/backgroundLayer.d.ts +4 -4
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/foregroundLayer.d.ts +21 -0
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/notesLayer.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/soundsLayer.d.ts +10 -2
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/tokenLayer.d.ts +41 -20
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +50 -121
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/sightLayer.d.ts +125 -107
- package/src/foundry/foundry.js/pixi/containers/controlIcon.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/tile.d.ts +11 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +34 -27
- package/src/foundry/foundry.js/pixi/filters/abstractFilter.d.ts +42 -0
- package/src/foundry/foundry.js/pixi/filters/abstractFilters/fogColorFilter.d.ts +16 -0
- package/src/foundry/foundry.js/pixi/filters/abstractFilters/forceColorFilter.d.ts +17 -0
- package/src/foundry/foundry.js/pixi/filters/abstractFilters/glowFilter.d.ts +31 -0
- package/src/foundry/foundry.js/pixi/filters/abstractFilters/index.d.ts +4 -0
- package/src/foundry/foundry.js/pixi/filters/abstractFilters/roofMaskFilter.d.ts +20 -0
- package/src/foundry/foundry.js/pixi/filters/index.d.ts +2 -0
- package/src/foundry/foundry.js/roll.d.ts +2 -2
- package/src/foundry/foundry.js/rollTerms/poolTerm.d.ts +5 -0
- package/src/types/augments/index.d.ts +2 -0
- package/src/types/augments/pixiGraphicsSmooth.d.ts +7 -0
- package/src/types/augments/pixiLegacyGraphics.d.ts +7 -0
package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts
CHANGED
@@ -11,17 +11,16 @@ declare global {
|
|
11
11
|
constructor();
|
12
12
|
|
13
13
|
/**
|
14
|
-
*
|
15
|
-
* @defaultValue `
|
14
|
+
* An array of Wall objects which represent the boundaries of the canvas.
|
15
|
+
* @defaultValue `new Set()`
|
16
16
|
*/
|
17
|
-
|
17
|
+
boundaries: Set<Wall>;
|
18
18
|
|
19
19
|
/**
|
20
|
-
*
|
21
|
-
*
|
22
|
-
* @defaultValue `[]`
|
20
|
+
* A graphics layer used to display chained Wall selection
|
21
|
+
* @defaultValue `null`
|
23
22
|
*/
|
24
|
-
|
23
|
+
chain: PIXI.Graphics | null;
|
25
24
|
|
26
25
|
/**
|
27
26
|
* Track whether we are currently within a chained placement workflow
|
@@ -47,13 +46,11 @@ declare global {
|
|
47
46
|
* @defaultValue
|
48
47
|
* ```
|
49
48
|
* {
|
50
|
-
* id: null,
|
51
49
|
* point: null,
|
52
50
|
* }
|
53
51
|
* ```
|
54
52
|
*/
|
55
53
|
protected last: {
|
56
|
-
id: string | null;
|
57
54
|
point: PointArray | null;
|
58
55
|
};
|
59
56
|
|
@@ -69,9 +66,6 @@ declare global {
|
|
69
66
|
* mergeObject(super.layerOptions, {
|
70
67
|
* name: "walls"
|
71
68
|
* controllableObjects: true,
|
72
|
-
* objectClass: Wall,
|
73
|
-
* quadtree: true,
|
74
|
-
* sheetClass: WallConfig,
|
75
69
|
* sortActiveTop: true,
|
76
70
|
* zIndex: 40
|
77
71
|
* })
|
@@ -107,6 +101,12 @@ declare global {
|
|
107
101
|
*/
|
108
102
|
initialize(): void;
|
109
103
|
|
104
|
+
/**
|
105
|
+
* Initialization to identify all intersections between walls.
|
106
|
+
* These intersections are cached and used later when computing point source polygons.
|
107
|
+
*/
|
108
|
+
identifyWallIntersections(): void;
|
109
|
+
|
110
110
|
/**
|
111
111
|
* Identify walls which are treated as "interior" because they are contained fully within a roof tile.
|
112
112
|
*/
|
@@ -120,31 +120,21 @@ declare global {
|
|
120
120
|
*/
|
121
121
|
static getClosestEndpoint(point: Point, wall: InstanceType<ConfiguredObjectClassForName<'Wall'>>): PointArray;
|
122
122
|
|
123
|
-
/**
|
124
|
-
* Given an array of Wall instances, identify the unique endpoints across all walls.
|
125
|
-
* @param walls - An array of Wall instances
|
126
|
-
* @param options - Additional options which modify the set of endpoints identified
|
127
|
-
* (defaultValue: `{}`)
|
128
|
-
* @returns An array of endpoints
|
129
|
-
*/
|
130
|
-
static getUniqueEndpoints(
|
131
|
-
walls:
|
132
|
-
| InstanceType<ConfiguredObjectClassForName<'Wall'>>[]
|
133
|
-
| Set<InstanceType<ConfiguredObjectClassForName<'Wall'>>>,
|
134
|
-
options?: EndpointOptions
|
135
|
-
): PointArray[];
|
136
|
-
|
137
123
|
/**
|
138
124
|
* Test whether movement along a given Ray collides with a Wall.
|
139
125
|
* @param ray - The attempted movement
|
140
126
|
* @param options - Options which customize how collision is tested
|
141
|
-
* @returns
|
127
|
+
* @returns False if there are no Walls
|
128
|
+
* True if the Ray is outside the Canvas
|
129
|
+
* Whether any collision occurred if mode is "any"
|
130
|
+
* An array of collisions, if mode is "all"
|
131
|
+
* The closest collision, if mode is "closest"
|
142
132
|
*/
|
143
|
-
checkCollision(ray: Ray, options: CollisionOptions & { mode: 'all' }): boolean |
|
144
|
-
checkCollision(ray: Ray, options: CollisionOptions & { mode: 'closest' }): boolean |
|
133
|
+
checkCollision(ray: Ray, options: CollisionOptions & { mode: 'all' }): boolean | PolygonVertex[];
|
134
|
+
checkCollision(ray: Ray, options: CollisionOptions & { mode: 'closest' }): boolean | PolygonVertex;
|
145
135
|
checkCollision(ray: Ray, options: CollisionOptions & { mode: 'any' }): boolean;
|
146
136
|
checkCollision(ray: Ray, options: Omit<CollisionOptions, 'mode'>): boolean;
|
147
|
-
checkCollision(ray: Ray, options: CollisionOptions): boolean |
|
137
|
+
checkCollision(ray: Ray, options: CollisionOptions): boolean | PolygonVertex;
|
148
138
|
checkCollision(ray: Ray, options?: CollisionOptions): boolean;
|
149
139
|
|
150
140
|
/**
|
@@ -164,6 +154,12 @@ declare global {
|
|
164
154
|
options?: PasteOptions
|
165
155
|
): Promise<InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseWall>>[]>;
|
166
156
|
|
157
|
+
/**
|
158
|
+
* Create temporary WallDocument instances which represent the rectangular boundaries of the canvas.
|
159
|
+
* @internal
|
160
|
+
*/
|
161
|
+
protected _createBoundaries(): void;
|
162
|
+
|
167
163
|
/**
|
168
164
|
* Pan the canvas view when the cursor position gets close to the edge of the frame
|
169
165
|
* @param event - The originating mouse movement event
|
@@ -189,8 +185,10 @@ declare global {
|
|
189
185
|
*/
|
190
186
|
protected _getWallDataFromActiveTool(tool: string):
|
191
187
|
| {
|
192
|
-
|
193
|
-
|
188
|
+
light: foundry.CONST.WALL_SENSE_TYPES;
|
189
|
+
sight: foundry.CONST.WALL_SENSE_TYPES;
|
190
|
+
sound: foundry.CONST.WALL_SENSE_TYPES;
|
191
|
+
move: foundry.CONST.WALL_SENSE_TYPES;
|
194
192
|
door?: foundry.CONST.WALL_DOOR_TYPES;
|
195
193
|
}
|
196
194
|
| this['_cloneType'];
|
@@ -210,32 +208,14 @@ declare global {
|
|
210
208
|
/** @override */
|
211
209
|
protected _onClickRight(event: PIXI.InteractionEvent): void;
|
212
210
|
|
213
|
-
/**
|
214
|
-
* Compute source polygons of a requested type for a given origin position and maximum radius.
|
215
|
-
* This method returns two polygons, one which is unrestricted by the provided radius, and one that is constrained
|
216
|
-
* by the maximum radius.
|
217
|
-
*
|
218
|
-
* @param origin - An point with coordinates x and y representing the origin of the test
|
219
|
-
* @param radius - A distance in canvas pixels which reflects the visible range
|
220
|
-
* @param options - Additional options which modify the sight computation
|
221
|
-
* (default: `{}`)
|
222
|
-
* @returns The computed rays and polygons
|
223
|
-
*/
|
211
|
+
/** @deprecated since v9 */
|
224
212
|
computePolygon(
|
225
213
|
origin: Point,
|
226
214
|
radius: number,
|
227
215
|
options?: ComputePolygonOptions
|
228
216
|
): { rays: Ray[]; los: PIXI.Polygon; fov: PIXI.Polygon };
|
229
217
|
|
230
|
-
/**
|
231
|
-
* Get the set of wall collisions for a given Ray
|
232
|
-
* @param ray - The Ray being tested
|
233
|
-
* @param options - Options which customize how collision is tested
|
234
|
-
* (default: `{}`)
|
235
|
-
* @returns An array of collisions, if mode is "all"
|
236
|
-
* The closest collision, if mode is "closest"
|
237
|
-
* Whether any collision occurred if mode is "any"
|
238
|
-
*/
|
218
|
+
/** @deprecated since v9 */
|
239
219
|
getRayCollisions(ray: Ray, options: RayCollisionsOptions & { mode: 'all' }): RayIntersection[];
|
240
220
|
getRayCollisions(ray: Ray, options: RayCollisionsOptions & { mode: 'closest' }): RayIntersection | null;
|
241
221
|
getRayCollisions(ray: Ray, options: RayCollisionsOptions & { mode: 'any' }): boolean;
|
@@ -243,77 +223,26 @@ declare global {
|
|
243
223
|
getRayCollisions(ray: Ray, options?: RayCollisionsOptions): RayIntersection[] | RayIntersection | boolean | null;
|
244
224
|
|
245
225
|
/**
|
246
|
-
*
|
247
|
-
*
|
248
|
-
*
|
249
|
-
* @param x - The origin x-coordinate
|
250
|
-
* @param y - The origin y-coordinate
|
251
|
-
* @param distance - The ray distance
|
252
|
-
* @param density - The desired radial density
|
253
|
-
* (default: `4`)
|
254
|
-
* @param endpoints - An array of endpoints to target
|
255
|
-
* @param limitAngle - Whether the rays should be cast subject to a limited angle of emission
|
256
|
-
* (default: `false`)
|
257
|
-
* @param aMin - The minimum bounding angle
|
258
|
-
* @param aMax - The maximum bounding angle
|
259
|
-
*
|
260
|
-
* @returns An array of Ray objects
|
261
|
-
*/
|
262
|
-
static castRays(
|
263
|
-
x: number,
|
264
|
-
y: number,
|
265
|
-
distance: number,
|
266
|
-
{
|
267
|
-
density,
|
268
|
-
endpoints,
|
269
|
-
limitAngle,
|
270
|
-
aMin,
|
271
|
-
aMax
|
272
|
-
}?: { density?: number; endpoints?: PointArray[]; limitAngle?: boolean; aMin?: number; aMax?: number }
|
273
|
-
): Ray[];
|
274
|
-
|
275
|
-
/**
|
276
|
-
* Test a single Ray against a single Wall
|
277
|
-
* @param ray - The Ray being tested
|
278
|
-
* @param wall - The Wall against which to test
|
279
|
-
* @returns A RayIntersection if a collision occurred, or null
|
280
|
-
*/
|
281
|
-
static testWall(ray: Ray, wall: InstanceType<ConfiguredObjectClassForName<'Wall'>>): RayIntersection | null;
|
282
|
-
|
283
|
-
/**
|
284
|
-
* Identify the closest collision point from an array of collisions
|
285
|
-
* @param collisions - An array of intersection points
|
286
|
-
* @returns The closest blocking intersection or null if no collision occurred
|
287
|
-
*/
|
288
|
-
static getClosestCollision(collisions: RayIntersection[]): RayIntersection | null;
|
289
|
-
|
290
|
-
/**
|
291
|
-
* Normalize an angle to ensure it is baselined to be the smallest angle that is greater than a minimum.
|
292
|
-
* @param aMin - The lower-bound minimum angle
|
293
|
-
* @param angle - The angle to adjust
|
294
|
-
* @returns The adjusted angle which is greater than or equal to aMin.
|
295
|
-
*/
|
296
|
-
protected static _normalizeAngle(aMin: number, angle: number): number;
|
297
|
-
|
298
|
-
/**
|
299
|
-
* Map source types to wall collision types
|
300
|
-
* @param type - The source polygon type
|
301
|
-
* @returns The wall collision attribute
|
302
|
-
*/
|
303
|
-
protected static _mapCollisionType(type: 'movement'): 'move';
|
304
|
-
protected static _mapCollisionType(type: 'light'): 'sense';
|
305
|
-
protected static _mapCollisionType(type: 'sight'): 'sense';
|
306
|
-
protected static _mapCollisionType(type: 'sound'): 'sound';
|
307
|
-
|
308
|
-
/**
|
309
|
-
* @deprecated since 0.8.0
|
226
|
+
* An array of all the unique perception-blocking endpoints which are present in the layer
|
227
|
+
* We keep this array cached for faster sight polygon computations
|
228
|
+
* @deprecated since v9
|
310
229
|
*/
|
311
|
-
get
|
230
|
+
get endpoints(): PointArray[];
|
312
231
|
|
313
232
|
/**
|
314
|
-
*
|
233
|
+
* Given an array of Wall instances, identify the unique endpoints across all walls.
|
234
|
+
* @param walls - An array of Wall instances
|
235
|
+
* @param options - Additional options which modify the set of endpoints identified
|
236
|
+
* (defaultValue: `{}`)
|
237
|
+
* @returns An array of endpoints
|
238
|
+
* @deprecated since v9
|
315
239
|
*/
|
316
|
-
|
240
|
+
static getUniqueEndpoints(
|
241
|
+
walls:
|
242
|
+
| InstanceType<ConfiguredObjectClassForName<'Wall'>>[]
|
243
|
+
| Set<InstanceType<ConfiguredObjectClassForName<'Wall'>>>,
|
244
|
+
options?: EndpointOptions
|
245
|
+
): PointArray[];
|
317
246
|
}
|
318
247
|
|
319
248
|
namespace WallsLayer {
|
@@ -345,9 +274,9 @@ interface EndpointOptions {
|
|
345
274
|
interface CollisionOptions {
|
346
275
|
/**
|
347
276
|
* Which collision type to check: movement, sight, sound
|
348
|
-
* @defaultValue `'
|
277
|
+
* @defaultValue `'move'`
|
349
278
|
*/
|
350
|
-
type?: '
|
279
|
+
type?: 'move' | 'sight' | 'sound';
|
351
280
|
|
352
281
|
/**
|
353
282
|
* Which type of collisions are returned: any, closest, all
|
@@ -4,18 +4,17 @@
|
|
4
4
|
* @see PointSource
|
5
5
|
*
|
6
6
|
* The container structure of this layer is as follows:
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
15
|
-
*
|
16
|
-
*
|
17
|
-
*
|
18
|
-
* msk: PIXI.Graphics The masking rectangle that limits exploration to the Scene background
|
7
|
+
*
|
8
|
+
* unexplored The unexplored background which spans the entire canvas
|
9
|
+
* explored The exploration container which tracks exploration progress
|
10
|
+
* revealed A container of regions which have previously been revealed
|
11
|
+
* saved The saved fog exploration texture
|
12
|
+
* pending Pending exploration which has not yet been committed to the texture
|
13
|
+
* vision The container of current vision exploration
|
14
|
+
* vision.base Baseline provided vision
|
15
|
+
* vision.fov Current light source field-of-view polygons
|
16
|
+
* vision.los Current vision source line-of-sight polygons
|
17
|
+
* vision.roofs Roof textures which should temporarily be revealed
|
19
18
|
*
|
20
19
|
* @example <caption>The sightRefresh hook</caption>
|
21
20
|
* ```typescript
|
@@ -26,6 +25,21 @@ import { ConfiguredDocumentClass } from '../../../../../types/helperTypes';
|
|
26
25
|
|
27
26
|
declare global {
|
28
27
|
class SightLayer extends CanvasLayer<SightLayer.LayerOptions> {
|
28
|
+
/** The unexplored background which spans the entire canvas */
|
29
|
+
unexplored?: PIXI.Graphics;
|
30
|
+
|
31
|
+
/** The exploration container which tracks exploration progress */
|
32
|
+
explored?: PIXI.Container;
|
33
|
+
|
34
|
+
/** A container of regions which have previously been revealed */
|
35
|
+
revealed?: PIXI.Container;
|
36
|
+
|
37
|
+
/** The saved fog exploration texture */
|
38
|
+
saved?: PIXI.Sprite;
|
39
|
+
|
40
|
+
/** Pending exploration which has not yet been committed to the texture */
|
41
|
+
pending?: PIXI.Container;
|
42
|
+
|
29
43
|
constructor();
|
30
44
|
|
31
45
|
/**
|
@@ -39,46 +53,78 @@ declare global {
|
|
39
53
|
*/
|
40
54
|
sources: foundry.utils.Collection<PointSource>;
|
41
55
|
|
42
|
-
/**
|
43
|
-
* The canonical line-of-sight polygon which defines current Token visibility.
|
44
|
-
*/
|
45
|
-
los: PIXI.Graphics;
|
46
|
-
|
47
56
|
/**
|
48
57
|
* A status flag for whether the layer initialization workflow has succeeded
|
49
58
|
* @defaultValue `false`
|
59
|
+
* @internal
|
50
60
|
*/
|
51
61
|
protected _initialized: boolean;
|
52
62
|
|
53
63
|
/**
|
54
|
-
* A
|
55
|
-
* @defaultValue `[]`
|
64
|
+
* A debounced function to save fog of war exploration once a stream of updates have stopped
|
56
65
|
*/
|
57
|
-
|
66
|
+
debounceSaveFog: (...args: Parameters<this['saveFog']>) => void;
|
58
67
|
|
59
68
|
/**
|
60
|
-
*
|
61
|
-
* @defaultValue `
|
69
|
+
* The current vision container which provides line-of-sight for vision sources and field-of-view of light sources.
|
70
|
+
* @defaultValue `undefined`
|
62
71
|
*/
|
63
|
-
|
72
|
+
vision:
|
73
|
+
| (PIXI.Container & {
|
74
|
+
/** Baseline provided vision */
|
75
|
+
base: PIXI.Graphics;
|
76
|
+
|
77
|
+
/** Current light source field-of-view polygons */
|
78
|
+
fov: PIXI.Container;
|
79
|
+
|
80
|
+
/** Current vision source line-of-sight polygons */
|
81
|
+
los: PIXI.Graphics;
|
82
|
+
|
83
|
+
/** Roof textures which should temporarily be revealed */
|
84
|
+
roofs: PIXI.Container;
|
85
|
+
})
|
86
|
+
| undefined;
|
64
87
|
|
65
88
|
/**
|
66
|
-
*
|
67
|
-
* @defaultValue `
|
89
|
+
* The canonical line-of-sight polygon which defines current Token visibility.
|
90
|
+
* @defaultValue `undefined`
|
68
91
|
*/
|
69
|
-
|
92
|
+
los: PIXI.Graphics | undefined;
|
70
93
|
|
71
94
|
/**
|
72
|
-
* A
|
95
|
+
* A cached container which creates a render texture used for the LOS mask.
|
96
|
+
* @defaultValue `undefined`
|
73
97
|
*/
|
74
|
-
|
98
|
+
losCache: CachedContainer | undefined;
|
99
|
+
|
100
|
+
/**
|
101
|
+
* Track whether we have pending fog updates which have not yet been saved to the database
|
102
|
+
* @defaultValue `false`
|
103
|
+
* @internal
|
104
|
+
*/
|
105
|
+
protected _fogUpdated: boolean;
|
75
106
|
|
76
107
|
/**
|
77
108
|
* The configured resolution used for the saved fog-of-war texture
|
78
109
|
* @defaultValue `undefined`
|
110
|
+
* @internal
|
79
111
|
*/
|
80
112
|
protected _fogResolution: { resolution: number; width: number; height: number } | undefined;
|
81
113
|
|
114
|
+
/**
|
115
|
+
* A pool of RenderTexture objects which can be cycled through to save fog exploration progress.
|
116
|
+
* @defaultValue `[]`
|
117
|
+
* @internal
|
118
|
+
*/
|
119
|
+
protected _fogTextures: PIXI.RenderTexture[];
|
120
|
+
|
121
|
+
/**
|
122
|
+
* Track whether there is a source of vision within the buffer region outside the primary scene canvas
|
123
|
+
* @defaultValue `false`
|
124
|
+
* @internal
|
125
|
+
*/
|
126
|
+
protected _inBuffer: boolean;
|
127
|
+
|
82
128
|
/**
|
83
129
|
* Define the threshold value for the number of distinct Wall endpoints.
|
84
130
|
* Below this threshold, exact vision computation is used by casting a Ray at every endpoint.
|
@@ -93,6 +139,12 @@ declare global {
|
|
93
139
|
*/
|
94
140
|
static FOG_COMMIT_THRESHOLD: number;
|
95
141
|
|
142
|
+
/**
|
143
|
+
* The maximum allowable fog of war texture size.
|
144
|
+
* @defaultValue `4096`
|
145
|
+
*/
|
146
|
+
static MAXIMUM_FOW_TEXTURE_SIZE: number;
|
147
|
+
|
96
148
|
/**
|
97
149
|
* @remarks This is not overridden in foundry but reflects the real behavior.
|
98
150
|
*/
|
@@ -123,18 +175,6 @@ declare global {
|
|
123
175
|
/** @override */
|
124
176
|
tearDown(): Promise<this>;
|
125
177
|
|
126
|
-
/**
|
127
|
-
* Initialize the Sight Layer. Initialization has the following hierarchical workflow:
|
128
|
-
*
|
129
|
-
* Initialize Layer (reset entire layer)
|
130
|
-
* InitializeLights (used to reset all lights)
|
131
|
-
* UpdateLight (update a single light)
|
132
|
-
* InitializeTokens (reset all tokens)
|
133
|
-
* UpdateToken (update a single token)
|
134
|
-
* Initialize Fog (reset FOW state)
|
135
|
-
*/
|
136
|
-
initialize(): Promise<void>;
|
137
|
-
|
138
178
|
/**
|
139
179
|
* Initialize fog of war - resetting it when switching scenes or re-drawing the canvas
|
140
180
|
*/
|
@@ -145,42 +185,45 @@ declare global {
|
|
145
185
|
*/
|
146
186
|
initializeSources(): Promise<void>;
|
147
187
|
|
148
|
-
/** @override */
|
149
|
-
draw(): Promise<this>;
|
150
|
-
|
151
188
|
/**
|
152
|
-
*
|
153
|
-
* These containers are placed into the _visionPool and recycled as needed.
|
189
|
+
* Update FoW unexplored and explored colors
|
154
190
|
*/
|
155
|
-
|
191
|
+
updateFogExplorationColors(): void;
|
192
|
+
|
193
|
+
/** @override */
|
194
|
+
draw(): Promise<this>;
|
156
195
|
|
157
196
|
/**
|
158
|
-
*
|
159
|
-
*
|
197
|
+
* Create the cached container and sprite used to provide a LOS mask
|
198
|
+
* @internal
|
160
199
|
*/
|
161
|
-
protected
|
200
|
+
protected _createCachedMask(): void;
|
162
201
|
|
163
202
|
/**
|
164
|
-
*
|
165
|
-
* @
|
203
|
+
* Construct a vision container that is used to render a single view position.
|
204
|
+
* @internal
|
166
205
|
*/
|
167
|
-
protected
|
206
|
+
protected _createVisionContainer(): PIXI.Container;
|
168
207
|
|
169
208
|
/**
|
170
209
|
* Update the display of the sight layer.
|
171
210
|
* Organize sources into rendering queues and draw lighting containers for each source
|
172
|
-
*
|
173
|
-
* @param forceUpdateFog - Always update the Fog exploration progress for this update
|
174
|
-
* (default: `false`)
|
175
|
-
* @param noUpdateFog - Never update the Fog exploration progress for this update
|
176
|
-
* (default: `false`)
|
177
211
|
*/
|
178
212
|
refresh({
|
179
213
|
forceUpdateFog,
|
180
|
-
|
214
|
+
skipUpdateFog
|
181
215
|
}?: {
|
216
|
+
/**
|
217
|
+
* Always update the Fog exploration progress for this update
|
218
|
+
* (default: `false`)
|
219
|
+
*/
|
182
220
|
forceUpdateFog?: boolean;
|
183
|
-
|
221
|
+
|
222
|
+
/**
|
223
|
+
* Never update the Fog exploration progress for this update
|
224
|
+
* (default: `false`)
|
225
|
+
*/
|
226
|
+
skipUpdateFog?: boolean;
|
184
227
|
}): void | ReturnType<this['restrictVisibility']>;
|
185
228
|
|
186
229
|
/**
|
@@ -192,21 +235,34 @@ declare global {
|
|
192
235
|
/**
|
193
236
|
* Test whether a point on the Canvas is visible based on the current vision and LOS polygons
|
194
237
|
*
|
195
|
-
* @param point
|
196
|
-
* @param tolerance - A numeric radial offset which allows for a non-exact match. For example, if
|
197
|
-
* tolerance is 2 then the test will pass if the point is within 2px of a vision
|
198
|
-
* polygon.
|
199
|
-
* (defaultValue: `2`)
|
200
|
-
* @param object - An optional reference to the object whose visibility is being tested
|
201
|
-
* (defaultValue: `null`)
|
202
|
-
*
|
238
|
+
* @param point - The point in space to test, an object with coordinates x and y.
|
203
239
|
* @returns Whether the point is currently visible.
|
204
240
|
*/
|
205
241
|
testVisibility(
|
206
242
|
point: Point,
|
207
|
-
{
|
243
|
+
{
|
244
|
+
tolerance,
|
245
|
+
object
|
246
|
+
}?: {
|
247
|
+
/**
|
248
|
+
* A numeric radial offset which allows for a non-exact match. For example, if
|
249
|
+
* tolerance is 2 then the test will pass if the point is within 2px of a vision
|
250
|
+
* polygon.
|
251
|
+
* (defaultValue: `2`)
|
252
|
+
*/
|
253
|
+
tolerance?: number;
|
254
|
+
|
255
|
+
/**
|
256
|
+
* An optional reference to the object whose visibility is being tested
|
257
|
+
* (defaultValue: `null`)
|
258
|
+
*/
|
259
|
+
object?: PIXI.DisplayObject | null;
|
260
|
+
}
|
208
261
|
): boolean;
|
209
262
|
|
263
|
+
/** @internal */
|
264
|
+
protected _getFogTexture(): PIXI.RenderTexture;
|
265
|
+
|
210
266
|
/**
|
211
267
|
* Once a new Fog of War location is explored, composite the explored container with the current staging sprite
|
212
268
|
* Save that staging Sprite as the rendered fog exploration and swap it out for a fresh staging texture
|
@@ -242,6 +298,7 @@ declare global {
|
|
242
298
|
/**
|
243
299
|
* Choose an adaptive fog rendering resolution which downscales the saved fog textures for larger dimension Scenes.
|
244
300
|
* It is important that the width and height of the fog texture is evenly divisible by the downscaling resolution.
|
301
|
+
* @internal
|
245
302
|
*/
|
246
303
|
protected _configureFogResolution(): { resolution: number; width: number; height: number };
|
247
304
|
|
@@ -249,50 +306,11 @@ declare global {
|
|
249
306
|
* If fog of war data is reset from the server, re-draw the canvas
|
250
307
|
*/
|
251
308
|
protected _handleResetFog(): Promise<void>;
|
252
|
-
|
253
|
-
/**
|
254
|
-
* Visualize the sight layer to understand algorithm performance.
|
255
|
-
* @param bounds - The initial rectangular bounds of the vision check
|
256
|
-
* @param endpoints - The wall endpoints being tested
|
257
|
-
* @param rays - The array of cast vision Rays
|
258
|
-
* @param los - The resulting line-of-sight polygon
|
259
|
-
* @param fov - The resulting field-of-vision polygon
|
260
|
-
*/
|
261
|
-
protected static _visualizeSight(
|
262
|
-
bounds: Rectangle,
|
263
|
-
endpoints: PointArray[],
|
264
|
-
rays: Ray[],
|
265
|
-
los: PIXI.Polygon,
|
266
|
-
fov: PIXI.Polygon
|
267
|
-
): void;
|
268
|
-
|
269
|
-
/**
|
270
|
-
* @deprecated since 0.8.2
|
271
|
-
* @see WallsLayer#computePolygon
|
272
|
-
* Compute line-of-sight and field-of-vision polygons for a given origin position and visibility radius.
|
273
|
-
* The line-of-sight polygon defines the unrestricted area of visibility for the source.
|
274
|
-
* The field-of-vision polygon defines the restricted area of visibility for the source.
|
275
|
-
* @param angle - (default: `360`)
|
276
|
-
* @param density - (default: `6`)
|
277
|
-
* @param rotation - (default: `0`)
|
278
|
-
* @param unrestricted - (default: `false`)
|
279
|
-
*/
|
280
|
-
static computeSight(
|
281
|
-
origin: Point,
|
282
|
-
radius: number,
|
283
|
-
{
|
284
|
-
angle,
|
285
|
-
density,
|
286
|
-
rotation,
|
287
|
-
unrestricted
|
288
|
-
}?: { angle?: number; density?: number; rotation?: number; unrestricted?: boolean }
|
289
|
-
): { rays: Ray[]; los: PIXI.Polygon; fov: PIXI.Polygon };
|
290
309
|
}
|
291
310
|
|
292
311
|
namespace SightLayer {
|
293
312
|
interface LayerOptions extends CanvasLayer.LayerOptions {
|
294
313
|
name: 'sight';
|
295
|
-
zIndex: 400;
|
296
314
|
}
|
297
315
|
}
|
298
316
|
}
|
@@ -70,6 +70,12 @@ declare global {
|
|
70
70
|
*/
|
71
71
|
occluded: boolean;
|
72
72
|
|
73
|
+
/**
|
74
|
+
* A flag which tracks if the Tile is currently playing
|
75
|
+
* @defaultValue `false`
|
76
|
+
*/
|
77
|
+
playing: boolean;
|
78
|
+
|
73
79
|
/** @override */
|
74
80
|
static embeddedName: 'Tile';
|
75
81
|
|
@@ -96,6 +102,11 @@ declare global {
|
|
96
102
|
*/
|
97
103
|
get isRoof(): boolean;
|
98
104
|
|
105
|
+
/**
|
106
|
+
* The effective volume at which this Tile should be playing, including the global ambient volume modifier
|
107
|
+
*/
|
108
|
+
get volume(): number;
|
109
|
+
|
99
110
|
/** @override */
|
100
111
|
draw(): Promise<this>;
|
101
112
|
|