isaacscript-common 10.0.2 → 10.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.
- package/dist/index.d.ts +10 -1
- package/dist/isaacscript-common.lua +12 -5
- package/dist/package.lua +2 -2
- package/dist/src/features/saveDataManager/load.d.ts.map +1 -1
- package/dist/src/features/saveDataManager/merge.d.ts.map +1 -1
- package/dist/src/features/saveDataManager/saveDataManagerConstants.d.ts +1 -1
- package/dist/src/features/saveDataManager/saveDataManagerConstants.d.ts.map +1 -1
- package/dist/src/functions/doors.d.ts +9 -1
- package/dist/src/functions/doors.d.ts.map +1 -1
- package/dist/src/functions/doors.lua +8 -1
- package/package.json +2 -2
- package/src/callbacks/customRevive.ts +1 -2
- package/src/features/saveDataManager/load.ts +0 -2
- package/src/features/saveDataManager/merge.ts +0 -3
- package/src/features/saveDataManager/saveDataManagerConstants.ts +1 -1
- package/src/functions/deepCopy.ts +0 -8
- package/src/functions/doors.ts +13 -1
package/dist/index.d.ts
CHANGED
|
@@ -5273,7 +5273,10 @@ export declare function getTrinketTypes(): TrinketType[];
|
|
|
5273
5273
|
*/
|
|
5274
5274
|
export declare function getTSTLClassName(object: unknown): string | undefined;
|
|
5275
5275
|
|
|
5276
|
-
/**
|
|
5276
|
+
/**
|
|
5277
|
+
* Helper function to find unused door slots in the current room that can be used to make custom
|
|
5278
|
+
* doors.
|
|
5279
|
+
*/
|
|
5277
5280
|
export declare function getUnusedDoorSlots(): DoorSlot[];
|
|
5278
5281
|
|
|
5279
5282
|
/** Helper function to get an array with every valid vanilla card sub-type. */
|
|
@@ -5458,6 +5461,12 @@ export declare function hasOpenTrinketSlot(player: EntityPlayer): boolean;
|
|
|
5458
5461
|
*/
|
|
5459
5462
|
export declare function hasSirenStolenFamiliar(familiar: EntityFamiliar): boolean;
|
|
5460
5463
|
|
|
5464
|
+
/**
|
|
5465
|
+
* Helper function to check if the current room has one or more open door slots that can be used to
|
|
5466
|
+
* make custom doors.
|
|
5467
|
+
*/
|
|
5468
|
+
export declare function hasUnusedDoorSlot(): boolean;
|
|
5469
|
+
|
|
5461
5470
|
/**
|
|
5462
5471
|
* Helper function to check if a player has previous visited a particular stage (or stage + stage
|
|
5463
5472
|
* type combination) on this run.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 10.0
|
|
3
|
+
isaacscript-common 10.1.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -4861,7 +4861,7 @@ return ____exports
|
|
|
4861
4861
|
["lua_modules.isaac-typescript-definitions.dist.package"] = function(...)
|
|
4862
4862
|
return {
|
|
4863
4863
|
name = "isaac-typescript-definitions",
|
|
4864
|
-
version = "7.2.
|
|
4864
|
+
version = "7.2.1",
|
|
4865
4865
|
description = "TypeScript definitions for The Binding of Isaac: Repentance.",
|
|
4866
4866
|
keywords = {"isaac", "rebirth", "afterbirth", "repentance"},
|
|
4867
4867
|
homepage = "https://isaacscript.github.io/",
|
|
@@ -22568,7 +22568,8 @@ function ____exports.getRoomShapeDoorSlotCoordinates(self, roomShape, doorSlot)
|
|
|
22568
22568
|
local coordinatesMap = ROOM_SHAPE_TO_DOOR_SLOT_COORDINATES[roomShape]
|
|
22569
22569
|
return coordinatesMap:get(doorSlot)
|
|
22570
22570
|
end
|
|
22571
|
-
--- Helper function to find unused door slots in the room that can be used to make custom
|
|
22571
|
+
--- Helper function to find unused door slots in the current room that can be used to make custom
|
|
22572
|
+
-- doors.
|
|
22572
22573
|
function ____exports.getUnusedDoorSlots(self)
|
|
22573
22574
|
local room = game:GetRoom()
|
|
22574
22575
|
local doorSlots = getEnumValues(nil, DoorSlot)
|
|
@@ -22577,6 +22578,12 @@ function ____exports.getUnusedDoorSlots(self)
|
|
|
22577
22578
|
function(____, doorSlot) return room:IsDoorSlotAllowed(doorSlot) and room:GetDoor(doorSlot) == nil end
|
|
22578
22579
|
)
|
|
22579
22580
|
end
|
|
22581
|
+
--- Helper function to check if the current room has one or more open door slots that can be used to
|
|
22582
|
+
-- make custom doors.
|
|
22583
|
+
function ____exports.hasUnusedDoorSlot(self)
|
|
22584
|
+
local unusedDoorSlots = ____exports.getUnusedDoorSlots(nil)
|
|
22585
|
+
return #unusedDoorSlots > 0
|
|
22586
|
+
end
|
|
22580
22587
|
function ____exports.isAngelRoomDoor(self, door)
|
|
22581
22588
|
return door.TargetRoomType == RoomType.ANGEL
|
|
22582
22589
|
end
|
|
@@ -46903,7 +46910,7 @@ return ____exports
|
|
|
46903
46910
|
["package"] = function(...)
|
|
46904
46911
|
return {
|
|
46905
46912
|
name = "isaacscript-common",
|
|
46906
|
-
version = "10.0
|
|
46913
|
+
version = "10.1.0",
|
|
46907
46914
|
description = "Helper functions and features for IsaacScript mods.",
|
|
46908
46915
|
keywords = {"isaac", "rebirth", "afterbirth", "repentance"},
|
|
46909
46916
|
homepage = "https://isaacscript.github.io/",
|
|
@@ -46914,7 +46921,7 @@ return {
|
|
|
46914
46921
|
type = "commonjs",
|
|
46915
46922
|
main = "dist/src/index",
|
|
46916
46923
|
types = "dist/src/index.d.ts",
|
|
46917
|
-
dependencies = {["isaac-typescript-definitions"] = "^7.2.
|
|
46924
|
+
dependencies = {["isaac-typescript-definitions"] = "^7.2.1"}
|
|
46918
46925
|
}
|
|
46919
46926
|
end,
|
|
46920
46927
|
["src.functions.map"] = function(...)
|
package/dist/package.lua
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
return {
|
|
2
2
|
name = "isaacscript-common",
|
|
3
|
-
version = "10.0
|
|
3
|
+
version = "10.1.0",
|
|
4
4
|
description = "Helper functions and features for IsaacScript mods.",
|
|
5
5
|
keywords = {"isaac", "rebirth", "afterbirth", "repentance"},
|
|
6
6
|
homepage = "https://isaacscript.github.io/",
|
|
@@ -11,5 +11,5 @@ return {
|
|
|
11
11
|
type = "commonjs",
|
|
12
12
|
main = "dist/src/index",
|
|
13
13
|
types = "dist/src/index.d.ts",
|
|
14
|
-
dependencies = {["isaac-typescript-definitions"] = "^7.2.
|
|
14
|
+
dependencies = {["isaac-typescript-definitions"] = "^7.2.1"}
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../../src/features/saveDataManager/load.ts"],"names":[],"mappings":";;AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AASrD,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GACpC,IAAI,
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../../src/features/saveDataManager/load.ts"],"names":[],"mappings":";;AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AASrD,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GACpC,IAAI,CAmDN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../../src/features/saveDataManager/merge.ts"],"names":[],"mappings":";AAgBA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,KAAK,CACnB,SAAS,EACL,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,GAC1B,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,GACvB,GAAG,CAAC,SAAS,CAAC,EAClB,QAAQ,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,EACpC,oBAAoB,EAAE,MAAM,GAC3B,IAAI,
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../../src/features/saveDataManager/merge.ts"],"names":[],"mappings":";AAgBA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,KAAK,CACnB,SAAS,EACL,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,GAC1B,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,GACvB,GAAG,CAAC,SAAS,CAAC,EAClB,QAAQ,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,EACpC,oBAAoB,EAAE,MAAM,GAC3B,IAAI,CA0BN"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** Set this to true to enable more verbosity in the save data manger. */
|
|
2
|
-
export declare const SAVE_DATA_MANAGER_DEBUG
|
|
2
|
+
export declare const SAVE_DATA_MANAGER_DEBUG: boolean;
|
|
3
3
|
export declare const SAVE_DATA_MANAGER_FEATURE_NAME = "save data manager";
|
|
4
4
|
//# sourceMappingURL=saveDataManagerConstants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saveDataManagerConstants.d.ts","sourceRoot":"","sources":["../../../../src/features/saveDataManager/saveDataManagerConstants.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"saveDataManagerConstants.d.ts","sourceRoot":"","sources":["../../../../src/features/saveDataManager/saveDataManagerConstants.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,eAAO,MAAM,uBAAuB,SAAmB,CAAC;AAExD,eAAO,MAAM,8BAA8B,sBAAsB,CAAC"}
|
|
@@ -85,8 +85,16 @@ export declare function getRoomShapeDoorSlot(roomShape: RoomShape, x: int, y: in
|
|
|
85
85
|
* combination.
|
|
86
86
|
*/
|
|
87
87
|
export declare function getRoomShapeDoorSlotCoordinates(roomShape: RoomShape, doorSlot: DoorSlot): readonly [x: int, y: int] | undefined;
|
|
88
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* Helper function to find unused door slots in the current room that can be used to make custom
|
|
90
|
+
* doors.
|
|
91
|
+
*/
|
|
89
92
|
export declare function getUnusedDoorSlots(): DoorSlot[];
|
|
93
|
+
/**
|
|
94
|
+
* Helper function to check if the current room has one or more open door slots that can be used to
|
|
95
|
+
* make custom doors.
|
|
96
|
+
*/
|
|
97
|
+
export declare function hasUnusedDoorSlot(): boolean;
|
|
90
98
|
export declare function isAngelRoomDoor(door: GridEntityDoor): boolean;
|
|
91
99
|
export declare function isBlueWombDoor(door: GridEntityDoor): boolean;
|
|
92
100
|
export declare function isDevilRoomDoor(door: GridEntityDoor): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doors.d.ts","sourceRoot":"","sources":["../../../src/functions/doors.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,YAAY,EAIZ,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAmBtC,wBAAgB,aAAa,IAAI,IAAI,CAIpC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAKxD;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,YAAY,GAAG,QAAQ,CAG3E;AAED,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,QAAQ,CAAC,YAAY,CAAC,GACpC,QAAQ,EAAE,CAWZ;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAEjE;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAEvE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EACL,QAAQ,EAAE,GACV,SAAS,QAAQ,EAAE,GACnB,GAAG,CAAC,QAAQ,CAAC,GACb,WAAW,CAAC,QAAQ,CAAC,GACxB,QAAQ,CAAC,YAAY,CAAC,CASxB;AAED,wBAAgB,gBAAgB,IAAI,cAAc,GAAG,SAAS,CAG7D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,cAAc,GAAG,SAAS,CAG5D;AAED,wBAAgB,gBAAgB,IAAI,cAAc,GAAG,SAAS,CAG7D;AAED;;;GAGG;A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AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAU/D;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAUrE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAU3D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAU/D;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAKpE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAM9D;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAUnD;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAMnC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAKvD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,CAK5D;AAED,+CAA+C;AAC/C,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAGrD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,KAAK,EAAE,cAAc,EAAE,GAAG,IAAI,CAI5D"}
|
|
@@ -263,7 +263,8 @@ function ____exports.getRoomShapeDoorSlotCoordinates(self, roomShape, doorSlot)
|
|
|
263
263
|
local coordinatesMap = ROOM_SHAPE_TO_DOOR_SLOT_COORDINATES[roomShape]
|
|
264
264
|
return coordinatesMap:get(doorSlot)
|
|
265
265
|
end
|
|
266
|
-
--- Helper function to find unused door slots in the room that can be used to make custom
|
|
266
|
+
--- Helper function to find unused door slots in the current room that can be used to make custom
|
|
267
|
+
-- doors.
|
|
267
268
|
function ____exports.getUnusedDoorSlots(self)
|
|
268
269
|
local room = game:GetRoom()
|
|
269
270
|
local doorSlots = getEnumValues(nil, DoorSlot)
|
|
@@ -272,6 +273,12 @@ function ____exports.getUnusedDoorSlots(self)
|
|
|
272
273
|
function(____, doorSlot) return room:IsDoorSlotAllowed(doorSlot) and room:GetDoor(doorSlot) == nil end
|
|
273
274
|
)
|
|
274
275
|
end
|
|
276
|
+
--- Helper function to check if the current room has one or more open door slots that can be used to
|
|
277
|
+
-- make custom doors.
|
|
278
|
+
function ____exports.hasUnusedDoorSlot(self)
|
|
279
|
+
local unusedDoorSlots = ____exports.getUnusedDoorSlots(nil)
|
|
280
|
+
return #unusedDoorSlots > 0
|
|
281
|
+
end
|
|
275
282
|
function ____exports.isAngelRoomDoor(self, door)
|
|
276
283
|
return door.TargetRoomType == RoomType.ANGEL
|
|
277
284
|
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "10.0
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"description": "Helper functions and features for IsaacScript mods.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"main": "dist/src/index",
|
|
23
23
|
"types": "dist/src/index.d.ts",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"isaac-typescript-definitions": "^7.2.
|
|
25
|
+
"isaac-typescript-definitions": "^7.2.1"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
preCustomReviveHasSubscriptions,
|
|
30
30
|
} from "./subscriptions/preCustomRevive";
|
|
31
31
|
|
|
32
|
-
const DEBUG = false;
|
|
32
|
+
const DEBUG = false as boolean;
|
|
33
33
|
|
|
34
34
|
enum CustomReviveState {
|
|
35
35
|
DISABLED,
|
|
@@ -203,7 +203,6 @@ function playerIsAboutToDie(player: EntityPlayer) {
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
function logStateChanged() {
|
|
206
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
207
206
|
if (DEBUG) {
|
|
208
207
|
log(
|
|
209
208
|
`Custom revive state changed: ${CustomReviveState[v.run.state]} (${
|
|
@@ -24,7 +24,6 @@ export function loadFromDisk(
|
|
|
24
24
|
const jsonString = readSaveDatFile(mod);
|
|
25
25
|
const newSaveData = jsonDecode(jsonString);
|
|
26
26
|
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
28
27
|
if (SAVE_DATA_MANAGER_DEBUG) {
|
|
29
28
|
log('Converted data from the "save#.dat" to a Lua table.');
|
|
30
29
|
}
|
|
@@ -51,7 +50,6 @@ export function loadFromDisk(
|
|
|
51
50
|
return;
|
|
52
51
|
}
|
|
53
52
|
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
55
53
|
if (SAVE_DATA_MANAGER_DEBUG) {
|
|
56
54
|
log(`Merging in stored data for feature: ${key}`);
|
|
57
55
|
}
|
|
@@ -45,7 +45,6 @@ export function merge(
|
|
|
45
45
|
newTable: LuaMap<AnyNotNil, unknown>,
|
|
46
46
|
traversalDescription: string,
|
|
47
47
|
): void {
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
49
48
|
if (SAVE_DATA_MANAGER_DEBUG) {
|
|
50
49
|
log(`merge is traversing: ${traversalDescription}`);
|
|
51
50
|
}
|
|
@@ -148,7 +147,6 @@ function mergeTable(
|
|
|
148
147
|
iterateTableInOrder(
|
|
149
148
|
newTable,
|
|
150
149
|
(key, value) => {
|
|
151
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
152
150
|
if (SAVE_DATA_MANAGER_DEBUG) {
|
|
153
151
|
const valueToPrint = value === "" ? "(empty string)" : `${value}`;
|
|
154
152
|
log(`merge is merging: ${traversalDescription} --> ${valueToPrint}`);
|
|
@@ -160,7 +158,6 @@ function mergeTable(
|
|
|
160
158
|
|
|
161
159
|
// Handle the special case of serialized Isaac API classes.
|
|
162
160
|
if (isSerializedIsaacAPIClass(value)) {
|
|
163
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
164
161
|
if (SAVE_DATA_MANAGER_DEBUG) {
|
|
165
162
|
log("merge found a serialized Isaac API class.");
|
|
166
163
|
}
|
|
@@ -77,7 +77,6 @@ export function deepCopy(
|
|
|
77
77
|
traversalDescription = "",
|
|
78
78
|
insideMap = false,
|
|
79
79
|
): unknown {
|
|
80
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
81
80
|
if (SAVE_DATA_MANAGER_DEBUG) {
|
|
82
81
|
let logString = `deepCopy is operating on: ${traversalDescription}`;
|
|
83
82
|
if (serializationType === SerializationType.SERIALIZE) {
|
|
@@ -227,7 +226,6 @@ function deepCopyDefaultMap(
|
|
|
227
226
|
traversalDescription: string,
|
|
228
227
|
insideMap: boolean,
|
|
229
228
|
) {
|
|
230
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
231
229
|
if (SAVE_DATA_MANAGER_DEBUG) {
|
|
232
230
|
log("deepCopy is copying a DefaultMap.");
|
|
233
231
|
}
|
|
@@ -359,7 +357,6 @@ function deepCopyMap(
|
|
|
359
357
|
traversalDescription: string,
|
|
360
358
|
insideMap: boolean,
|
|
361
359
|
) {
|
|
362
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
363
360
|
if (SAVE_DATA_MANAGER_DEBUG) {
|
|
364
361
|
log("deepCopy is copying a Map.");
|
|
365
362
|
}
|
|
@@ -412,7 +409,6 @@ function deepCopySet(
|
|
|
412
409
|
traversalDescription: string,
|
|
413
410
|
insideMap: boolean,
|
|
414
411
|
) {
|
|
415
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
416
412
|
if (SAVE_DATA_MANAGER_DEBUG) {
|
|
417
413
|
log("deepCopy is copying a Set.");
|
|
418
414
|
}
|
|
@@ -466,7 +462,6 @@ function deepCopyTSTLClass(
|
|
|
466
462
|
traversalDescription: string,
|
|
467
463
|
insideMap: boolean,
|
|
468
464
|
) {
|
|
469
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
470
465
|
if (SAVE_DATA_MANAGER_DEBUG) {
|
|
471
466
|
log("deepCopy is copying a TSTL class.");
|
|
472
467
|
}
|
|
@@ -505,7 +500,6 @@ function deepCopyArray(
|
|
|
505
500
|
traversalDescription: string,
|
|
506
501
|
insideMap: boolean,
|
|
507
502
|
) {
|
|
508
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
509
503
|
if (SAVE_DATA_MANAGER_DEBUG) {
|
|
510
504
|
log("deepCopy is copying an array.");
|
|
511
505
|
}
|
|
@@ -531,7 +525,6 @@ function deepCopyNormalLuaTable(
|
|
|
531
525
|
traversalDescription: string,
|
|
532
526
|
insideMap: boolean,
|
|
533
527
|
) {
|
|
534
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
535
528
|
if (SAVE_DATA_MANAGER_DEBUG) {
|
|
536
529
|
log("deepCopy is copying a normal Lua table.");
|
|
537
530
|
}
|
|
@@ -581,7 +574,6 @@ function getCopiedEntries(
|
|
|
581
574
|
}
|
|
582
575
|
}
|
|
583
576
|
|
|
584
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
585
577
|
if (SAVE_DATA_MANAGER_DEBUG) {
|
|
586
578
|
entries.sort(twoDimensionalSort);
|
|
587
579
|
}
|
package/src/functions/doors.ts
CHANGED
|
@@ -259,7 +259,10 @@ export function getRoomShapeDoorSlotCoordinates(
|
|
|
259
259
|
return coordinatesMap.get(doorSlot);
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
/**
|
|
262
|
+
/**
|
|
263
|
+
* Helper function to find unused door slots in the current room that can be used to make custom
|
|
264
|
+
* doors.
|
|
265
|
+
*/
|
|
263
266
|
export function getUnusedDoorSlots(): DoorSlot[] {
|
|
264
267
|
const room = game.GetRoom();
|
|
265
268
|
const doorSlots = getEnumValues(DoorSlot);
|
|
@@ -269,6 +272,15 @@ export function getUnusedDoorSlots(): DoorSlot[] {
|
|
|
269
272
|
);
|
|
270
273
|
}
|
|
271
274
|
|
|
275
|
+
/**
|
|
276
|
+
* Helper function to check if the current room has one or more open door slots that can be used to
|
|
277
|
+
* make custom doors.
|
|
278
|
+
*/
|
|
279
|
+
export function hasUnusedDoorSlot(): boolean {
|
|
280
|
+
const unusedDoorSlots = getUnusedDoorSlots();
|
|
281
|
+
return unusedDoorSlots.length > 0;
|
|
282
|
+
}
|
|
283
|
+
|
|
272
284
|
export function isAngelRoomDoor(door: GridEntityDoor): boolean {
|
|
273
285
|
return door.TargetRoomType === RoomType.ANGEL;
|
|
274
286
|
}
|