isaacscript-common 1.2.90 → 1.2.91
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/functions/log.d.ts +9 -7
- package/dist/functions/log.lua +30 -5
- package/package.json +1 -1
package/dist/functions/log.d.ts
CHANGED
|
@@ -10,18 +10,18 @@ export declare function getDebugPrependString(msg: string, numParentFunctions?:
|
|
|
10
10
|
* and the line number before the string.
|
|
11
11
|
*/
|
|
12
12
|
export declare function log(this: void, msg: string): void;
|
|
13
|
-
/** Helper function for printing out every damage flag that is turned on.
|
|
13
|
+
/** Helper function for printing out every damage flag that is turned on. Useful when debugging. */
|
|
14
14
|
export declare function logAllDamageFlags(this: void, flags: int): void;
|
|
15
|
-
/** Helper function for printing out every entity flag that is turned on.
|
|
15
|
+
/** Helper function for printing out every entity flag that is turned on. Useful when debugging. */
|
|
16
16
|
export declare function logAllEntityFlags(this: void, flags: int): void;
|
|
17
|
-
/** Helper function for printing out every flag that is turned on.
|
|
17
|
+
/** Helper function for printing out every flag that is turned on. Useful when debugging. */
|
|
18
18
|
export declare function logAllFlags(this: void, flags: int, flagEnum: LuaTable, description?: string): void;
|
|
19
19
|
/**
|
|
20
|
-
* Helper function for printing out every game state flag that is turned on.
|
|
20
|
+
* Helper function for printing out every game state flag that is turned on. Useful when debugging.
|
|
21
21
|
*/
|
|
22
22
|
export declare function logAllGameStateFlags(this: void): void;
|
|
23
23
|
/**
|
|
24
|
-
* Helper function for printing out every projectile flag that is turned on.
|
|
24
|
+
* Helper function for printing out every projectile flag that is turned on. Useful when debugging.
|
|
25
25
|
*/
|
|
26
26
|
export declare function logAllProjectileFlags(this: void, flags: int): void;
|
|
27
27
|
/**
|
|
@@ -29,15 +29,17 @@ export declare function logAllProjectileFlags(this: void, flags: int): void;
|
|
|
29
29
|
* particular run.
|
|
30
30
|
*/
|
|
31
31
|
export declare function logAllSeedEffects(this: void): void;
|
|
32
|
-
/** Helper function for printing out every
|
|
32
|
+
/** Helper function for printing out every tear flag that is turned on. Useful when debugging. */
|
|
33
33
|
export declare function logAllTearFlags(this: void, flags: int): void;
|
|
34
|
-
/** Helper function for printing out every use flag that is turned on.
|
|
34
|
+
/** Helper function for printing out every use flag that is turned on. Useful when debugging. */
|
|
35
35
|
export declare function logAllUseFlags(this: void, flags: int): void;
|
|
36
36
|
export declare function logArray<T>(this: void, array: T[]): void;
|
|
37
37
|
export declare function logColor(this: void, color: Color): void;
|
|
38
38
|
export declare function logEntity(this: void, entity: Entity): void;
|
|
39
39
|
export declare function logKColor(this: void, kColor: KColor): void;
|
|
40
40
|
export declare function logMap(this: void, map: Map<AnyNotNil, unknown>): void;
|
|
41
|
+
/** Helper function for printing out information about the current room. */
|
|
42
|
+
export declare function logRoom(this: void): void;
|
|
41
43
|
export declare function logTable(this: void, table: unknown, parentTables?: number): void;
|
|
42
44
|
export declare function logTemporaryEffects(this: void, player: EntityPlayer): void;
|
|
43
45
|
export declare function logSet(this: void, set: Set<AnyNotNil>): void;
|
package/dist/functions/log.lua
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
2
|
local ____lualib = require("lualib_bundle")
|
|
3
3
|
local Map = ____lualib.Map
|
|
4
|
-
local
|
|
4
|
+
local __TS__Spread = ____lualib.__TS__Spread
|
|
5
|
+
local __TS__ArraySort = ____lualib.__TS__ArraySort
|
|
5
6
|
local __TS__ArrayForEach = ____lualib.__TS__ArrayForEach
|
|
6
7
|
local Set = ____lualib.Set
|
|
7
8
|
local ____exports = {}
|
|
@@ -13,6 +14,11 @@ local ____flag = require("functions.flag")
|
|
|
13
14
|
local hasFlag = ____flag.hasFlag
|
|
14
15
|
local ____player = require("functions.player")
|
|
15
16
|
local getEffectsList = ____player.getEffectsList
|
|
17
|
+
local ____rooms = require("functions.rooms")
|
|
18
|
+
local getRoomListIndex = ____rooms.getRoomListIndex
|
|
19
|
+
local getRoomSafeGridIndex = ____rooms.getRoomSafeGridIndex
|
|
20
|
+
local getRoomSubType = ____rooms.getRoomSubType
|
|
21
|
+
local getRoomVariant = ____rooms.getRoomVariant
|
|
16
22
|
local ____trinkets = require("functions.trinkets")
|
|
17
23
|
local getTrinketName = ____trinkets.getTrinketName
|
|
18
24
|
function ____exports.getDebugPrependString(self, msg, numParentFunctions)
|
|
@@ -115,13 +121,26 @@ function ____exports.logKColor(kColor)
|
|
|
115
121
|
end
|
|
116
122
|
function ____exports.logMap(map)
|
|
117
123
|
____exports.log("Printing out a TSTL Map:")
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
124
|
+
local mapKeys = {__TS__Spread(map:keys())}
|
|
125
|
+
__TS__ArraySort(mapKeys)
|
|
126
|
+
for ____, key in ipairs(mapKeys) do
|
|
127
|
+
local value = map:get(key)
|
|
121
128
|
____exports.log(((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value))
|
|
122
129
|
end
|
|
123
130
|
____exports.log("The size of the map was: " .. tostring(map.size))
|
|
124
131
|
end
|
|
132
|
+
function ____exports.logRoom()
|
|
133
|
+
local game = Game()
|
|
134
|
+
local room = game:GetRoom()
|
|
135
|
+
local roomType = room:GetType()
|
|
136
|
+
local roomVariant = getRoomVariant(nil)
|
|
137
|
+
local roomSubType = getRoomSubType(nil)
|
|
138
|
+
local roomSafeGridIndex = getRoomSafeGridIndex(nil)
|
|
139
|
+
local roomListIndex = getRoomListIndex(nil)
|
|
140
|
+
____exports.log((((("Current room type/variant/sub-type: " .. tostring(roomType)) .. ".") .. tostring(roomVariant)) .. ".") .. tostring(roomSubType))
|
|
141
|
+
____exports.log("Current room safe grid index: " .. tostring(roomSafeGridIndex))
|
|
142
|
+
____exports.log("Current room list index: " .. tostring(roomListIndex))
|
|
143
|
+
end
|
|
125
144
|
function ____exports.logTable(____table, parentTables)
|
|
126
145
|
if parentTables == nil then
|
|
127
146
|
parentTables = 0
|
|
@@ -134,13 +153,16 @@ function ____exports.logTable(____table, parentTables)
|
|
|
134
153
|
" ",
|
|
135
154
|
math.floor(numSpaces)
|
|
136
155
|
)
|
|
156
|
+
local numKeys = 0
|
|
137
157
|
for key, value in pairs(____table) do
|
|
138
158
|
____exports.log((((indentation .. "Key: ") .. tostring(key)) .. ", Value: ") .. tostring(value))
|
|
139
159
|
local valueType = type(value)
|
|
140
160
|
if valueType == "table" then
|
|
141
161
|
____exports.logTable(value, parentTables + 1)
|
|
142
162
|
end
|
|
163
|
+
numKeys = numKeys + 1
|
|
143
164
|
end
|
|
165
|
+
____exports.log("The size of the table was: " .. tostring(numKeys))
|
|
144
166
|
end
|
|
145
167
|
function ____exports.logTemporaryEffects(player)
|
|
146
168
|
local effects = getEffectsList(nil, player)
|
|
@@ -168,7 +190,9 @@ function ____exports.logTemporaryEffects(player)
|
|
|
168
190
|
end
|
|
169
191
|
function ____exports.logSet(set)
|
|
170
192
|
____exports.log("Printing out a TSTL Set:")
|
|
171
|
-
|
|
193
|
+
local setValues = {__TS__Spread(set:values())}
|
|
194
|
+
__TS__ArraySort(setValues)
|
|
195
|
+
for ____, value in ipairs(setValues) do
|
|
172
196
|
____exports.log(" Value: " .. tostring(value))
|
|
173
197
|
end
|
|
174
198
|
____exports.log("The size of the set was: " .. tostring(set.size))
|
|
@@ -192,6 +216,7 @@ function ____exports.setLogFunctionsGlobal(self)
|
|
|
192
216
|
globals.logEntity = ____exports.logEntity
|
|
193
217
|
globals.logKColor = ____exports.logKColor
|
|
194
218
|
globals.logMap = ____exports.logMap
|
|
219
|
+
globals.logRoom = ____exports.logRoom
|
|
195
220
|
globals.logTable = ____exports.logTable
|
|
196
221
|
globals.logTemporaryEffects = ____exports.logTemporaryEffects
|
|
197
222
|
globals.logSet = ____exports.logSet
|