isaacscript-common 7.16.1 → 7.17.0
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/features/disableInputs.d.ts +11 -0
- package/dist/features/disableInputs.d.ts.map +1 -1
- package/dist/features/disableInputs.lua +31 -12
- package/dist/features/pause.d.ts.map +1 -1
- package/dist/functions/doors.d.ts +10 -1
- package/dist/functions/doors.d.ts.map +1 -1
- package/dist/functions/doors.lua +15 -3
- package/dist/functions/utils.lua +2 -2
- package/dist/index.d.ts +11 -1
- package/dist/lualib_bundle.lua +11 -0
- package/package.json +1 -1
- package/src/features/disableInputs.ts +47 -12
- package/src/features/pause.ts +2 -1
- package/src/functions/doors.ts +16 -1
- package/src/functions/utils.ts +2 -2
|
@@ -8,6 +8,17 @@ export declare function disableInputsInit(mod: Mod): void;
|
|
|
8
8
|
* that multiple mod features can work in tandem.
|
|
9
9
|
*/
|
|
10
10
|
export declare function enableAllInputs(key: string): void;
|
|
11
|
+
/**
|
|
12
|
+
* Helper function to disable specific inputs, like opening the console. (To disable all inputs, see
|
|
13
|
+
* the `disableAllInputs` function.)
|
|
14
|
+
*
|
|
15
|
+
* Use the `enableAllInputs` helper function to set things back to normal.
|
|
16
|
+
*
|
|
17
|
+
* @param key The name of the mod feature that is requesting the enable/disable. This is needed so
|
|
18
|
+
* that multiple mod features can work in tandem.
|
|
19
|
+
* @param buttonActions An array of the actions to action.
|
|
20
|
+
*/
|
|
21
|
+
export declare function disableInputs(key: string, buttonActions: ButtonAction[]): void;
|
|
11
22
|
/**
|
|
12
23
|
* Helper function to disable all inputs. This is useful because `EntityPlayer.ControlsEnabled` can
|
|
13
24
|
* be changed by the game under certain conditions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disableInputs.d.ts","sourceRoot":"","sources":["../../src/features/disableInputs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"disableInputs.d.ts","sourceRoot":"","sources":["../../src/features/disableInputs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,8BAA8B,CAAC;AA0BtC,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAoBhD;AAqDD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAKjD;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,YAAY,EAAE,GAC5B,IAAI,CAKN;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAKlD;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,GACvD,IAAI,CAKN;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,GACvD,IAAI,CAKN;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAGvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAGvD"}
|
|
@@ -32,12 +32,17 @@ function getReturnValue(self, buttonAction, booleanCallback)
|
|
|
32
32
|
____booleanCallback_0 = 0
|
|
33
33
|
end
|
|
34
34
|
local disableValue = ____booleanCallback_0
|
|
35
|
-
for ____,
|
|
35
|
+
for ____, blacklist in __TS__Iterator(v.run.disableInputs:values()) do
|
|
36
|
+
if blacklist:has(buttonAction) then
|
|
37
|
+
return disableValue
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
for ____, whitelist in __TS__Iterator(v.run.disableAllInputsWithWhitelistMap:values()) do
|
|
36
41
|
if not whitelist:has(buttonAction) then
|
|
37
42
|
return disableValue
|
|
38
43
|
end
|
|
39
44
|
end
|
|
40
|
-
for ____, blacklist in __TS__Iterator(v.run.
|
|
45
|
+
for ____, blacklist in __TS__Iterator(v.run.enableAllInputsWithBlacklistMap:values()) do
|
|
41
46
|
if blacklist:has(buttonAction) then
|
|
42
47
|
return disableValue
|
|
43
48
|
end
|
|
@@ -46,8 +51,9 @@ function getReturnValue(self, buttonAction, booleanCallback)
|
|
|
46
51
|
end
|
|
47
52
|
local FEATURE_NAME = "disableInputs"
|
|
48
53
|
v = {run = {
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
disableInputs = __TS__New(Map),
|
|
55
|
+
enableAllInputsWithBlacklistMap = __TS__New(Map),
|
|
56
|
+
disableAllInputsWithWhitelistMap = __TS__New(Map)
|
|
51
57
|
}}
|
|
52
58
|
function ____exports.disableInputsInit(self, mod)
|
|
53
59
|
saveDataManager(nil, FEATURE_NAME, v)
|
|
@@ -62,8 +68,21 @@ end
|
|
|
62
68
|
-- that multiple mod features can work in tandem.
|
|
63
69
|
function ____exports.enableAllInputs(self, key)
|
|
64
70
|
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
65
|
-
v.run.
|
|
66
|
-
v.run.
|
|
71
|
+
v.run.disableAllInputsWithWhitelistMap:delete(key)
|
|
72
|
+
v.run.enableAllInputsWithBlacklistMap:delete(key)
|
|
73
|
+
end
|
|
74
|
+
--- Helper function to disable specific inputs, like opening the console. (To disable all inputs, see
|
|
75
|
+
-- the `disableAllInputs` function.)
|
|
76
|
+
--
|
|
77
|
+
-- Use the `enableAllInputs` helper function to set things back to normal.
|
|
78
|
+
--
|
|
79
|
+
-- @param key The name of the mod feature that is requesting the enable/disable. This is needed so
|
|
80
|
+
-- that multiple mod features can work in tandem.
|
|
81
|
+
-- @param buttonActions An array of the actions to action.
|
|
82
|
+
function ____exports.disableInputs(self, key, buttonActions)
|
|
83
|
+
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
84
|
+
local buttonActionsSet = __TS__New(Set, buttonActions)
|
|
85
|
+
v.run.disableInputs:set(key, buttonActionsSet)
|
|
67
86
|
end
|
|
68
87
|
--- Helper function to disable all inputs. This is useful because `EntityPlayer.ControlsEnabled` can
|
|
69
88
|
-- be changed by the game under certain conditions.
|
|
@@ -74,11 +93,11 @@ end
|
|
|
74
93
|
-- that multiple mod features can work in tandem.
|
|
75
94
|
function ____exports.disableAllInputs(self, key)
|
|
76
95
|
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
77
|
-
v.run.
|
|
96
|
+
v.run.disableAllInputsWithWhitelistMap:set(
|
|
78
97
|
key,
|
|
79
98
|
__TS__New(Set)
|
|
80
99
|
)
|
|
81
|
-
v.run.
|
|
100
|
+
v.run.enableAllInputsWithBlacklistMap:delete(key)
|
|
82
101
|
end
|
|
83
102
|
--- Helper function to enable all inputs besides the ones provided. This is useful because
|
|
84
103
|
-- `EntityPlayer.ControlsEnabled` can be changed by the game under certain conditions.
|
|
@@ -90,8 +109,8 @@ end
|
|
|
90
109
|
-- @param blacklist A set of ButtonActions to disallow.
|
|
91
110
|
function ____exports.enableAllInputsExceptFor(self, key, blacklist)
|
|
92
111
|
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
93
|
-
v.run.
|
|
94
|
-
v.run.
|
|
112
|
+
v.run.disableAllInputsWithWhitelistMap:delete(key)
|
|
113
|
+
v.run.enableAllInputsWithBlacklistMap:set(key, blacklist)
|
|
95
114
|
end
|
|
96
115
|
--- Helper function to disable all inputs besides the ones provided. This is useful because
|
|
97
116
|
-- `EntityPlayer.ControlsEnabled` can be changed by the game under certain conditions.
|
|
@@ -103,8 +122,8 @@ end
|
|
|
103
122
|
-- @param whitelist A set of ButtonActions to allow.
|
|
104
123
|
function ____exports.disableAllInputsExceptFor(self, key, whitelist)
|
|
105
124
|
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
106
|
-
v.run.
|
|
107
|
-
v.run.
|
|
125
|
+
v.run.disableAllInputsWithWhitelistMap:set(key, whitelist)
|
|
126
|
+
v.run.enableAllInputsWithBlacklistMap:delete(key)
|
|
108
127
|
end
|
|
109
128
|
--- Helper function to disable only the inputs used for moving the character (or moving the cursor in
|
|
110
129
|
-- the UI). This is useful because `EntityPlayer.ControlsEnabled` can be changed by the game under
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pause.d.ts","sourceRoot":"","sources":["../../src/features/pause.ts"],"names":[],"mappings":";AAuCA,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAUxC;AA2DD;;;;;;;GAOG;AACH,wBAAgB,KAAK,IAAI,IAAI,CA8C5B;AAED,wFAAwF;AACxF,wBAAgB,OAAO,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"pause.d.ts","sourceRoot":"","sources":["../../src/features/pause.ts"],"names":[],"mappings":";AAuCA,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAUxC;AA2DD;;;;;;;GAOG;AACH,wBAAgB,KAAK,IAAI,IAAI,CA8C5B;AAED,wFAAwF;AACxF,wBAAgB,OAAO,IAAI,IAAI,CAsB9B"}
|
|
@@ -22,13 +22,22 @@ export declare function getDevilRoomDoor(): GridEntityDoor | undefined;
|
|
|
22
22
|
*/
|
|
23
23
|
export declare function getDevilRoomOrAngelRoomDoor(): GridEntityDoor | undefined;
|
|
24
24
|
/**
|
|
25
|
-
* Helper function to get the position that a player will enter a room at.
|
|
25
|
+
* Helper function to get the position that a player will enter a room at corresponding to a door.
|
|
26
26
|
*
|
|
27
27
|
* When players enter a room, they do not appear exactly on the location of the door, because then
|
|
28
28
|
* they would immediately collide with the loading zone. Instead, they appear on the grid tile next
|
|
29
29
|
* to the door.
|
|
30
30
|
*/
|
|
31
31
|
export declare function getDoorEnterPosition(door: GridEntityDoor): Readonly<Vector>;
|
|
32
|
+
/**
|
|
33
|
+
* Helper function to get the position that a player will enter a room at corresponding to a door
|
|
34
|
+
* slot.
|
|
35
|
+
*
|
|
36
|
+
* When players enter a room, they do not appear exactly on the location of the door, because then
|
|
37
|
+
* they would immediately collide with the loading zone. Instead, they appear on the grid tile next
|
|
38
|
+
* to the door.
|
|
39
|
+
*/
|
|
40
|
+
export declare function getDoorSlotEnterPosition(doorSlot: DoorSlot): Readonly<Vector>;
|
|
32
41
|
/**
|
|
33
42
|
* Helper function to get the offset from a door position that a player will enter a room at.
|
|
34
43
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doors.d.ts","sourceRoot":"","sources":["../../src/functions/doors.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,YAAY,EAIZ,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAmBtC,wBAAgB,aAAa,IAAI,IAAI,CAIpC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAKxD;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,YAAY,GAAG,QAAQ,CAG3E;AAED,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,QAAQ,CAAC,YAAY,CAAC,GACpC,QAAQ,EAAE,CAWZ;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAEjE;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAEvE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EACL,QAAQ,EAAE,GACV,SAAS,QAAQ,EAAE,GACnB,GAAG,CAAC,QAAQ,CAAC,GACb,WAAW,CAAC,QAAQ,CAAC,GACxB,QAAQ,CAAC,YAAY,CAAC,CASxB;AAED,wBAAgB,gBAAgB,IAAI,cAAc,GAAG,SAAS,CAG7D;AAED,wB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B,uBAAuB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAUrE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAU3D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAU/D;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAKpE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAM9D;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAUnD;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAMnC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAKvD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,CAK5D;AAED,+CAA+C;AAC/C,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAGrD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,KAAK,EAAE,cAAc,EAAE,GAAG,IAAI,CAI5D"}
|
package/dist/functions/doors.lua
CHANGED
|
@@ -70,13 +70,13 @@ function ____exports.getDoors(self, ...)
|
|
|
70
70
|
do
|
|
71
71
|
local door = room:GetDoor(doorSlot)
|
|
72
72
|
if door == nil then
|
|
73
|
-
goto
|
|
73
|
+
goto __continue23
|
|
74
74
|
end
|
|
75
75
|
if roomTypesSet.size == 0 or roomTypesSet:has(door.TargetRoomType) then
|
|
76
76
|
doors[#doors + 1] = door
|
|
77
77
|
end
|
|
78
78
|
end
|
|
79
|
-
::
|
|
79
|
+
::__continue23::
|
|
80
80
|
end
|
|
81
81
|
return doors
|
|
82
82
|
end
|
|
@@ -178,7 +178,7 @@ function ____exports.getDevilRoomOrAngelRoomDoor(self)
|
|
|
178
178
|
end
|
|
179
179
|
return ____temp_2
|
|
180
180
|
end
|
|
181
|
-
--- Helper function to get the position that a player will enter a room at.
|
|
181
|
+
--- Helper function to get the position that a player will enter a room at corresponding to a door.
|
|
182
182
|
--
|
|
183
183
|
-- When players enter a room, they do not appear exactly on the location of the door, because then
|
|
184
184
|
-- they would immediately collide with the loading zone. Instead, they appear on the grid tile next
|
|
@@ -187,6 +187,18 @@ function ____exports.getDoorEnterPosition(self, door)
|
|
|
187
187
|
local offset = ____exports.getDoorSlotEnterPositionOffset(nil, door.Slot)
|
|
188
188
|
return door.Position + offset
|
|
189
189
|
end
|
|
190
|
+
--- Helper function to get the position that a player will enter a room at corresponding to a door
|
|
191
|
+
-- slot.
|
|
192
|
+
--
|
|
193
|
+
-- When players enter a room, they do not appear exactly on the location of the door, because then
|
|
194
|
+
-- they would immediately collide with the loading zone. Instead, they appear on the grid tile next
|
|
195
|
+
-- to the door.
|
|
196
|
+
function ____exports.getDoorSlotEnterPosition(self, doorSlot)
|
|
197
|
+
local room = game:GetRoom()
|
|
198
|
+
local position = room:GetDoorSlotPosition(doorSlot)
|
|
199
|
+
local offset = ____exports.getDoorSlotEnterPositionOffset(nil, doorSlot)
|
|
200
|
+
return position + offset
|
|
201
|
+
end
|
|
190
202
|
--- Helper function to get the possible door slots that can exist for a given room shape.
|
|
191
203
|
function ____exports.getDoorSlotsForRoomShape(self, roomShape)
|
|
192
204
|
return ROOM_SHAPE_TO_DOOR_SLOTS[roomShape]
|
package/dist/functions/utils.lua
CHANGED
|
@@ -19,12 +19,12 @@ function hexToRGB(self, hexString)
|
|
|
19
19
|
if r == nil then
|
|
20
20
|
error(("Failed to convert `0x" .. rString) .. "` to a number.")
|
|
21
21
|
end
|
|
22
|
-
local gString = __TS__StringSubstring(hexString, 2,
|
|
22
|
+
local gString = __TS__StringSubstring(hexString, 2, 4)
|
|
23
23
|
local g = tonumber("0x" .. gString)
|
|
24
24
|
if g == nil then
|
|
25
25
|
error(("Failed to convert `0x" .. gString) .. "` to a number.")
|
|
26
26
|
end
|
|
27
|
-
local bString = __TS__StringSubstring(hexString, 4,
|
|
27
|
+
local bString = __TS__StringSubstring(hexString, 4, 6)
|
|
28
28
|
local b = tonumber("0x" .. bString)
|
|
29
29
|
if b == nil then
|
|
30
30
|
error(("Failed to convert `0x" .. bString) .. "` to a number.")
|
package/dist/index.d.ts
CHANGED
|
@@ -2839,7 +2839,7 @@ export declare function getDimension(): Dimension;
|
|
|
2839
2839
|
export declare function getDirectionName(direction: Direction): string | undefined;
|
|
2840
2840
|
|
|
2841
2841
|
/**
|
|
2842
|
-
* Helper function to get the position that a player will enter a room at.
|
|
2842
|
+
* Helper function to get the position that a player will enter a room at corresponding to a door.
|
|
2843
2843
|
*
|
|
2844
2844
|
* When players enter a room, they do not appear exactly on the location of the door, because then
|
|
2845
2845
|
* they would immediately collide with the loading zone. Instead, they appear on the grid tile next
|
|
@@ -2854,6 +2854,16 @@ export declare function getDoorEnterPosition(door: GridEntityDoor): Readonly<Vec
|
|
|
2854
2854
|
*/
|
|
2855
2855
|
export declare function getDoors(...roomTypes: RoomType[]): GridEntityDoor[];
|
|
2856
2856
|
|
|
2857
|
+
/**
|
|
2858
|
+
* Helper function to get the position that a player will enter a room at corresponding to a door
|
|
2859
|
+
* slot.
|
|
2860
|
+
*
|
|
2861
|
+
* When players enter a room, they do not appear exactly on the location of the door, because then
|
|
2862
|
+
* they would immediately collide with the loading zone. Instead, they appear on the grid tile next
|
|
2863
|
+
* to the door.
|
|
2864
|
+
*/
|
|
2865
|
+
export declare function getDoorSlotEnterPosition(doorSlot: DoorSlot): Readonly<Vector>;
|
|
2866
|
+
|
|
2857
2867
|
/**
|
|
2858
2868
|
* Helper function to get the offset from a door position that a player will enter a room at.
|
|
2859
2869
|
*
|
package/dist/lualib_bundle.lua
CHANGED
|
@@ -1207,6 +1207,16 @@ local function __TS__InstanceOfObject(value)
|
|
|
1207
1207
|
return valueType == "table" or valueType == "function"
|
|
1208
1208
|
end
|
|
1209
1209
|
|
|
1210
|
+
local function __TS__LuaIteratorSpread(self, state, firstKey)
|
|
1211
|
+
local results = {}
|
|
1212
|
+
local key, value = self(state, firstKey)
|
|
1213
|
+
while key do
|
|
1214
|
+
results[#results + 1] = {key, value}
|
|
1215
|
+
key, value = self(state, key)
|
|
1216
|
+
end
|
|
1217
|
+
return __TS__Unpack(results)
|
|
1218
|
+
end
|
|
1219
|
+
|
|
1210
1220
|
local Map
|
|
1211
1221
|
do
|
|
1212
1222
|
Map = __TS__Class()
|
|
@@ -2448,6 +2458,7 @@ return {
|
|
|
2448
2458
|
__TS__InstanceOf = __TS__InstanceOf,
|
|
2449
2459
|
__TS__InstanceOfObject = __TS__InstanceOfObject,
|
|
2450
2460
|
__TS__Iterator = __TS__Iterator,
|
|
2461
|
+
__TS__LuaIteratorSpread = __TS__LuaIteratorSpread,
|
|
2451
2462
|
Map = Map,
|
|
2452
2463
|
__TS__MathAtan2 = __TS__MathAtan2,
|
|
2453
2464
|
__TS__MathSign = __TS__MathSign,
|
package/package.json
CHANGED
|
@@ -12,10 +12,19 @@ const FEATURE_NAME = "disableInputs";
|
|
|
12
12
|
const v = {
|
|
13
13
|
run: {
|
|
14
14
|
/** Indexed by the requesting feature key. */
|
|
15
|
-
|
|
15
|
+
disableInputs: new Map<string, ReadonlySet<ButtonAction>>(),
|
|
16
16
|
|
|
17
17
|
/** Indexed by the requesting feature key. */
|
|
18
|
-
|
|
18
|
+
enableAllInputsWithBlacklistMap: new Map<
|
|
19
|
+
string,
|
|
20
|
+
ReadonlySet<ButtonAction>
|
|
21
|
+
>(),
|
|
22
|
+
|
|
23
|
+
/** Indexed by the requesting feature key. */
|
|
24
|
+
disableAllInputsWithWhitelistMap: new Map<
|
|
25
|
+
string,
|
|
26
|
+
ReadonlySet<ButtonAction>
|
|
27
|
+
>(),
|
|
19
28
|
},
|
|
20
29
|
};
|
|
21
30
|
|
|
@@ -71,13 +80,19 @@ function getActionValue(
|
|
|
71
80
|
function getReturnValue(buttonAction: ButtonAction, booleanCallback: boolean) {
|
|
72
81
|
const disableValue = booleanCallback ? false : 0;
|
|
73
82
|
|
|
74
|
-
for (const
|
|
83
|
+
for (const blacklist of v.run.disableInputs.values()) {
|
|
84
|
+
if (blacklist.has(buttonAction)) {
|
|
85
|
+
return disableValue;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
for (const whitelist of v.run.disableAllInputsWithWhitelistMap.values()) {
|
|
75
90
|
if (!whitelist.has(buttonAction)) {
|
|
76
91
|
return disableValue;
|
|
77
92
|
}
|
|
78
93
|
}
|
|
79
94
|
|
|
80
|
-
for (const blacklist of v.run.
|
|
95
|
+
for (const blacklist of v.run.enableAllInputsWithBlacklistMap.values()) {
|
|
81
96
|
if (blacklist.has(buttonAction)) {
|
|
82
97
|
return disableValue;
|
|
83
98
|
}
|
|
@@ -96,8 +111,28 @@ function getReturnValue(buttonAction: ButtonAction, booleanCallback: boolean) {
|
|
|
96
111
|
export function enableAllInputs(key: string): void {
|
|
97
112
|
errorIfFeaturesNotInitialized(FEATURE_NAME);
|
|
98
113
|
|
|
99
|
-
v.run.
|
|
100
|
-
v.run.
|
|
114
|
+
v.run.disableAllInputsWithWhitelistMap.delete(key);
|
|
115
|
+
v.run.enableAllInputsWithBlacklistMap.delete(key);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Helper function to disable specific inputs, like opening the console. (To disable all inputs, see
|
|
120
|
+
* the `disableAllInputs` function.)
|
|
121
|
+
*
|
|
122
|
+
* Use the `enableAllInputs` helper function to set things back to normal.
|
|
123
|
+
*
|
|
124
|
+
* @param key The name of the mod feature that is requesting the enable/disable. This is needed so
|
|
125
|
+
* that multiple mod features can work in tandem.
|
|
126
|
+
* @param buttonActions An array of the actions to action.
|
|
127
|
+
*/
|
|
128
|
+
export function disableInputs(
|
|
129
|
+
key: string,
|
|
130
|
+
buttonActions: ButtonAction[],
|
|
131
|
+
): void {
|
|
132
|
+
errorIfFeaturesNotInitialized(FEATURE_NAME);
|
|
133
|
+
|
|
134
|
+
const buttonActionsSet = new Set(buttonActions);
|
|
135
|
+
v.run.disableInputs.set(key, buttonActionsSet);
|
|
101
136
|
}
|
|
102
137
|
|
|
103
138
|
/**
|
|
@@ -112,8 +147,8 @@ export function enableAllInputs(key: string): void {
|
|
|
112
147
|
export function disableAllInputs(key: string): void {
|
|
113
148
|
errorIfFeaturesNotInitialized(FEATURE_NAME);
|
|
114
149
|
|
|
115
|
-
v.run.
|
|
116
|
-
v.run.
|
|
150
|
+
v.run.disableAllInputsWithWhitelistMap.set(key, new Set());
|
|
151
|
+
v.run.enableAllInputsWithBlacklistMap.delete(key);
|
|
117
152
|
}
|
|
118
153
|
|
|
119
154
|
/**
|
|
@@ -132,8 +167,8 @@ export function enableAllInputsExceptFor(
|
|
|
132
167
|
): void {
|
|
133
168
|
errorIfFeaturesNotInitialized(FEATURE_NAME);
|
|
134
169
|
|
|
135
|
-
v.run.
|
|
136
|
-
v.run.
|
|
170
|
+
v.run.disableAllInputsWithWhitelistMap.delete(key);
|
|
171
|
+
v.run.enableAllInputsWithBlacklistMap.set(key, blacklist);
|
|
137
172
|
}
|
|
138
173
|
|
|
139
174
|
/**
|
|
@@ -152,8 +187,8 @@ export function disableAllInputsExceptFor(
|
|
|
152
187
|
): void {
|
|
153
188
|
errorIfFeaturesNotInitialized(FEATURE_NAME);
|
|
154
189
|
|
|
155
|
-
v.run.
|
|
156
|
-
v.run.
|
|
190
|
+
v.run.disableAllInputsWithWhitelistMap.set(key, whitelist);
|
|
191
|
+
v.run.enableAllInputsWithBlacklistMap.delete(key);
|
|
157
192
|
}
|
|
158
193
|
|
|
159
194
|
/**
|
package/src/features/pause.ts
CHANGED
|
@@ -181,7 +181,8 @@ export function unpause(): void {
|
|
|
181
181
|
// After a vanilla pause, the tears will not resume their normal velocity and will "stick" to the
|
|
182
182
|
// air. Even if we try to help the tears along by explicitly resetting all of the velocity-related
|
|
183
183
|
// variables to their initial values, this will not make a difference. Thus, revert to removing
|
|
184
|
-
// all of the tears and projectiles in the room.
|
|
184
|
+
// all of the tears and projectiles in the room. (If a Ludovico tear is removed, it will
|
|
185
|
+
// automatically be respawned on the next frame.)
|
|
185
186
|
removeAllTears();
|
|
186
187
|
removeAllProjectiles();
|
|
187
188
|
}
|
package/src/functions/doors.ts
CHANGED
|
@@ -114,7 +114,7 @@ export function getDevilRoomOrAngelRoomDoor(): GridEntityDoor | undefined {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
|
-
* Helper function to get the position that a player will enter a room at.
|
|
117
|
+
* Helper function to get the position that a player will enter a room at corresponding to a door.
|
|
118
118
|
*
|
|
119
119
|
* When players enter a room, they do not appear exactly on the location of the door, because then
|
|
120
120
|
* they would immediately collide with the loading zone. Instead, they appear on the grid tile next
|
|
@@ -125,6 +125,21 @@ export function getDoorEnterPosition(door: GridEntityDoor): Readonly<Vector> {
|
|
|
125
125
|
return door.Position.add(offset);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
/**
|
|
129
|
+
* Helper function to get the position that a player will enter a room at corresponding to a door
|
|
130
|
+
* slot.
|
|
131
|
+
*
|
|
132
|
+
* When players enter a room, they do not appear exactly on the location of the door, because then
|
|
133
|
+
* they would immediately collide with the loading zone. Instead, they appear on the grid tile next
|
|
134
|
+
* to the door.
|
|
135
|
+
*/
|
|
136
|
+
export function getDoorSlotEnterPosition(doorSlot: DoorSlot): Readonly<Vector> {
|
|
137
|
+
const room = game.GetRoom();
|
|
138
|
+
const position = room.GetDoorSlotPosition(doorSlot);
|
|
139
|
+
const offset = getDoorSlotEnterPositionOffset(doorSlot);
|
|
140
|
+
return position.add(offset);
|
|
141
|
+
}
|
|
142
|
+
|
|
128
143
|
/**
|
|
129
144
|
* Helper function to get the offset from a door position that a player will enter a room at.
|
|
130
145
|
*
|
package/src/functions/utils.ts
CHANGED
|
@@ -82,13 +82,13 @@ function hexToRGB(hexString: string): [r: float, g: float, b: float] {
|
|
|
82
82
|
error(`Failed to convert \`0x${rString}\` to a number.`);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
const gString = hexString.substring(2,
|
|
85
|
+
const gString = hexString.substring(2, 4);
|
|
86
86
|
const g = tonumber(`0x${gString}`);
|
|
87
87
|
if (g === undefined) {
|
|
88
88
|
error(`Failed to convert \`0x${gString}\` to a number.`);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
const bString = hexString.substring(4,
|
|
91
|
+
const bString = hexString.substring(4, 6);
|
|
92
92
|
const b = tonumber(`0x${bString}`);
|
|
93
93
|
if (b === undefined) {
|
|
94
94
|
error(`Failed to convert \`0x${bString}\` to a number.`);
|