isaacscript-common 30.11.5 → 30.11.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.rollup.d.ts +20 -17
- package/dist/isaacscript-common.lua +32 -5
- package/dist/src/functions/logMisc.d.ts +19 -17
- package/dist/src/functions/logMisc.d.ts.map +1 -1
- package/dist/src/functions/logMisc.lua +47 -15
- package/package.json +1 -1
- package/src/classes/features/other/saveDataManager/saveToDisk.ts +1 -1
- package/src/decorators.ts +1 -1
- package/src/functions/decorators.ts +2 -2
- package/src/functions/logMisc.ts +48 -21
- package/dist/src/indexLua.d.ts +0 -186
- package/dist/src/indexLua.d.ts.map +0 -1
- package/dist/src/indexLua.lua +0 -1114
package/dist/index.rollup.d.ts
CHANGED
|
@@ -9067,10 +9067,10 @@ export declare function logCollectibleTypes(this: void, collectibleTypes: Collec
|
|
|
9067
9067
|
*/
|
|
9068
9068
|
export declare function logColor(this: void, color: Color, name?: string): void;
|
|
9069
9069
|
|
|
9070
|
-
/** Helper function
|
|
9070
|
+
/** Helper function to log every damage flag that is turned on. Useful when debugging. */
|
|
9071
9071
|
export declare function logDamageFlags(this: void, flags: DamageFlag | BitFlags<DamageFlag>): void;
|
|
9072
9072
|
|
|
9073
|
-
/** Helper function
|
|
9073
|
+
/** Helper function to log every display flag that is turned on. Useful when debugging. */
|
|
9074
9074
|
export declare function logDisplayFlags(this: void, flags: DisplayFlag | BitFlags<DisplayFlag>): void;
|
|
9075
9075
|
|
|
9076
9076
|
/** Helper function for logging an array of specific entities. */
|
|
@@ -9079,7 +9079,7 @@ export declare function logEntities(this: void, entities: Entity[]): void;
|
|
|
9079
9079
|
/** Helper function to log information about a specific entity. */
|
|
9080
9080
|
export declare function logEntity(this: void, entity: Entity): void;
|
|
9081
9081
|
|
|
9082
|
-
/** Helper function
|
|
9082
|
+
/** Helper function to log every entity flag that is turned on. Useful when debugging. */
|
|
9083
9083
|
export declare function logEntityFlags(this: void, flags: EntityFlag | BitFlags<EntityFlag>): void;
|
|
9084
9084
|
|
|
9085
9085
|
export declare function logEntityID(this: void, entity: Entity): void;
|
|
@@ -9092,12 +9092,10 @@ export declare function logEntityID(this: void, entity: Entity): void;
|
|
|
9092
9092
|
*/
|
|
9093
9093
|
export declare function logError(this: void, msg: string): void;
|
|
9094
9094
|
|
|
9095
|
-
/** Helper function for
|
|
9095
|
+
/** Helper function for logging every flag that is turned on. Useful when debugging. */
|
|
9096
9096
|
export declare function logFlags<T extends BitFlag | BitFlag128>(this: void, flags: T | BitFlags<T>, flagEnum: Record<string, T>, description?: string): void;
|
|
9097
9097
|
|
|
9098
|
-
/**
|
|
9099
|
-
* Helper function for printing out every game state flag that is turned on. Useful when debugging.
|
|
9100
|
-
*/
|
|
9098
|
+
/** Helper function for logging every game state flag that is turned on. Useful when debugging. */
|
|
9101
9099
|
export declare function logGameStateFlags(this: void): void;
|
|
9102
9100
|
|
|
9103
9101
|
/** Helper function for logging an array of specific grid entities. */
|
|
@@ -9114,9 +9112,7 @@ export declare function logGridEntity(this: void, gridEntity: GridEntity): void;
|
|
|
9114
9112
|
*/
|
|
9115
9113
|
export declare function logKColor(this: void, kColor: KColor, name?: string): void;
|
|
9116
9114
|
|
|
9117
|
-
/**
|
|
9118
|
-
* Helper function for printing out every level state flag that is turned on. Useful when debugging.
|
|
9119
|
-
*/
|
|
9115
|
+
/** Helper function for logging every level state flag that is turned on. Useful when debugging. */
|
|
9120
9116
|
export declare function logLevelStateFlags(this: void): void;
|
|
9121
9117
|
|
|
9122
9118
|
/**
|
|
@@ -9135,9 +9131,7 @@ export declare function logPlayerEffects(this: void, player: EntityPlayer): void
|
|
|
9135
9131
|
|
|
9136
9132
|
export declare function logPlayerHealth(this: void, player: EntityPlayer): void;
|
|
9137
9133
|
|
|
9138
|
-
/**
|
|
9139
|
-
* Helper function for printing out every projectile flag that is turned on. Useful when debugging.
|
|
9140
|
-
*/
|
|
9134
|
+
/** Helper function for logging every projectile flag that is turned on. Useful when debugging. */
|
|
9141
9135
|
export declare function logProjectileFlags(this: void, flags: ProjectileFlag | BitFlags<ProjectileFlag>): void;
|
|
9142
9136
|
|
|
9143
9137
|
/**
|
|
@@ -9156,7 +9150,7 @@ export declare function logPtrHashes(this: void, ptrHashes: PtrHash[]): void;
|
|
|
9156
9150
|
export declare function logRoom(this: void): void;
|
|
9157
9151
|
|
|
9158
9152
|
/**
|
|
9159
|
-
* Helper function for
|
|
9153
|
+
* Helper function for logging every seed effect (i.e. Easter Egg) that is turned on for the
|
|
9160
9154
|
* particular run.
|
|
9161
9155
|
*/
|
|
9162
9156
|
export declare function logSeedEffects(this: void): void;
|
|
@@ -9185,8 +9179,8 @@ export declare function logSounds(this: void): void;
|
|
|
9185
9179
|
export declare function logTable(this: void, luaTable: unknown, parentTables?: number): void;
|
|
9186
9180
|
|
|
9187
9181
|
/**
|
|
9188
|
-
* Helper function to
|
|
9189
|
-
*
|
|
9182
|
+
* Helper function to log the differences between the entries of two tables. Note that this will
|
|
9183
|
+
* only do a shallow comparison.
|
|
9190
9184
|
*/
|
|
9191
9185
|
export declare function logTableDifferences<K extends AnyNotNil, V>(this: void, table1: LuaMap<K, V>, table2: LuaMap<K, V>): void;
|
|
9192
9186
|
|
|
@@ -9198,7 +9192,16 @@ export declare function logTableDifferences<K extends AnyNotNil, V>(this: void,
|
|
|
9198
9192
|
*/
|
|
9199
9193
|
export declare function logTableKeys(this: void, luaTable: unknown): void;
|
|
9200
9194
|
|
|
9201
|
-
/**
|
|
9195
|
+
/**
|
|
9196
|
+
* Helper function to log every table key and value. This is a shallow log; the function will not
|
|
9197
|
+
* recursively traverse sub-tables.
|
|
9198
|
+
*
|
|
9199
|
+
* This function will only work on tables that have string keys (because it logs the keys in order,
|
|
9200
|
+
* instead of randomly). It will throw a run-time error if it encounters a non-string key.
|
|
9201
|
+
*/
|
|
9202
|
+
export declare function logTableShallow<K extends AnyNotNil, V>(this: void, luaTable: LuaMap<K, V>): void;
|
|
9203
|
+
|
|
9204
|
+
/** Helper function for log every tear flag that is turned on. Useful when debugging. */
|
|
9202
9205
|
export declare function logTearFlags(this: void, flags: TearFlag | BitFlags<TearFlag>): void;
|
|
9203
9206
|
|
|
9204
9207
|
/** Helper function for printing out every use flag that is turned on. Useful when debugging. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 30.11.
|
|
3
|
+
isaacscript-common 30.11.6
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -29411,7 +29411,7 @@ function ____exports.logMap(map, name)
|
|
|
29411
29411
|
return
|
|
29412
29412
|
end
|
|
29413
29413
|
local suffix = name == nil and (" \"" .. tostring(name)) .. "\"" or ""
|
|
29414
|
-
log(("
|
|
29414
|
+
log(("Logging a TSTL map" .. suffix) .. ":")
|
|
29415
29415
|
local mapKeys = {__TS__Spread(map:keys())}
|
|
29416
29416
|
__TS__ArraySort(mapKeys)
|
|
29417
29417
|
for ____, key in ipairs(mapKeys) do
|
|
@@ -29519,7 +29519,7 @@ function ____exports.logSet(set, name)
|
|
|
29519
29519
|
return
|
|
29520
29520
|
end
|
|
29521
29521
|
local suffix = name == nil and (" \"" .. tostring(name)) .. "\"" or ""
|
|
29522
|
-
log(("
|
|
29522
|
+
log(("Logging a TSTL set" .. suffix) .. ":")
|
|
29523
29523
|
local setValues = getSortedSetValues(nil, set)
|
|
29524
29524
|
for ____, value in ipairs(setValues) do
|
|
29525
29525
|
log(" Value: " .. tostring(value))
|
|
@@ -29541,7 +29541,7 @@ function ____exports.logTable(luaTable, parentTables)
|
|
|
29541
29541
|
parentTables = 0
|
|
29542
29542
|
end
|
|
29543
29543
|
if parentTables == 0 then
|
|
29544
|
-
log("
|
|
29544
|
+
log("Logging a Lua table:", false)
|
|
29545
29545
|
elseif parentTables > 10 then
|
|
29546
29546
|
return
|
|
29547
29547
|
end
|
|
@@ -29605,7 +29605,7 @@ function ____exports.logTableDifferences(table1, table2)
|
|
|
29605
29605
|
end
|
|
29606
29606
|
end
|
|
29607
29607
|
function ____exports.logTableKeys(luaTable)
|
|
29608
|
-
log("
|
|
29608
|
+
log("Logging the keys of a Lua table:")
|
|
29609
29609
|
if not isTable(nil, luaTable) then
|
|
29610
29610
|
log((" n/a (encountered a variable of type \"" .. __TS__TypeOf(luaTable)) .. "\" instead of a table)")
|
|
29611
29611
|
return
|
|
@@ -29621,6 +29621,33 @@ function ____exports.logTableKeys(luaTable)
|
|
|
29621
29621
|
)
|
|
29622
29622
|
log(" The size of the table was: " .. tostring(numElements))
|
|
29623
29623
|
end
|
|
29624
|
+
function ____exports.logTableShallow(luaTable)
|
|
29625
|
+
log("Logging a Lua table (shallow):", false)
|
|
29626
|
+
if not isTable(nil, luaTable) then
|
|
29627
|
+
log(
|
|
29628
|
+
("n/a (encountered a variable of type \"" .. __TS__TypeOf(luaTable)) .. "\" instead of a table)",
|
|
29629
|
+
false
|
|
29630
|
+
)
|
|
29631
|
+
return
|
|
29632
|
+
end
|
|
29633
|
+
local numElements = 0
|
|
29634
|
+
local indentation = " "
|
|
29635
|
+
iterateTableInOrder(
|
|
29636
|
+
nil,
|
|
29637
|
+
luaTable,
|
|
29638
|
+
function(____, key, value)
|
|
29639
|
+
log(
|
|
29640
|
+
((indentation .. tostring(key)) .. " --> ") .. tostring(value),
|
|
29641
|
+
false
|
|
29642
|
+
)
|
|
29643
|
+
numElements = numElements + 1
|
|
29644
|
+
end
|
|
29645
|
+
)
|
|
29646
|
+
log(
|
|
29647
|
+
(indentation .. "The size of the table was: ") .. tostring(numElements),
|
|
29648
|
+
false
|
|
29649
|
+
)
|
|
29650
|
+
end
|
|
29624
29651
|
function ____exports.logTearFlags(flags)
|
|
29625
29652
|
____exports.logFlags(flags, TearFlag, "tear")
|
|
29626
29653
|
end
|
|
@@ -21,11 +21,11 @@ export declare function logCollectibleTypes(this: void, collectibleTypes: Collec
|
|
|
21
21
|
* @param name Optional. The name of the object, which will be logged before the properties.
|
|
22
22
|
*/
|
|
23
23
|
export declare function logColor(this: void, color: Color, name?: string): void;
|
|
24
|
-
/** Helper function
|
|
24
|
+
/** Helper function to log every damage flag that is turned on. Useful when debugging. */
|
|
25
25
|
export declare function logDamageFlags(this: void, flags: DamageFlag | BitFlags<DamageFlag>): void;
|
|
26
|
-
/** Helper function
|
|
26
|
+
/** Helper function to log every display flag that is turned on. Useful when debugging. */
|
|
27
27
|
export declare function logDisplayFlags(this: void, flags: DisplayFlag | BitFlags<DisplayFlag>): void;
|
|
28
|
-
/** Helper function
|
|
28
|
+
/** Helper function to log every entity flag that is turned on. Useful when debugging. */
|
|
29
29
|
export declare function logEntityFlags(this: void, flags: EntityFlag | BitFlags<EntityFlag>): void;
|
|
30
30
|
export declare function logEntityID(this: void, entity: Entity): void;
|
|
31
31
|
/**
|
|
@@ -35,11 +35,9 @@ export declare function logEntityID(this: void, entity: Entity): void;
|
|
|
35
35
|
* prevents all of the subsequent code in the callback from running).
|
|
36
36
|
*/
|
|
37
37
|
export declare function logError(this: void, msg: string): void;
|
|
38
|
-
/** Helper function for
|
|
38
|
+
/** Helper function for logging every flag that is turned on. Useful when debugging. */
|
|
39
39
|
export declare function logFlags<T extends BitFlag | BitFlag128>(this: void, flags: T | BitFlags<T>, flagEnum: Record<string, T>, description?: string): void;
|
|
40
|
-
/**
|
|
41
|
-
* Helper function for printing out every game state flag that is turned on. Useful when debugging.
|
|
42
|
-
*/
|
|
40
|
+
/** Helper function for logging every game state flag that is turned on. Useful when debugging. */
|
|
43
41
|
export declare function logGameStateFlags(this: void): void;
|
|
44
42
|
/**
|
|
45
43
|
* Helper function to log a `KColor` object.
|
|
@@ -48,9 +46,7 @@ export declare function logGameStateFlags(this: void): void;
|
|
|
48
46
|
* @param name Optional. The name of the object, which will be logged before the properties.
|
|
49
47
|
*/
|
|
50
48
|
export declare function logKColor(this: void, kColor: KColor, name?: string): void;
|
|
51
|
-
/**
|
|
52
|
-
* Helper function for printing out every level state flag that is turned on. Useful when debugging.
|
|
53
|
-
*/
|
|
49
|
+
/** Helper function for logging every level state flag that is turned on. Useful when debugging. */
|
|
54
50
|
export declare function logLevelStateFlags(this: void): void;
|
|
55
51
|
/**
|
|
56
52
|
* Helper function to log a TSTL `Map`.
|
|
@@ -62,14 +58,12 @@ export declare function logMap(this: void, map: Map<AnyNotNil, unknown>, name?:
|
|
|
62
58
|
export declare function logMusic(this: void): void;
|
|
63
59
|
export declare function logPlayerEffects(this: void, player: EntityPlayer): void;
|
|
64
60
|
export declare function logPlayerHealth(this: void, player: EntityPlayer): void;
|
|
65
|
-
/**
|
|
66
|
-
* Helper function for printing out every projectile flag that is turned on. Useful when debugging.
|
|
67
|
-
*/
|
|
61
|
+
/** Helper function for logging every projectile flag that is turned on. Useful when debugging. */
|
|
68
62
|
export declare function logProjectileFlags(this: void, flags: ProjectileFlag | BitFlags<ProjectileFlag>): void;
|
|
69
63
|
/** Helper function for logging information about the current room. */
|
|
70
64
|
export declare function logRoom(this: void): void;
|
|
71
65
|
/**
|
|
72
|
-
* Helper function for
|
|
66
|
+
* Helper function for logging every seed effect (i.e. Easter Egg) that is turned on for the
|
|
73
67
|
* particular run.
|
|
74
68
|
*/
|
|
75
69
|
export declare function logSeedEffects(this: void): void;
|
|
@@ -94,8 +88,8 @@ export declare function logSounds(this: void): void;
|
|
|
94
88
|
*/
|
|
95
89
|
export declare function logTable(this: void, luaTable: unknown, parentTables?: number): void;
|
|
96
90
|
/**
|
|
97
|
-
* Helper function to
|
|
98
|
-
*
|
|
91
|
+
* Helper function to log the differences between the entries of two tables. Note that this will
|
|
92
|
+
* only do a shallow comparison.
|
|
99
93
|
*/
|
|
100
94
|
export declare function logTableDifferences<K extends AnyNotNil, V>(this: void, table1: LuaMap<K, V>, table2: LuaMap<K, V>): void;
|
|
101
95
|
/**
|
|
@@ -105,7 +99,15 @@ export declare function logTableDifferences<K extends AnyNotNil, V>(this: void,
|
|
|
105
99
|
* This function is useful for tables that have recursive references.
|
|
106
100
|
*/
|
|
107
101
|
export declare function logTableKeys(this: void, luaTable: unknown): void;
|
|
108
|
-
/**
|
|
102
|
+
/**
|
|
103
|
+
* Helper function to log every table key and value. This is a shallow log; the function will not
|
|
104
|
+
* recursively traverse sub-tables.
|
|
105
|
+
*
|
|
106
|
+
* This function will only work on tables that have string keys (because it logs the keys in order,
|
|
107
|
+
* instead of randomly). It will throw a run-time error if it encounters a non-string key.
|
|
108
|
+
*/
|
|
109
|
+
export declare function logTableShallow<K extends AnyNotNil, V>(this: void, luaTable: LuaMap<K, V>): void;
|
|
110
|
+
/** Helper function for log every tear flag that is turned on. Useful when debugging. */
|
|
109
111
|
export declare function logTearFlags(this: void, flags: TearFlag | BitFlags<TearFlag>): void;
|
|
110
112
|
/** Helper function for printing out every use flag that is turned on. Useful when debugging. */
|
|
111
113
|
export declare function logUseFlags(this: void, flags: UseFlag | BitFlags<UseFlag>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logMisc.d.ts","sourceRoot":"","sources":["../../../src/functions/logMisc.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACV,WAAW,EACX,UAAU,EAMV,cAAc,EAGd,QAAQ,EACR,OAAO,EACR,MAAM,8BAA8B,CAAC;AAoBtC;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACzB,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,CAaN;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,EACV,gBAAgB,EAAE,eAAe,EAAE,EACnC,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,CAaN;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,I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EAAE,OAAO,GAAG,IAAI,CAoB/D;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,UAAQ,GACZ,IAAI,CAON"}
|
|
@@ -69,7 +69,7 @@ local isTable = ____types.isTable
|
|
|
69
69
|
local isUserdata = ____types.isUserdata
|
|
70
70
|
local ____vector = require("src.functions.vector")
|
|
71
71
|
local vectorToString = ____vector.vectorToString
|
|
72
|
-
--- Helper function for
|
|
72
|
+
--- Helper function for logging every flag that is turned on. Useful when debugging.
|
|
73
73
|
function ____exports.logFlags(flags, flagEnum, description)
|
|
74
74
|
if description == nil then
|
|
75
75
|
description = ""
|
|
@@ -132,15 +132,15 @@ function ____exports.logColor(color, name)
|
|
|
132
132
|
end
|
|
133
133
|
log((((((((((((((("Logging " .. name) .. ": R") .. tostring(color.R)) .. ", G") .. tostring(color.G)) .. ", B") .. tostring(color.B)) .. ", A") .. tostring(color.A)) .. ", RO") .. tostring(color.RO)) .. ", BO") .. tostring(color.BO)) .. ", GO") .. tostring(color.GO))
|
|
134
134
|
end
|
|
135
|
-
--- Helper function
|
|
135
|
+
--- Helper function to log every damage flag that is turned on. Useful when debugging.
|
|
136
136
|
function ____exports.logDamageFlags(flags)
|
|
137
137
|
____exports.logFlags(flags, DamageFlag, "damage")
|
|
138
138
|
end
|
|
139
|
-
--- Helper function
|
|
139
|
+
--- Helper function to log every display flag that is turned on. Useful when debugging.
|
|
140
140
|
function ____exports.logDisplayFlags(flags)
|
|
141
141
|
____exports.logFlags(flags, DisplayFlag, "display")
|
|
142
142
|
end
|
|
143
|
-
--- Helper function
|
|
143
|
+
--- Helper function to log every entity flag that is turned on. Useful when debugging.
|
|
144
144
|
function ____exports.logEntityFlags(flags)
|
|
145
145
|
____exports.logFlags(flags, EntityFlag, "entity")
|
|
146
146
|
end
|
|
@@ -156,7 +156,7 @@ function ____exports.logError(msg)
|
|
|
156
156
|
local errorMsg = "Error: " .. msg
|
|
157
157
|
logAndPrint(nil, errorMsg)
|
|
158
158
|
end
|
|
159
|
-
--- Helper function for
|
|
159
|
+
--- Helper function for logging every game state flag that is turned on. Useful when debugging.
|
|
160
160
|
function ____exports.logGameStateFlags()
|
|
161
161
|
log("Logging game state flags:")
|
|
162
162
|
local gameStateFlagEntries = getEnumEntries(nil, GameStateFlag)
|
|
@@ -184,7 +184,7 @@ function ____exports.logKColor(kColor, name)
|
|
|
184
184
|
end
|
|
185
185
|
log((((((((("Logging " .. name) .. ": R") .. tostring(kColor.Red)) .. ", G") .. tostring(kColor.Green)) .. ", B") .. tostring(kColor.Blue)) .. ", A") .. tostring(kColor.Alpha))
|
|
186
186
|
end
|
|
187
|
-
--- Helper function for
|
|
187
|
+
--- Helper function for logging every level state flag that is turned on. Useful when debugging.
|
|
188
188
|
function ____exports.logLevelStateFlags()
|
|
189
189
|
local level = game:GetLevel()
|
|
190
190
|
local levelStateFlagEntries = getEnumEntries(nil, LevelStateFlag)
|
|
@@ -213,7 +213,7 @@ function ____exports.logMap(map, name)
|
|
|
213
213
|
return
|
|
214
214
|
end
|
|
215
215
|
local suffix = name == nil and (" \"" .. tostring(name)) .. "\"" or ""
|
|
216
|
-
log(("
|
|
216
|
+
log(("Logging a TSTL map" .. suffix) .. ":")
|
|
217
217
|
local mapKeys = {__TS__Spread(map:keys())}
|
|
218
218
|
__TS__ArraySort(mapKeys)
|
|
219
219
|
for ____, key in ipairs(mapKeys) do
|
|
@@ -272,7 +272,7 @@ function ____exports.logPlayerHealth(player)
|
|
|
272
272
|
end
|
|
273
273
|
log(" ]")
|
|
274
274
|
end
|
|
275
|
-
--- Helper function for
|
|
275
|
+
--- Helper function for logging every projectile flag that is turned on. Useful when debugging.
|
|
276
276
|
function ____exports.logProjectileFlags(flags)
|
|
277
277
|
____exports.logFlags(flags, ProjectileFlag, "projectile")
|
|
278
278
|
end
|
|
@@ -300,7 +300,7 @@ function ____exports.logRoom()
|
|
|
300
300
|
log("- List index: " .. tostring(roomListIndex))
|
|
301
301
|
log("- Boss ID: " .. tostring(bossID))
|
|
302
302
|
end
|
|
303
|
-
--- Helper function for
|
|
303
|
+
--- Helper function for logging every seed effect (i.e. Easter Egg) that is turned on for the
|
|
304
304
|
-- particular run.
|
|
305
305
|
function ____exports.logSeedEffects()
|
|
306
306
|
local seeds = game:GetSeeds()
|
|
@@ -329,7 +329,7 @@ function ____exports.logSet(set, name)
|
|
|
329
329
|
return
|
|
330
330
|
end
|
|
331
331
|
local suffix = name == nil and (" \"" .. tostring(name)) .. "\"" or ""
|
|
332
|
-
log(("
|
|
332
|
+
log(("Logging a TSTL set" .. suffix) .. ":")
|
|
333
333
|
local setValues = getSortedSetValues(nil, set)
|
|
334
334
|
for ____, value in ipairs(setValues) do
|
|
335
335
|
log(" Value: " .. tostring(value))
|
|
@@ -360,7 +360,7 @@ function ____exports.logTable(luaTable, parentTables)
|
|
|
360
360
|
parentTables = 0
|
|
361
361
|
end
|
|
362
362
|
if parentTables == 0 then
|
|
363
|
-
log("
|
|
363
|
+
log("Logging a Lua table:", false)
|
|
364
364
|
elseif parentTables > 10 then
|
|
365
365
|
return
|
|
366
366
|
end
|
|
@@ -400,8 +400,8 @@ function ____exports.logTable(luaTable, parentTables)
|
|
|
400
400
|
false
|
|
401
401
|
)
|
|
402
402
|
end
|
|
403
|
-
--- Helper function to
|
|
404
|
-
--
|
|
403
|
+
--- Helper function to log the differences between the entries of two tables. Note that this will
|
|
404
|
+
-- only do a shallow comparison.
|
|
405
405
|
function ____exports.logTableDifferences(table1, table2)
|
|
406
406
|
log("Comparing two Lua tables:")
|
|
407
407
|
local table1Keys = __TS__ObjectKeys(table1)
|
|
@@ -430,7 +430,7 @@ end
|
|
|
430
430
|
--
|
|
431
431
|
-- This function is useful for tables that have recursive references.
|
|
432
432
|
function ____exports.logTableKeys(luaTable)
|
|
433
|
-
log("
|
|
433
|
+
log("Logging the keys of a Lua table:")
|
|
434
434
|
if not isTable(nil, luaTable) then
|
|
435
435
|
log((" n/a (encountered a variable of type \"" .. __TS__TypeOf(luaTable)) .. "\" instead of a table)")
|
|
436
436
|
return
|
|
@@ -446,7 +446,39 @@ function ____exports.logTableKeys(luaTable)
|
|
|
446
446
|
)
|
|
447
447
|
log(" The size of the table was: " .. tostring(numElements))
|
|
448
448
|
end
|
|
449
|
-
--- Helper function
|
|
449
|
+
--- Helper function to log every table key and value. This is a shallow log; the function will not
|
|
450
|
+
-- recursively traverse sub-tables.
|
|
451
|
+
--
|
|
452
|
+
-- This function will only work on tables that have string keys (because it logs the keys in order,
|
|
453
|
+
-- instead of randomly). It will throw a run-time error if it encounters a non-string key.
|
|
454
|
+
function ____exports.logTableShallow(luaTable)
|
|
455
|
+
log("Logging a Lua table (shallow):", false)
|
|
456
|
+
if not isTable(nil, luaTable) then
|
|
457
|
+
log(
|
|
458
|
+
("n/a (encountered a variable of type \"" .. __TS__TypeOf(luaTable)) .. "\" instead of a table)",
|
|
459
|
+
false
|
|
460
|
+
)
|
|
461
|
+
return
|
|
462
|
+
end
|
|
463
|
+
local numElements = 0
|
|
464
|
+
local indentation = " "
|
|
465
|
+
iterateTableInOrder(
|
|
466
|
+
nil,
|
|
467
|
+
luaTable,
|
|
468
|
+
function(____, key, value)
|
|
469
|
+
log(
|
|
470
|
+
((indentation .. tostring(key)) .. " --> ") .. tostring(value),
|
|
471
|
+
false
|
|
472
|
+
)
|
|
473
|
+
numElements = numElements + 1
|
|
474
|
+
end
|
|
475
|
+
)
|
|
476
|
+
log(
|
|
477
|
+
(indentation .. "The size of the table was: ") .. tostring(numElements),
|
|
478
|
+
false
|
|
479
|
+
)
|
|
480
|
+
end
|
|
481
|
+
--- Helper function for log every tear flag that is turned on. Useful when debugging.
|
|
450
482
|
function ____exports.logTearFlags(flags)
|
|
451
483
|
____exports.logFlags(flags, TearFlag, "tear")
|
|
452
484
|
end
|
package/package.json
CHANGED
|
@@ -48,7 +48,7 @@ function getAllSaveDataToWriteToDisk(
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
// If there is no data, then we can move on to the next feature.
|
|
51
|
-
if (isTableEmpty(saveDataWithoutRoom as
|
|
51
|
+
if (isTableEmpty(saveDataWithoutRoom as LuaMap<AnyNotNil, unknown>)) {
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
|
package/src/decorators.ts
CHANGED
|
@@ -14,7 +14,7 @@ export function Exported<Class extends Feature>(
|
|
|
14
14
|
): void {
|
|
15
15
|
// Since the decorator runs prior to instantiation, we only have access to get and set static
|
|
16
16
|
// properties, which are located on the "constructor" table.
|
|
17
|
-
const constructor = target.constructor as unknown as
|
|
17
|
+
const constructor = target.constructor as unknown as LuaMap<
|
|
18
18
|
AnyNotNil,
|
|
19
19
|
unknown
|
|
20
20
|
>;
|
|
@@ -96,7 +96,7 @@ export function PriorityCallback<T extends ModCallback>(
|
|
|
96
96
|
// properties, which are located on the "constructor" table. Thus, we store the callback
|
|
97
97
|
// arguments for later.
|
|
98
98
|
const constructor = target.constructor as unknown as
|
|
99
|
-
|
|
|
99
|
+
| LuaMap<AnyNotNil, unknown>
|
|
100
100
|
| undefined;
|
|
101
101
|
|
|
102
102
|
if (constructor === undefined) {
|
|
@@ -146,7 +146,7 @@ export function PriorityCallbackCustom<T extends ModCallbackCustom>(
|
|
|
146
146
|
// properties, which are located on the "constructor" table. Thus, we store the callback
|
|
147
147
|
// arguments for later.
|
|
148
148
|
const constructor = target.constructor as unknown as
|
|
149
|
-
|
|
|
149
|
+
| LuaMap<AnyNotNil, unknown>
|
|
150
150
|
| undefined;
|
|
151
151
|
|
|
152
152
|
if (constructor === undefined) {
|
package/src/functions/logMisc.ts
CHANGED
|
@@ -99,7 +99,7 @@ export function logColor(this: void, color: Color, name?: string): void {
|
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
/** Helper function
|
|
102
|
+
/** Helper function to log every damage flag that is turned on. Useful when debugging. */
|
|
103
103
|
export function logDamageFlags(
|
|
104
104
|
this: void,
|
|
105
105
|
flags: DamageFlag | BitFlags<DamageFlag>,
|
|
@@ -107,7 +107,7 @@ export function logDamageFlags(
|
|
|
107
107
|
logFlags(flags, DamageFlag, "damage");
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
/** Helper function
|
|
110
|
+
/** Helper function to log every display flag that is turned on. Useful when debugging. */
|
|
111
111
|
export function logDisplayFlags(
|
|
112
112
|
this: void,
|
|
113
113
|
flags: DisplayFlag | BitFlags<DisplayFlag>,
|
|
@@ -115,7 +115,7 @@ export function logDisplayFlags(
|
|
|
115
115
|
logFlags(flags, DisplayFlag, "display");
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
/** Helper function
|
|
118
|
+
/** Helper function to log every entity flag that is turned on. Useful when debugging. */
|
|
119
119
|
export function logEntityFlags(
|
|
120
120
|
this: void,
|
|
121
121
|
flags: EntityFlag | BitFlags<EntityFlag>,
|
|
@@ -139,7 +139,7 @@ export function logError(this: void, msg: string): void {
|
|
|
139
139
|
logAndPrint(errorMsg);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
/** Helper function for
|
|
142
|
+
/** Helper function for logging every flag that is turned on. Useful when debugging. */
|
|
143
143
|
export function logFlags<T extends BitFlag | BitFlag128>(
|
|
144
144
|
this: void,
|
|
145
145
|
flags: T | BitFlags<T>,
|
|
@@ -166,9 +166,7 @@ export function logFlags<T extends BitFlag | BitFlag128>(
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
/**
|
|
170
|
-
* Helper function for printing out every game state flag that is turned on. Useful when debugging.
|
|
171
|
-
*/
|
|
169
|
+
/** Helper function for logging every game state flag that is turned on. Useful when debugging. */
|
|
172
170
|
export function logGameStateFlags(this: void): void {
|
|
173
171
|
log("Logging game state flags:");
|
|
174
172
|
|
|
@@ -204,9 +202,7 @@ export function logKColor(this: void, kColor: KColor, name?: string): void {
|
|
|
204
202
|
);
|
|
205
203
|
}
|
|
206
204
|
|
|
207
|
-
/**
|
|
208
|
-
* Helper function for printing out every level state flag that is turned on. Useful when debugging.
|
|
209
|
-
*/
|
|
205
|
+
/** Helper function for logging every level state flag that is turned on. Useful when debugging. */
|
|
210
206
|
export function logLevelStateFlags(this: void): void {
|
|
211
207
|
const level = game.GetLevel();
|
|
212
208
|
|
|
@@ -244,7 +240,7 @@ export function logMap(
|
|
|
244
240
|
}
|
|
245
241
|
|
|
246
242
|
const suffix = name === undefined ? ` "${name}"` : "";
|
|
247
|
-
log(`
|
|
243
|
+
log(`Logging a TSTL map${suffix}:`);
|
|
248
244
|
|
|
249
245
|
const mapKeys = [...map.keys()];
|
|
250
246
|
mapKeys.sort();
|
|
@@ -315,9 +311,7 @@ export function logPlayerHealth(this: void, player: EntityPlayer): void {
|
|
|
315
311
|
log(" ]");
|
|
316
312
|
}
|
|
317
313
|
|
|
318
|
-
/**
|
|
319
|
-
* Helper function for printing out every projectile flag that is turned on. Useful when debugging.
|
|
320
|
-
*/
|
|
314
|
+
/** Helper function for logging every projectile flag that is turned on. Useful when debugging. */
|
|
321
315
|
export function logProjectileFlags(
|
|
322
316
|
this: void,
|
|
323
317
|
flags: ProjectileFlag | BitFlags<ProjectileFlag>,
|
|
@@ -356,7 +350,7 @@ export function logRoom(this: void): void {
|
|
|
356
350
|
}
|
|
357
351
|
|
|
358
352
|
/**
|
|
359
|
-
* Helper function for
|
|
353
|
+
* Helper function for logging every seed effect (i.e. Easter Egg) that is turned on for the
|
|
360
354
|
* particular run.
|
|
361
355
|
*/
|
|
362
356
|
export function logSeedEffects(this: void): void {
|
|
@@ -395,7 +389,7 @@ export function logSet(
|
|
|
395
389
|
}
|
|
396
390
|
|
|
397
391
|
const suffix = name === undefined ? ` "${name}"` : "";
|
|
398
|
-
log(`
|
|
392
|
+
log(`Logging a TSTL set${suffix}:`);
|
|
399
393
|
|
|
400
394
|
const setValues = getSortedSetValues(set);
|
|
401
395
|
for (const value of setValues) {
|
|
@@ -433,7 +427,7 @@ export function logTable(
|
|
|
433
427
|
parentTables = 0,
|
|
434
428
|
): void {
|
|
435
429
|
if (parentTables === 0) {
|
|
436
|
-
log("
|
|
430
|
+
log("Logging a Lua table:", false);
|
|
437
431
|
} else if (parentTables > 10) {
|
|
438
432
|
return;
|
|
439
433
|
}
|
|
@@ -473,8 +467,8 @@ export function logTable(
|
|
|
473
467
|
}
|
|
474
468
|
|
|
475
469
|
/**
|
|
476
|
-
* Helper function to
|
|
477
|
-
*
|
|
470
|
+
* Helper function to log the differences between the entries of two tables. Note that this will
|
|
471
|
+
* only do a shallow comparison.
|
|
478
472
|
*/
|
|
479
473
|
export function logTableDifferences<K extends AnyNotNil, V>(
|
|
480
474
|
this: void,
|
|
@@ -519,7 +513,7 @@ export function logTableDifferences<K extends AnyNotNil, V>(
|
|
|
519
513
|
* This function is useful for tables that have recursive references.
|
|
520
514
|
*/
|
|
521
515
|
export function logTableKeys(this: void, luaTable: unknown): void {
|
|
522
|
-
log("
|
|
516
|
+
log("Logging the keys of a Lua table:");
|
|
523
517
|
|
|
524
518
|
if (!isTable(luaTable)) {
|
|
525
519
|
log(
|
|
@@ -538,7 +532,40 @@ export function logTableKeys(this: void, luaTable: unknown): void {
|
|
|
538
532
|
log(` The size of the table was: ${numElements}`);
|
|
539
533
|
}
|
|
540
534
|
|
|
541
|
-
/**
|
|
535
|
+
/**
|
|
536
|
+
* Helper function to log every table key and value. This is a shallow log; the function will not
|
|
537
|
+
* recursively traverse sub-tables.
|
|
538
|
+
*
|
|
539
|
+
* This function will only work on tables that have string keys (because it logs the keys in order,
|
|
540
|
+
* instead of randomly). It will throw a run-time error if it encounters a non-string key.
|
|
541
|
+
*/
|
|
542
|
+
export function logTableShallow<K extends AnyNotNil, V>(
|
|
543
|
+
this: void,
|
|
544
|
+
luaTable: LuaMap<K, V>,
|
|
545
|
+
): void {
|
|
546
|
+
log("Logging a Lua table (shallow):", false);
|
|
547
|
+
|
|
548
|
+
if (!isTable(luaTable)) {
|
|
549
|
+
log(
|
|
550
|
+
`n/a (encountered a variable of type "${typeof luaTable}" instead of a table)`,
|
|
551
|
+
false,
|
|
552
|
+
);
|
|
553
|
+
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
let numElements = 0;
|
|
558
|
+
const indentation = " ";
|
|
559
|
+
iterateTableInOrder(luaTable, (key, value) => {
|
|
560
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
561
|
+
log(`${indentation}${key} --> ${value}`, false);
|
|
562
|
+
numElements++;
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
log(`${indentation}The size of the table was: ${numElements}`, false);
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/** Helper function for log every tear flag that is turned on. Useful when debugging. */
|
|
542
569
|
export function logTearFlags(
|
|
543
570
|
this: void,
|
|
544
571
|
flags: TearFlag | BitFlags<TearFlag>,
|