isaacscript-common 20.12.2 → 20.12.3

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.
Files changed (52) hide show
  1. package/dist/index.d.ts +44 -40
  2. package/dist/isaacscript-common.lua +262 -416
  3. package/dist/src/classes/ModFeature.lua +0 -4
  4. package/dist/src/classes/ModUpgradedBase.lua +3 -9
  5. package/dist/src/classes/callbacks/PostNewRoomEarly.lua +2 -2
  6. package/dist/src/classes/features/callbackLogic/CustomRevive.lua +2 -5
  7. package/dist/src/classes/features/other/CustomStages.lua +4 -16
  8. package/dist/src/classes/features/other/CustomTrapdoors.lua +1 -4
  9. package/dist/src/classes/features/other/DeployJSONRoom.lua +8 -14
  10. package/dist/src/classes/features/other/Pause.lua +2 -2
  11. package/dist/src/classes/features/other/TaintedLazarusPlayers.lua +1 -1
  12. package/dist/src/classes/features/other/customStages/utils.lua +4 -16
  13. package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +4 -4
  14. package/dist/src/classes/features/other/extraConsoleCommands/subroutines.lua +2 -2
  15. package/dist/src/classes/features/other/saveDataManager/loadFromDisk.lua +4 -7
  16. package/dist/src/classes/features/other/saveDataManager/restoreDefaults.lua +2 -2
  17. package/dist/src/classes/features/other/saveDataManager/saveToDisk.lua +1 -1
  18. package/dist/src/functions/benchmark.lua +2 -8
  19. package/dist/src/functions/debugFunctions.d.ts +2 -2
  20. package/dist/src/functions/debugFunctions.d.ts.map +1 -1
  21. package/dist/src/functions/debugFunctions.lua +4 -4
  22. package/dist/src/functions/deepCopy.lua +7 -7
  23. package/dist/src/functions/deepCopyTests.lua +1 -1
  24. package/dist/src/functions/globals.lua +3 -6
  25. package/dist/src/functions/hex.lua +4 -7
  26. package/dist/src/functions/jsonHelpers.lua +1 -1
  27. package/dist/src/functions/jsonRoom.lua +4 -16
  28. package/dist/src/functions/log.d.ts +8 -4
  29. package/dist/src/functions/log.d.ts.map +1 -1
  30. package/dist/src/functions/log.lua +18 -5
  31. package/dist/src/functions/logEntities.d.ts +8 -8
  32. package/dist/src/functions/logEntities.d.ts.map +1 -1
  33. package/dist/src/functions/logEntities.lua +24 -27
  34. package/dist/src/functions/logMisc.d.ts +26 -26
  35. package/dist/src/functions/logMisc.d.ts.map +1 -1
  36. package/dist/src/functions/logMisc.lua +114 -226
  37. package/dist/src/functions/merge.lua +6 -6
  38. package/dist/src/functions/run.lua +2 -5
  39. package/dist/src/functions/utils.d.ts.map +1 -1
  40. package/dist/src/functions/utils.lua +20 -1
  41. package/dist/src/lib/jsonLua.lua +16 -7
  42. package/dist/src/patchErrorFunctions.lua +1 -1
  43. package/package.json +1 -1
  44. package/src/classes/ModFeature.ts +0 -6
  45. package/src/classes/features/other/saveDataManager/saveToDisk.ts +3 -4
  46. package/src/functions/debugFunctions.ts +2 -2
  47. package/src/functions/deepCopy.ts +2 -0
  48. package/src/functions/log.ts +15 -4
  49. package/src/functions/logEntities.ts +14 -8
  50. package/src/functions/logMisc.ts +56 -39
  51. package/src/functions/utils.ts +30 -0
  52. package/src/lib/jsonLua.lua +16 -7
@@ -125,15 +125,11 @@ function removeCallback(self, modFeatureConstructor, mod, modCallback, vanilla)
125
125
  end
126
126
  end
127
127
  function initSaveDataManager(self, modFeature, tstlClassName, init)
128
- if tstlClassName == "AtePoopBaby" then
129
- Isaac.DebugString("GETTING HERE 1")
130
- end
131
128
  local ____modFeature_0 = modFeature
132
129
  local v = ____modFeature_0.v
133
130
  if v == nil then
134
131
  return
135
132
  end
136
- Isaac.DebugString("GETTING HERE 2")
137
133
  if not isTable(nil, v) then
138
134
  error("Failed to initialize a mod feature class due to having a \"v\" property that is not an object. (The \"v\" property is supposed to be an object that holds the variables for the class, managed by the save data manager.)")
139
135
  end
