isaacscript-common 1.2.183 → 1.2.186

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.
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Removes the fade-in that occurs at the beginning of a run. If this behavior is desired, call this
3
+ * function once at the beginning of your mod.
4
+ *
5
+ * This is useful for debugging, when you are resetting the game often.
6
+ *
7
+ * You can restore the vanilla behavior with the `restoreFadeIn` function.
8
+ */
9
+ export declare function removeFadeIn(): void;
10
+ /**
11
+ * Disables the fade-in remover. Only useful if you have previously called the `removeFadeIn`
12
+ * function.
13
+ */
14
+ export declare function restoreFadeIn(): void;
@@ -0,0 +1,44 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____exports = {}
3
+ local postRender, shouldRemoveFadeIn, FADE_IN_SPEED, enabled, v
4
+ local ____cachedClasses = require("cachedClasses")
5
+ local game = ____cachedClasses.game
6
+ local ____featuresInitialized = require("featuresInitialized")
7
+ local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
8
+ local ____exports = require("features.saveDataManager.exports")
9
+ local saveDataManager = ____exports.saveDataManager
10
+ function postRender(self)
11
+ if not enabled then
12
+ return
13
+ end
14
+ if shouldRemoveFadeIn(nil) then
15
+ v.run.removedFadeIn = true
16
+ game:Fadein(FADE_IN_SPEED)
17
+ end
18
+ end
19
+ function shouldRemoveFadeIn(self)
20
+ local gameFrameCount = game:GetFrameCount()
21
+ return not v.run.removedFadeIn and gameFrameCount == 0
22
+ end
23
+ local FEATURE_NAME = "fade-in remover"
24
+ FADE_IN_SPEED = 1
25
+ enabled = false
26
+ v = {run = {removedFadeIn = false}}
27
+ function ____exports.fadeInRemoverInit(self, mod)
28
+ saveDataManager(
29
+ nil,
30
+ "fadeInRemover",
31
+ v,
32
+ function() return false end
33
+ )
34
+ mod:AddCallback(ModCallbacks.MC_POST_RENDER, postRender)
35
+ end
36
+ function ____exports.removeFadeIn(self)
37
+ errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
38
+ enabled = true
39
+ end
40
+ function ____exports.restoreFadeIn(self)
41
+ errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
42
+ enabled = false
43
+ end
44
+ return ____exports
@@ -1,6 +1,6 @@
1
- export declare function postRender(): void;
2
1
  /**
3
- * Enables the fast-reset feature, which allows you to restart the game instantaneously.
2
+ * Enables the fast-reset feature, which allows you to restart the game instantaneously. If this
3
+ * behavior is desired, call this function once at the beginning of your mod.
4
4
  *
5
5
  * This is useful for debugging, when you are resetting the game often.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____exports = {}
3
- local checkResetInput, enabled
3
+ local postRender, checkResetInput, enabled
4
4
  local ____cachedClasses = require("cachedClasses")
5
5
  local game = ____cachedClasses.game
6
6
  local ____featuresInitialized = require("featuresInitialized")
@@ -10,7 +10,7 @@ local isActionTriggeredOnAnyInput = ____input.isActionTriggeredOnAnyInput
10
10
  local isKeyboardPressed = ____input.isKeyboardPressed
11
11
  local ____run = require("functions.run")
12
12
  local restart = ____run.restart
13
- function ____exports.postRender(self)
13
+ function postRender(self)
14
14
  if not enabled then
15
15
  return
16
16
  end
@@ -34,7 +34,7 @@ end
34
34
  local FEATURE_NAME = "fast reset"
35
35
  enabled = false
36
36
  function ____exports.fastResetInit(self, mod)
37
- mod:AddCallback(ModCallbacks.MC_POST_RENDER, ____exports.postRender)
37
+ mod:AddCallback(ModCallbacks.MC_POST_RENDER, postRender)
38
38
  end
39
39
  function ____exports.enableFastReset(self)
40
40
  errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
package/dist/index.d.ts CHANGED
@@ -16,6 +16,8 @@ export { deployJSONRoom, deployRandomJSONRoom, emptyRoom, } from "./features/dep
16
16
  export { disableAllInputs, disableAllInputsExceptFor, disableMovementInputs, disableShootingInputs, enableAllInputs, enableAllInputsExceptFor, } from "./features/disableInputs";
17
17
  export { disableAllSound, enableAllSound } from "./features/disableSound";
18
18
  export { addConsoleCommand, enableExtraConsoleCommands, removeConsoleCommand, } from "./features/extraConsoleCommands/init";
19
+ export { removeFadeIn, restoreFadeIn } from "./features/fadeInRemover";
20
+ export { disableFastReset, enableFastReset } from "./features/fastReset";
19
21
  export { forgottenSwitch } from "./features/forgottenSwitch";
20
22
  export { getCollectibleItemPoolType } from "./features/getCollectibleItemPoolType";
21
23
  export * from "./features/isPonyActive";
package/dist/index.lua CHANGED
@@ -150,6 +150,20 @@ do
150
150
  ____exports.enableExtraConsoleCommands = enableExtraConsoleCommands
151
151
  ____exports.removeConsoleCommand = removeConsoleCommand
152
152
  end
153
+ do
154
+ local ____fadeInRemover = require("features.fadeInRemover")
155
+ local removeFadeIn = ____fadeInRemover.removeFadeIn
156
+ local restoreFadeIn = ____fadeInRemover.restoreFadeIn
157
+ ____exports.removeFadeIn = removeFadeIn
158
+ ____exports.restoreFadeIn = restoreFadeIn
159
+ end
160
+ do
161
+ local ____fastReset = require("features.fastReset")
162
+ local disableFastReset = ____fastReset.disableFastReset
163
+ local enableFastReset = ____fastReset.enableFastReset
164
+ ____exports.disableFastReset = disableFastReset
165
+ ____exports.enableFastReset = enableFastReset
166
+ end
153
167
  do
154
168
  local ____forgottenSwitch = require("features.forgottenSwitch")
155
169
  local forgottenSwitch = ____forgottenSwitch.forgottenSwitch
@@ -84,6 +84,10 @@ local ____disableInputs = require("features.disableInputs")
84
84
  local disableInputsInit = ____disableInputs.disableInputsInit
85
85
  local ____disableSound = require("features.disableSound")
86
86
  local disableSoundsInit = ____disableSound.disableSoundsInit
87
+ local ____fadeInRemover = require("features.fadeInRemover")
88
+ local fadeInRemoverInit = ____fadeInRemover.fadeInRemoverInit
89
+ local ____fastReset = require("features.fastReset")
90
+ local fastResetInit = ____fastReset.fastResetInit
87
91
  local ____forgottenSwitch = require("features.forgottenSwitch")
88
92
  local forgottenSwitchInit = ____forgottenSwitch.forgottenSwitchInit
89
93
  local ____getCollectibleItemPoolType = require("features.getCollectibleItemPoolType")
@@ -157,6 +161,8 @@ function initFeatures(self, mod)
157
161
  isPonyActiveInit(nil, mod)
158
162
  playerInventoryInit(nil, mod)
159
163
  taintedLazarusPlayersInit(nil, mod)
164
+ fastResetInit(nil, mod)
165
+ fadeInRemoverInit(nil, mod)
160
166
  end
161
167
  function ____exports.upgradeMod(self, modVanilla, verbose)
162
168
  if verbose == nil then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.183",
3
+ "version": "1.2.186",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",