isaacscript-common 31.6.0 → 31.7.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/index.rollup.d.ts +8 -2
- package/dist/isaacscript-common.lua +16 -11
- package/dist/src/classes/DefaultMap.d.ts +2 -0
- package/dist/src/classes/DefaultMap.d.ts.map +1 -1
- package/dist/src/classes/ModUpgraded.d.ts.map +1 -1
- package/dist/src/classes/features/other/DisableInputs.d.ts.map +1 -1
- package/dist/src/classes/features/other/DisableInputs.lua +4 -6
- package/dist/src/functions/input.d.ts +2 -2
- package/dist/src/functions/input.d.ts.map +1 -1
- package/dist/src/functions/input.lua +11 -4
- package/dist/src/functions/playerDataStructures.d.ts +2 -0
- package/dist/src/functions/playerDataStructures.d.ts.map +1 -1
- package/dist/src/functions/playerDataStructures.lua +2 -0
- package/dist/src/functions/sprites.d.ts +2 -0
- package/dist/src/functions/sprites.d.ts.map +1 -1
- package/dist/src/functions/sprites.lua +2 -0
- package/package.json +1 -1
- package/src/classes/DefaultMap.ts +2 -0
- package/src/classes/ModUpgraded.ts +1 -0
- package/src/classes/features/other/DisableInputs.ts +6 -5
- package/src/functions/input.ts +12 -4
- package/src/functions/playerDataStructures.ts +2 -0
- package/src/functions/sprites.ts +2 -0
package/dist/index.rollup.d.ts
CHANGED
|
@@ -1540,6 +1540,8 @@ export declare function clearRoomDisplayFlags(roomGridIndex: int): void;
|
|
|
1540
1540
|
* This function will still work identically if PNG file does not exist, but it will cause a
|
|
1541
1541
|
* spurious error to appear in the "log.txt" file. If silencing these errors is desired, you can
|
|
1542
1542
|
* create a transparent 1 pixel PNG file in your mod's resources folder at `EMPTY_PNG_PATH`.
|
|
1543
|
+
*
|
|
1544
|
+
* @allowEmptyVariadic
|
|
1543
1545
|
*/
|
|
1544
1546
|
export declare function clearSprite(sprite: Sprite, ...layerIDs: int[]): void;
|
|
1545
1547
|
|
|
@@ -3357,6 +3359,8 @@ export declare class DefaultMap<Key, Value, Args extends unknown[] = []> extends
|
|
|
3357
3359
|
/**
|
|
3358
3360
|
* If the key exists, this will return the same thing as the normal `Map.get` method. Otherwise,
|
|
3359
3361
|
* it will set a default value for the provided key, and then return the default value.
|
|
3362
|
+
*
|
|
3363
|
+
* @allowEmptyVariadic
|
|
3360
3364
|
*/
|
|
3361
3365
|
getAndSetDefault(key: Key, ...args: Args): Value;
|
|
3362
3366
|
/**
|
|
@@ -3420,6 +3424,8 @@ export declare function defaultMapGetNPC<V, Args extends unknown[]>(map: Default
|
|
|
3420
3424
|
* player.MoveSpeed = defaultMapGetPlayer(v.run.playersSpeedBoost, player);
|
|
3421
3425
|
* }
|
|
3422
3426
|
* ```
|
|
3427
|
+
*
|
|
3428
|
+
* @allowEmptyVariadic
|
|
3423
3429
|
*/
|
|
3424
3430
|
export declare function defaultMapGetPlayer<V, Args extends unknown[]>(map: DefaultMap<PlayerIndex, V, Args>, player: EntityPlayer, ...extraArgs: Args): V;
|
|
3425
3431
|
|
|
@@ -5686,7 +5692,7 @@ export declare function getMapPartialMatch<T>(searchText: string, map: ReadonlyM
|
|
|
5686
5692
|
*/
|
|
5687
5693
|
export declare function getMatchingGridEntities(gridEntityType: GridEntityType, variant: int): GridEntity[];
|
|
5688
5694
|
|
|
5689
|
-
export declare function getMoveActions():
|
|
5695
|
+
export declare function getMoveActions(controllerIndex: ControllerIndex): ButtonAction[];
|
|
5690
5696
|
|
|
5691
5697
|
/**
|
|
5692
5698
|
* Helper function to get the corresponding music value for a stage and stage type combination.
|
|
@@ -6931,7 +6937,7 @@ export declare function getScreenTopRightPos(): Readonly<Vector>;
|
|
|
6931
6937
|
*/
|
|
6932
6938
|
export declare function getSetCombinations<T>(set: Set<T> | ReadonlySet<T>, includeEmptyArray: boolean): ReadonlyArray<ReadonlySet<T>>;
|
|
6933
6939
|
|
|
6934
|
-
export declare function getShootActions():
|
|
6940
|
+
export declare function getShootActions(controllerIndex: ControllerIndex): ButtonAction[];
|
|
6935
6941
|
|
|
6936
6942
|
/**
|
|
6937
6943
|
* Helper function to get the corresponding "Siren Helper" entity for a stolen familiar.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 31.
|
|
3
|
+
isaacscript-common 31.7.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -25735,6 +25735,7 @@ return ____exports
|
|
|
25735
25735
|
["src.functions.input"] = function(...)
|
|
25736
25736
|
local ____lualib = require("lualib_bundle")
|
|
25737
25737
|
local __TS__New = ____lualib.__TS__New
|
|
25738
|
+
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
25738
25739
|
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
25739
25740
|
local ____exports = {}
|
|
25740
25741
|
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
|
|
@@ -25771,11 +25772,17 @@ function ____exports.controllerToString(self, controller)
|
|
|
25771
25772
|
end
|
|
25772
25773
|
return trimPrefix(nil, key, "BUTTON_")
|
|
25773
25774
|
end
|
|
25774
|
-
function ____exports.getMoveActions(self)
|
|
25775
|
-
return
|
|
25775
|
+
function ____exports.getMoveActions(self, controllerIndex)
|
|
25776
|
+
return __TS__ArrayFilter(
|
|
25777
|
+
____exports.MOVEMENT_ACTIONS,
|
|
25778
|
+
function(____, buttonAction) return Input.IsActionPressed(buttonAction, controllerIndex) end
|
|
25779
|
+
)
|
|
25776
25780
|
end
|
|
25777
|
-
function ____exports.getShootActions(self)
|
|
25778
|
-
return
|
|
25781
|
+
function ____exports.getShootActions(self, controllerIndex)
|
|
25782
|
+
return __TS__ArrayFilter(
|
|
25783
|
+
____exports.SHOOTING_ACTIONS,
|
|
25784
|
+
function(____, buttonAction) return Input.IsActionPressed(buttonAction, controllerIndex) end
|
|
25785
|
+
)
|
|
25779
25786
|
end
|
|
25780
25787
|
function ____exports.isActionPressed(self, controllerIndex, ...)
|
|
25781
25788
|
local buttonActions = {...}
|
|
@@ -40900,8 +40907,8 @@ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
|
40900
40907
|
local ____decorators = require("src.decorators")
|
|
40901
40908
|
local Exported = ____decorators.Exported
|
|
40902
40909
|
local ____input = require("src.functions.input")
|
|
40903
|
-
local
|
|
40904
|
-
local
|
|
40910
|
+
local MOVEMENT_ACTIONS_SET = ____input.MOVEMENT_ACTIONS_SET
|
|
40911
|
+
local SHOOTING_ACTIONS_SET = ____input.SHOOTING_ACTIONS_SET
|
|
40905
40912
|
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
40906
40913
|
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
40907
40914
|
local ____Feature = require("src.classes.private.Feature")
|
|
@@ -40983,13 +40990,11 @@ function DisableInputs.prototype.disableAllInputsExceptFor(self, key, whitelist)
|
|
|
40983
40990
|
end
|
|
40984
40991
|
__TS__DecorateLegacy({Exported}, DisableInputs.prototype, "disableAllInputsExceptFor", true)
|
|
40985
40992
|
function DisableInputs.prototype.disableMovementInputs(self, key)
|
|
40986
|
-
|
|
40987
|
-
self:enableAllInputsExceptFor(key, moveActions)
|
|
40993
|
+
self:enableAllInputsExceptFor(key, MOVEMENT_ACTIONS_SET)
|
|
40988
40994
|
end
|
|
40989
40995
|
__TS__DecorateLegacy({Exported}, DisableInputs.prototype, "disableMovementInputs", true)
|
|
40990
40996
|
function DisableInputs.prototype.disableShootingInputs(self, key)
|
|
40991
|
-
|
|
40992
|
-
self:enableAllInputsExceptFor(key, shootActions)
|
|
40997
|
+
self:enableAllInputsExceptFor(key, SHOOTING_ACTIONS_SET)
|
|
40993
40998
|
end
|
|
40994
40999
|
__TS__DecorateLegacy({Exported}, DisableInputs.prototype, "disableShootingInputs", true)
|
|
40995
41000
|
return ____exports
|
|
@@ -88,6 +88,8 @@ export declare class DefaultMap<Key, Value, Args extends unknown[] = []> extends
|
|
|
88
88
|
/**
|
|
89
89
|
* If the key exists, this will return the same thing as the normal `Map.get` method. Otherwise,
|
|
90
90
|
* it will set a default value for the provided key, and then return the default value.
|
|
91
|
+
*
|
|
92
|
+
* @allowEmptyVariadic
|
|
91
93
|
*/
|
|
92
94
|
getAndSetDefault(key: Key, ...args: Args): Value;
|
|
93
95
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultMap.d.ts","sourceRoot":"","sources":["../../../src/classes/DefaultMap.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8EG;AACH,qBAAa,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,SAAS,OAAO,EAAE,GAAG,EAAE,CAAE,SAAQ,GAAG,CAC1E,GAAG,EACH,KAAK,CACN;IACC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAoB;IACjD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAEtB;IAEd;;;OAGG;gBAED,6BAA6B,EAAE,KAAK,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,EACnE,gBAAgB,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAqB3C
|
|
1
|
+
{"version":3,"file":"DefaultMap.d.ts","sourceRoot":"","sources":["../../../src/classes/DefaultMap.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8EG;AACH,qBAAa,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,SAAS,OAAO,EAAE,GAAG,EAAE,CAAE,SAAQ,GAAG,CAC1E,GAAG,EACH,KAAK,CACN;IACC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAoB;IACjD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAEtB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AC,IAAI,EAAE,MAAM,GAAG,IAAI;IAQnC;;;;;;OAMG;IACI,iBAAiB,CAAC,CAAC,SAAS,iBAAiB,EAClD,iBAAiB,EAAE,CAAC,EACpB,GAAG,IAAI,EAAE,2BAA2B,CAAC,CAAC,CAAC,GACtC,IAAI;IAQP;;;;OAIG;IACI,yBAAyB,CAAC,CAAC,SAAS,iBAAiB,EAC1D,iBAAiB,EAAE,CAAC,EACpB,QAAQ,EAAE,gBAAgB,GAAG,GAAG,EAChC,GAAG,IAAI,EAAE,2BAA2B,CAAC,CAAC,CAAC,GACtC,IAAI;IAQP;;;;;;;;;OASG;IACI,oBAAoB,CAAC,CAAC,SAAS,iBAAiB,EACrD,iBAAiB,EAAE,CAAC,EACpB,QAAQ,EAAE,2BAA2B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAC1C,IAAI;IAOP;;;OAGG;IACI,eAAe,IAAI,IAAI;IA0C9B;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAgEnB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAqDrB;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;CAM5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisableInputs.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/DisableInputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"DisableInputs.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/DisableInputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAQjE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AA4BhD,qBAAa,aAAc,SAAQ,OAAO;IAiCxC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAIa;IAG7C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAIW;IAG7C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAIe;IAE9C,OAAO,CAAC,cAAc;IAwBtB;;;;;OAKG;IAEI,gBAAgB,IAAI,OAAO;IAQlC;;;;;;;;;;OAUG;IAEI,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAKzC;;;;;;;;;;;;;;;OAeG;IAEI,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE,YAAY,EAAE,GAAG,IAAI;IAKzE;;;;;;;;;;;;OAYG;IAEI,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAK1C;;;;;;;;;;;;;OAaG;IAEI,wBAAwB,CAC7B,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,GACvD,IAAI;IAKP;;;;;;;;;;;;;OAaG;IAEI,yBAAyB,CAC9B,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,GACvD,IAAI;IAKP;;;;;;;;;;;;;OAaG;IAEI,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI/C;;;;;;;;;;;;OAYG;IAEI,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;CAGhD"}
|
|
@@ -12,8 +12,8 @@ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
|
12
12
|
local ____decorators = require("src.decorators")
|
|
13
13
|
local Exported = ____decorators.Exported
|
|
14
14
|
local ____input = require("src.functions.input")
|
|
15
|
-
local
|
|
16
|
-
local
|
|
15
|
+
local MOVEMENT_ACTIONS_SET = ____input.MOVEMENT_ACTIONS_SET
|
|
16
|
+
local SHOOTING_ACTIONS_SET = ____input.SHOOTING_ACTIONS_SET
|
|
17
17
|
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
18
18
|
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
19
19
|
local ____Feature = require("src.classes.private.Feature")
|
|
@@ -95,13 +95,11 @@ function DisableInputs.prototype.disableAllInputsExceptFor(self, key, whitelist)
|
|
|
95
95
|
end
|
|
96
96
|
__TS__DecorateLegacy({Exported}, DisableInputs.prototype, "disableAllInputsExceptFor", true)
|
|
97
97
|
function DisableInputs.prototype.disableMovementInputs(self, key)
|
|
98
|
-
|
|
99
|
-
self:enableAllInputsExceptFor(key, moveActions)
|
|
98
|
+
self:enableAllInputsExceptFor(key, MOVEMENT_ACTIONS_SET)
|
|
100
99
|
end
|
|
101
100
|
__TS__DecorateLegacy({Exported}, DisableInputs.prototype, "disableMovementInputs", true)
|
|
102
101
|
function DisableInputs.prototype.disableShootingInputs(self, key)
|
|
103
|
-
|
|
104
|
-
self:enableAllInputsExceptFor(key, shootActions)
|
|
102
|
+
self:enableAllInputsExceptFor(key, SHOOTING_ACTIONS_SET)
|
|
105
103
|
end
|
|
106
104
|
__TS__DecorateLegacy({Exported}, DisableInputs.prototype, "disableShootingInputs", true)
|
|
107
105
|
return ____exports
|
|
@@ -11,8 +11,8 @@ export declare const SHOOTING_ACTIONS_SET: ReadonlySet<ButtonAction>;
|
|
|
11
11
|
* Returns undefined if the submitted controller value was not valid.
|
|
12
12
|
*/
|
|
13
13
|
export declare function controllerToString(controller: Controller): string | undefined;
|
|
14
|
-
export declare function getMoveActions():
|
|
15
|
-
export declare function getShootActions():
|
|
14
|
+
export declare function getMoveActions(controllerIndex: ControllerIndex): ButtonAction[];
|
|
15
|
+
export declare function getShootActions(controllerIndex: ControllerIndex): ButtonAction[];
|
|
16
16
|
/**
|
|
17
17
|
* Helper function to check if a player is pressing a specific button (i.e. holding it down).
|
|
18
18
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/functions/input.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EACV,eAAe,EACf,QAAQ,EACT,MAAM,8BAA8B,CAA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AC/B,OAAO,CAIT;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,aAAa,EAAE,YAAY,EAAE,GAC/B,OAAO,CAIT;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,CAI9D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAEhE;AAED,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAE7E;AAED,wBAAgB,6BAA6B,IAAI,OAAO,CAIvD;AAED,wBAAgB,qBAAqB,CACnC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAET;AAED,wBAAgB,+BAA+B,IAAI,OAAO,CAIzD;AAED,wBAAgB,aAAa,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAEjE;AAED,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAET;AAED,wBAAgB,8BAA8B,IAAI,OAAO,CAIxD;AAED,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAET;AAED,wBAAgB,gCAAgC,IAAI,OAAO,CAI1D;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,OAAO,GACjB,MAAM,GAAG,SAAS,CAQpB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__New = ____lualib.__TS__New
|
|
3
|
+
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
3
4
|
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
4
5
|
local ____exports = {}
|
|
5
6
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
@@ -40,11 +41,17 @@ function ____exports.controllerToString(self, controller)
|
|
|
40
41
|
end
|
|
41
42
|
return trimPrefix(nil, key, "BUTTON_")
|
|
42
43
|
end
|
|
43
|
-
function ____exports.getMoveActions(self)
|
|
44
|
-
return
|
|
44
|
+
function ____exports.getMoveActions(self, controllerIndex)
|
|
45
|
+
return __TS__ArrayFilter(
|
|
46
|
+
____exports.MOVEMENT_ACTIONS,
|
|
47
|
+
function(____, buttonAction) return Input.IsActionPressed(buttonAction, controllerIndex) end
|
|
48
|
+
)
|
|
45
49
|
end
|
|
46
|
-
function ____exports.getShootActions(self)
|
|
47
|
-
return
|
|
50
|
+
function ____exports.getShootActions(self, controllerIndex)
|
|
51
|
+
return __TS__ArrayFilter(
|
|
52
|
+
____exports.SHOOTING_ACTIONS,
|
|
53
|
+
function(____, buttonAction) return Input.IsActionPressed(buttonAction, controllerIndex) end
|
|
54
|
+
)
|
|
48
55
|
end
|
|
49
56
|
--- Helper function to check if a player is pressing a specific button (i.e. holding it down).
|
|
50
57
|
--
|
|
@@ -18,6 +18,8 @@ import type { PlayerIndex } from "../types/PlayerIndex";
|
|
|
18
18
|
* player.MoveSpeed = defaultMapGetPlayer(v.run.playersSpeedBoost, player);
|
|
19
19
|
* }
|
|
20
20
|
* ```
|
|
21
|
+
*
|
|
22
|
+
* @allowEmptyVariadic
|
|
21
23
|
*/
|
|
22
24
|
export declare function defaultMapGetPlayer<V, Args extends unknown[]>(map: DefaultMap<PlayerIndex, V, Args>, player: EntityPlayer, ...extraArgs: Args): V;
|
|
23
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerDataStructures.d.ts","sourceRoot":"","sources":["../../../src/functions/playerDataStructures.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD
|
|
1
|
+
{"version":3,"file":"playerDataStructures.d.ts","sourceRoot":"","sources":["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GAAG,EAAE,GAAG,CAAC,WAAW,CAAC,EACrB,MAAM,EAAE,YAAY,GACnB,GAAG,CAAC,WAAW,CAAC,CAGlB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,GAAG,CAAC,WAAW,CAAC,EACrB,MAAM,EAAE,YAAY,GACnB,OAAO,CAGT;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,CAAC,WAAW,CAAC,EACrB,MAAM,EAAE,YAAY,GACnB,OAAO,CAGT"}
|
|
@@ -42,6 +42,8 @@ end
|
|
|
42
42
|
-- player.MoveSpeed = defaultMapGetPlayer(v.run.playersSpeedBoost, player);
|
|
43
43
|
-- }
|
|
44
44
|
-- ```
|
|
45
|
+
--
|
|
46
|
+
-- @allowEmptyVariadic
|
|
45
47
|
function ____exports.defaultMapGetPlayer(self, map, player, ...)
|
|
46
48
|
local playerIndex = getPlayerIndex(nil, player)
|
|
47
49
|
return map:getAndSetDefault(playerIndex, ...)
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
* This function will still work identically if PNG file does not exist, but it will cause a
|
|
19
19
|
* spurious error to appear in the "log.txt" file. If silencing these errors is desired, you can
|
|
20
20
|
* create a transparent 1 pixel PNG file in your mod's resources folder at `EMPTY_PNG_PATH`.
|
|
21
|
+
*
|
|
22
|
+
* @allowEmptyVariadic
|
|
21
23
|
*/
|
|
22
24
|
export declare function clearSprite(sprite: Sprite, ...layerIDs: int[]): void;
|
|
23
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sprites.d.ts","sourceRoot":"","sources":["../../../src/functions/sprites.ts"],"names":[],"mappings":";;;AAKA
|
|
1
|
+
{"version":3,"file":"sprites.d.ts","sourceRoot":"","sources":["../../../src/functions/sprites.ts"],"names":[],"mappings":";;;AAKA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,CAWpE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,GACjB,GAAG,CAmBL;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAepE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAInE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,GAAG,EACZ,MAAM,EAAE,GAAG,EACX,OAAO,EAAE,GAAG,EACZ,UAAU,EAAE,GAAG,EACf,MAAM,EAAE,GAAG,EACX,OAAO,EAAE,GAAG,EACZ,UAAU,EAAE,GAAG,GACd,OAAO,CAaT;AAED,uFAAuF;AACvF,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,GAAG,GACX,OAAO,CAIT"}
|
|
@@ -30,6 +30,8 @@ end
|
|
|
30
30
|
-- This function will still work identically if PNG file does not exist, but it will cause a
|
|
31
31
|
-- spurious error to appear in the "log.txt" file. If silencing these errors is desired, you can
|
|
32
32
|
-- create a transparent 1 pixel PNG file in your mod's resources folder at `EMPTY_PNG_PATH`.
|
|
33
|
+
--
|
|
34
|
+
-- @allowEmptyVariadic
|
|
33
35
|
function ____exports.clearSprite(self, sprite, ...)
|
|
34
36
|
local layerIDs = {...}
|
|
35
37
|
if #layerIDs == 0 then
|
package/package.json
CHANGED
|
@@ -118,6 +118,8 @@ export class DefaultMap<Key, Value, Args extends unknown[] = []> extends Map<
|
|
|
118
118
|
/**
|
|
119
119
|
* If the key exists, this will return the same thing as the normal `Map.get` method. Otherwise,
|
|
120
120
|
* it will set a default value for the provided key, and then return the default value.
|
|
121
|
+
*
|
|
122
|
+
* @allowEmptyVariadic
|
|
121
123
|
*/
|
|
122
124
|
public getAndSetDefault(key: Key, ...args: Args): Value {
|
|
123
125
|
const value = super.get(key);
|
|
@@ -197,6 +197,7 @@ export class ModUpgraded implements Mod {
|
|
|
197
197
|
): void {
|
|
198
198
|
const callbackClass = this.callbacks[modCallbackCustom];
|
|
199
199
|
// @ts-expect-error The compiler is not smart enough to figure out that the parameters match.
|
|
200
|
+
// eslint-disable-next-line isaacscript/require-variadic-function-argument
|
|
200
201
|
callbackClass.addSubscriber(priority, ...args);
|
|
201
202
|
this.initFeature(callbackClass);
|
|
202
203
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { ButtonAction } from "isaac-typescript-definitions";
|
|
2
2
|
import { InputHook, ModCallback } from "isaac-typescript-definitions";
|
|
3
3
|
import { Exported } from "../../../decorators";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
MOVEMENT_ACTIONS_SET,
|
|
6
|
+
SHOOTING_ACTIONS_SET,
|
|
7
|
+
} from "../../../functions/input";
|
|
5
8
|
import { ReadonlySet } from "../../../types/ReadonlySet";
|
|
6
9
|
import { Feature } from "../../private/Feature";
|
|
7
10
|
|
|
@@ -243,8 +246,7 @@ export class DisableInputs extends Feature {
|
|
|
243
246
|
*/
|
|
244
247
|
@Exported
|
|
245
248
|
public disableMovementInputs(key: string): void {
|
|
246
|
-
|
|
247
|
-
this.enableAllInputsExceptFor(key, moveActions);
|
|
249
|
+
this.enableAllInputsExceptFor(key, MOVEMENT_ACTIONS_SET);
|
|
248
250
|
}
|
|
249
251
|
|
|
250
252
|
/**
|
|
@@ -262,7 +264,6 @@ export class DisableInputs extends Feature {
|
|
|
262
264
|
*/
|
|
263
265
|
@Exported
|
|
264
266
|
public disableShootingInputs(key: string): void {
|
|
265
|
-
|
|
266
|
-
this.enableAllInputsExceptFor(key, shootActions);
|
|
267
|
+
this.enableAllInputsExceptFor(key, SHOOTING_ACTIONS_SET);
|
|
267
268
|
}
|
|
268
269
|
}
|
package/src/functions/input.ts
CHANGED
|
@@ -58,12 +58,20 @@ export function controllerToString(controller: Controller): string | undefined {
|
|
|
58
58
|
return trimPrefix(key, "BUTTON_");
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
export function getMoveActions(
|
|
62
|
-
|
|
61
|
+
export function getMoveActions(
|
|
62
|
+
controllerIndex: ControllerIndex,
|
|
63
|
+
): ButtonAction[] {
|
|
64
|
+
return MOVEMENT_ACTIONS.filter((buttonAction) =>
|
|
65
|
+
Input.IsActionPressed(buttonAction, controllerIndex),
|
|
66
|
+
);
|
|
63
67
|
}
|
|
64
68
|
|
|
65
|
-
export function getShootActions(
|
|
66
|
-
|
|
69
|
+
export function getShootActions(
|
|
70
|
+
controllerIndex: ControllerIndex,
|
|
71
|
+
): ButtonAction[] {
|
|
72
|
+
return SHOOTING_ACTIONS.filter((buttonAction) =>
|
|
73
|
+
Input.IsActionPressed(buttonAction, controllerIndex),
|
|
74
|
+
);
|
|
67
75
|
}
|
|
68
76
|
|
|
69
77
|
/**
|
|
@@ -19,6 +19,8 @@ import { getPlayerIndex } from "./playerIndex";
|
|
|
19
19
|
* player.MoveSpeed = defaultMapGetPlayer(v.run.playersSpeedBoost, player);
|
|
20
20
|
* }
|
|
21
21
|
* ```
|
|
22
|
+
*
|
|
23
|
+
* @allowEmptyVariadic
|
|
22
24
|
*/
|
|
23
25
|
export function defaultMapGetPlayer<V, Args extends unknown[]>(
|
|
24
26
|
map: DefaultMap<PlayerIndex, V, Args>,
|
package/src/functions/sprites.ts
CHANGED
|
@@ -20,6 +20,8 @@ import { eRange } from "./utils";
|
|
|
20
20
|
* This function will still work identically if PNG file does not exist, but it will cause a
|
|
21
21
|
* spurious error to appear in the "log.txt" file. If silencing these errors is desired, you can
|
|
22
22
|
* create a transparent 1 pixel PNG file in your mod's resources folder at `EMPTY_PNG_PATH`.
|
|
23
|
+
*
|
|
24
|
+
* @allowEmptyVariadic
|
|
23
25
|
*/
|
|
24
26
|
export function clearSprite(sprite: Sprite, ...layerIDs: int[]): void {
|
|
25
27
|
if (layerIDs.length === 0) {
|