isaacscript-common 20.14.4 → 20.14.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 20.14.
|
|
3
|
+
isaacscript-common 20.14.5
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -42257,6 +42257,7 @@ function getRoomTypeMap(self, customStageLua)
|
|
|
42257
42257
|
end
|
|
42258
42258
|
return roomTypeMap
|
|
42259
42259
|
end
|
|
42260
|
+
local MUSIC_DELAY_RENDER_FRAMES = 70
|
|
42260
42261
|
____exports.CustomStages = __TS__Class()
|
|
42261
42262
|
local CustomStages = ____exports.CustomStages
|
|
42262
42263
|
CustomStages.name = "CustomStages"
|
|
@@ -42497,10 +42498,13 @@ function CustomStages.prototype.setCustomStage(self, name, firstFloor, streakTex
|
|
|
42497
42498
|
end)
|
|
42498
42499
|
end
|
|
42499
42500
|
local music = customStage.music == nil and getMusicForStage(nil, baseStage, baseStageType) or Isaac.GetMusicIdByName(customStage.music)
|
|
42500
|
-
self.runInNFrames:
|
|
42501
|
-
|
|
42502
|
-
|
|
42503
|
-
|
|
42501
|
+
self.runInNFrames:runInNRenderFrames(
|
|
42502
|
+
function()
|
|
42503
|
+
musicManager:Enable()
|
|
42504
|
+
musicManager:Crossfade(music)
|
|
42505
|
+
end,
|
|
42506
|
+
MUSIC_DELAY_RENDER_FRAMES
|
|
42507
|
+
)
|
|
42504
42508
|
end
|
|
42505
42509
|
function CustomStages.prototype.disableCustomStage(self)
|
|
42506
42510
|
self.v.run.currentCustomStage = nil
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomStages.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/CustomStages.ts"],"names":[],"mappings":"AAyCA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomStages.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/CustomStages.ts"],"names":[],"mappings":"AAyCA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AA0ChD,qBAAa,YAAa,SAAQ,OAAO;IA8BvC,oCAAoC;IACpC,OAAO,CAAC,eAAe,CAAkC;IAEzD,+BAA+B;IAC/B,OAAO,CAAC,yBAAyB,CAAwC;IAEzE,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,sBAAsB,CAAyB;IACvD,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,YAAY,CAAe;IAqDnC,OAAO,CAAC,uBAAuB;IAc/B,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,6BAA6B;IAOrC,OAAO,CAAC,eAAe,CAarB;IAGF,OAAO,CAAC,UAAU,CAQhB;IAGF,OAAO,CAAC,aAAa,CAcnB;IAGF,OAAO,CAAC,eAAe,CAUrB;IAIF,OAAO,CAAC,2BAA2B,CAejC;IAGF,OAAO,CAAC,kBAAkB,CAqBxB;IAGF,OAAO,CAAC,oBAAoB,CAe1B;IAEF,gDAAgD;IAChD,OAAO,CAAC,iBAAiB;IA+FzB;;;;;;;;;;;;;;;;OAgBG;IAEI,cAAc,CACnB,IAAI,EAAE,MAAM,EACZ,UAAU,UAAO,EACjB,UAAU,UAAO,EACjB,OAAO,UAAQ,GACd,IAAI;IAuFP;;;;;OAKG;IAEI,kBAAkB,IAAI,IAAI;CAGlC"}
|
|
@@ -102,6 +102,9 @@ function getRoomTypeMap(self, customStageLua)
|
|
|
102
102
|
end
|
|
103
103
|
return roomTypeMap
|
|
104
104
|
end
|
|
105
|
+
--- 60 does not work correctly (the music kicking in from stage -1 will mute it), so we use 70 to be
|
|
106
|
+
-- safe.
|
|
107
|
+
local MUSIC_DELAY_RENDER_FRAMES = 70
|
|
105
108
|
____exports.CustomStages = __TS__Class()
|
|
106
109
|
local CustomStages = ____exports.CustomStages
|
|
107
110
|
CustomStages.name = "CustomStages"
|
|
@@ -342,10 +345,13 @@ function CustomStages.prototype.setCustomStage(self, name, firstFloor, streakTex
|
|
|
342
345
|
end)
|
|
343
346
|
end
|
|
344
347
|
local music = customStage.music == nil and getMusicForStage(nil, baseStage, baseStageType) or Isaac.GetMusicIdByName(customStage.music)
|
|
345
|
-
self.runInNFrames:
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
348
|
+
self.runInNFrames:runInNRenderFrames(
|
|
349
|
+
function()
|
|
350
|
+
musicManager:Enable()
|
|
351
|
+
musicManager:Crossfade(music)
|
|
352
|
+
end,
|
|
353
|
+
MUSIC_DELAY_RENDER_FRAMES
|
|
354
|
+
)
|
|
349
355
|
end
|
|
350
356
|
function CustomStages.prototype.disableCustomStage(self)
|
|
351
357
|
self.v.run.currentCustomStage = nil
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "20.14.
|
|
3
|
+
"version": "20.14.5",
|
|
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": "^11.0.
|
|
25
|
+
"isaac-typescript-definitions": "^11.0.3"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -75,6 +75,12 @@ import { DisableAllSound } from "./DisableAllSound";
|
|
|
75
75
|
import { Pause } from "./Pause";
|
|
76
76
|
import { RunInNFrames } from "./RunInNFrames";
|
|
77
77
|
|
|
78
|
+
/**
|
|
79
|
+
* 60 does not work correctly (the music kicking in from stage -1 will mute it), so we use 70 to be
|
|
80
|
+
* safe.
|
|
81
|
+
*/
|
|
82
|
+
const MUSIC_DELAY_RENDER_FRAMES = 70;
|
|
83
|
+
|
|
78
84
|
export class CustomStages extends Feature {
|
|
79
85
|
/** @internal */
|
|
80
86
|
public override v = {
|
|
@@ -507,12 +513,13 @@ export class CustomStages extends Feature {
|
|
|
507
513
|
customStage.music === undefined
|
|
508
514
|
? getMusicForStage(baseStage, baseStageType)
|
|
509
515
|
: Isaac.GetMusicIdByName(customStage.music);
|
|
510
|
-
|
|
516
|
+
|
|
517
|
+
this.runInNFrames.runInNRenderFrames(() => {
|
|
511
518
|
// By default, the `MusicManager.Play` method will play the music at max volume (1.0), which
|
|
512
519
|
// is around twice as loud as the vanilla music plays.
|
|
513
520
|
musicManager.Enable();
|
|
514
521
|
musicManager.Crossfade(music);
|
|
515
|
-
});
|
|
522
|
+
}, MUSIC_DELAY_RENDER_FRAMES);
|
|
516
523
|
|
|
517
524
|
// We must reload the current room in order for the `Level.SetStage` method to take effect.
|
|
518
525
|
// Furthermore, we need to cancel the queued warp to the `GridRoom.DEBUG` room. We can
|