isaacscript-common 30.5.3 → 30.5.5
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.rollup.d.ts +9 -1
- package/dist/isaacscript-common.lua +31 -10
- package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.d.ts +4 -0
- package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.lua +23 -4
- package/dist/src/classes/features/other/SaveDataManager.d.ts +1 -1
- package/dist/src/classes/features/other/SaveDataManager.d.ts.map +1 -1
- package/dist/src/classes/features/other/SaveDataManager.lua +5 -5
- package/dist/src/enums/ModCallbackCustom.d.ts +4 -0
- package/dist/src/enums/ModCallbackCustom.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +29 -2
- package/src/classes/features/other/SaveDataManager.ts +5 -5
- package/src/enums/ModCallbackCustom.ts +4 -0
package/dist/index.rollup.d.ts
CHANGED
|
@@ -4240,6 +4240,8 @@ export declare const GAME_FRAMES_PER_SECOND = 30;
|
|
|
4240
4240
|
* that you may run into with these callbacks.
|
|
4241
4241
|
*/
|
|
4242
4242
|
declare class GameReorderedCallbacks extends Feature {
|
|
4243
|
+
/** Used to detect a player resuming a saved run. */
|
|
4244
|
+
private renderFrameRunStarted;
|
|
4243
4245
|
private currentStage;
|
|
4244
4246
|
private currentStageType;
|
|
4245
4247
|
private usedGlowingHourGlass;
|
|
@@ -4250,7 +4252,9 @@ declare class GameReorderedCallbacks extends Feature {
|
|
|
4250
4252
|
private postNewRoomReordered;
|
|
4251
4253
|
private postGameStartedReorderedLast;
|
|
4252
4254
|
private postUseItemGlowingHourGlass;
|
|
4255
|
+
private postPlayerInit;
|
|
4253
4256
|
private postGameStarted;
|
|
4257
|
+
private preGameExit;
|
|
4254
4258
|
private postNewLevel;
|
|
4255
4259
|
private postNewRoom;
|
|
4256
4260
|
private recordCurrentStage;
|
|
@@ -10393,6 +10397,10 @@ export declare enum ModCallbackCustom {
|
|
|
10393
10397
|
* Additionally, this callback will pass the `LevelStage` as the first callback argument and the
|
|
10394
10398
|
* `StageType` as the second callback argument.
|
|
10395
10399
|
*
|
|
10400
|
+
* Note that similar to the vanilla `POST_NEW_LEVEL` callback, this callback will not fire when a
|
|
10401
|
+
* player resumes a saved run. (In that case, only the `POST_GAME_STARTED_REORDERED` and the
|
|
10402
|
+
* `POST_NEW_ROOM_REORDERED` callbacks will fire, in that order).
|
|
10403
|
+
*
|
|
10396
10404
|
* If some specific cases, mods can change the current level during run initialization (on the 0th
|
|
10397
10405
|
* frame). However, due to how the callback reordering works, the custom
|
|
10398
10406
|
* `POST_NEW_LEVEL_REORDERED` callback will never fire on the 0th frame. To get around this, call
|
|
@@ -14850,7 +14858,7 @@ declare class SaveDataManager extends Feature {
|
|
|
14850
14858
|
* contained in nested maps, sets, and arrays.
|
|
14851
14859
|
*/
|
|
14852
14860
|
private classConstructors;
|
|
14853
|
-
private
|
|
14861
|
+
private inARun;
|
|
14854
14862
|
private restoreGlowingHourGlassDataOnNextRoom;
|
|
14855
14863
|
private postUseItemGlowingHourGlass;
|
|
14856
14864
|
private postPlayerInit;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 30.5.
|
|
3
|
+
isaacscript-common 30.5.5
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -13780,6 +13780,8 @@ local ____exports = {}
|
|
|
13780
13780
|
____exports.GridEntityXMLType = {}
|
|
13781
13781
|
____exports.GridEntityXMLType.DECORATION = 0
|
|
13782
13782
|
____exports.GridEntityXMLType[____exports.GridEntityXMLType.DECORATION] = "DECORATION"
|
|
13783
|
+
____exports.GridEntityXMLType.EFFECT = 999
|
|
13784
|
+
____exports.GridEntityXMLType[____exports.GridEntityXMLType.EFFECT] = "EFFECT"
|
|
13783
13785
|
____exports.GridEntityXMLType.ROCK = 1000
|
|
13784
13786
|
____exports.GridEntityXMLType[____exports.GridEntityXMLType.ROCK] = "ROCK"
|
|
13785
13787
|
____exports.GridEntityXMLType.ROCK_BOMB = 1001
|
|
@@ -34550,6 +34552,7 @@ GameReorderedCallbacks.name = "GameReorderedCallbacks"
|
|
|
34550
34552
|
__TS__ClassExtends(GameReorderedCallbacks, Feature)
|
|
34551
34553
|
function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedReordered, postNewLevelReordered, postNewRoomReordered, postGameStartedReorderedLast)
|
|
34552
34554
|
Feature.prototype.____constructor(self)
|
|
34555
|
+
self.renderFrameRunStarted = nil
|
|
34553
34556
|
self.currentStage = nil
|
|
34554
34557
|
self.currentStageType = nil
|
|
34555
34558
|
self.usedGlowingHourGlass = false
|
|
@@ -34559,6 +34562,11 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
|
|
|
34559
34562
|
self.usedGlowingHourGlass = true
|
|
34560
34563
|
return nil
|
|
34561
34564
|
end
|
|
34565
|
+
self.postPlayerInit = function(____, _player)
|
|
34566
|
+
if self.renderFrameRunStarted == nil then
|
|
34567
|
+
self.renderFrameRunStarted = Isaac.GetFrameCount()
|
|
34568
|
+
end
|
|
34569
|
+
end
|
|
34562
34570
|
self.postGameStarted = function(____, isContinued)
|
|
34563
34571
|
local level = game:GetLevel()
|
|
34564
34572
|
local stage = level:GetStage()
|
|
@@ -34567,9 +34575,14 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
|
|
|
34567
34575
|
local roomType = room:GetType()
|
|
34568
34576
|
self:recordCurrentStage()
|
|
34569
34577
|
self.postGameStartedReordered:fire(isContinued)
|
|
34570
|
-
self.postNewLevelReordered:fire(stage, stageType)
|
|
34571
|
-
self.postNewRoomReordered:fire(roomType)
|
|
34572
34578
|
self.postGameStartedReorderedLast:fire(isContinued)
|
|
34579
|
+
if not isContinued then
|
|
34580
|
+
self.postNewLevelReordered:fire(stage, stageType)
|
|
34581
|
+
end
|
|
34582
|
+
self.postNewRoomReordered:fire(roomType)
|
|
34583
|
+
end
|
|
34584
|
+
self.preGameExit = function()
|
|
34585
|
+
self.renderFrameRunStarted = nil
|
|
34573
34586
|
end
|
|
34574
34587
|
self.postNewLevel = function()
|
|
34575
34588
|
local gameFrameCount = game:GetFrameCount()
|
|
@@ -34593,6 +34606,7 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
|
|
|
34593
34606
|
local stageType = level:GetStageType()
|
|
34594
34607
|
local room = game:GetRoom()
|
|
34595
34608
|
local roomType = room:GetType()
|
|
34609
|
+
local renderFrameCount = Isaac.GetFrameCount()
|
|
34596
34610
|
if self.usedGlowingHourGlass then
|
|
34597
34611
|
self.usedGlowingHourGlass = false
|
|
34598
34612
|
if self.currentStage ~= stage or self.currentStageType ~= stageType then
|
|
@@ -34602,13 +34616,20 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
|
|
|
34602
34616
|
return
|
|
34603
34617
|
end
|
|
34604
34618
|
end
|
|
34605
|
-
if (gameFrameCount == 0 or self.currentStage ~= stage or self.currentStageType ~= stageType) and not self.forceNewRoom then
|
|
34619
|
+
if (gameFrameCount == 0 or renderFrameCount == self.renderFrameRunStarted or self.currentStage ~= stage or self.currentStageType ~= stageType) and not self.forceNewRoom then
|
|
34606
34620
|
return
|
|
34607
34621
|
end
|
|
34608
34622
|
self.forceNewRoom = false
|
|
34609
34623
|
self.postNewRoomReordered:fire(roomType)
|
|
34610
34624
|
end
|
|
34611
|
-
self.callbacksUsed = {
|
|
34625
|
+
self.callbacksUsed = {
|
|
34626
|
+
{ModCallback.POST_USE_ITEM, self.postUseItemGlowingHourGlass, {CollectibleType.GLOWING_HOUR_GLASS}},
|
|
34627
|
+
{ModCallback.POST_PLAYER_INIT, self.postPlayerInit},
|
|
34628
|
+
{ModCallback.POST_GAME_STARTED, self.postGameStarted},
|
|
34629
|
+
{ModCallback.PRE_GAME_EXIT, self.preGameExit},
|
|
34630
|
+
{ModCallback.POST_NEW_LEVEL, self.postNewLevel},
|
|
34631
|
+
{ModCallback.POST_NEW_ROOM, self.postNewRoom}
|
|
34632
|
+
}
|
|
34612
34633
|
self.postGameStartedReordered = postGameStartedReordered
|
|
34613
34634
|
self.postNewLevelReordered = postNewLevelReordered
|
|
34614
34635
|
self.postNewRoomReordered = postNewRoomReordered
|
|
@@ -36631,17 +36652,17 @@ function SaveDataManager.prototype.____constructor(self, mod)
|
|
|
36631
36652
|
self.saveDataConditionalFuncMap = {}
|
|
36632
36653
|
self.saveDataGlowingHourGlassMap = {}
|
|
36633
36654
|
self.classConstructors = {}
|
|
36634
|
-
self.
|
|
36655
|
+
self.inARun = false
|
|
36635
36656
|
self.restoreGlowingHourGlassDataOnNextRoom = false
|
|
36636
36657
|
self.postUseItemGlowingHourGlass = function(____, _collectibleType, _rng, _player, _useFlags, _activeSlot, _customVarData)
|
|
36637
36658
|
self.restoreGlowingHourGlassDataOnNextRoom = true
|
|
36638
36659
|
return nil
|
|
36639
36660
|
end
|
|
36640
36661
|
self.postPlayerInit = function(____, _player)
|
|
36641
|
-
if self.
|
|
36662
|
+
if self.inARun then
|
|
36642
36663
|
return
|
|
36643
36664
|
end
|
|
36644
|
-
self.
|
|
36665
|
+
self.inARun = true
|
|
36645
36666
|
self.restoreGlowingHourGlassDataOnNextRoom = false
|
|
36646
36667
|
loadFromDisk(nil, self.mod, self.saveDataMap, self.classConstructors)
|
|
36647
36668
|
local gameFrameCount = game:GetFrameCount()
|
|
@@ -36652,7 +36673,7 @@ function SaveDataManager.prototype.____constructor(self, mod)
|
|
|
36652
36673
|
end
|
|
36653
36674
|
self.preGameExit = function()
|
|
36654
36675
|
saveToDisk(nil, self.mod, self.saveDataMap, self.saveDataConditionalFuncMap)
|
|
36655
|
-
self.
|
|
36676
|
+
self.inARun = false
|
|
36656
36677
|
end
|
|
36657
36678
|
self.postNewLevel = function()
|
|
36658
36679
|
restoreDefaultsForAllFeaturesKey(nil, self.saveDataMap, self.saveDataDefaultsMap, SaveDataKey.LEVEL)
|
|
@@ -36767,7 +36788,7 @@ function SaveDataManager.prototype.saveDataManagerReset(self, key, childObjectKe
|
|
|
36767
36788
|
)
|
|
36768
36789
|
end
|
|
36769
36790
|
function SaveDataManager.prototype.saveDataManagerInMenu(self)
|
|
36770
|
-
return not self.
|
|
36791
|
+
return not self.inARun
|
|
36771
36792
|
end
|
|
36772
36793
|
function SaveDataManager.prototype.saveDataManagerLogSubscribers(self)
|
|
36773
36794
|
log("List of save data manager subscribers:")
|
|
@@ -16,6 +16,8 @@ import { Feature } from "../../private/Feature";
|
|
|
16
16
|
* that you may run into with these callbacks.
|
|
17
17
|
*/
|
|
18
18
|
export declare class GameReorderedCallbacks extends Feature {
|
|
19
|
+
/** Used to detect a player resuming a saved run. */
|
|
20
|
+
private renderFrameRunStarted;
|
|
19
21
|
private currentStage;
|
|
20
22
|
private currentStageType;
|
|
21
23
|
private usedGlowingHourGlass;
|
|
@@ -26,7 +28,9 @@ export declare class GameReorderedCallbacks extends Feature {
|
|
|
26
28
|
private postNewRoomReordered;
|
|
27
29
|
private postGameStartedReorderedLast;
|
|
28
30
|
private postUseItemGlowingHourGlass;
|
|
31
|
+
private postPlayerInit;
|
|
29
32
|
private postGameStarted;
|
|
33
|
+
private preGameExit;
|
|
30
34
|
private postNewLevel;
|
|
31
35
|
private postNewRoom;
|
|
32
36
|
private recordCurrentStage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GameReorderedCallbacks.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/GameReorderedCallbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,sBAAuB,SAAQ,OAAO;IACjD,OAAO,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,gBAAgB,CAAoB;IAC5C,OAAO,CAAC,oBAAoB,CAAS;IACrC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAO,CAAC,wBAAwB,CAA2B;IAC3D,OAAO,CAAC,qBAAqB,CAAwB;IACrD,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,4BAA4B,CAA+B;
|
|
1
|
+
{"version":3,"file":"GameReorderedCallbacks.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/GameReorderedCallbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,sBAAuB,SAAQ,OAAO;IACjD,oDAAoD;IACpD,OAAO,CAAC,qBAAqB,CAAoB;IAEjD,OAAO,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,gBAAgB,CAAoB;IAC5C,OAAO,CAAC,oBAAoB,CAAS;IACrC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAO,CAAC,wBAAwB,CAA2B;IAC3D,OAAO,CAAC,qBAAqB,CAAwB;IACrD,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,4BAA4B,CAA+B;IA8CnE,OAAO,CAAC,2BAA2B,CAMjC;IAGF,OAAO,CAAC,cAAc,CAIpB;IAGF,OAAO,CAAC,eAAe,CAgBrB;IAGF,OAAO,CAAC,WAAW,CAEjB;IAGF,OAAO,CAAC,YAAY,CAiBlB;IAGF,OAAO,CAAC,WAAW,CAmCjB;IAEF,OAAO,CAAC,kBAAkB;IAS1B;;;;;;;;;;;;OAYG;IAEI,qBAAqB,IAAI,IAAI;IAIpC;;;;;;;;;;;;OAYG;IAEI,oBAAoB,IAAI,IAAI;IAInC;;;;;;;;;OASG;IAEI,0BAA0B,CAC/B,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,GACnB,IAAI;CAIR"}
|
|
@@ -31,6 +31,7 @@ GameReorderedCallbacks.name = "GameReorderedCallbacks"
|
|
|
31
31
|
__TS__ClassExtends(GameReorderedCallbacks, Feature)
|
|
32
32
|
function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedReordered, postNewLevelReordered, postNewRoomReordered, postGameStartedReorderedLast)
|
|
33
33
|
Feature.prototype.____constructor(self)
|
|
34
|
+
self.renderFrameRunStarted = nil
|
|
34
35
|
self.currentStage = nil
|
|
35
36
|
self.currentStageType = nil
|
|
36
37
|
self.usedGlowingHourGlass = false
|
|
@@ -40,6 +41,11 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
|
|
|
40
41
|
self.usedGlowingHourGlass = true
|
|
41
42
|
return nil
|
|
42
43
|
end
|
|
44
|
+
self.postPlayerInit = function(____, _player)
|
|
45
|
+
if self.renderFrameRunStarted == nil then
|
|
46
|
+
self.renderFrameRunStarted = Isaac.GetFrameCount()
|
|
47
|
+
end
|
|
48
|
+
end
|
|
43
49
|
self.postGameStarted = function(____, isContinued)
|
|
44
50
|
local level = game:GetLevel()
|
|
45
51
|
local stage = level:GetStage()
|
|
@@ -48,9 +54,14 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
|
|
|
48
54
|
local roomType = room:GetType()
|
|
49
55
|
self:recordCurrentStage()
|
|
50
56
|
self.postGameStartedReordered:fire(isContinued)
|
|
51
|
-
self.postNewLevelReordered:fire(stage, stageType)
|
|
52
|
-
self.postNewRoomReordered:fire(roomType)
|
|
53
57
|
self.postGameStartedReorderedLast:fire(isContinued)
|
|
58
|
+
if not isContinued then
|
|
59
|
+
self.postNewLevelReordered:fire(stage, stageType)
|
|
60
|
+
end
|
|
61
|
+
self.postNewRoomReordered:fire(roomType)
|
|
62
|
+
end
|
|
63
|
+
self.preGameExit = function()
|
|
64
|
+
self.renderFrameRunStarted = nil
|
|
54
65
|
end
|
|
55
66
|
self.postNewLevel = function()
|
|
56
67
|
local gameFrameCount = game:GetFrameCount()
|
|
@@ -74,6 +85,7 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
|
|
|
74
85
|
local stageType = level:GetStageType()
|
|
75
86
|
local room = game:GetRoom()
|
|
76
87
|
local roomType = room:GetType()
|
|
88
|
+
local renderFrameCount = Isaac.GetFrameCount()
|
|
77
89
|
if self.usedGlowingHourGlass then
|
|
78
90
|
self.usedGlowingHourGlass = false
|
|
79
91
|
if self.currentStage ~= stage or self.currentStageType ~= stageType then
|
|
@@ -83,13 +95,20 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
|
|
|
83
95
|
return
|
|
84
96
|
end
|
|
85
97
|
end
|
|
86
|
-
if (gameFrameCount == 0 or self.currentStage ~= stage or self.currentStageType ~= stageType) and not self.forceNewRoom then
|
|
98
|
+
if (gameFrameCount == 0 or renderFrameCount == self.renderFrameRunStarted or self.currentStage ~= stage or self.currentStageType ~= stageType) and not self.forceNewRoom then
|
|
87
99
|
return
|
|
88
100
|
end
|
|
89
101
|
self.forceNewRoom = false
|
|
90
102
|
self.postNewRoomReordered:fire(roomType)
|
|
91
103
|
end
|
|
92
|
-
self.callbacksUsed = {
|
|
104
|
+
self.callbacksUsed = {
|
|
105
|
+
{ModCallback.POST_USE_ITEM, self.postUseItemGlowingHourGlass, {CollectibleType.GLOWING_HOUR_GLASS}},
|
|
106
|
+
{ModCallback.POST_PLAYER_INIT, self.postPlayerInit},
|
|
107
|
+
{ModCallback.POST_GAME_STARTED, self.postGameStarted},
|
|
108
|
+
{ModCallback.PRE_GAME_EXIT, self.preGameExit},
|
|
109
|
+
{ModCallback.POST_NEW_LEVEL, self.postNewLevel},
|
|
110
|
+
{ModCallback.POST_NEW_ROOM, self.postNewRoom}
|
|
111
|
+
}
|
|
93
112
|
self.postGameStartedReordered = postGameStartedReordered
|
|
94
113
|
self.postNewLevelReordered = postNewLevelReordered
|
|
95
114
|
self.postNewRoomReordered = postNewRoomReordered
|
|
@@ -37,7 +37,7 @@ export declare class SaveDataManager extends Feature {
|
|
|
37
37
|
* contained in nested maps, sets, and arrays.
|
|
38
38
|
*/
|
|
39
39
|
private classConstructors;
|
|
40
|
-
private
|
|
40
|
+
private inARun;
|
|
41
41
|
private restoreGlowingHourGlassDataOnNextRoom;
|
|
42
42
|
private postUseItemGlowingHourGlass;
|
|
43
43
|
private postPlayerInit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveDataManager.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/SaveDataManager.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAOzD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAsBhD,qBAAa,eAAgB,SAAQ,OAAO;IAC1C;;;OAGG;IACH,OAAO,CAAC,GAAG,CAAM;IAEjB;;;;OAIG;IACH,OAAO,CAAC,WAAW,CAAkC;IAErD;;;OAGG;IACH,OAAO,CAAC,mBAAmB,CAAkC;IAE7D;;;OAGG;IACH,OAAO,CAAC,0BAA0B,CAAuC;IAEzE;;;;;;OAMG;IACH,OAAO,CAAC,2BAA2B,CAAkC;IAErE;;;OAGG;IACH,OAAO,CAAC,iBAAiB,CAAkC;IAG3D,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"SaveDataManager.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/SaveDataManager.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAOzD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,QAAQ,E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AAwB,IAAI,IAAI;IAIvC;;;;;;;;;;;OAWG;IAEI,4BAA4B,CAAC,GAAG,WAAW,EAAE,QAAQ,EAAE,GAAG,IAAI;IAcrE;;;;;OAKG;IAEI,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAoB/C;;;;;;;;;;;;;;;;;;;;;OAqBG;IAEI,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,GAAG,IAAI;IAsB3E;;;;;;;;;;;;OAYG;IAEI,qBAAqB,IAAI,OAAO;IAKhC,6BAA6B,IAAI,IAAI;CAQ7C"}
|
|
@@ -59,17 +59,17 @@ function SaveDataManager.prototype.____constructor(self, mod)
|
|
|
59
59
|
self.saveDataConditionalFuncMap = {}
|
|
60
60
|
self.saveDataGlowingHourGlassMap = {}
|
|
61
61
|
self.classConstructors = {}
|
|
62
|
-
self.
|
|
62
|
+
self.inARun = false
|
|
63
63
|
self.restoreGlowingHourGlassDataOnNextRoom = false
|
|
64
64
|
self.postUseItemGlowingHourGlass = function(____, _collectibleType, _rng, _player, _useFlags, _activeSlot, _customVarData)
|
|
65
65
|
self.restoreGlowingHourGlassDataOnNextRoom = true
|
|
66
66
|
return nil
|
|
67
67
|
end
|
|
68
68
|
self.postPlayerInit = function(____, _player)
|
|
69
|
-
if self.
|
|
69
|
+
if self.inARun then
|
|
70
70
|
return
|
|
71
71
|
end
|
|
72
|
-
self.
|
|
72
|
+
self.inARun = true
|
|
73
73
|
self.restoreGlowingHourGlassDataOnNextRoom = false
|
|
74
74
|
loadFromDisk(nil, self.mod, self.saveDataMap, self.classConstructors)
|
|
75
75
|
local gameFrameCount = game:GetFrameCount()
|
|
@@ -80,7 +80,7 @@ function SaveDataManager.prototype.____constructor(self, mod)
|
|
|
80
80
|
end
|
|
81
81
|
self.preGameExit = function()
|
|
82
82
|
saveToDisk(nil, self.mod, self.saveDataMap, self.saveDataConditionalFuncMap)
|
|
83
|
-
self.
|
|
83
|
+
self.inARun = false
|
|
84
84
|
end
|
|
85
85
|
self.postNewLevel = function()
|
|
86
86
|
restoreDefaultsForAllFeaturesKey(nil, self.saveDataMap, self.saveDataDefaultsMap, SaveDataKey.LEVEL)
|
|
@@ -195,7 +195,7 @@ function SaveDataManager.prototype.saveDataManagerReset(self, key, childObjectKe
|
|
|
195
195
|
)
|
|
196
196
|
end
|
|
197
197
|
function SaveDataManager.prototype.saveDataManagerInMenu(self)
|
|
198
|
-
return not self.
|
|
198
|
+
return not self.inARun
|
|
199
199
|
end
|
|
200
200
|
function SaveDataManager.prototype.saveDataManagerLogSubscribers(self)
|
|
201
201
|
log("List of save data manager subscribers:")
|
|
@@ -1073,6 +1073,10 @@ export declare enum ModCallbackCustom {
|
|
|
1073
1073
|
* Additionally, this callback will pass the `LevelStage` as the first callback argument and the
|
|
1074
1074
|
* `StageType` as the second callback argument.
|
|
1075
1075
|
*
|
|
1076
|
+
* Note that similar to the vanilla `POST_NEW_LEVEL` callback, this callback will not fire when a
|
|
1077
|
+
* player resumes a saved run. (In that case, only the `POST_GAME_STARTED_REORDERED` and the
|
|
1078
|
+
* `POST_NEW_ROOM_REORDERED` callbacks will fire, in that order).
|
|
1079
|
+
*
|
|
1076
1080
|
* If some specific cases, mods can change the current level during run initialization (on the 0th
|
|
1077
1081
|
* frame). However, due to how the callback reordering works, the custom
|
|
1078
1082
|
* `POST_NEW_LEVEL_REORDERED` callback will never fire on the 0th frame. To get around this, call
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModCallbackCustom.d.ts","sourceRoot":"","sources":["../../../src/enums/ModCallbackCustom.ts"],"names":[],"mappings":"AAYA;;;;;;;GAOG;AACH,oBAAY,iBAAiB;IAC3B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,sBAAsB,IAAA;IAEtB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,sBAAsB,IAAA;IAEtB;;;;;;;;;;;;;;;;;OAiBG;IACH,mBAAmB,IAAA;IAEnB;;;;;;;;;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;;;;;;;;;;;;OAeG;IACH,qBAAqB,MAAA;IAErB;;;;;;;;;;;;;;;;;OAiBG;IACH,+BAA+B,MAAA;IAE/B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,4BAA4B,MAAA;IAE5B;;;;;;;;;;;;;;;;;OAiBG;IACH,yBAAyB,MAAA;CAC1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "30.5.
|
|
3
|
+
"version": "30.5.5",
|
|
4
4
|
"description": "Helper functions and features for IsaacScript mods.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
"main": "dist/src/index",
|
|
26
26
|
"types": "dist/index.rollup.d.ts",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^13.0.
|
|
28
|
+
"isaac-typescript-definitions": "^13.0.9"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -28,6 +28,9 @@ import { Feature } from "../../private/Feature";
|
|
|
28
28
|
* that you may run into with these callbacks.
|
|
29
29
|
*/
|
|
30
30
|
export class GameReorderedCallbacks extends Feature {
|
|
31
|
+
/** Used to detect a player resuming a saved run. */
|
|
32
|
+
private renderFrameRunStarted: int | null = null;
|
|
33
|
+
|
|
31
34
|
private currentStage: int | null = null;
|
|
32
35
|
private currentStageType: int | null = null;
|
|
33
36
|
private usedGlowingHourGlass = false;
|
|
@@ -56,10 +59,16 @@ export class GameReorderedCallbacks extends Feature {
|
|
|
56
59
|
[CollectibleType.GLOWING_HOUR_GLASS],
|
|
57
60
|
],
|
|
58
61
|
|
|
62
|
+
// 9
|
|
63
|
+
[ModCallback.POST_PLAYER_INIT, this.postPlayerInit],
|
|
64
|
+
|
|
59
65
|
// 15
|
|
60
66
|
// eslint-disable-next-line deprecation/deprecation
|
|
61
67
|
[ModCallback.POST_GAME_STARTED, this.postGameStarted],
|
|
62
68
|
|
|
69
|
+
// 17
|
|
70
|
+
[ModCallback.PRE_GAME_EXIT, this.preGameExit],
|
|
71
|
+
|
|
63
72
|
// 18
|
|
64
73
|
// eslint-disable-next-line deprecation/deprecation
|
|
65
74
|
[ModCallback.POST_NEW_LEVEL, this.postNewLevel],
|
|
@@ -85,6 +94,13 @@ export class GameReorderedCallbacks extends Feature {
|
|
|
85
94
|
return undefined;
|
|
86
95
|
};
|
|
87
96
|
|
|
97
|
+
// ModCallback.POST_PLAYER_INIT (9)
|
|
98
|
+
private postPlayerInit = (_player: EntityPlayer): void => {
|
|
99
|
+
if (this.renderFrameRunStarted === null) {
|
|
100
|
+
this.renderFrameRunStarted = Isaac.GetFrameCount();
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
88
104
|
// ModCallback.POST_GAME_STARTED (15)
|
|
89
105
|
private postGameStarted = (isContinued: boolean): void => {
|
|
90
106
|
const level = game.GetLevel();
|
|
@@ -95,9 +111,18 @@ export class GameReorderedCallbacks extends Feature {
|
|
|
95
111
|
|
|
96
112
|
this.recordCurrentStage();
|
|
97
113
|
this.postGameStartedReordered.fire(isContinued);
|
|
98
|
-
this.postNewLevelReordered.fire(stage, stageType);
|
|
99
|
-
this.postNewRoomReordered.fire(roomType);
|
|
100
114
|
this.postGameStartedReorderedLast.fire(isContinued);
|
|
115
|
+
if (!isContinued) {
|
|
116
|
+
// The vanilla `POST_NEW_LEVEL` callback only fires on non-continued runs, which makes sense,
|
|
117
|
+
// because we do not want to blow away level variables in this case.
|
|
118
|
+
this.postNewLevelReordered.fire(stage, stageType);
|
|
119
|
+
}
|
|
120
|
+
this.postNewRoomReordered.fire(roomType);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// ModCallback.PRE_GAME_EXIT (17)
|
|
124
|
+
private preGameExit = (): void => {
|
|
125
|
+
this.renderFrameRunStarted = null;
|
|
101
126
|
};
|
|
102
127
|
|
|
103
128
|
// ModCallback.POST_NEW_LEVEL (18)
|
|
@@ -128,6 +153,7 @@ export class GameReorderedCallbacks extends Feature {
|
|
|
128
153
|
const stageType = level.GetStageType();
|
|
129
154
|
const room = game.GetRoom();
|
|
130
155
|
const roomType = room.GetType();
|
|
156
|
+
const renderFrameCount = Isaac.GetFrameCount();
|
|
131
157
|
|
|
132
158
|
if (this.usedGlowingHourGlass) {
|
|
133
159
|
this.usedGlowingHourGlass = false;
|
|
@@ -145,6 +171,7 @@ export class GameReorderedCallbacks extends Feature {
|
|
|
145
171
|
|
|
146
172
|
if (
|
|
147
173
|
(gameFrameCount === 0 ||
|
|
174
|
+
renderFrameCount === this.renderFrameRunStarted ||
|
|
148
175
|
this.currentStage !== stage ||
|
|
149
176
|
this.currentStageType !== stageType) &&
|
|
150
177
|
!this.forceNewRoom
|
|
@@ -81,7 +81,7 @@ export class SaveDataManager extends Feature {
|
|
|
81
81
|
private classConstructors = new LuaMap<string, AnyClass>();
|
|
82
82
|
|
|
83
83
|
// Other variables
|
|
84
|
-
private
|
|
84
|
+
private inARun = false;
|
|
85
85
|
private restoreGlowingHourGlassDataOnNextRoom = false;
|
|
86
86
|
|
|
87
87
|
/** @internal */
|
|
@@ -133,10 +133,10 @@ export class SaveDataManager extends Feature {
|
|
|
133
133
|
private postPlayerInit = (_player: EntityPlayer): void => {
|
|
134
134
|
// We want to only load data once per run to handle the case of a player using Genesis, a second
|
|
135
135
|
// player joining the run, and so on.
|
|
136
|
-
if (this.
|
|
136
|
+
if (this.inARun) {
|
|
137
137
|
return;
|
|
138
138
|
}
|
|
139
|
-
this.
|
|
139
|
+
this.inARun = true;
|
|
140
140
|
|
|
141
141
|
// Handle the race-condition of using the Glowing Hourglass and then resetting the run.
|
|
142
142
|
this.restoreGlowingHourGlassDataOnNextRoom = false;
|
|
@@ -166,7 +166,7 @@ export class SaveDataManager extends Feature {
|
|
|
166
166
|
|
|
167
167
|
// Mark that we are going to the menu. (Technically, the `POST_ENTITY_REMOVE` callback may fire
|
|
168
168
|
// before actually going to the menu, but that must be explicitly handled.)
|
|
169
|
-
this.
|
|
169
|
+
this.inARun = false;
|
|
170
170
|
|
|
171
171
|
// At this point, we could blow away the existing save data or restore defaults, but it is not
|
|
172
172
|
// necessary since we will have to do it again in the `POST_PLAYER_INIT` callback. Furthermore,
|
|
@@ -560,7 +560,7 @@ export class SaveDataManager extends Feature {
|
|
|
560
560
|
*/
|
|
561
561
|
@Exported
|
|
562
562
|
public saveDataManagerInMenu(): boolean {
|
|
563
|
-
return !this.
|
|
563
|
+
return !this.inARun;
|
|
564
564
|
}
|
|
565
565
|
|
|
566
566
|
@Exported
|
|
@@ -1148,6 +1148,10 @@ export enum ModCallbackCustom {
|
|
|
1148
1148
|
* Additionally, this callback will pass the `LevelStage` as the first callback argument and the
|
|
1149
1149
|
* `StageType` as the second callback argument.
|
|
1150
1150
|
*
|
|
1151
|
+
* Note that similar to the vanilla `POST_NEW_LEVEL` callback, this callback will not fire when a
|
|
1152
|
+
* player resumes a saved run. (In that case, only the `POST_GAME_STARTED_REORDERED` and the
|
|
1153
|
+
* `POST_NEW_ROOM_REORDERED` callbacks will fire, in that order).
|
|
1154
|
+
*
|
|
1151
1155
|
* If some specific cases, mods can change the current level during run initialization (on the 0th
|
|
1152
1156
|
* frame). However, due to how the callback reordering works, the custom
|
|
1153
1157
|
* `POST_NEW_LEVEL_REORDERED` callback will never fire on the 0th frame. To get around this, call
|