isaacscript-common 1.2.157 → 1.2.158
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 +1 -1
- package/dist/functions/log.lua +20 -4
- package/package.json +1 -1
package/dist/functions/log.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare function logAllDamageFlags(this: void, flags: int): void;
|
|
|
15
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
17
|
/** Helper function for printing out every flag that is turned on. Useful when debugging. */
|
|
18
|
-
export declare function logAllFlags(this: void, flags: int, flagEnum
|
|
18
|
+
export declare function logAllFlags(this: void, flags: int, flagEnum?: LuaTable, description?: string): void;
|
|
19
19
|
/**
|
|
20
20
|
* Helper function for printing out every game state flag that is turned on. Useful when debugging.
|
|
21
21
|
*/
|
package/dist/functions/log.lua
CHANGED
|
@@ -62,13 +62,29 @@ function ____exports.logAllFlags(flags, flagEnum, description)
|
|
|
62
62
|
if description ~= "" then
|
|
63
63
|
description = description .. " "
|
|
64
64
|
end
|
|
65
|
-
|
|
65
|
+
if flagEnum == nil then
|
|
66
|
+
flagEnum = {}
|
|
67
|
+
do
|
|
68
|
+
local i = 0
|
|
69
|
+
while i <= 62 do
|
|
70
|
+
flagEnum["1 << " .. tostring(i)] = 1 << i
|
|
71
|
+
i = i + 1
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
____exports.log(((("Logging all " .. description) .. "flags for value ") .. tostring(flags)) .. ":")
|
|
66
76
|
local hasNoFlags = true
|
|
67
77
|
for key, value in pairs(flagEnum) do
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
do
|
|
79
|
+
if type(value) ~= "number" then
|
|
80
|
+
goto __continue13
|
|
81
|
+
end
|
|
82
|
+
if hasFlag(nil, flags, value) then
|
|
83
|
+
____exports.log((((" Has flag: " .. tostring(key)) .. " (") .. tostring(value)) .. ")")
|
|
84
|
+
hasNoFlags = false
|
|
85
|
+
end
|
|
71
86
|
end
|
|
87
|
+
::__continue13::
|
|
72
88
|
end
|
|
73
89
|
if hasNoFlags then
|
|
74
90
|
____exports.log(" n/a (no flags)")
|