isaacscript-common 12.3.4 → 12.3.6
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 +0 -7
- package/dist/isaacscript-common.lua +21 -71
- package/dist/src/features/saveDataManager/main.d.ts.map +1 -1
- package/dist/src/features/saveDataManager/main.lua +1 -1
- package/dist/src/features/saveDataManager/maps.d.ts +3 -0
- package/dist/src/features/saveDataManager/maps.d.ts.map +1 -1
- package/dist/src/features/saveDataManager/maps.lua +3 -0
- package/dist/src/features/saveDataManager/merge.lua +16 -7
- package/dist/src/functions/debugFunctions.d.ts +0 -6
- package/dist/src/functions/debugFunctions.d.ts.map +1 -1
- package/dist/src/functions/debugFunctions.lua +0 -8
- package/dist/src/functions/log.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/features/saveDataManager/main.ts +6 -1
- package/src/features/saveDataManager/maps.ts +3 -0
- package/src/features/saveDataManager/merge.ts +19 -6
- package/src/functions/debugFunctions.ts +0 -10
- package/src/functions/log.ts +2 -6
- package/dist/package.lua +0 -15
package/dist/index.d.ts
CHANGED
|
@@ -3442,13 +3442,6 @@ export declare function getHUDOffsetVector(): Vector;
|
|
|
3442
3442
|
*/
|
|
3443
3443
|
export declare function getIsaacAPIClassName(object: unknown): string | undefined;
|
|
3444
3444
|
|
|
3445
|
-
/**
|
|
3446
|
-
* Helper function to get the current version of the `isaacscript-common` library, according to the
|
|
3447
|
-
* "package.json" file at the time of compilation. (The version is in the Semantic Versioning
|
|
3448
|
-
* format, e.g. "1.0.0".)
|
|
3449
|
-
*/
|
|
3450
|
-
export declare function getIsaacScriptCommonVersion(): string;
|
|
3451
|
-
|
|
3452
3445
|
export declare function getItemConfigCardType(cardType: CardType): ItemConfigCardType;
|
|
3453
3446
|
|
|
3454
3447
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 12.3.
|
|
3
|
+
isaacscript-common 12.3.6
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -4126,14 +4126,6 @@ return ____exports
|
|
|
4126
4126
|
end,
|
|
4127
4127
|
["lua_modules.isaac-typescript-definitions.dist.src.index"] = function(...)
|
|
4128
4128
|
local ____exports = {}
|
|
4129
|
-
do
|
|
4130
|
-
local ____export = require("lua_modules.isaac-typescript-definitions.dist.src.debug")
|
|
4131
|
-
for ____exportKey, ____exportValue in pairs(____export) do
|
|
4132
|
-
if ____exportKey ~= "default" then
|
|
4133
|
-
____exports[____exportKey] = ____exportValue
|
|
4134
|
-
end
|
|
4135
|
-
end
|
|
4136
|
-
end
|
|
4137
4129
|
do
|
|
4138
4130
|
local ____export = require("lua_modules.isaac-typescript-definitions.dist.src.enums.ActiveSlot")
|
|
4139
4131
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -4848,35 +4840,6 @@ do
|
|
|
4848
4840
|
end
|
|
4849
4841
|
return ____exports
|
|
4850
4842
|
end,
|
|
4851
|
-
["lua_modules.isaac-typescript-definitions.dist.src.debug"] = function(...)
|
|
4852
|
-
local ____exports = {}
|
|
4853
|
-
local ____package_2Ejson = require("lua_modules.isaac-typescript-definitions.dist.package")
|
|
4854
|
-
local version = ____package_2Ejson.version
|
|
4855
|
-
--- Helper function to get the current version of the `isaac-typescript-definitions` library,
|
|
4856
|
-
-- according to the "package.json" file at the time of compilation. (The version is in the Semantic
|
|
4857
|
-
-- Versioning format, e.g. "1.0.0".)
|
|
4858
|
-
function ____exports.getIsaacTypeScriptDefinitionsVersion(self)
|
|
4859
|
-
return version
|
|
4860
|
-
end
|
|
4861
|
-
return ____exports
|
|
4862
|
-
end,
|
|
4863
|
-
["lua_modules.isaac-typescript-definitions.dist.package"] = function(...)
|
|
4864
|
-
return {
|
|
4865
|
-
name = "isaac-typescript-definitions",
|
|
4866
|
-
version = "7.2.4",
|
|
4867
|
-
description = "TypeScript definitions for The Binding of Isaac: Repentance.",
|
|
4868
|
-
keywords = {"isaac", "rebirth", "afterbirth", "repentance"},
|
|
4869
|
-
homepage = "https://isaacscript.github.io/",
|
|
4870
|
-
bugs = {url = "https://github.com/IsaacScript/isaacscript/issues"},
|
|
4871
|
-
repository = {type = "git", url = "git+https://github.com/IsaacScript/isaacscript.git"},
|
|
4872
|
-
license = "GPL-3.0",
|
|
4873
|
-
author = "Zamiell",
|
|
4874
|
-
type = "commonjs",
|
|
4875
|
-
main = "dist/src/index",
|
|
4876
|
-
types = "dist/src/index.d.ts",
|
|
4877
|
-
dependencies = {["lua-types"] = "^2.13.0"}
|
|
4878
|
-
}
|
|
4879
|
-
end,
|
|
4880
4843
|
["lua_modules.isaac-typescript-definitions.dist.src.enums.ActiveSlot"] = function(...)
|
|
4881
4844
|
local ____exports = {}
|
|
4882
4845
|
____exports.ActiveSlot = {}
|
|
@@ -31355,7 +31318,7 @@ local ____lualib = require("lualib_bundle")
|
|
|
31355
31318
|
local Set = ____lualib.Set
|
|
31356
31319
|
local Map = ____lualib.Map
|
|
31357
31320
|
local ____exports = {}
|
|
31358
|
-
local
|
|
31321
|
+
local mergeSerializedArray, mergeSerializedTSTLObject, mergeSerializedTable
|
|
31359
31322
|
local ____SerializationBrand = require("src.enums.private.SerializationBrand")
|
|
31360
31323
|
local SerializationBrand = ____SerializationBrand.SerializationBrand
|
|
31361
31324
|
local ____SerializationType = require("src.enums.SerializationType")
|
|
@@ -31416,16 +31379,19 @@ function ____exports.merge(self, oldObject, newTable, traversalDescription)
|
|
|
31416
31379
|
error("The second argument given to the merge function is not a table.")
|
|
31417
31380
|
end
|
|
31418
31381
|
if isArray(nil, oldObject) and isArray(nil, newTable) then
|
|
31419
|
-
|
|
31382
|
+
mergeSerializedArray(nil, oldObject, newTable, traversalDescription)
|
|
31420
31383
|
return
|
|
31421
31384
|
end
|
|
31422
31385
|
if isTSTLMap(nil, oldObject) or isTSTLSet(nil, oldObject) or isDefaultMap(nil, oldObject) then
|
|
31423
|
-
|
|
31386
|
+
mergeSerializedTSTLObject(nil, oldObject, newTable, traversalDescription)
|
|
31424
31387
|
else
|
|
31425
|
-
|
|
31388
|
+
mergeSerializedTable(nil, oldObject, newTable, traversalDescription)
|
|
31426
31389
|
end
|
|
31427
31390
|
end
|
|
31428
|
-
function
|
|
31391
|
+
function mergeSerializedArray(self, oldArray, newArray, traversalDescription)
|
|
31392
|
+
if SAVE_DATA_MANAGER_DEBUG then
|
|
31393
|
+
log(nil, "merge encountered an array: " .. traversalDescription)
|
|
31394
|
+
end
|
|
31429
31395
|
clearTable(nil, oldArray)
|
|
31430
31396
|
iterateTableInOrder(
|
|
31431
31397
|
nil,
|
|
@@ -31436,7 +31402,10 @@ function mergeArray(self, oldArray, newArray)
|
|
|
31436
31402
|
SAVE_DATA_MANAGER_DEBUG
|
|
31437
31403
|
)
|
|
31438
31404
|
end
|
|
31439
|
-
function
|
|
31405
|
+
function mergeSerializedTSTLObject(self, oldObject, newTable, traversalDescription)
|
|
31406
|
+
if SAVE_DATA_MANAGER_DEBUG then
|
|
31407
|
+
log(nil, "merge encountered a TSTL object: " .. traversalDescription)
|
|
31408
|
+
end
|
|
31440
31409
|
oldObject:clear()
|
|
31441
31410
|
local convertStringKeysToNumbers = newTable[SerializationBrand.OBJECT_WITH_NUMBER_KEYS] ~= nil
|
|
31442
31411
|
iterateTableInOrder(
|
|
@@ -31469,7 +31438,10 @@ function mergeTSTLObject(self, oldObject, newTable, traversalDescription)
|
|
|
31469
31438
|
SAVE_DATA_MANAGER_DEBUG
|
|
31470
31439
|
)
|
|
31471
31440
|
end
|
|
31472
|
-
function
|
|
31441
|
+
function mergeSerializedTable(self, oldTable, newTable, traversalDescription)
|
|
31442
|
+
if SAVE_DATA_MANAGER_DEBUG then
|
|
31443
|
+
log(nil, "merge encountered a Lua table: " .. traversalDescription)
|
|
31444
|
+
end
|
|
31473
31445
|
iterateTableInOrder(
|
|
31474
31446
|
nil,
|
|
31475
31447
|
newTable,
|
|
@@ -31593,6 +31565,9 @@ ____exports.saveDataDefaultsMap = {}
|
|
|
31593
31565
|
____exports.saveDataConditionalFuncMap = {}
|
|
31594
31566
|
--- We backup some save data keys on every new room for the purposes of restoring it when Glowing
|
|
31595
31567
|
-- Hour Glass is used.
|
|
31568
|
+
--
|
|
31569
|
+
-- Note that the save data is backed up in serialized form so that we can use the `merge` function
|
|
31570
|
+
-- to restore it.
|
|
31596
31571
|
____exports.saveDataGlowingHourGlassMap = {}
|
|
31597
31572
|
return ____exports
|
|
31598
31573
|
end,
|
|
@@ -31753,7 +31728,7 @@ function makeGlowingHourGlassBackup(self)
|
|
|
31753
31728
|
saveDataGlowingHourGlass = {}
|
|
31754
31729
|
saveDataGlowingHourGlassMap[subscriberName] = saveDataGlowingHourGlass
|
|
31755
31730
|
end
|
|
31756
|
-
local copiedChildTable = deepCopy(nil, childTable)
|
|
31731
|
+
local copiedChildTable = deepCopy(nil, childTable, SerializationType.SERIALIZE)
|
|
31757
31732
|
saveDataGlowingHourGlass[saveDataKey] = copiedChildTable
|
|
31758
31733
|
end
|
|
31759
31734
|
::__continue18::
|
|
@@ -47062,23 +47037,6 @@ function ____exports.initFeatures(self, mod)
|
|
|
47062
47037
|
end
|
|
47063
47038
|
return ____exports
|
|
47064
47039
|
end,
|
|
47065
|
-
["package"] = function(...)
|
|
47066
|
-
return {
|
|
47067
|
-
name = "isaacscript-common",
|
|
47068
|
-
version = "12.3.4",
|
|
47069
|
-
description = "Helper functions and features for IsaacScript mods.",
|
|
47070
|
-
keywords = {"isaac", "rebirth", "afterbirth", "repentance"},
|
|
47071
|
-
homepage = "https://isaacscript.github.io/",
|
|
47072
|
-
bugs = {url = "https://github.com/IsaacScript/isaacscript/issues"},
|
|
47073
|
-
repository = {type = "git", url = "git+https://github.com/IsaacScript/isaacscript.git"},
|
|
47074
|
-
license = "GPL-3.0",
|
|
47075
|
-
author = "Zamiell",
|
|
47076
|
-
type = "commonjs",
|
|
47077
|
-
main = "dist/src/index",
|
|
47078
|
-
types = "dist/src/index.d.ts",
|
|
47079
|
-
dependencies = {["isaac-typescript-definitions"] = "^7.2.4"}
|
|
47080
|
-
}
|
|
47081
|
-
end,
|
|
47082
47040
|
["src.functions.map"] = function(...)
|
|
47083
47041
|
local ____lualib = require("lualib_bundle")
|
|
47084
47042
|
local Map = ____lualib.Map
|
|
@@ -52632,8 +52590,6 @@ local ____lualib = require("lualib_bundle")
|
|
|
52632
52590
|
local __TS__ObjectEntries = ____lualib.__TS__ObjectEntries
|
|
52633
52591
|
local ____exports = {}
|
|
52634
52592
|
local setDebugFunctionsGlobal
|
|
52635
|
-
local ____package_2Ejson = require("package")
|
|
52636
|
-
local version = ____package_2Ejson.version
|
|
52637
52593
|
local ____exports = require("src.features.extraConsoleCommands.exports")
|
|
52638
52594
|
local enableExtraConsoleCommands = ____exports.enableExtraConsoleCommands
|
|
52639
52595
|
local ____fadeInRemover = require("src.features.fadeInRemover")
|
|
@@ -52714,12 +52670,6 @@ function ____exports.enableDevFeatures(self, mod)
|
|
|
52714
52670
|
enableFastReset(nil)
|
|
52715
52671
|
removeFadeIn(nil)
|
|
52716
52672
|
end
|
|
52717
|
-
--- Helper function to get the current version of the `isaacscript-common` library, according to the
|
|
52718
|
-
-- "package.json" file at the time of compilation. (The version is in the Semantic Versioning
|
|
52719
|
-
-- format, e.g. "1.0.0".)
|
|
52720
|
-
function ____exports.getIsaacScriptCommonVersion(self)
|
|
52721
|
-
return version
|
|
52722
|
-
end
|
|
52723
52673
|
--- Players can boot the game with an launch option called "--luadebug", which will enable additional
|
|
52724
52674
|
-- functionality that is considered to be unsafe. For more information about this flag, see the
|
|
52725
52675
|
-- wiki: https://bindingofisaacrebirth.fandom.com/wiki/Launch_Options
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../src/features/saveDataManager/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAMtD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AA2BrD,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAelE;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../src/features/saveDataManager/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAMtD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AA2BrD,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAelE;AA0LD,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,GACvB,IAAI,CA4CN;AAiBD,wBAAgB,wBAAwB,IAAI,IAAI,CAM/C;AAED,wBAAgB,wBAAwB,IAAI,IAAI,CAM/C"}
|
|
@@ -104,7 +104,7 @@ function makeGlowingHourGlassBackup(self)
|
|
|
104
104
|
saveDataGlowingHourGlass = {}
|
|
105
105
|
saveDataGlowingHourGlassMap[subscriberName] = saveDataGlowingHourGlass
|
|
106
106
|
end
|
|
107
|
-
local copiedChildTable = deepCopy(nil, childTable)
|
|
107
|
+
local copiedChildTable = deepCopy(nil, childTable, SerializationType.SERIALIZE)
|
|
108
108
|
saveDataGlowingHourGlass[saveDataKey] = copiedChildTable
|
|
109
109
|
end
|
|
110
110
|
::__continue18::
|
|
@@ -11,6 +11,9 @@ export declare const saveDataConditionalFuncMap: LuaMap<string, () => boolean>;
|
|
|
11
11
|
/**
|
|
12
12
|
* We backup some save data keys on every new room for the purposes of restoring it when Glowing
|
|
13
13
|
* Hour Glass is used.
|
|
14
|
+
*
|
|
15
|
+
* Note that the save data is backed up in serialized form so that we can use the `merge` function
|
|
16
|
+
* to restore it.
|
|
14
17
|
*/
|
|
15
18
|
export declare const saveDataGlowingHourGlassMap: LuaMap<string, SaveData<unknown, unknown, unknown>>;
|
|
16
19
|
//# sourceMappingURL=maps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maps.d.ts","sourceRoot":"","sources":["../../../../src/features/saveDataManager/maps.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,WAAW,qDAAiC,CAAC;AAE1D,eAAO,MAAM,mBAAmB,qDAAiC,CAAC;AAClE,eAAO,MAAM,0BAA0B,uBAA4B,OAAO,CAAG,CAAC;AAE9E
|
|
1
|
+
{"version":3,"file":"maps.d.ts","sourceRoot":"","sources":["../../../../src/features/saveDataManager/maps.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,WAAW,qDAAiC,CAAC;AAE1D,eAAO,MAAM,mBAAmB,qDAAiC,CAAC;AAClE,eAAO,MAAM,0BAA0B,uBAA4B,OAAO,CAAG,CAAC;AAE9E;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,qDAAiC,CAAC"}
|
|
@@ -7,5 +7,8 @@ ____exports.saveDataDefaultsMap = {}
|
|
|
7
7
|
____exports.saveDataConditionalFuncMap = {}
|
|
8
8
|
--- We backup some save data keys on every new room for the purposes of restoring it when Glowing
|
|
9
9
|
-- Hour Glass is used.
|
|
10
|
+
--
|
|
11
|
+
-- Note that the save data is backed up in serialized form so that we can use the `merge` function
|
|
12
|
+
-- to restore it.
|
|
10
13
|
____exports.saveDataGlowingHourGlassMap = {}
|
|
11
14
|
return ____exports
|
|
@@ -2,7 +2,7 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local Set = ____lualib.Set
|
|
3
3
|
local Map = ____lualib.Map
|
|
4
4
|
local ____exports = {}
|
|
5
|
-
local
|
|
5
|
+
local mergeSerializedArray, mergeSerializedTSTLObject, mergeSerializedTable
|
|
6
6
|
local ____SerializationBrand = require("src.enums.private.SerializationBrand")
|
|
7
7
|
local SerializationBrand = ____SerializationBrand.SerializationBrand
|
|
8
8
|
local ____SerializationType = require("src.enums.SerializationType")
|
|
@@ -63,16 +63,19 @@ function ____exports.merge(self, oldObject, newTable, traversalDescription)
|
|
|
63
63
|
error("The second argument given to the merge function is not a table.")
|
|
64
64
|
end
|
|
65
65
|
if isArray(nil, oldObject) and isArray(nil, newTable) then
|
|
66
|
-
|
|
66
|
+
mergeSerializedArray(nil, oldObject, newTable, traversalDescription)
|
|
67
67
|
return
|
|
68
68
|
end
|
|
69
69
|
if isTSTLMap(nil, oldObject) or isTSTLSet(nil, oldObject) or isDefaultMap(nil, oldObject) then
|
|
70
|
-
|
|
70
|
+
mergeSerializedTSTLObject(nil, oldObject, newTable, traversalDescription)
|
|
71
71
|
else
|
|
72
|
-
|
|
72
|
+
mergeSerializedTable(nil, oldObject, newTable, traversalDescription)
|
|
73
73
|
end
|
|
74
74
|
end
|
|
75
|
-
function
|
|
75
|
+
function mergeSerializedArray(self, oldArray, newArray, traversalDescription)
|
|
76
|
+
if SAVE_DATA_MANAGER_DEBUG then
|
|
77
|
+
log(nil, "merge encountered an array: " .. traversalDescription)
|
|
78
|
+
end
|
|
76
79
|
clearTable(nil, oldArray)
|
|
77
80
|
iterateTableInOrder(
|
|
78
81
|
nil,
|
|
@@ -83,7 +86,10 @@ function mergeArray(self, oldArray, newArray)
|
|
|
83
86
|
SAVE_DATA_MANAGER_DEBUG
|
|
84
87
|
)
|
|
85
88
|
end
|
|
86
|
-
function
|
|
89
|
+
function mergeSerializedTSTLObject(self, oldObject, newTable, traversalDescription)
|
|
90
|
+
if SAVE_DATA_MANAGER_DEBUG then
|
|
91
|
+
log(nil, "merge encountered a TSTL object: " .. traversalDescription)
|
|
92
|
+
end
|
|
87
93
|
oldObject:clear()
|
|
88
94
|
local convertStringKeysToNumbers = newTable[SerializationBrand.OBJECT_WITH_NUMBER_KEYS] ~= nil
|
|
89
95
|
iterateTableInOrder(
|
|
@@ -116,7 +122,10 @@ function mergeTSTLObject(self, oldObject, newTable, traversalDescription)
|
|
|
116
122
|
SAVE_DATA_MANAGER_DEBUG
|
|
117
123
|
)
|
|
118
124
|
end
|
|
119
|
-
function
|
|
125
|
+
function mergeSerializedTable(self, oldTable, newTable, traversalDescription)
|
|
126
|
+
if SAVE_DATA_MANAGER_DEBUG then
|
|
127
|
+
log(nil, "merge encountered a Lua table: " .. traversalDescription)
|
|
128
|
+
end
|
|
120
129
|
iterateTableInOrder(
|
|
121
130
|
nil,
|
|
122
131
|
newTable,
|
|
@@ -17,12 +17,6 @@ import { ModUpgraded } from "../classes/ModUpgraded";
|
|
|
17
17
|
* can immediately start playing or testing.
|
|
18
18
|
*/
|
|
19
19
|
export declare function enableDevFeatures(mod: ModUpgraded): void;
|
|
20
|
-
/**
|
|
21
|
-
* Helper function to get the current version of the `isaacscript-common` library, according to the
|
|
22
|
-
* "package.json" file at the time of compilation. (The version is in the Semantic Versioning
|
|
23
|
-
* format, e.g. "1.0.0".)
|
|
24
|
-
*/
|
|
25
|
-
export declare function getIsaacScriptCommonVersion(): string;
|
|
26
20
|
/**
|
|
27
21
|
* Helper function to get a stack trace.
|
|
28
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugFunctions.d.ts","sourceRoot":"","sources":["../../../src/functions/debugFunctions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"debugFunctions.d.ts","sourceRoot":"","sources":["../../../src/functions/debugFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AASrD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAMxD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAYrC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAI3C;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAU5C;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAGhC"}
|
|
@@ -2,8 +2,6 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local __TS__ObjectEntries = ____lualib.__TS__ObjectEntries
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local setDebugFunctionsGlobal
|
|
5
|
-
local ____package_2Ejson = require("package")
|
|
6
|
-
local version = ____package_2Ejson.version
|
|
7
5
|
local ____exports = require("src.features.extraConsoleCommands.exports")
|
|
8
6
|
local enableExtraConsoleCommands = ____exports.enableExtraConsoleCommands
|
|
9
7
|
local ____fadeInRemover = require("src.features.fadeInRemover")
|
|
@@ -84,12 +82,6 @@ function ____exports.enableDevFeatures(self, mod)
|
|
|
84
82
|
enableFastReset(nil)
|
|
85
83
|
removeFadeIn(nil)
|
|
86
84
|
end
|
|
87
|
-
--- Helper function to get the current version of the `isaacscript-common` library, according to the
|
|
88
|
-
-- "package.json" file at the time of compilation. (The version is in the Semantic Versioning
|
|
89
|
-
-- format, e.g. "1.0.0".)
|
|
90
|
-
function ____exports.getIsaacScriptCommonVersion(self)
|
|
91
|
-
return version
|
|
92
|
-
end
|
|
93
85
|
--- Players can boot the game with an launch option called "--luadebug", which will enable additional
|
|
94
86
|
-- functionality that is considered to be unsafe. For more information about this flag, see the
|
|
95
87
|
-- wiki: https://bindingofisaacrebirth.fandom.com/wiki/Launch_Options
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/functions/log.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACV,UAAU,EAKV,cAAc,EAGd,QAAQ,EACR,OAAO,EACR,MAAM,8BAA8B,CAAC;AAkBtC;;GAEG;AACH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AAC,GAAG,WAAW,CAAC,SAAS,CAAC,GAAG,IAAI,CAUzE;AAED,gFAAgF;AAChF,wBAAgB,SAAS,IAAI,IAAI,CAQhC;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,SAAI,GAAG,IAAI,CA6ClE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,EACxD,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GACnB,IAAI,CA8BN;AAED,iGAAiG;AACjG,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,CAEvE;AAED,gGAAgG;AAChG,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,CAEpE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAoBnD;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,IAAI,CAG7D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "12.3.
|
|
3
|
+
"version": "12.3.6",
|
|
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": "^7.2.
|
|
25
|
+
"isaac-typescript-definitions": "^7.2.5"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -163,7 +163,12 @@ function makeGlowingHourGlassBackup() {
|
|
|
163
163
|
);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
// We serialize the table so that we can use the `merge` function later on with no other
|
|
167
|
+
// modifications.
|
|
168
|
+
const copiedChildTable = deepCopy(
|
|
169
|
+
childTable,
|
|
170
|
+
SerializationType.SERIALIZE,
|
|
171
|
+
) as Record<string, unknown>;
|
|
167
172
|
saveDataGlowingHourGlass[saveDataKey] = copiedChildTable;
|
|
168
173
|
}
|
|
169
174
|
},
|
|
@@ -13,5 +13,8 @@ export const saveDataConditionalFuncMap = new LuaMap<string, () => boolean>();
|
|
|
13
13
|
/**
|
|
14
14
|
* We backup some save data keys on every new room for the purposes of restoring it when Glowing
|
|
15
15
|
* Hour Glass is used.
|
|
16
|
+
*
|
|
17
|
+
* Note that the save data is backed up in serialized form so that we can use the `merge` function
|
|
18
|
+
* to restore it.
|
|
16
19
|
*/
|
|
17
20
|
export const saveDataGlowingHourGlassMap = new LuaMap<string, SaveData>();
|
|
@@ -59,23 +59,28 @@ export function merge(
|
|
|
59
59
|
|
|
60
60
|
// First, handle the special case of an array with a shallow copy.
|
|
61
61
|
if (isArray(oldObject) && isArray(newTable)) {
|
|
62
|
-
|
|
62
|
+
mergeSerializedArray(oldObject, newTable, traversalDescription);
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
// Depending on whether we are working on a Lua table or a TypeScriptToLua object, we need to
|
|
67
67
|
// iterate in a specific way.
|
|
68
68
|
if (isTSTLMap(oldObject) || isTSTLSet(oldObject) || isDefaultMap(oldObject)) {
|
|
69
|
-
|
|
69
|
+
mergeSerializedTSTLObject(oldObject, newTable, traversalDescription);
|
|
70
70
|
} else {
|
|
71
|
-
|
|
71
|
+
mergeSerializedTable(oldObject, newTable, traversalDescription);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
function
|
|
75
|
+
function mergeSerializedArray(
|
|
76
76
|
oldArray: LuaMap<AnyNotNil, unknown>,
|
|
77
77
|
newArray: LuaMap<AnyNotNil, unknown>,
|
|
78
|
+
traversalDescription: string,
|
|
78
79
|
) {
|
|
80
|
+
if (SAVE_DATA_MANAGER_DEBUG) {
|
|
81
|
+
log(`merge encountered an array: ${traversalDescription}`);
|
|
82
|
+
}
|
|
83
|
+
|
|
79
84
|
// Assume that we should blow away all array values with whatever is present in the incoming
|
|
80
85
|
// array.
|
|
81
86
|
clearTable(oldArray);
|
|
@@ -88,11 +93,15 @@ function mergeArray(
|
|
|
88
93
|
);
|
|
89
94
|
}
|
|
90
95
|
|
|
91
|
-
function
|
|
96
|
+
function mergeSerializedTSTLObject(
|
|
92
97
|
oldObject: Map<AnyNotNil, unknown> | Set<AnyNotNil>,
|
|
93
98
|
newTable: LuaMap<AnyNotNil, unknown>,
|
|
94
99
|
traversalDescription: string,
|
|
95
100
|
) {
|
|
101
|
+
if (SAVE_DATA_MANAGER_DEBUG) {
|
|
102
|
+
log(`merge encountered a TSTL object: ${traversalDescription}`);
|
|
103
|
+
}
|
|
104
|
+
|
|
96
105
|
// We blow away the old object and recursively copy over all of the incoming values.
|
|
97
106
|
oldObject.clear();
|
|
98
107
|
|
|
@@ -139,11 +148,15 @@ function mergeTSTLObject(
|
|
|
139
148
|
);
|
|
140
149
|
}
|
|
141
150
|
|
|
142
|
-
function
|
|
151
|
+
function mergeSerializedTable(
|
|
143
152
|
oldTable: LuaMap<AnyNotNil, unknown>,
|
|
144
153
|
newTable: LuaMap<AnyNotNil, unknown>,
|
|
145
154
|
traversalDescription: string,
|
|
146
155
|
) {
|
|
156
|
+
if (SAVE_DATA_MANAGER_DEBUG) {
|
|
157
|
+
log(`merge encountered a Lua table: ${traversalDescription}`);
|
|
158
|
+
}
|
|
159
|
+
|
|
147
160
|
iterateTableInOrder(
|
|
148
161
|
newTable,
|
|
149
162
|
(key, value) => {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { version } from "../../package.json";
|
|
2
1
|
import { ModUpgraded } from "../classes/ModUpgraded";
|
|
3
2
|
import { enableExtraConsoleCommands } from "../features/extraConsoleCommands/exports";
|
|
4
3
|
import { removeFadeIn } from "../features/fadeInRemover";
|
|
@@ -33,15 +32,6 @@ export function enableDevFeatures(mod: ModUpgraded): void {
|
|
|
33
32
|
removeFadeIn();
|
|
34
33
|
}
|
|
35
34
|
|
|
36
|
-
/**
|
|
37
|
-
* Helper function to get the current version of the `isaacscript-common` library, according to the
|
|
38
|
-
* "package.json" file at the time of compilation. (The version is in the Semantic Versioning
|
|
39
|
-
* format, e.g. "1.0.0".)
|
|
40
|
-
*/
|
|
41
|
-
export function getIsaacScriptCommonVersion(): string {
|
|
42
|
-
return version;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
35
|
/**
|
|
46
36
|
* Helper function to get a stack trace.
|
|
47
37
|
*
|
package/src/functions/log.ts
CHANGED
|
@@ -365,9 +365,7 @@ export function logTable(luaTable: unknown, parentTables = 0): void {
|
|
|
365
365
|
// Put it in an IIFE so that it will show as "func" instead of "logTable" and align with the
|
|
366
366
|
// other text. We have to use a non-arrow function to prevent Lua language server errors with
|
|
367
367
|
// the self argument.
|
|
368
|
-
|
|
369
|
-
// eslint-disable-next-line func-names
|
|
370
|
-
(function () {
|
|
368
|
+
(function func() {
|
|
371
369
|
log(
|
|
372
370
|
`${indentation}n/a (encountered a variable of type "${typeof luaTable}" instead of a table)`,
|
|
373
371
|
);
|
|
@@ -397,9 +395,7 @@ export function logTable(luaTable: unknown, parentTables = 0): void {
|
|
|
397
395
|
// Put it in an IIFE so that it will show as "func" instead of "logTable" and align with the other
|
|
398
396
|
// text. We have to use a non-arrow function to prevent Lua language server errors with the self
|
|
399
397
|
// argument.
|
|
400
|
-
|
|
401
|
-
// eslint-disable-next-line func-names
|
|
402
|
-
(function () {
|
|
398
|
+
(function func() {
|
|
403
399
|
log(`${indentation}The size of the table was: ${numElements}`);
|
|
404
400
|
})();
|
|
405
401
|
}
|
package/dist/package.lua
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
return {
|
|
2
|
-
name = "isaacscript-common",
|
|
3
|
-
version = "12.3.4",
|
|
4
|
-
description = "Helper functions and features for IsaacScript mods.",
|
|
5
|
-
keywords = {"isaac", "rebirth", "afterbirth", "repentance"},
|
|
6
|
-
homepage = "https://isaacscript.github.io/",
|
|
7
|
-
bugs = {url = "https://github.com/IsaacScript/isaacscript/issues"},
|
|
8
|
-
repository = {type = "git", url = "git+https://github.com/IsaacScript/isaacscript.git"},
|
|
9
|
-
license = "GPL-3.0",
|
|
10
|
-
author = "Zamiell",
|
|
11
|
-
type = "commonjs",
|
|
12
|
-
main = "dist/src/index",
|
|
13
|
-
types = "dist/src/index.d.ts",
|
|
14
|
-
dependencies = {["isaac-typescript-definitions"] = "^7.2.4"}
|
|
15
|
-
}
|