isaacscript-common 3.0.0 → 3.2.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/cachedClasses.d.ts +6 -4
- package/cachedClasses.lua +4 -4
- package/callbacks/postPickupInitFirst.d.ts +1 -0
- package/callbacks/postPickupInitFirst.lua +55 -0
- package/callbacks/postSlotDestroyed.d.ts +1 -0
- package/callbacks/postSlotDestroyed.lua +66 -0
- package/callbacks/postSlotRender.lua +3 -21
- package/callbacks/subscriptions/postCustomRevive.d.ts +1 -0
- package/callbacks/subscriptions/postDoorRender.d.ts +1 -0
- package/callbacks/subscriptions/postDoorUpdate.d.ts +1 -0
- package/callbacks/subscriptions/postPickupCollect.d.ts +1 -0
- package/callbacks/subscriptions/postPickupInitFirst.d.ts +3 -0
- package/callbacks/subscriptions/postPickupInitFirst.lua +29 -0
- package/callbacks/subscriptions/postPickupStateChanged.d.ts +1 -0
- package/callbacks/subscriptions/postPitRender.d.ts +1 -0
- package/callbacks/subscriptions/postPitUpdate.d.ts +1 -0
- package/callbacks/subscriptions/postPoopRender.d.ts +1 -0
- package/callbacks/subscriptions/postPoopUpdate.d.ts +1 -0
- package/callbacks/subscriptions/postPressurePlateRender.d.ts +1 -0
- package/callbacks/subscriptions/postPressurePlateUpdate.d.ts +1 -0
- package/callbacks/subscriptions/postRockRender.d.ts +1 -0
- package/callbacks/subscriptions/postRockUpdate.d.ts +1 -0
- package/callbacks/subscriptions/postSpikesRender.d.ts +1 -0
- package/callbacks/subscriptions/postSpikesUpdate.d.ts +1 -0
- package/callbacks/subscriptions/postTNTRender.d.ts +1 -0
- package/callbacks/subscriptions/postTNTUpdate.d.ts +1 -0
- package/classes/DefaultMap.d.ts +1 -2
- package/classes/DefaultMap.lua +1 -4
- package/enums/ModCallbackCustom.d.ts +61 -39
- package/enums/ModCallbackCustom.lua +40 -38
- package/features/debugDisplay/exports.d.ts +17 -0
- package/features/debugDisplay/v.d.ts +17 -0
- package/features/deployJSONRoom.d.ts +1 -0
- package/features/saveDataManager/load.lua +12 -8
- package/features/saveDataManager/main.lua +10 -3
- package/features/saveDataManager/merge.lua +33 -21
- package/features/saveDataManager/save.lua +12 -7
- package/functions/array.d.ts +2 -0
- package/functions/bombs.d.ts +3 -0
- package/functions/bombs.lua +12 -0
- package/functions/chargeBar.d.ts +1 -0
- package/functions/collectibles.d.ts +13 -8
- package/functions/collectibles.lua +24 -11
- package/functions/deepCopy.lua +35 -26
- package/functions/deepCopyTests.lua +8 -5
- package/functions/direction.d.ts +8 -0
- package/functions/direction.lua +27 -0
- package/functions/doors.d.ts +1 -0
- package/functions/doors.lua +5 -0
- package/functions/entity.d.ts +4 -4
- package/functions/entity.lua +8 -8
- package/functions/entitySpecific.d.ts +20 -20
- package/functions/entitySpecific.lua +10 -10
- package/functions/enums.d.ts +2 -0
- package/functions/globals.lua +2 -10
- package/functions/gridEntitySpecific.d.ts +5 -0
- package/functions/isaacAPIClass.d.ts +4 -4
- package/functions/isaacAPIClass.lua +6 -6
- package/functions/jsonRoom.d.ts +2 -0
- package/functions/log.lua +3 -3
- package/functions/pickups.d.ts +9 -9
- package/functions/player.d.ts +7 -0
- package/functions/player.lua +44 -9
- package/functions/playerHealth.d.ts +3 -0
- package/functions/playerHealth.lua +87 -68
- package/functions/playerIndex.d.ts +2 -0
- package/functions/positionVelocity.d.ts +3 -0
- package/functions/random.d.ts +2 -0
- package/functions/revive.d.ts +2 -0
- package/functions/rng.d.ts +1 -0
- package/functions/saveFile.d.ts +15 -0
- package/functions/saveFile.lua +106 -0
- package/functions/serialization.lua +2 -2
- package/functions/set.d.ts +1 -0
- package/functions/sprite.d.ts +2 -0
- package/functions/table.d.ts +12 -0
- package/functions/table.lua +34 -0
- package/functions/tears.d.ts +1 -0
- package/functions/tstlClass.d.ts +34 -0
- package/functions/tstlClass.lua +54 -9
- package/functions/ui.d.ts +2 -0
- package/functions/utils.d.ts +15 -0
- package/functions/utils.lua +20 -0
- package/functions/vector.lua +4 -16
- package/index.d.ts +2 -0
- package/index.lua +16 -0
- package/initCustomCallbacks.lua +6 -0
- package/interfaces/AddCallbackParameterCustom.d.ts +2 -0
- package/interfaces/ChargeBarSprites.d.ts +1 -0
- package/interfaces/private/TSTLClassMetatable.d.ts +2 -0
- package/objects/callbackRegisterFunctions.lua +3 -0
- package/objects/oppositeDoorSlots.d.ts +4 -0
- package/objects/oppositeDoorSlots.lua +15 -0
- package/package.json +1 -1
- package/types/AnyEntity.d.ts +10 -0
package/cachedClasses.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
3
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
4
|
/**
|
|
3
5
|
* A cached version of the class returned from the `Game()` constructor.
|
|
4
6
|
*
|
|
5
7
|
* Use this instead of invoking the constructor again for a miniscule performance increase.
|
|
6
8
|
*
|
|
7
|
-
* Caching the results of
|
|
9
|
+
* Caching the results of this constructor is safe, but caching other classes (like `Level` or
|
|
8
10
|
* `Room`) is not safe and can lead to the game crashing in certain situations.
|
|
9
11
|
*/
|
|
10
12
|
export declare const game: Game;
|
|
@@ -13,7 +15,7 @@ export declare const game: Game;
|
|
|
13
15
|
*
|
|
14
16
|
* Use this instead of invoking the constructor again for a miniscule performance increase.
|
|
15
17
|
*
|
|
16
|
-
* Caching the results of
|
|
18
|
+
* Caching the results of this constructor is safe, but caching other classes (like `Level` or
|
|
17
19
|
* `Room`) is not safe and can lead to the game crashing in certain situations.
|
|
18
20
|
*/
|
|
19
21
|
export declare const itemConfig: import("isaac-typescript-definitions/types/ItemConfig").ItemConfig;
|
|
@@ -22,7 +24,7 @@ export declare const itemConfig: import("isaac-typescript-definitions/types/Item
|
|
|
22
24
|
*
|
|
23
25
|
* Use this instead of invoking the constructor again for a miniscule performance increase.
|
|
24
26
|
*
|
|
25
|
-
* Caching the results of
|
|
27
|
+
* Caching the results of this constructor is safe, but caching other classes (like `Level` or
|
|
26
28
|
* `Room`) is not safe and can lead to the game crashing in certain situations.
|
|
27
29
|
*/
|
|
28
30
|
export declare const musicManager: MusicManager;
|
|
@@ -31,7 +33,7 @@ export declare const musicManager: MusicManager;
|
|
|
31
33
|
*
|
|
32
34
|
* Use this instead of invoking the constructor again for a miniscule performance increase.
|
|
33
35
|
*
|
|
34
|
-
* Caching the results of
|
|
36
|
+
* Caching the results of this constructor is safe, but caching other classes (like `Level` or
|
|
35
37
|
* `Room`) is not safe and can lead to the game crashing in certain situations.
|
|
36
38
|
*/
|
|
37
39
|
export declare const sfxManager: SFXManager;
|
package/cachedClasses.lua
CHANGED
|
@@ -3,28 +3,28 @@ local ____exports = {}
|
|
|
3
3
|
--
|
|
4
4
|
-- Use this instead of invoking the constructor again for a miniscule performance increase.
|
|
5
5
|
--
|
|
6
|
-
-- Caching the results of
|
|
6
|
+
-- Caching the results of this constructor is safe, but caching other classes (like `Level` or
|
|
7
7
|
-- `Room`) is not safe and can lead to the game crashing in certain situations.
|
|
8
8
|
____exports.game = Game()
|
|
9
9
|
--- A cached version of the class returned from the `Isaac.GetItemConfig()` constructor.
|
|
10
10
|
--
|
|
11
11
|
-- Use this instead of invoking the constructor again for a miniscule performance increase.
|
|
12
12
|
--
|
|
13
|
-
-- Caching the results of
|
|
13
|
+
-- Caching the results of this constructor is safe, but caching other classes (like `Level` or
|
|
14
14
|
-- `Room`) is not safe and can lead to the game crashing in certain situations.
|
|
15
15
|
____exports.itemConfig = Isaac.GetItemConfig()
|
|
16
16
|
--- A cached version of the class returned from the `MusicManager()` constructor.
|
|
17
17
|
--
|
|
18
18
|
-- Use this instead of invoking the constructor again for a miniscule performance increase.
|
|
19
19
|
--
|
|
20
|
-
-- Caching the results of
|
|
20
|
+
-- Caching the results of this constructor is safe, but caching other classes (like `Level` or
|
|
21
21
|
-- `Room`) is not safe and can lead to the game crashing in certain situations.
|
|
22
22
|
____exports.musicManager = MusicManager()
|
|
23
23
|
--- A cached version of the class returned from the `SFXManager()` constructor.
|
|
24
24
|
--
|
|
25
25
|
-- Use this instead of invoking the constructor again for a miniscule performance increase.
|
|
26
26
|
--
|
|
27
|
-
-- Caching the results of
|
|
27
|
+
-- Caching the results of this constructor is safe, but caching other classes (like `Level` or
|
|
28
28
|
-- `Room`) is not safe and can lead to the game crashing in certain situations.
|
|
29
29
|
____exports.sfxManager = SFXManager()
|
|
30
30
|
return ____exports
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Set = ____lualib.Set
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
local hasSubscriptions, postPickupInit, POST_ASCENT_ROOM_TYPES, v
|
|
6
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
|
+
local GameStateFlag = ____isaac_2Dtypescript_2Ddefinitions.GameStateFlag
|
|
8
|
+
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
9
|
+
local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
|
|
10
|
+
local ____cachedClasses = require("cachedClasses")
|
|
11
|
+
local game = ____cachedClasses.game
|
|
12
|
+
local ____exports = require("features.saveDataManager.exports")
|
|
13
|
+
local saveDataManager = ____exports.saveDataManager
|
|
14
|
+
local ____roomData = require("functions.roomData")
|
|
15
|
+
local getRoomVisitedCount = ____roomData.getRoomVisitedCount
|
|
16
|
+
local ____postPickupInitFirst = require("callbacks.subscriptions.postPickupInitFirst")
|
|
17
|
+
local postPickupInitFirstFire = ____postPickupInitFirst.postPickupInitFirstFire
|
|
18
|
+
local postPickupInitFirstHasSubscriptions = ____postPickupInitFirst.postPickupInitFirstHasSubscriptions
|
|
19
|
+
function hasSubscriptions(self)
|
|
20
|
+
return postPickupInitFirstHasSubscriptions(nil)
|
|
21
|
+
end
|
|
22
|
+
function postPickupInit(self, pickup)
|
|
23
|
+
if not hasSubscriptions(nil) then
|
|
24
|
+
return
|
|
25
|
+
end
|
|
26
|
+
local room = game:GetRoom()
|
|
27
|
+
local roomType = room:GetType()
|
|
28
|
+
local roomFrameCount = room:GetFrameCount()
|
|
29
|
+
local previouslySeen = v.run.postAscentPickupInitSeeds:has(pickup.InitSeed)
|
|
30
|
+
if POST_ASCENT_ROOM_TYPES:has(roomType) then
|
|
31
|
+
v.run.postAscentPickupInitSeeds:add(pickup.InitSeed)
|
|
32
|
+
end
|
|
33
|
+
if roomFrameCount > 0 then
|
|
34
|
+
postPickupInitFirstFire(nil, pickup)
|
|
35
|
+
return
|
|
36
|
+
end
|
|
37
|
+
local roomVisitedCount = getRoomVisitedCount(nil)
|
|
38
|
+
if roomVisitedCount > 0 then
|
|
39
|
+
return
|
|
40
|
+
end
|
|
41
|
+
local onAscent = game:GetStateFlag(GameStateFlag.BACKWARDS_PATH)
|
|
42
|
+
if onAscent and POST_ASCENT_ROOM_TYPES:has(roomType) and previouslySeen then
|
|
43
|
+
return
|
|
44
|
+
end
|
|
45
|
+
postPickupInitFirstFire(nil, pickup)
|
|
46
|
+
end
|
|
47
|
+
POST_ASCENT_ROOM_TYPES = __TS__New(Set, {RoomType.TREASURE, RoomType.BOSS})
|
|
48
|
+
v = {run = {postAscentPickupInitSeeds = __TS__New(Set)}}
|
|
49
|
+
---
|
|
50
|
+
-- @internal
|
|
51
|
+
function ____exports.postPickupInitFirstCallbackInit(self, mod)
|
|
52
|
+
saveDataManager(nil, "postPickupInitFirst", v, hasSubscriptions)
|
|
53
|
+
mod:AddCallback(ModCallback.POST_PICKUP_INIT, postPickupInit)
|
|
54
|
+
end
|
|
55
|
+
return ____exports
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Set = ____lualib.Set
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local Map = ____lualib.Map
|
|
5
|
+
local ____exports = {}
|
|
6
|
+
local hasSubscriptions, postEntityRemove, postSlotAnimationChanged, BROKEN_ANIMATIONS, PRIZE_GAME_FRAME_DELAY_UNTIL_REMOVAL, v
|
|
7
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
8
|
+
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
9
|
+
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
10
|
+
local ____cachedClasses = require("cachedClasses")
|
|
11
|
+
local game = ____cachedClasses.game
|
|
12
|
+
local ____ModCallbackCustom = require("enums.ModCallbackCustom")
|
|
13
|
+
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
14
|
+
local ____exports = require("features.saveDataManager.exports")
|
|
15
|
+
local saveDataManager = ____exports.saveDataManager
|
|
16
|
+
local ____postSlotDestroyed = require("callbacks.subscriptions.postSlotDestroyed")
|
|
17
|
+
local postSlotDestroyedFire = ____postSlotDestroyed.postSlotDestroyedFire
|
|
18
|
+
local postSlotDestroyedHasSubscriptions = ____postSlotDestroyed.postSlotDestroyedHasSubscriptions
|
|
19
|
+
function hasSubscriptions(self)
|
|
20
|
+
return postSlotDestroyedHasSubscriptions(nil)
|
|
21
|
+
end
|
|
22
|
+
function postEntityRemove(self, entity)
|
|
23
|
+
local slot = entity
|
|
24
|
+
local ptrHash = GetPtrHash(slot)
|
|
25
|
+
local gameFrameCount = game:GetFrameCount()
|
|
26
|
+
local prizeFrame = v.room.slotPrizeAnimationGameFrame:get(ptrHash)
|
|
27
|
+
if prizeFrame == nil then
|
|
28
|
+
return
|
|
29
|
+
end
|
|
30
|
+
if prizeFrame + PRIZE_GAME_FRAME_DELAY_UNTIL_REMOVAL == gameFrameCount then
|
|
31
|
+
postSlotDestroyedFire(nil, slot)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
function postSlotAnimationChanged(self, slot)
|
|
35
|
+
local ptrHash = GetPtrHash(slot)
|
|
36
|
+
local gameFrameCount = game:GetFrameCount()
|
|
37
|
+
local alreadyBroken = v.room.brokenSlots:has(ptrHash)
|
|
38
|
+
if alreadyBroken then
|
|
39
|
+
return
|
|
40
|
+
end
|
|
41
|
+
local sprite = slot:GetSprite()
|
|
42
|
+
local animation = sprite:GetAnimation()
|
|
43
|
+
if BROKEN_ANIMATIONS:has(animation) then
|
|
44
|
+
v.room.brokenSlots:add(ptrHash)
|
|
45
|
+
postSlotDestroyedFire(nil, slot)
|
|
46
|
+
end
|
|
47
|
+
if animation == "Prize" then
|
|
48
|
+
v.room.slotPrizeAnimationGameFrame:set(ptrHash, gameFrameCount)
|
|
49
|
+
else
|
|
50
|
+
v.room.slotPrizeAnimationGameFrame:delete(ptrHash)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
BROKEN_ANIMATIONS = __TS__New(Set, {"Broken", "Death"})
|
|
54
|
+
PRIZE_GAME_FRAME_DELAY_UNTIL_REMOVAL = 3
|
|
55
|
+
v = {room = {
|
|
56
|
+
brokenSlots = __TS__New(Set),
|
|
57
|
+
slotPrizeAnimationGameFrame = __TS__New(Map)
|
|
58
|
+
}}
|
|
59
|
+
---
|
|
60
|
+
-- @internal
|
|
61
|
+
function ____exports.postSlotDestroyedCallbacksInit(self, mod)
|
|
62
|
+
saveDataManager(nil, "postSlotDestroyed", v, hasSubscriptions)
|
|
63
|
+
mod:AddCallback(ModCallback.POST_ENTITY_REMOVE, postEntityRemove, EntityType.SLOT)
|
|
64
|
+
mod:AddCallbackCustom(ModCallbackCustom.POST_SLOT_ANIMATION_CHANGED, postSlotAnimationChanged)
|
|
65
|
+
end
|
|
66
|
+
return ____exports
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
-
local Set = ____lualib.Set
|
|
3
2
|
local __TS__New = ____lualib.__TS__New
|
|
3
|
+
local Set = ____lualib.Set
|
|
4
4
|
local ____exports = {}
|
|
5
|
-
local hasSubscriptions, postRender, checkSlotAnimationChanged,
|
|
5
|
+
local hasSubscriptions, postRender, checkSlotAnimationChanged, v
|
|
6
6
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
7
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
8
8
|
local ____DefaultMap = require("classes.DefaultMap")
|
|
@@ -14,14 +14,11 @@ local getSlots = ____entitySpecific.getSlots
|
|
|
14
14
|
local ____postSlotAnimationChanged = require("callbacks.subscriptions.postSlotAnimationChanged")
|
|
15
15
|
local postSlotAnimationChangedFire = ____postSlotAnimationChanged.postSlotAnimationChangedFire
|
|
16
16
|
local postSlotAnimationChangedHasSubscriptions = ____postSlotAnimationChanged.postSlotAnimationChangedHasSubscriptions
|
|
17
|
-
local ____postSlotDestroyed = require("callbacks.subscriptions.postSlotDestroyed")
|
|
18
|
-
local postSlotDestroyedFire = ____postSlotDestroyed.postSlotDestroyedFire
|
|
19
|
-
local postSlotDestroyedHasSubscriptions = ____postSlotDestroyed.postSlotDestroyedHasSubscriptions
|
|
20
17
|
local ____postSlotRender = require("callbacks.subscriptions.postSlotRender")
|
|
21
18
|
local postSlotRenderFire = ____postSlotRender.postSlotRenderFire
|
|
22
19
|
local postSlotRenderHasSubscriptions = ____postSlotRender.postSlotRenderHasSubscriptions
|
|
23
20
|
function hasSubscriptions(self)
|
|
24
|
-
return postSlotRenderHasSubscriptions(nil) or
|
|
21
|
+
return postSlotRenderHasSubscriptions(nil) or postSlotAnimationChangedHasSubscriptions(nil)
|
|
25
22
|
end
|
|
26
23
|
function postRender(self)
|
|
27
24
|
if not hasSubscriptions(nil) then
|
|
@@ -30,7 +27,6 @@ function postRender(self)
|
|
|
30
27
|
for ____, slot in ipairs(getSlots(nil)) do
|
|
31
28
|
postSlotRenderFire(nil, slot)
|
|
32
29
|
checkSlotAnimationChanged(nil, slot)
|
|
33
|
-
checkSlotBroken(nil, slot)
|
|
34
30
|
end
|
|
35
31
|
end
|
|
36
32
|
function checkSlotAnimationChanged(self, slot)
|
|
@@ -43,20 +39,6 @@ function checkSlotAnimationChanged(self, slot)
|
|
|
43
39
|
postSlotAnimationChangedFire(nil, slot, previousAnimation, currentAnimation)
|
|
44
40
|
end
|
|
45
41
|
end
|
|
46
|
-
function checkSlotBroken(self, slot)
|
|
47
|
-
local ptrHash = GetPtrHash(slot)
|
|
48
|
-
local alreadyBroken = v.room.brokenSlots:has(ptrHash)
|
|
49
|
-
if alreadyBroken then
|
|
50
|
-
return
|
|
51
|
-
end
|
|
52
|
-
local sprite = slot:GetSprite()
|
|
53
|
-
local animation = sprite:GetAnimation()
|
|
54
|
-
if BROKEN_ANIMATIONS:has(animation) then
|
|
55
|
-
v.room.brokenSlots:add(ptrHash)
|
|
56
|
-
postSlotDestroyedFire(nil, slot)
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
BROKEN_ANIMATIONS = __TS__New(Set, {"Broken", "Death"})
|
|
60
42
|
v = {room = {
|
|
61
43
|
slotAnimations = __TS__New(
|
|
62
44
|
DefaultMap,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local subscriptions = {}
|
|
3
|
+
---
|
|
4
|
+
-- @internal
|
|
5
|
+
function ____exports.postPickupInitFirstHasSubscriptions(self)
|
|
6
|
+
return #subscriptions > 0
|
|
7
|
+
end
|
|
8
|
+
---
|
|
9
|
+
-- @internal
|
|
10
|
+
function ____exports.postPickupInitFirstRegister(self, ...)
|
|
11
|
+
local args = {...}
|
|
12
|
+
subscriptions[#subscriptions + 1] = args
|
|
13
|
+
end
|
|
14
|
+
---
|
|
15
|
+
-- @internal
|
|
16
|
+
function ____exports.postPickupInitFirstFire(self, pickup)
|
|
17
|
+
for ____, ____value in ipairs(subscriptions) do
|
|
18
|
+
local callback = ____value[1]
|
|
19
|
+
local pickupVariant = ____value[2]
|
|
20
|
+
do
|
|
21
|
+
if pickupVariant ~= nil and pickupVariant ~= pickup.Variant then
|
|
22
|
+
goto __continue5
|
|
23
|
+
end
|
|
24
|
+
callback(nil, pickup)
|
|
25
|
+
end
|
|
26
|
+
::__continue5::
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
return ____exports
|
package/classes/DefaultMap.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export declare type FactoryFunction<V, Args extends unknown[]> = (...extraArgs:
|
|
|
46
46
|
*
|
|
47
47
|
* ```ts
|
|
48
48
|
* // Initializes a new empty DefaultMap with a default value of a new empty array.
|
|
49
|
-
* const factoryFunction = () => []
|
|
49
|
+
* const factoryFunction = () => [];
|
|
50
50
|
* const defaultMapWithArray = new DefaultMap<string, string[]>(factoryFunction);
|
|
51
51
|
* ```
|
|
52
52
|
*
|
|
@@ -96,7 +96,6 @@ export declare class DefaultMap<Key, Value, Args extends unknown[] = []> extends
|
|
|
96
96
|
* it will set a default value for the provided key, and then return the default value.
|
|
97
97
|
*/
|
|
98
98
|
getAndSetDefault(key: Key, ...extraArgs: Args): Value;
|
|
99
|
-
getWithoutDefault(key: Key): Value | undefined;
|
|
100
99
|
/**
|
|
101
100
|
* Returns the default value to be used for a new key. (If a factory function was provided during
|
|
102
101
|
* instantiation, this will execute the factory function.)
|
package/classes/DefaultMap.lua
CHANGED
|
@@ -46,7 +46,7 @@ local ____exports = {}
|
|
|
46
46
|
--
|
|
47
47
|
-- ```ts
|
|
48
48
|
-- // Initializes a new empty DefaultMap with a default value of a new empty array.
|
|
49
|
-
-- const factoryFunction = () => []
|
|
49
|
+
-- const factoryFunction = () => [];
|
|
50
50
|
-- const defaultMapWithArray = new DefaultMap<string, string[]>(factoryFunction);
|
|
51
51
|
-- ```
|
|
52
52
|
--
|
|
@@ -111,9 +111,6 @@ function DefaultMap.prototype.getAndSetDefault(self, key, ...)
|
|
|
111
111
|
self:set(key, defaultValue)
|
|
112
112
|
return defaultValue
|
|
113
113
|
end
|
|
114
|
-
function DefaultMap.prototype.getWithoutDefault(self, key)
|
|
115
|
-
return Map.prototype.get(self, key)
|
|
116
|
-
end
|
|
117
114
|
function DefaultMap.prototype.getDefaultValue(self, ...)
|
|
118
115
|
if self.defaultValue ~= nil then
|
|
119
116
|
return self.defaultValue
|