@@ -76,7 +76,7 @@ function ModUpgradedBase.prototype.AddPriorityCallback(self, modCallback, priori
76
76
  if self.debug then
77
77
  local callback = args[1]
78
78
  local optionalArg = args[2]
79
- local parentFunctionDescription = getParentFunctionDescription(nil)
79
+ local parentFunctionDescription = getParentFunctionDescription()
80
80
  local customCallback = type(modCallback) == "string"
81
81
  local callbackName = customCallback and tostring(modCallback) .. " (custom callback)" or "ModCallback." .. ModCallback[modCallback]
82
82
  local signature = parentFunctionDescription == nil and callbackName or (parentFunctionDescription .. " - ") .. callbackName
@@ -146,10 +146,7 @@ function ModUpgradedBase.prototype.logUsedFeatures(self)
146
146
  if modCallbackCustom == nil then
147
147
  error("Failed to convert an index on the callbacks object to a number.")
148
148
  end
149
- log(
150
- nil,
151
- ((("- ModCallbackCustom." .. tostring(ModCallbackCustom[modCallbackCustom])) .. " (") .. tostring(modCallbackCustom)) .. ")"
152
- )
149
+ log(((("- ModCallbackCustom." .. tostring(ModCallbackCustom[modCallbackCustom])) .. " (") .. tostring(modCallbackCustom)) .. ")")
153
150
  end
154
151
  ::__continue18::
155
152
  end
@@ -164,10 +161,7 @@ function ModUpgradedBase.prototype.logUsedFeatures(self)
164
161
  if iscFeature == nil then
165
162
  error("Failed to convert an index on the features object to a number.")
166
163
  end
167
- log(
168
- nil,
169
- ((("- ISCFeature." .. tostring(ISCFeature[iscFeature])) .. " (") .. tostring(iscFeature)) .. ")"
170
- )
164
+ log(((("- ISCFeature." .. tostring(ISCFeature[iscFeature])) .. " (") .. tostring(iscFeature)) .. ")")
171
165
  end
172
166
  ::__continue22::
173
167
  end
@@ -45,14 +45,14 @@ function PostNewRoomEarly.prototype.isNewRoom(self)
45
45
  if topLeftWall == nil then
46
46
  topLeftWall = spawnGridEntity(nil, GridEntityType.WALL, topLeftWallGridIndex)
47
47
  if topLeftWall == nil then
48
- logError(nil, "Failed to spawn a new wall (1) for the POST_NEW_ROOM_EARLY callback.")
48
+ logError("Failed to spawn a new wall (1) for the POST_NEW_ROOM_EARLY callback.")
49
49
  return false
50
50
  end
51
51
  end
52
52
  if topLeftWall2 == nil then
53
53
  topLeftWall2 = spawnGridEntity(nil, GridEntityType.WALL, rightOfTopWallGridIndex)
54
54
  if topLeftWall2 == nil then
55
- logError(nil, "Failed to spawn a new wall (2) for the POST_NEW_ROOM_EARLY callback.")
55
+ logError("Failed to spawn a new wall (2) for the POST_NEW_ROOM_EARLY callback.")
56
56
  return false
57
57
  end
58
58
  end
@@ -124,16 +124,13 @@ function CustomRevive.prototype.playerIsAboutToDie(self, player)
124
124
  if futurePlayer:IsDead() then
125
125
  return
126
126
  end
127
- logError(nil, "The player is still alive after initializing a custom revive. Explicitly killing the player.")
127
+ logError("The player is still alive after initializing a custom revive. Explicitly killing the player.")
128
128
  futurePlayer:Kill()
129
129
  end)
130
130
  end
131
131
  function CustomRevive.prototype.logStateChanged(self)
132
132
  if DEBUG then
133
- log(
134
- nil,
135
- ((("Custom revive state changed: " .. CustomReviveState[self.v.run.state]) .. " (") .. tostring(self.v.run.state)) .. ")"
136
- )
133
+ log(((("Custom revive state changed: " .. CustomReviveState[self.v.run.state]) .. " (") .. tostring(self.v.run.state)) .. ")")
137
134
  end
138
135
  end
139
136
  return ____exports
@@ -246,20 +246,14 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
246
246
  local roomShapeMap = customStage.roomTypeMap:get(roomType)
247
247
  if roomShapeMap == nil then
248
248
  if roomType == RoomType.DEFAULT then
