isaacscript-common 17.2.0 → 17.2.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.
package/dist/index.d.ts CHANGED
@@ -4563,8 +4563,11 @@ export declare function getEffectsList(player: EntityPlayer): TemporaryEffect[];
4563
4563
  * which will not display correctly on some fonts.
4564
4564
  *
4565
4565
  * Note that this returns "Blue Womb" instead of "???" for stage 9.
4566
+ *
4567
+ * @param stage Optional. If not specified, the current stage will be used.
4568
+ * @param stageType Optional. If not specified, the current stage type will be used.
4566
4569
  */
4567
- export declare function getEnglishLevelName(stage: LevelStage, stageType: StageType): string;
4570
+ export declare function getEnglishLevelName(stage?: LevelStage, stageType?: StageType): string;
4568
4571
 
4569
4572
  /**
4570
4573
  * Helper function to get all of the entities in the room or all of the entities that match a
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 17.2.0
3
+ isaacscript-common 17.2.1
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -25313,6 +25313,13 @@ function ____exports.getEffectiveStage(self)
25313
25313
  return stage
25314
25314
  end
25315
25315
  function ____exports.getEnglishLevelName(self, stage, stageType)
25316
+ local level = game:GetLevel()
25317
+ if stage == nil then
25318
+ stage = level:GetStage()
25319
+ end
25320
+ if stageType == nil then
25321
+ stageType = level:GetStageType()
25322
+ end
25316
25323
  local stageNames = ENGLISH_LEVEL_NAMES[stage]
25317
25324
  return stageNames[stageType]
25318
25325
  end
@@ -22,8 +22,11 @@ export declare function getEffectiveStage(): int;
22
22
  * which will not display correctly on some fonts.
23
23
  *
24
24
  * Note that this returns "Blue Womb" instead of "???" for stage 9.
25
+ *
26
+ * @param stage Optional. If not specified, the current stage will be used.
27
+ * @param stageType Optional. If not specified, the current stage type will be used.
25
28
  */
26
- export declare function getEnglishLevelName(stage: LevelStage, stageType: StageType): string;
29
+ export declare function getEnglishLevelName(stage?: LevelStage, stageType?: StageType): string;
27
30
  /**
28
31
  * Helper function to get the corresponding "goto" console command that would correspond to the
29
32
  * provided room type and room variant.
@@ -1 +1 @@
1
- {"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../../src/functions/stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,QAAQ,EACR,SAAS,EACV,MAAM,8BAA8B,CAAC;AAQtC;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CA6B/D;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAmBzE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,GAAG,CASvC;AAGD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,GACnB,MAAM,CAGR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,GAAG,MAAM,CAG3E;AAED,6CAA6C;AAC7C,wBAAgB,QAAQ,IAAI,UAAU,CAIrC;AAED,iDAAiD;AACjD,wBAAgB,YAAY,IAAI,SAAS,CAIxC;AAED,8FAA8F;AAC9F,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI,CAIvE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAI/D;AAED,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED,wBAAgB,WAAW,IAAI,OAAO,CASrC;AAED,wBAAgB,OAAO,IAAI,OAAO,CASjC;AAED,wBAAgB,UAAU,IAAI,OAAO,CAQpC;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAUtC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAKtC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,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O,IAAI,OAAO,CASjC;AAED,wBAAgB,UAAU,IAAI,OAAO,CAQpC;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAUtC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAKtC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAK3C;AAED,wBAAgB,OAAO,IAAI,OAAO,CAQjC;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,EACpB,MAAM,UAAQ,GACb,IAAI,CAUN;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAE9D"}
@@ -83,7 +83,17 @@ end
83
83
  -- which will not display correctly on some fonts.
84
84
  --
85
85
  -- Note that this returns "Blue Womb" instead of "???" for stage 9.
86
+ --
87
+ -- @param stage Optional. If not specified, the current stage will be used.
88
+ -- @param stageType Optional. If not specified, the current stage type will be used.
86
89
  function ____exports.getEnglishLevelName(self, stage, stageType)
90
+ local level = game:GetLevel()
91
+ if stage == nil then
92
+ stage = level:GetStage()
93
+ end
94
+ if stageType == nil then
95
+ stageType = level:GetStageType()
96
+ end
87
97
  local stageNames = ENGLISH_LEVEL_NAMES[stage]
88
98
  return stageNames[stageType]
89
99
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "17.2.0",
3
+ "version": "17.2.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -95,11 +95,24 @@ export function getEffectiveStage(): int {
95
95
  * which will not display correctly on some fonts.
96
96
  *
97
97
  * Note that this returns "Blue Womb" instead of "???" for stage 9.
98
+ *
99
+ * @param stage Optional. If not specified, the current stage will be used.
100
+ * @param stageType Optional. If not specified, the current stage type will be used.
98
101
  */
99
102
  export function getEnglishLevelName(
100
- stage: LevelStage,
101
- stageType: StageType,
103
+ stage?: LevelStage,
104
+ stageType?: StageType,
102
105
  ): string {
106
+ const level = game.GetLevel();
107
+
108
+ if (stage === undefined) {
109
+ stage = level.GetStage();
110
+ }
111
+
112
+ if (stageType === undefined) {
113
+ stageType = level.GetStageType();
114
+ }
115
+
103
116
  const stageNames = ENGLISH_LEVEL_NAMES[stage];
104
117
  return stageNames[stageType];
105
118
  }