isaacscript-common 33.4.1 → 33.5.1

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.
@@ -4193,6 +4193,17 @@ declare class ExtraConsoleCommands extends Feature {
4193
4193
  * `ISCFeature.EXTRA_CONSOLE_COMMANDS`.
4194
4194
  */
4195
4195
  removeConsoleCommand(commandName: string): void;
4196
+ /**
4197
+ * Helper function to remove all custom console commands.
4198
+ *
4199
+ * The standard library comes with [many existing console commands](ExtraConsoleCommandsList) that
4200
+ * are useful for debugging. If you want to disable all of them after this feature has already
4201
+ * been initialized, use this function.
4202
+ *
4203
+ * In order to use this function, you must upgrade your mod with
4204
+ * `ISCFeature.EXTRA_CONSOLE_COMMANDS`.
4205
+ */
4206
+ removeAllConsoleCommands(): void;
4196
4207
  }
4197
4208
 
4198
4209
  /**
@@ -9574,6 +9585,7 @@ export declare function logMap(this: void, map: Map<AnyNotNil, unknown>, name?:
9574
9585
 
9575
9586
  export declare function logMusic(this: void): void;
9576
9587
 
9588
+ /** Helper function to log any added global variables in the Isaac Lua environment. */
9577
9589
  export declare function logNewGlobals(): void;
9578
9590
 
9579
9591
  export declare function logPlayerEffects(this: void, player: EntityPlayer): void;
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 33.4.1
3
+ isaacscript-common 33.5.1
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -24401,7 +24401,6 @@ local ____exports = {}
24401
24401
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
24402
24402
  local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
24403
24403
  local Difficulty = ____isaac_2Dtypescript_2Ddefinitions.Difficulty
24404
- local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
24405
24404
  local SlotVariant = ____isaac_2Dtypescript_2Ddefinitions.SlotVariant
24406
24405
  local ____cachedClasses = require("src.core.cachedClasses")
24407
24406
  local game = ____cachedClasses.game
@@ -24409,6 +24408,8 @@ local ____constants = require("src.core.constants")
24409
24408
  local VectorZero = ____constants.VectorZero
24410
24409
  local ____constantsFirstLast = require("src.core.constantsFirstLast")
24411
24410
  local FIRST_CHARACTER = ____constantsFirstLast.FIRST_CHARACTER
24411
+ local ____characters = require("src.functions.characters")
24412
+ local getCharacterName = ____characters.getCharacterName
24412
24413
  local ____entitiesSpecific = require("src.functions.entitiesSpecific")
24413
24414
  local spawnSlot = ____entitiesSpecific.spawnSlot
24414
24415
  local ____log = require("src.functions.log")
@@ -24439,7 +24440,8 @@ function ____exports.restart(self, character)
24439
24440
  error(("Restarting as a character of " .. tostring(character)) .. " would crash the game.")
24440
24441
  end
24441
24442
  local command = "restart " .. tostring(character)
24442
- log((((("Restarting the run as PlayerType." .. PlayerType[character]) .. " (") .. tostring(character)) .. ") with a console command of: ") .. command)
24443
+ local characterName = getCharacterName(nil, character)
24444
+ log((((("Restarting the run as " .. characterName) .. " (") .. tostring(character)) .. ") with a console command of: ") .. command)
24443
24445
  Isaac.ExecuteCommand(command)
24444
24446
  end
24445
24447
  function ____exports.setUnseeded(self)
@@ -50749,6 +50751,10 @@ function ExtraConsoleCommands.prototype.removeConsoleCommand(self, commandName)
50749
50751
  self.commandFunctionMap:delete(commandName)
50750
50752
  end
50751
50753
  __TS__DecorateLegacy({Exported}, ExtraConsoleCommands.prototype, "removeConsoleCommand", true)
50754
+ function ExtraConsoleCommands.prototype.removeAllConsoleCommands(self)
50755
+ self.commandFunctionMap:clear()
50756
+ end
50757
+ __TS__DecorateLegacy({Exported}, ExtraConsoleCommands.prototype, "removeAllConsoleCommands", true)
50752
50758
  return ____exports
50753
50759
  end,
50754
50760
  ["src.classes.features.other.FadeInRemover"] = function(...)
@@ -48,5 +48,16 @@ export declare class ExtraConsoleCommands extends Feature {
48
48
  * `ISCFeature.EXTRA_CONSOLE_COMMANDS`.
49
49
  */
50
50
  removeConsoleCommand(commandName: string): void;
51
+ /**
52
+ * Helper function to remove all custom console commands.
53
+ *
54
+ * The standard library comes with [many existing console commands](ExtraConsoleCommandsList) that
55
+ * are useful for debugging. If you want to disable all of them after this feature has already
56
+ * been initialized, use this function.
57
+ *
58
+ * In order to use this function, you must upgrade your mod with
59
+ * `ISCFeature.EXTRA_CONSOLE_COMMANDS`.
60
+ */
61
+ removeAllConsoleCommands(): void;
51
62
  }