249
- logError(
250
- nil,
251
- (((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") for custom stage: ") .. customStage.name
252
- )
249
+ logError((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") for custom stage: ") .. customStage.name)
253
250
  end
254
251
  goto __continue27
255
252
  end
256
253
  local roomShape = room.Data.Shape
257
254
  local roomDoorSlotFlagMap = roomShapeMap:get(roomShape)
258
255
  if roomDoorSlotFlagMap == nil then
259
- logError(
260
- nil,
261
- (((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") for custom stage: ") .. customStage.name
262
- )
256
+ logError((((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") for custom stage: ") .. customStage.name)
263
257
  goto __continue27
264
258
  end
265
259
  local doorSlotFlags = room.Data.Doors
@@ -269,10 +263,7 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
269
263
  local allDoorSlotFlags = doorSlotsToDoorSlotFlags(nil, allDoorSlots)
270
264
  roomsMetadata = roomDoorSlotFlagMap:get(allDoorSlotFlags)
271
265
  if roomsMetadata == nil then
272
- logError(
273
- nil,
274
- (((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") + all doors enabled for custom stage: ") .. customStage.name
275
- )
266
+ logError((((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") + all doors enabled for custom stage: ") .. customStage.name)
276
267
  goto __continue27
277
268
  end
278
269
  end
@@ -295,10 +286,7 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
295
286
  if newRoomData == nil then
296
287
  newRoomData = getRoomDataForTypeVariant(nil, roomType, randomRoom.variant, false)
297
288
  if newRoomData == nil then
298
- logError(
299
- nil,
300
- (("Failed to get the room data for room variant " .. tostring(randomRoom.variant)) .. " for custom stage: ") .. customStage.name
301
- )
289
+ logError((("Failed to get the room data for room variant " .. tostring(randomRoom.variant)) .. " for custom stage: ") .. customStage.name)
302
290
  goto __continue27
303
291
  end
304
292
  self.customStageCachedRoomData:set(randomRoom.variant, newRoomData)
@@ -433,10 +433,7 @@ function CustomTrapdoors.prototype.shouldTrapdoorSpawnOpen(self, gridEntity, fir
433
433
  end
434
434
  function CustomTrapdoors.prototype.logStateChanged(self)
435
435
  if DEBUG then
436
- log(
437
- nil,
438
- ((("Custom trapdoors state changed: " .. StageTravelState[self.v.run.state]) .. " (") .. tostring(self.v.run.state)) .. ")"
439
- )
436
+ log(((("Custom trapdoors state changed: " .. StageTravelState[self.v.run.state]) .. " (") .. tostring(self.v.run.state)) .. ")")
440
437
  end
441
438
  end
442
439
  function CustomTrapdoors.prototype.registerCustomTrapdoorDestination(self, destinationName, destinationFunc)
@@ -230,10 +230,7 @@ function DeployJSONRoom.prototype.spawnAllEntities(self, jsonRoom, rng, verbose)
230
230
  if isGridEntity then
231
231
  local gridEntityXMLType = entityTypeNumber
232
232
  if verbose then
233
- log(
234
- nil,
235
- ((((((("Spawning grid entity " .. tostring(gridEntityXMLType)) .. ".") .. tostring(variant)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")"
236
- )
233
+ log(((((((("Spawning grid entity " .. tostring(gridEntityXMLType)) .. ".") .. tostring(variant)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
237
234
  end
238
235
  spawnGridEntityForJSONRoom(
239
236
  nil,
@@ -246,10 +243,7 @@ function DeployJSONRoom.prototype.spawnAllEntities(self, jsonRoom, rng, verbose)
246
243
  local entityType = entityTypeNumber
247
244
  if verbose then
248
245
  local entityID = getEntityIDFromConstituents(nil, entityType, variant, subType)
249
- log(
250
- nil,
251
- ((((("Spawning normal entity " .. entityID) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")"
252
- )
246
+ log(((((("Spawning normal entity " .. entityID) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
253
247
  end
254
248
  local entity = self:spawnNormalEntityForJSONRoom(
255
249
  entityType,
@@ -267,11 +261,11 @@ function DeployJSONRoom.prototype.spawnAllEntities(self, jsonRoom, rng, verbose)
267
261
  end
268
262
  if shouldUnclearRoom then
269
263
  if verbose then
270
- log(nil, "Setting the room to be uncleared since there were one or more battle NPCs spawned.")
264
+ log("Setting the room to be uncleared since there were one or more battle NPCs spawned.")
271
265
  end
272
266
  setRoomUncleared(nil)
273
267
  elseif verbose then
274
- log(nil, "Leaving the room cleared since there were no battle NPCs spawned.")
268
+ log("Leaving the room cleared since there were no battle NPCs spawned.")
275
269
  end
276
270
  end
277
271
  function DeployJSONRoom.prototype.spawnNormalEntityForJSONRoom(self, entityType, variant, subType, x, y, rng)
@@ -313,19 +307,19 @@ function DeployJSONRoom.prototype.deployJSONRoom(self, jsonRoom, seedOrRNG, verb
313
307
  end
314
308
  local rng = isRNG(nil, seedOrRNG) and seedOrRNG or newRNG(nil, seedOrRNG)
315
309
  if verbose then
316
- log(nil, "Starting to empty the room of entities and grid entities.")
310
+ log("Starting to empty the room of entities and grid entities.")
317
311
  end
318
312
  emptyRoom(nil)
319
313
  if verbose then
320
- log(nil, "Finished emptying the room of entities and grid entities.")
314
+ log("Finished emptying the room of entities and grid entities.")
321
315
  end
322
316
  setRoomCleared(nil)
323
317
  if verbose then
324
- log(nil, "Starting to spawn all of the new entities and grid entities.")
318
+ log("Starting to spawn all of the new entities and grid entities.")
325
319
  end
326
320
  self:spawnAllEntities(jsonRoom, rng, verbose)
327
321
  if verbose then
328
- log(nil, "Finished spawning all of the new entities and grid entities.")
322
+ log("Finished spawning all of the new entities and grid entities.")
329
323
  end
330
324
  fixPitGraphics(nil)
331
325
  self.preventGridEntityRespawn:preventGridEntityRespawn()
@@ -100,7 +100,7 @@ function Pause.prototype.isPaused(self)
100
100
  end
101
101
  function Pause.prototype.pause(self)
102
102
  if self.v.run.isPseudoPaused then
103
- logError(nil, "Failed to pseudo-pause the game, since it was already pseudo-paused.")
103
+ logError("Failed to pseudo-pause the game, since it was already pseudo-paused.")
104
104
  return
105
105
  end
106
106
  self.v.run.isPseudoPaused = true
@@ -139,7 +139,7 @@ function Pause.prototype.pause(self)
139
139
  end
140
140
  function Pause.prototype.unpause(self)
141
141
  if not self.v.run.isPseudoPaused then
142
- logError(nil, "Failed to pseudo-unpause the game, since it was not already pseudo-paused.")
142
+ logError("Failed to pseudo-unpause the game, since it was not already pseudo-paused.")
143
143
  return
144
144
  end
145
145
  self.v.run.isPseudoPaused = false
@@ -55,7 +55,7 @@ function TaintedLazarusPlayers.prototype.checkDequeue(self)
55
55
  local taintedLazarusPtrHash = GetPtrHash(taintedLazarus)
56
56
  local deadTaintedLazarusPtrHash = GetPtrHash(deadTaintedLazarus)
57
57
  if taintedLazarusPtrHash == deadTaintedLazarusPtrHash then
58
- logError(nil, "Failed to cache the Tainted Lazarus player objects, since the hash for Tainted Lazarus and Dead Tainted Lazarus were the same.")
58
+ logError("Failed to cache the Tainted Lazarus player objects, since the hash for Tainted Lazarus and Dead Tainted Lazarus were the same.")
59
59
  return
60
60
  end
61
61
  self.v.run.subPlayerMap:set(taintedLazarusPtrHash, deadTaintedLazarus)
@@ -57,17 +57,11 @@ function ____exports.getRandomCustomStageRoom(self, roomsMetadata, seedOrRNG, ve
57
57
  end
58
58
  local totalWeight = getTotalWeightOfCustomStageRooms(nil, roomsMetadata)
59
59
  if verbose then
60
- log(
61
- nil,
62
- "Total weight of the custom stage rooms provided: " .. tostring(totalWeight)
63
- )
60
+ log("Total weight of the custom stage rooms provided: " .. tostring(totalWeight))
64
61
  end
65
62
  local chosenWeight = getRandomFloat(nil, 0, totalWeight, seedOrRNG)
66
63
  if verbose then
67
- log(
68
- nil,
69
- "Randomly chose weight for custom stage room: " .. tostring(chosenWeight)
70
- )
64
+ log("Randomly chose weight for custom stage room: " .. tostring(chosenWeight))
71
65
  end
72
66
  return getCustomStageRoomWithChosenWeight(nil, roomsMetadata, chosenWeight)
73
67
  end
@@ -80,17 +74,11 @@ function ____exports.getRandomBossRoomFromPool(self, roomsMetadata, bossPool, se
80
74
  end
81
75
  local totalWeight = getTotalWeightOfBossPool(nil, bossPool)
82
76
  if verbose then
83
- log(
84
- nil,
85
- "Total weight of the custom stage boss pool provided: " .. tostring(totalWeight)
86
- )
77
+ log("Total weight of the custom stage boss pool provided: " .. tostring(totalWeight))
87
78
  end
88
79
  local chosenWeight = getRandomFloat(nil, 0, totalWeight, seedOrRNG)
89
80
  if verbose then
90
- log(
91
- nil,
92
- "Randomly chose weight for custom stage boss pool: " .. tostring(chosenWeight)
93
- )
81
+ log("Randomly chose weight for custom stage boss pool: " .. tostring(chosenWeight))
94
82
  end
95
83
  local bossEntry = getBossEntryWithChosenWeight(nil, bossPool, chosenWeight)
96
84
  local roomsMetadataForBoss = __TS__ArrayFilter(
@@ -554,7 +554,7 @@ end
554
554
  --- Logs the player's current temporary effects to the "log.txt" file.
555
555
  function ____exports.effects(self)
556
556
  local player = Isaac.GetPlayer()
557
- logPlayerEffects(nil, player)
557
+ logPlayerEffects(player)
558
558
  print("Logged the player's effects to the \"log.txt\" file.")
559
559
  end
560
560
  --- Alias for the "iAmError" command.
@@ -909,7 +909,7 @@ function ____exports.right(self, params)
909
909
  end
910
910
  --- Logs information about the room to the "log.txt" file.
911
911
  function ____exports.room(self)
912
- logRoom(nil)
912
+ logRoom()
913
913
  print("Logged room information to the \"log.txt\" file.")
914
914
  end
915
915
  --- Gives a rotten heart. Provide a number to give a custom amount of hearts. (You can use negative
@@ -977,7 +977,7 @@ function ____exports.seedStick(self)
977
977
  end
978
978
  --- Logs all of the current run's seed effects to the "log.txt" file.
979
979
  function ____exports.seeds(self)
980
- logSeedEffects(nil)
980
+ logSeedEffects()
981
981
  print("Logged the seed effects to the \"log.txt\" file.")
982
982
  end
983
983
  --- Sets a charge to the player's specified active item. You must provide the active slot number and
@@ -1079,7 +1079,7 @@ function ____exports.soulHearts(self, params)
1079
1079
  end
1080
1080
  --- Logs all of the currently playing sound effects to the "log.txt" file.
1081
1081
  function ____exports.sounds(self)
1082
- logSounds(nil)
1082
+ logSounds()
1083
1083
  print("Logged the currently playing sound effects to the \"log.txt\" file.")
1084
1084
  end
1085
1085
  --- Toggles spamming Blood Rights on every frame. Useful for killing enemies very fast without using
@@ -69,7 +69,7 @@ function ____exports.listEntities(self, params, includeBackgroundEffects)
69
69
  return
70
70
  end
71
71
  end
72
- logAllEntities(nil, includeBackgroundEffects, entityTypeFilter)
72
+ logAllEntities(includeBackgroundEffects, entityTypeFilter)
73
73
  print("Logged the entities in the room to the \"log.txt\" file.")
74
74
  end
75
75
  function ____exports.listGridEntities(self, params, includeWalls)
@@ -81,7 +81,7 @@ function ____exports.listGridEntities(self, params, includeWalls)
81
81
  return
82
82
  end
83
83
  end
84
- logAllGridEntities(nil, includeWalls, gridEntityTypeFilter)
84
+ logAllGridEntities(includeWalls, gridEntityTypeFilter)
85
85
  print("Logged the grid entities in the room to the \"log.txt\" file.")
86
86
  end
87
87
  function ____exports.movePlayer(self, params, direction)
@@ -21,10 +21,7 @@ function readSaveDatFile(self, mod)
21
21
  local renderFrameCount = Isaac.GetFrameCount()
22
22
  local ok, jsonStringOrErrMsg = pcall(tryLoadModData, mod)
23
23
  if not ok then
24
- logError(
25
- nil,
26
- (("Failed to read from the \"save#.dat\" file on render frame " .. tostring(renderFrameCount)) .. ": ") .. jsonStringOrErrMsg
27
- )
24
+ logError((("Failed to read from the \"save#.dat\" file on render frame " .. tostring(renderFrameCount)) .. ": ") .. jsonStringOrErrMsg)
28
25
  return DEFAULT_MOD_DATA
29
26
  end
30
27
  if jsonStringOrErrMsg == nil then
@@ -47,7 +44,7 @@ function ____exports.loadFromDisk(self, mod, oldSaveData, classConstructors)
47
44
  local jsonString = readSaveDatFile(nil, mod)
48
45
  local newSaveData = jsonDecode(nil, jsonString)
49
46
  if SAVE_DATA_MANAGER_DEBUG then
50
- log(nil, "Converted data from the \"save#.dat\" to a Lua table.")
47
+ log("Converted data from the \"save#.dat\" to a Lua table.")
51
48
  end
52
49
  iterateTableInOrder(
53
50
  nil,
@@ -64,7 +61,7 @@ function ____exports.loadFromDisk(self, mod, oldSaveData, classConstructors)
64
61
  return
65
62
  end
66
63
  if SAVE_DATA_MANAGER_DEBUG then
67
- log(nil, "Merging in stored data for feature: " .. subscriberName)
64
+ log("Merging in stored data for feature: " .. subscriberName)
68
65
  end
69
66
  merge(
70
67
  nil,
@@ -76,6 +73,6 @@ function ____exports.loadFromDisk(self, mod, oldSaveData, classConstructors)
76
73
  end,
77
74
  SAVE_DATA_MANAGER_DEBUG
78
75
  )
79
- log(nil, "The save data manager loaded data from the \"save#.dat\" file.")
76
+ log("The save data manager loaded data from the \"save#.dat\" file.")
80
77
  end
81
78
  return ____exports
@@ -43,12 +43,12 @@ function ____exports.restoreDefaultForFeatureKey(self, saveDataDefaultsMap, subs
43
43
  end
44
44
  local saveDataDefaults = saveDataDefaultsMap[subscriberName]
45
45
  if saveDataDefaults == nil then
46
- logError(nil, "Failed to find the default copy of the save data for subscriber: " .. subscriberName)
46
+ logError("Failed to find the default copy of the save data for subscriber: " .. subscriberName)
47
47
  return
48
48
  end
49
49
  local childTableDefaults = saveDataDefaults[saveDataKey]
50
50
  if childTableDefaults == nil then
51
- logError(nil, ((("Failed to find the default copy of the child table \"" .. saveDataKey) .. "\" for subscriber \"") .. subscriberName) .. "\". This error usually means that your save data is out of date. You can try purging all of your save data by deleting the following directory: C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Binding of Isaac Rebirth\\data")
51
+ logError(((("Failed to find the default copy of the child table \"" .. saveDataKey) .. "\" for subscriber \"") .. subscriberName) .. "\". This error usually means that your save data is out of date. You can try purging all of your save data by deleting the following directory: C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Binding of Isaac Rebirth\\data")
52
52
  return
53
53
  end
54
54
  local childTableDefaultsCopy = deepCopy(nil, childTableDefaults, SerializationType.NONE, (subscriberName .. " --> ") .. saveDataKey)
@@ -41,6 +41,6 @@ function ____exports.saveToDisk(self, mod, saveDataMap, saveDataConditionalFuncM
41
41
  local allSaveData = getAllSaveDataToWriteToDisk(nil, saveDataMap, saveDataConditionalFuncMap)
42
42
  local jsonString = jsonEncode(nil, allSaveData)
43
43
  mod:SaveData(jsonString)
44
- log(nil, "The save data manager wrote data to the \"save#.dat\" file.")
44
+ log("The save data manager wrote data to the \"save#.dat\" file.")
45
45
  end
46
46
  return ____exports
@@ -16,10 +16,7 @@ local log = ____log.log
16
16
  -- be printed to the log.)
17
17
  function ____exports.benchmark(self, numTrials, ...)
18
18
  local functions = {...}
19
- log(
20
- nil,
21
- ((("Benchmarking " .. tostring(#functions)) .. " function(s) with ") .. tostring(numTrials)) .. " trials."
22
- )
19
+ log(((("Benchmarking " .. tostring(#functions)) .. " function(s) with ") .. tostring(numTrials)) .. " trials.")
23
20
  local averages = {}
24
21
  __TS__ArrayForEach(
25
22
  functions,
@@ -37,10 +34,7 @@ function ____exports.benchmark(self, numTrials, ...)
37
34
  end
38
35
  end
39
36
  local averageTimeMilliseconds = totalTimeMilliseconds / numTrials
40
- log(
41
- nil,
42
- ((("The average time of the function at index " .. tostring(i)) .. " is: ") .. tostring(averageTimeMilliseconds)) .. " milliseconds"
43
- )
37
+ log(((("The average time of the function at index " .. tostring(i)) .. " is: ") .. tostring(averageTimeMilliseconds)) .. " milliseconds")
44
38
  averages[#averages + 1] = averageTimeMilliseconds
45
39
  end
46
40
  )
@@ -24,7 +24,7 @@ export declare function getTime(useSocketIfAvailable?: boolean): float;
24
24
  * This will only work if the `--luadebug` launch option is enabled or the Racing+ sandbox is
25
25
  * enabled.
26
26
  */
27
- export declare function getTraceback(): string;
27
+ export declare function getTraceback(this: void): string;
28
28
  /**
29
29
  * Players can boot the game with an launch option called "--luadebug", which will enable additional
30
30
  * functionality that is considered to be unsafe. For more information about this flag, see the
@@ -48,5 +48,5 @@ export declare function isLuaDebugEnabled(): boolean;
48
48
  * This will only work if the `--luadebug` launch option is enabled or the Racing+ sandbox is
49
49
  * enabled.
50
50
  */
51
- export declare function traceback(): void;
51
+ export declare function traceback(this: void): void;
52
52
  //# sourceMappingURL=debugFunctions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"debugFunctions.d.ts","sourceRoot":"","sources":["../../../src/functions/debugFunctions.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,oBAAoB,UAAO,GAAG,KAAK,CAmB1D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAarC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAI3C;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAGhC"}
1
+ {"version":3,"file":"debugFunctions.d.ts","sourceRoot":"","sources":["../../../src/functions/debugFunctions.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,oBAAoB,UAAO,GAAG,KAAK,CAmB1D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAa/C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAI3C;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAG1C"}
@@ -55,7 +55,7 @@ end
55
55
  --
56
56
  -- This will only work if the `--luadebug` launch option is enabled or the Racing+ sandbox is
57
57
  -- enabled.
58
- function ____exports.getTraceback(self)
58
+ function ____exports.getTraceback()
59
59
  if SandboxGetTraceback ~= nil then
60
60
  return SandboxGetTraceback()
61
61
  end
@@ -69,8 +69,8 @@ end
69
69
  --
70
70
  -- This will only work if the `--luadebug` launch option is enabled or the Racing+ sandbox is
71
71
  -- enabled.
72
- function ____exports.traceback(self)
73
- local tracebackOutput = ____exports.getTraceback(nil)
74
- log(nil, tracebackOutput)
72
+ function ____exports.traceback()
73
+ local tracebackOutput = ____exports.getTraceback()
74
+ log(tracebackOutput)
75
75
  end
76
76
  return ____exports
@@ -99,7 +99,7 @@ function ____exports.deepCopy(self, value, serializationType, traversalDescripti
99
99
  logString = logString .. " (deserializing)"
100
100
  end
101
101
  logString = logString .. ": " .. tostring(value)
102
- log(nil, logString)
102
+ log(logString)
103
103
  end
104
104
  local valueType = type(value)
105
105
  repeat
@@ -217,7 +217,7 @@ function deepCopyTable(self, luaMap, serializationType, traversalDescription, cl
217
217
  end
218
218
  function deepCopyDefaultMap(self, defaultMap, serializationType, traversalDescription, classConstructors, insideMap)
219
219
  if SAVE_DATA_MANAGER_DEBUG then
220
- log(nil, "deepCopy is copying a DefaultMap.")
220
+ log("deepCopy is copying a DefaultMap.")
221
221
  end
222
222
  local ____isDefaultMap_result_0
223
223
  if isDefaultMap(nil, defaultMap) then
@@ -312,7 +312,7 @@ function getNewDefaultMap(self, defaultMap, serializationType, traversalDescript
312
312
  end
313
313
  function deepCopyMap(self, map, serializationType, traversalDescription, classConstructors, insideMap)
314
314
  if SAVE_DATA_MANAGER_DEBUG then
315
- log(nil, "deepCopy is copying a Map.")
315
+ log("deepCopy is copying a Map.")
316
316
  end
317
317
  local newMap
318
318
  if serializationType == SerializationType.SERIALIZE then
@@ -353,7 +353,7 @@ function deepCopyMap(self, map, serializationType, traversalDescription, classCo
353
353
  end
354
354
  function deepCopySet(self, set, serializationType, traversalDescription, classConstructors, insideMap)
355
355
  if SAVE_DATA_MANAGER_DEBUG then
356
- log(nil, "deepCopy is copying a Set.")
356
+ log("deepCopy is copying a Set.")
357
357
  end
358
358
  local newSet
359
359
  if serializationType == SerializationType.SERIALIZE then
@@ -391,7 +391,7 @@ function deepCopySet(self, set, serializationType, traversalDescription, classCo
391
391
  end
392
392
  function deepCopyTSTLClass(self, tstlClass, serializationType, traversalDescription, classConstructors, insideMap)
393
393
  if SAVE_DATA_MANAGER_DEBUG then
394
- log(nil, "deepCopy is copying a TSTL class.")
394
+ log("deepCopy is copying a TSTL class.")
395
395
  end
396
396
  local newClass
397
397
  repeat
@@ -452,7 +452,7 @@ function deepCopyTSTLClass(self, tstlClass, serializationType, traversalDescript
452
452
  end
453
453
  function deepCopyArray(self, array, serializationType, traversalDescription, classConstructors, insideMap)
454
454
  if SAVE_DATA_MANAGER_DEBUG then
455
- log(nil, "deepCopy is copying an array.")
455
+ log("deepCopy is copying an array.")
456
456
  end
457
457
  local newArray = {}
458
458
  for ____, value in ipairs(array) do
@@ -470,7 +470,7 @@ function deepCopyArray(self, array, serializationType, traversalDescription, cla
470
470
  end
471
471
  function deepCopyNormalLuaTable(self, luaMap, serializationType, traversalDescription, classConstructors, insideMap)
472
472
  if SAVE_DATA_MANAGER_DEBUG then
473
- log(nil, "deepCopy is copying a normal Lua table.")
473
+ log("deepCopy is copying a normal Lua table.")
474
474
  end
475
475
  local newTable = {}
476
476
  local ____getCopiedEntries_result_5 = getCopiedEntries(
@@ -358,7 +358,7 @@ function ____exports.runDeepCopyTests(self)
358
358
  copiedSerializedDefaultMapHasStringKey(nil)
359
359
  copiedSerializedDefaultMapHasNumberKey(nil)
360
360
  local successText = "All deep copy tests passed!"
361
- log(nil, successText)
361
+ log(successText)
362
362
  print(successText)
363
363
  end
364
364
  return ____exports
@@ -226,9 +226,9 @@ function ____exports.getNewGlobals(self)
226
226
  end
227
227
  function ____exports.logNewGlobals(self)
228
228
  local newGlobals = ____exports.getNewGlobals(nil)
229
- log(nil, "List of added global variables in the Isaac environment:")
229
+ log("List of added global variables in the Isaac environment:")
230
230
  if #newGlobals == 0 then
231
- log(nil, "- n/a (no extra global variables found)")
231
+ log("- n/a (no extra global variables found)")
232
232
  end
233
233
  __TS__ArrayForEach(
234
234
  newGlobals,
@@ -237,10 +237,7 @@ function ____exports.logNewGlobals(self)
237
237
  local key
238
238
  key = ____bindingPattern0[1]
239
239
  value = ____bindingPattern0[2]
240
- log(
241
- nil,
242
- (((tostring(i + 1) .. ") ") .. tostring(key)) .. " - ") .. tostring(value)
243
- )
240
+ log((((tostring(i + 1) .. ") ") .. tostring(key)) .. " - ") .. tostring(value))
244
241
  end
245
242
  )
246
243
  end
@@ -8,28 +8,25 @@ local logError = ____logMisc.logError
8
8
  function hexToRGB(self, hexString)
9
9
  hexString = __TS__StringReplace(hexString, "#", "")
10
10
  if #hexString ~= HEX_STRING_LENGTH then
11
- logError(
12
- nil,
13
- "Hex strings must be of length: " .. tostring(HEX_STRING_LENGTH)
14
- )
11
+ logError("Hex strings must be of length: " .. tostring(HEX_STRING_LENGTH))
15
12
  return {0, 0, 0}
16
13
  end
17
14
  local rString = __TS__StringSubstring(hexString, 0, 2)
18
15
  local r = tonumber("0x" .. rString)
19
16
  if r == nil then
20
- logError(nil, ("Failed to convert `0x" .. rString) .. "` to a number.")
17
+ logError(("Failed to convert `0x" .. rString) .. "` to a number.")
21
18
  return {0, 0, 0}
22
19
  end
23
20
  local gString = __TS__StringSubstring(hexString, 2, 4)
24
21
  local g = tonumber("0x" .. gString)
25
22
  if g == nil then
26
- logError(nil, ("Failed to convert `0x" .. gString) .. "` to a number.")
23
+ logError(("Failed to convert `0x" .. gString) .. "` to a number.")
27
24
  return {0, 0, 0}
28
25
  end
29
26
  local bString = __TS__StringSubstring(hexString, 4, 6)
30
27
  local b = tonumber("0x" .. bString)
31
28
  if b == nil then
32
- logError(nil, ("Failed to convert `0x" .. bString) .. "` to a number.")
29
+ logError(("Failed to convert `0x" .. bString) .. "` to a number.")
33
30
  return {0, 0, 0}
34
31
  end
35
32
  return {r, g, b}
@@ -20,7 +20,7 @@ end
20
20
  function ____exports.jsonDecode(self, jsonString)
21
21
  local ok, luaTableOrErrMsg = pcall(tryDecode, jsonString)
22
22
  if not ok then
23
- logError(nil, "Failed to convert the JSON string to a Lua table: " .. jsonString)
23
+ logError("Failed to convert the JSON string to a Lua table: " .. jsonString)
24
24
  return {}
25
25
  end
26
26
  return luaTableOrErrMsg