52
63
  //# sourceMappingURL=ExtraConsoleCommands.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExtraConsoleCommands.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ExtraConsoleCommands.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAShD;;;;;;;;;;GAUG;AACH,qBAAa,oBAAqB,SAAQ,OAAO;IAI/C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAU;IAExC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAG/B;IAoEJ,OAAO,CAAC,QAAQ,CAAC,UAAU,CAKzB;IAIF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAIlC;IAIF,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAIrC;IAIF,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAIjC;IAIF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAIlC;IAGF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAkD5B;IAGF,OAAO,CAAC,QAAQ,CAAC,UAAU,CAWzB;IAGF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAI3B;IAGF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAYlC;IAEF;;;;;;;;;;;;OAYG;IAEI,iBAAiB,CACtB,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GACxC,IAAI;IA4BP;;;;;;;;;;OAUG;IAEI,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;CAoBvD"}
1
+ {"version":3,"file":"ExtraConsoleCommands.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ExtraConsoleCommands.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAShD;;;;;;;;;;GAUG;AACH,qBAAa,oBAAqB,SAAQ,OAAO;IAI/C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAU;IAExC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAG/B;IAoEJ,OAAO,CAAC,QAAQ,CAAC,UAAU,CAKzB;IAIF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAIlC;IAIF,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAIrC;IAIF,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAIjC;IAIF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAIlC;IAGF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAkD5B;IAGF,OAAO,CAAC,QAAQ,CAAC,UAAU,CAWzB;IAGF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAI3B;IAGF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAYlC;IAEF;;;;;;;;;;;;OAYG;IAEI,iBAAiB,CACtB,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GACxC,IAAI;IA4BP;;;;;;;;;;OAUG;IAEI,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAqBtD;;;;;;;;;OASG;IAEI,wBAAwB,IAAI,IAAI;CAGxC"}
@@ -179,4 +179,8 @@ function ExtraConsoleCommands.prototype.removeConsoleCommand(self, commandName)
179
179
  self.commandFunctionMap:delete(commandName)
180
180
  end
181
181
  __TS__DecorateLegacy({Exported}, ExtraConsoleCommands.prototype, "removeConsoleCommand", true)
182
+ function ExtraConsoleCommands.prototype.removeAllConsoleCommands(self)
183
+ self.commandFunctionMap:clear()
184
+ end
185
+ __TS__DecorateLegacy({Exported}, ExtraConsoleCommands.prototype, "removeAllConsoleCommands", true)
182
186
  return ____exports
@@ -11,6 +11,7 @@ export declare function getDefaultGlobals(): ReadonlySet<string>;
11
11
  * Returns a sorted array of key/value tuples.
12
12
  */
13
13
  export declare function getNewGlobals(): ReadonlyArray<[AnyNotNil, unknown]>;
14
+ /** Helper function to log any added global variables in the Isaac Lua environment. */
14
15
  export declare function logNewGlobals(): void;
15
16
  /**
16
17
  * Converts every `isaacscript-common` function that begins with "log" to a global function.
@@ -1 +1 @@
1
- {"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../../../src/functions/globals.ts"],"names":[],"mappings":";AA6LA;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,WAAW,CAAC,MAAM,CAAC,CAYvD;AAMD;;;GAGG;AACH,wBAAgB,aAAa,IAAI,aAAa,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAcnE;AAED,wBAAgB,aAAa,IAAI,IAAI,CAapC;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAS5C;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAKlD"}
1
+ {"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../../../src/functions/globals.ts"],"names":[],"mappings":";AA6LA;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,WAAW,CAAC,MAAM,CAAC,CAYvD;AAMD;;;GAGG;AACH,wBAAgB,aAAa,IAAI,aAAa,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAcnE;AAED,sFAAsF;AACtF,wBAAgB,aAAa,IAAI,IAAI,CAapC;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAS5C;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAKlD"}
@@ -227,6 +227,7 @@ function ____exports.getNewGlobals(self)
227
227
  __TS__ArraySort(newGlobals, sortTwoDimensionalArray)
228
228
  return newGlobals
229
229
  end
230
+ --- Helper function to log any added global variables in the Isaac Lua environment.
230
231
  function ____exports.logNewGlobals(self)
231
232
  local newGlobals = ____exports.getNewGlobals(nil)
232
233
  log("List of added global variables in the Isaac environment:")
@@ -1,4 +1,4 @@
1
- import { PlayerType } from "isaac-typescript-definitions";
1
+ import type { PlayerType } from "isaac-typescript-definitions";
2
2
  /**
3
3
  * Helper function to see if the current run can unlock achievements. For example, if playing on a
4
4
  * set seed or in a victory lap, achievements are disabled.
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAOtC;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAUlD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAKrC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAiBpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAUlC"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAa/D;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAUlD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAKrC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAkBpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAUlC"}
@@ -2,7 +2,6 @@ local ____exports = {}
2
2
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
3
  local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
4
4
  local Difficulty = ____isaac_2Dtypescript_2Ddefinitions.Difficulty
5
- local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
6
5
  local SlotVariant = ____isaac_2Dtypescript_2Ddefinitions.SlotVariant
7
6
  local ____cachedClasses = require("src.core.cachedClasses")
8
7
  local game = ____cachedClasses.game
@@ -10,6 +9,8 @@ local ____constants = require("src.core.constants")
10
9
  local VectorZero = ____constants.VectorZero
11
10
  local ____constantsFirstLast = require("src.core.constantsFirstLast")
12
11
  local FIRST_CHARACTER = ____constantsFirstLast.FIRST_CHARACTER
12
+ local ____characters = require("src.functions.characters")
13
+ local getCharacterName = ____characters.getCharacterName
13
14
  local ____entitiesSpecific = require("src.functions.entitiesSpecific")
14
15
  local spawnSlot = ____entitiesSpecific.spawnSlot
15
16
  local ____log = require("src.functions.log")
@@ -52,7 +53,8 @@ function ____exports.restart(self, character)
52
53
  error(("Restarting as a character of " .. tostring(character)) .. " would crash the game.")
53
54
  end
54
55
  local command = "restart " .. tostring(character)
55
- log((((("Restarting the run as PlayerType." .. PlayerType[character]) .. " (") .. tostring(character)) .. ") with a console command of: ") .. command)
56
+ local characterName = getCharacterName(nil, character)
57
+ log((((("Restarting the run as " .. characterName) .. " (") .. tostring(character)) .. ") with a console command of: ") .. command)
56
58
  Isaac.ExecuteCommand(command)
57
59
  end
58
60
  --- Helper function to change the run status to that of an unseeded run with a new random seed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "33.4.1",
3
+ "version": "33.5.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -314,4 +314,19 @@ export class ExtraConsoleCommands extends Feature {
314
314
 
315
315
  this.commandFunctionMap.delete(commandName);
316
316
  }
317
+
318
+ /**
319
+ * Helper function to remove all custom console commands.
320
+ *
321
+ * The standard library comes with [many existing console commands](ExtraConsoleCommandsList) that
322
+ * are useful for debugging. If you want to disable all of them after this feature has already
323
+ * been initialized, use this function.
324
+ *
325
+ * In order to use this function, you must upgrade your mod with
326
+ * `ISCFeature.EXTRA_CONSOLE_COMMANDS`.
327
+ */
328
+ @Exported
329
+ public removeAllConsoleCommands(): void {
330
+ this.commandFunctionMap.clear();
331
+ }
317
332
  }
@@ -231,6 +231,7 @@ export function getNewGlobals(): ReadonlyArray<[AnyNotNil, unknown]> {
231
231
  return newGlobals;
232
232
  }
233
233
 
234
+ /** Helper function to log any added global variables in the Isaac Lua environment. */
234
235
  export function logNewGlobals(): void {
235
236
  const newGlobals = getNewGlobals();
236
237
 
@@ -1,12 +1,13 @@
1
+ import type { PlayerType } from "isaac-typescript-definitions";
1
2
  import {
2
3
  Challenge,
3
4
  Difficulty,
4
- PlayerType,
5
5
  SlotVariant,
6
6
  } from "isaac-typescript-definitions";
7
7
  import { game } from "../core/cachedClasses";
8
8
  import { VectorZero } from "../core/constants";
9
9
  import { FIRST_CHARACTER } from "../core/constantsFirstLast";
10
+ import { getCharacterName } from "./characters";
10
11
  import { spawnSlot } from "./entitiesSpecific";
11
12
  import { log } from "./log";
12
13
 
@@ -70,8 +71,9 @@ export function restart(character?: PlayerType): void {
70
71
  }
71
72
 
72
73
  const command = `restart ${character}`;
74
+ const characterName = getCharacterName(character);
73
75
  log(
74
- `Restarting the run as PlayerType.${PlayerType[character]} (${character}) with a console command of: ${command}`,
76
+ `Restarting the run as ${characterName} (${character}) with a console command of: ${command}`,
75
77
  );
76
78
  Isaac.ExecuteCommand(command);
77
79
  }