isaacscript-common 21.4.0 → 21.5.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.d.ts +186 -3766
- package/dist/isaacscript-common.lua +1055 -973
- package/dist/src/classes/ModFeature.d.ts +2 -2
- package/dist/src/classes/ModFeature.d.ts.map +1 -1
- package/dist/src/classes/{ModUpgradedBase.d.ts → ModUpgraded.d.ts} +20 -32
- package/dist/src/classes/ModUpgraded.d.ts.map +1 -0
- package/dist/src/classes/{ModUpgradedBase.lua → ModUpgraded.lua} +30 -29
- package/dist/src/classes/features/other/DebugDisplay.lua +2 -2
- package/dist/src/classes/features/other/ExtraConsoleCommands.lua +2 -2
- package/dist/src/classes/features/other/extraConsoleCommands/commands.d.ts.map +1 -1
- package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +2 -1
- package/dist/src/classes/private/CustomCallback.d.ts +3 -1
- package/dist/src/classes/private/CustomCallback.d.ts.map +1 -1
- package/dist/src/classes/private/CustomCallback.lua +12 -4
- package/dist/src/core/upgradeMod.d.ts +0 -42
- package/dist/src/core/upgradeMod.d.ts.map +1 -1
- package/dist/src/core/upgradeMod.lua +46 -21
- package/dist/src/features.lua +2 -2
- package/dist/src/functions/console.d.ts +8 -0
- package/dist/src/functions/console.d.ts.map +1 -0
- package/dist/src/functions/console.lua +14 -0
- package/dist/src/functions/deepCopy.d.ts.map +1 -1
- package/dist/src/functions/deepCopy.lua +3 -2
- package/dist/src/functions/enums.d.ts +28 -0
- package/dist/src/functions/enums.d.ts.map +1 -1
- package/dist/src/functions/enums.lua +27 -0
- package/dist/src/functions/globals.lua +3 -3
- package/dist/src/functions/log.d.ts +5 -0
- package/dist/src/functions/log.d.ts.map +1 -1
- package/dist/src/functions/log.lua +6 -0
- package/dist/src/functions/mergeTests.lua +2 -2
- package/dist/src/functions/modFeatures.d.ts +1 -1
- package/dist/src/functions/modFeatures.d.ts.map +1 -1
- package/dist/src/functions/sort.d.ts +38 -0
- package/dist/src/functions/sort.d.ts.map +1 -0
- package/dist/src/functions/sort.lua +95 -0
- package/dist/src/functions/utils.d.ts +0 -54
- package/dist/src/functions/utils.d.ts.map +1 -1
- package/dist/src/functions/utils.lua +0 -91
- package/dist/src/index.d.ts +3 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +17 -1
- package/dist/src/interfaces/private/AddCallbackParametersCustom.lua +2 -2
- package/dist/src/interfaces/private/ModUpgradedInterface.d.ts +4 -2
- package/dist/src/interfaces/private/ModUpgradedInterface.d.ts.map +1 -1
- package/dist/src/types/{ModUpgraded.d.ts → private/ModUpgradedWithFeatures.d.ts} +13 -9
- package/dist/src/types/private/ModUpgradedWithFeatures.d.ts.map +1 -0
- package/dist/src/types/{ModUpgraded.lua → private/ModUpgradedWithFeatures.lua} +0 -0
- package/package.json +1 -1
- package/src/classes/ModFeature.ts +5 -5
- package/src/classes/{ModUpgradedBase.ts → ModUpgraded.ts} +33 -37
- package/src/classes/features/other/DebugDisplay.ts +1 -1
- package/src/classes/features/other/ExtraConsoleCommands.ts +1 -1
- package/src/classes/features/other/extraConsoleCommands/commands.ts +2 -1
- package/src/classes/private/CustomCallback.ts +17 -7
- package/src/core/upgradeMod.ts +55 -29
- package/src/features.ts +1 -1
- package/src/functions/console.ts +15 -0
- package/src/functions/deepCopy.ts +3 -2
- package/src/functions/enums.ts +33 -0
- package/src/functions/globals.ts +2 -2
- package/src/functions/log.ts +9 -0
- package/src/functions/mergeTests.ts +1 -1
- package/src/functions/modFeatures.ts +1 -1
- package/src/functions/sort.ts +128 -0
- package/src/functions/utils.ts +0 -124
- package/src/index.ts +3 -2
- package/src/interfaces/private/AddCallbackParametersCustom.ts +1 -1
- package/src/interfaces/private/ModUpgradedInterface.ts +4 -2
- package/src/types/{ModUpgraded.ts → private/ModUpgradedWithFeatures.ts} +13 -9
- package/dist/src/classes/ModUpgradedBase.d.ts.map +0 -1
- package/dist/src/types/ModUpgraded.d.ts.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModCallback } from "isaac-typescript-definitions";
|
|
2
2
|
import { ModCallbackCustom } from "../enums/ModCallbackCustom";
|
|
3
|
-
import {
|
|
3
|
+
import { ModUpgraded } from "./ModUpgraded";
|
|
4
4
|
export declare const MOD_FEATURE_CALLBACKS_KEY = "__callbacks";
|
|
5
5
|
export declare const MOD_FEATURE_CUSTOM_CALLBACKS_KEY = "__customCallbacks";
|
|
6
6
|
/**
|
|
@@ -62,7 +62,7 @@ export declare class ModFeature {
|
|
|
62
62
|
* argument of the constructor.
|
|
63
63
|
*/
|
|
64
64
|
initialized: boolean;
|
|
65
|
-
constructor(mod:
|
|
65
|
+
constructor(mod: ModUpgraded, init?: boolean);
|
|
66
66
|
/**
|
|
67
67
|
* Runs the `Mod.AddCallback` and `ModUpgraded.AddCallbackCustom` methods for all of the decorated
|
|
68
68
|
* callbacks.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModFeature.d.ts","sourceRoot":"","sources":["../../../src/classes/ModFeature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAS/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ModFeature.d.ts","sourceRoot":"","sources":["../../../src/classes/ModFeature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAS/D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,eAAO,MAAM,yBAAyB,gBAAgB,CAAC;AACvD,eAAO,MAAM,gCAAgC,sBAAsB,CAAC;AAyBpE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,qBAAa,UAAU;IACrB,OAAO,CAAC,GAAG,CAAc;IAEzB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,SAAS,CAAC,yBAAyB,EAC/B,CAAC,CAAC,CAAC,SAAS,OAAO,EACjB,OAAO,EAAE,CAAC,EACV,WAAW,EAAE,CAAC,SAAS,IAAI,GAAG,WAAW,GAAG,iBAAiB,EAC7D,GAAG,YAAY,EAAE,OAAO,EAAE,KACvB,OAAO,CAAC,GACb,IAAI,CAAQ;IAEhB;;;;;OAKG;IACI,WAAW,UAAS;gBAEf,GAAG,EAAE,WAAW,EAAE,IAAI,UAAO;IAQzC;;;;;OAKG;IACI,IAAI,CAAC,IAAI,UAAO,GAAG,IAAI;IAqB9B;;;;;OAKG;IACI,MAAM,IAAI,IAAI;CAGtB"}
|
|
@@ -9,10 +9,11 @@ import { AddCallbackParametersCustom } from "../interfaces/private/AddCallbackPa
|
|
|
9
9
|
*
|
|
10
10
|
* To upgrade your mod, use the `upgradeMod` helper function.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* By specifying one or more optional features when upgrading your mod, you will get a version of
|
|
13
|
+
* `ModUpgraded` that has extra methods corresponding to the features that were specified. (This
|
|
14
|
+
* corresponds to the internal-type `ModUpgradedWithFeatures` type, which extends `ModUpgraded`.)
|
|
14
15
|
*/
|
|
15
|
-
export declare class
|
|
16
|
+
export declare class ModUpgraded implements Mod {
|
|
16
17
|
Name: string;
|
|
17
18
|
/** We store a copy of the original mod object so that we can re-implement its functions. */
|
|
18
19
|
private mod;
|
|
@@ -21,42 +22,34 @@ export declare class ModUpgradedBase implements Mod {
|
|
|
21
22
|
private callbacks;
|
|
22
23
|
private features;
|
|
23
24
|
constructor(mod: Mod, debug: boolean, timeThreshold?: float);
|
|
24
|
-
/**
|
|
25
|
-
* Registers a function to be executed when an in-game event happens. For example, the
|
|
26
|
-
* `ModCallback.POST_UPDATE` event corresponds to being executed once at the end of every game
|
|
27
|
-
* logic frame.
|
|
28
|
-
*/
|
|
29
25
|
AddCallback<T extends ModCallback | string>(modCallback: T, ...args: T extends ModCallback ? AddCallbackParameters[T] : unknown[]): void;
|
|
30
26
|
AddPriorityCallback<T extends ModCallback | string>(modCallback: T, priority: CallbackPriority | int, ...args: T extends ModCallback ? AddCallbackParameters[T] : unknown[]): void;
|
|
31
|
-
/** Returns whether or not a corresponding "save#.dat" file exists for the current mod. */
|
|
32
27
|
HasData(): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Returns a string containing all of the data inside of the corresponding "save#.dat" file for
|
|
35
|
-
* this mod.
|
|
36
|
-
*/
|
|
37
28
|
LoadData(): string;
|
|
38
|
-
/**
|
|
39
|
-
* Unregisters a function that was previously registered with the `AddCallback` method.
|
|
40
|
-
*
|
|
41
|
-
* This method does not care about the tertiary argument. In other words, regardless of the
|
|
42
|
-
* conditions of how you registered the callback, it will be removed.
|
|
43
|
-
*/
|
|
44
29
|
RemoveCallback<T extends ModCallback>(modCallback: T, callback: AddCallbackParameters[T][0]): void;
|
|
45
|
-
/** Deletes the corresponding "save#.dat" file for this mod, if it exists. */
|
|
46
30
|
RemoveData(): void;
|
|
47
|
-
/**
|
|
48
|
-
* Creates or updates the corresponding "save#.dat" file for this mod with the provided string.
|
|
49
|
-
*/
|
|
50
31
|
SaveData(data: string): void;
|
|
51
32
|
/**
|
|
52
|
-
* Registers a function to be executed when an in-game event happens.
|
|
53
|
-
*
|
|
54
|
-
*
|
|
33
|
+
* Registers a function to be executed when an in-game event happens.
|
|
34
|
+
*
|
|
35
|
+
* This method is specifically for events that are provided by the IsaacScript standard library.
|
|
36
|
+
* For example, the `ModCallbackCustom.POST_BOMB_EXPLODE` event corresponds to when a bomb
|
|
37
|
+
* explodes.
|
|
55
38
|
*/
|
|
56
39
|
AddCallbackCustom<T extends ModCallbackCustom>(modCallbackCustom: T, ...args: AddCallbackParametersCustom[T]): void;
|
|
40
|
+
/**
|
|
41
|
+
* The same as the `ModUpgraded.AddCallbackCustom` method, but allows setting a custom priority.
|
|
42
|
+
* By default, callbacks are added with a priority of 0, so this allows you to add early or late
|
|
43
|
+
* callbacks as necessary. See the `CallbackPriority` enum.
|
|
44
|
+
*/
|
|
45
|
+
AddPriorityCallbackCustom<T extends ModCallbackCustom>(modCallbackCustom: T, priority: CallbackPriority | int, ...args: AddCallbackParametersCustom[T]): void;
|
|
57
46
|
/**
|
|
58
47
|
* Unregisters a function that was previously registered with the `AddCallbackCustom` method.
|
|
59
48
|
*
|
|
49
|
+
* This method is specifically for events that are provided by the IsaacScript standard library.
|
|
50
|
+
* For example, the `ModCallbackCustom.POST_BOMB_EXPLODE` event corresponds to when a bomb
|
|
51
|
+
* explodes.
|
|
52
|
+
*
|
|
60
53
|
* This method does not care about the tertiary argument. In other words, regardless of the
|
|
61
54
|
* conditions of how you registered the callback, it will be removed.
|
|
62
55
|
*/
|
|
@@ -84,10 +77,5 @@ export declare class ModUpgradedBase implements Mod {
|
|
|
84
77
|
* don't have access to it.
|
|
85
78
|
*/
|
|
86
79
|
private initOptionalFeature;
|
|
87
|
-
/**
|
|
88
|
-
* This is mostly the same as the `AddCustomCallback` method, but we initialize the custom
|
|
89
|
-
* callback without actually registering a subscription.
|
|
90
|
-
*/
|
|
91
|
-
private initCustomCallbackEarly;
|
|
92
80
|
}
|
|
93
|
-
//# sourceMappingURL=
|
|
81
|
+
//# sourceMappingURL=ModUpgraded.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModUpgraded.d.ts","sourceRoot":"","sources":["../../../src/classes/ModUpgraded.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAIhG,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAQ/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AAMhG;;;;;;;;;;GAUG;AACH,qBAAa,WAAY,YAAW,GAAG;IAK9B,IAAI,EAAE,MAAM,CAAC;IA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tC,IAAI;IAOP;;;;;;;;;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;IAsDrB;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;CAM5B"}
|
|
@@ -55,12 +55,13 @@ end
|
|
|
55
55
|
--
|
|
56
56
|
-- To upgrade your mod, use the `upgradeMod` helper function.
|
|
57
57
|
--
|
|
58
|
-
--
|
|
59
|
-
--
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
-- By specifying one or more optional features when upgrading your mod, you will get a version of
|
|
59
|
+
-- `ModUpgraded` that has extra methods corresponding to the features that were specified. (This
|
|
60
|
+
-- corresponds to the internal-type `ModUpgradedWithFeatures` type, which extends `ModUpgraded`.)
|
|
61
|
+
____exports.ModUpgraded = __TS__Class()
|
|
62
|
+
local ModUpgraded = ____exports.ModUpgraded
|
|
63
|
+
ModUpgraded.name = "ModUpgraded"
|
|
64
|
+
function ModUpgraded.prototype.____constructor(self, mod, ____debug, timeThreshold)
|
|
64
65
|
self.Name = mod.Name
|
|
65
66
|
self.mod = mod
|
|
66
67
|
self.debug = ____debug
|
|
@@ -68,10 +69,10 @@ function ModUpgradedBase.prototype.____constructor(self, mod, ____debug, timeThr
|
|
|
68
69
|
self.callbacks = getCallbacks(nil)
|
|
69
70
|
self.features = getFeatures(nil, self, self.callbacks)
|
|
70
71
|
end
|
|
71
|
-
function
|
|
72
|
+
function ModUpgraded.prototype.AddCallback(self, modCallback, ...)
|
|
72
73
|
self:AddPriorityCallback(modCallback, CallbackPriority.DEFAULT, ...)
|
|
73
74
|
end
|
|
74
|
-
function
|
|
75
|
+
function ModUpgraded.prototype.AddPriorityCallback(self, modCallback, priority, ...)
|
|
75
76
|
local args = {...}
|
|
76
77
|
if self.debug then
|
|
77
78
|
local callback = args[1]
|
|
@@ -109,38 +110,41 @@ function ModUpgradedBase.prototype.AddPriorityCallback(self, modCallback, priori
|
|
|
109
110
|
)
|
|
110
111
|
end
|
|
111
112
|
end
|
|
112
|
-
function
|
|
113
|
+
function ModUpgraded.prototype.HasData(self)
|
|
113
114
|
return self.mod:HasData()
|
|
114
115
|
end
|
|
115
|
-
function
|
|
116
|
+
function ModUpgraded.prototype.LoadData(self)
|
|
116
117
|
return self.mod:LoadData()
|
|
117
118
|
end
|
|
118
|
-
function
|
|
119
|
+
function ModUpgraded.prototype.RemoveCallback(self, modCallback, callback)
|
|
119
120
|
self.mod:RemoveCallback(modCallback, callback)
|
|
120
121
|
end
|
|
121
|
-
function
|
|
122
|
+
function ModUpgraded.prototype.RemoveData(self)
|
|
122
123
|
self.mod:RemoveData()
|
|
123
124
|
end
|
|
124
|
-
function
|
|
125
|
+
function ModUpgraded.prototype.SaveData(self, data)
|
|
125
126
|
self.mod:SaveData(data)
|
|
126
127
|
end
|
|
127
|
-
function
|
|
128
|
+
function ModUpgraded.prototype.AddCallbackCustom(self, modCallbackCustom, ...)
|
|
129
|
+
self:AddPriorityCallbackCustom(modCallbackCustom, CallbackPriority.DEFAULT, ...)
|
|
130
|
+
end
|
|
131
|
+
function ModUpgraded.prototype.AddPriorityCallbackCustom(self, modCallbackCustom, priority, ...)
|
|
128
132
|
local callbackClass = self.callbacks[modCallbackCustom]
|
|
129
|
-
callbackClass:addSubscriber(...)
|
|
133
|
+
callbackClass:addSubscriber(priority, ...)
|
|
130
134
|
self:initFeature(callbackClass)
|
|
131
135
|
end
|
|
132
|
-
function
|
|
136
|
+
function ModUpgraded.prototype.RemoveCallbackCustom(self, modCallbackCustom, callback)
|
|
133
137
|
local callbackClass = self.callbacks[modCallbackCustom]
|
|
134
138
|
callbackClass:removeSubscriber(callback)
|
|
135
139
|
self:uninitFeature(callbackClass)
|
|
136
140
|
end
|
|
137
|
-
function
|
|
141
|
+
function ModUpgraded.prototype.logUsedFeatures(self)
|
|
138
142
|
for ____, ____value in ipairs(__TS__ObjectEntries(self.callbacks)) do
|
|
139
143
|
local modCallbackCustomString = ____value[1]
|
|
140
144
|
local callbackClass = ____value[2]
|
|
141
145
|
do
|
|
142
146
|
if callbackClass.numConsumers == 0 then
|
|
143
|
-
goto
|
|
147
|
+
goto __continue19
|
|
144
148
|
end
|
|
145
149
|
local modCallbackCustom = tonumber(modCallbackCustomString)
|
|
146
150
|
if modCallbackCustom == nil then
|
|
@@ -148,14 +152,14 @@ function ModUpgradedBase.prototype.logUsedFeatures(self)
|
|
|
148
152
|
end
|
|
149
153
|
log(((("- ModCallbackCustom." .. tostring(ModCallbackCustom[modCallbackCustom])) .. " (") .. tostring(modCallbackCustom)) .. ")")
|
|
150
154
|
end
|
|
151
|
-
::
|
|
155
|
+
::__continue19::
|
|
152
156
|
end
|
|
153
157
|
for ____, ____value in ipairs(__TS__ObjectEntries(self.features)) do
|
|
154
158
|
local iscFeatureString = ____value[1]
|
|
155
159
|
local featureClass = ____value[2]
|
|
156
160
|
do
|
|
157
161
|
if featureClass.numConsumers == 0 then
|
|
158
|
-
goto
|
|
162
|
+
goto __continue23
|
|
159
163
|
end
|
|
160
164
|
local iscFeature = tonumber(iscFeatureString)
|
|
161
165
|
if iscFeature == nil then
|
|
@@ -163,10 +167,10 @@ function ModUpgradedBase.prototype.logUsedFeatures(self)
|
|
|
163
167
|
end
|
|
164
168
|
log(((("- ISCFeature." .. tostring(ISCFeature[iscFeature])) .. " (") .. tostring(iscFeature)) .. ")")
|
|
165
169
|
end
|
|
166
|
-
::
|
|
170
|
+
::__continue23::
|
|
167
171
|
end
|
|
168
172
|
end
|
|
169
|
-
function
|
|
173
|
+
function ModUpgraded.prototype.initFeature(self, feature)
|
|
170
174
|
feature.numConsumers = feature.numConsumers + 1
|
|
171
175
|
if feature.initialized then
|
|
172
176
|
return
|
|
@@ -189,8 +193,9 @@ function ModUpgradedBase.prototype.initFeature(self, feature)
|
|
|
189
193
|
if feature.callbacksUsed ~= nil then
|
|
190
194
|
for ____, callbackTuple in ipairs(feature.callbacksUsed) do
|
|
191
195
|
local modCallback, callbackFunc, optionalArgs = table.unpack(callbackTuple)
|
|
192
|
-
self:
|
|
196
|
+
self:AddPriorityCallback(
|
|
193
197
|
modCallback,
|
|
198
|
+
CallbackPriority.IMPORTANT,
|
|
194
199
|
callbackFunc,
|
|
195
200
|
table.unpack(optionalArgs or ({}))
|
|
196
201
|
)
|
|
@@ -215,7 +220,7 @@ function ModUpgradedBase.prototype.initFeature(self, feature)
|
|
|
215
220
|
saveDataManagerClass:saveDataManager(className, feature.v, feature.vConditionalFunc)
|
|
216
221
|
end
|
|
217
222
|
end
|
|
218
|
-
function
|
|
223
|
+
function ModUpgraded.prototype.uninitFeature(self, feature)
|
|
219
224
|
if feature.numConsumers <= 0 then
|
|
220
225
|
local className = getTSTLClassName(nil, feature) or "unknown"
|
|
221
226
|
error(((("Failed to uninit feature \"" .. className) .. "\" since it has ") .. tostring(feature.numConsumers)) .. " consumers, which should never happen.")
|
|
@@ -256,13 +261,9 @@ function ModUpgradedBase.prototype.uninitFeature(self, feature)
|
|
|
256
261
|
saveDataManagerClass:saveDataManagerRemove(className)
|
|
257
262
|
end
|
|
258
263
|
end
|
|
259
|
-
function
|
|
264
|
+
function ModUpgraded.prototype.initOptionalFeature(self, feature)
|
|
260
265
|
local featureClass = self.features[feature]
|
|
261
266
|
self:initFeature(featureClass)
|
|
262
267
|
return getExportedMethodsFromFeature(nil, featureClass)
|
|
263
268
|
end
|
|
264
|
-
function ModUpgradedBase.prototype.initCustomCallbackEarly(self, modCallbackCustom)
|
|
265
|
-
local callbackClass = self.callbacks[modCallbackCustom]
|
|
266
|
-
self:initFeature(callbackClass)
|
|
267
|
-
end
|
|
268
269
|
return ____exports
|
|
@@ -6,8 +6,8 @@ local __TS__Decorate = ____lualib.__TS__Decorate
|
|
|
6
6
|
local ____exports = {}
|
|
7
7
|
local ____decorators = require("src.decorators")
|
|
8
8
|
local Exported = ____decorators.Exported
|
|
9
|
-
local
|
|
10
|
-
local printEnabled =
|
|
9
|
+
local ____console = require("src.functions.console")
|
|
10
|
+
local printEnabled = ____console.printEnabled
|
|
11
11
|
local ____Feature = require("src.classes.private.Feature")
|
|
12
12
|
local Feature = ____Feature.Feature
|
|
13
13
|
local ____DebugDisplayBomb = require("src.classes.features.other.debugDisplay.DebugDisplayBomb")
|
|
@@ -16,13 +16,13 @@ local ____decorators = require("src.decorators")
|
|
|
16
16
|
local Exported = ____decorators.Exported
|
|
17
17
|
local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
|
|
18
18
|
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
19
|
+
local ____console = require("src.functions.console")
|
|
20
|
+
local isVanillaConsoleCommand = ____console.isVanillaConsoleCommand
|
|
19
21
|
local ____flag = require("src.functions.flag")
|
|
20
22
|
local addFlag = ____flag.addFlag
|
|
21
23
|
local bitFlags = ____flag.bitFlags
|
|
22
24
|
local ____map = require("src.functions.map")
|
|
23
25
|
local getMapPartialMatch = ____map.getMapPartialMatch
|
|
24
|
-
local ____utils = require("src.functions.utils")
|
|
25
|
-
local isVanillaConsoleCommand = ____utils.isVanillaConsoleCommand
|
|
26
26
|
local ____Feature = require("src.classes.private.Feature")
|
|
27
27
|
local Feature = ____Feature.Feature
|
|
28
28
|
local commands = require("src.classes.features.other.extraConsoleCommands.commands")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../../../src/classes/features/other/extraConsoleCommands/commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../../../src/classes/features/other/extraConsoleCommands/commands.ts"],"names":[],"mappings":"AAwIA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,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BAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAkB1C;AAED,wCAAwC;AACxC,wBAAgB,KAAK,IAAI,IAAI,CAE5B;AAED,6CAA6C;AAC7C,wBAAgB,QAAQ,IAAI,IAAI,CAE/B;AAED,qDAAqD;AACrD,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED,yDAAyD;AACzD,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,8CAA8C;AAC9C,wBAAgB,OAAO,IAAI,IAAI,CAG9B;AAED,sFAAsF;AACtF,wBAAgB,MAAM,IAAI,IAAI,CAQ7B;AAED,wFAAwF;AACxF,wBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA0BzC"}
|
|
@@ -48,6 +48,8 @@ local addCharge = ____charge.addCharge
|
|
|
48
48
|
local getTotalCharge = ____charge.getTotalCharge
|
|
49
49
|
local ____collectibles = require("src.functions.collectibles")
|
|
50
50
|
local isValidCollectibleType = ____collectibles.isValidCollectibleType
|
|
51
|
+
local ____console = require("src.functions.console")
|
|
52
|
+
local printEnabled = ____console.printEnabled
|
|
51
53
|
local ____deepCopyTests = require("src.functions.deepCopyTests")
|
|
52
54
|
local runDeepCopyTests = ____deepCopyTests.runDeepCopyTests
|
|
53
55
|
local ____entitiesSpecific = require("src.functions.entitiesSpecific")
|
|
@@ -103,7 +105,6 @@ local asCollectibleType = ____types.asCollectibleType
|
|
|
103
105
|
local asTrinketType = ____types.asTrinketType
|
|
104
106
|
local ____utils = require("src.functions.utils")
|
|
105
107
|
local iRange = ____utils.iRange
|
|
106
|
-
local printEnabled = ____utils.printEnabled
|
|
107
108
|
local ____cardNameToTypeMap = require("src.maps.cardNameToTypeMap")
|
|
108
109
|
local CARD_NAME_TO_TYPE_MAP = ____cardNameToTypeMap.CARD_NAME_TO_TYPE_MAP
|
|
109
110
|
local ____characterNameToTypeMap = require("src.maps.characterNameToTypeMap")
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
import { CallbackPriority } from "isaac-typescript-definitions/dist/src/enums/CallbackPriority";
|
|
1
3
|
import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
|
|
2
4
|
import { AddCallbackParametersCustom } from "../../interfaces/private/AddCallbackParametersCustom";
|
|
3
5
|
import { AllButFirst } from "../../types/AllButFirst";
|
|
@@ -10,7 +12,7 @@ export type OptionalArgs<T extends ModCallbackCustom> = AllButFirst<AddCallbackP
|
|
|
10
12
|
*/
|
|
11
13
|
export declare abstract class CustomCallback<T extends ModCallbackCustom> extends Feature {
|
|
12
14
|
private subscriptions;
|
|
13
|
-
addSubscriber(callbackFunc: AddCallbackParametersCustom[T][0], ...optionalArgs: AllButFirst<AddCallbackParametersCustom[T]>): void;
|
|
15
|
+
addSubscriber(priority: CallbackPriority | int, callbackFunc: AddCallbackParametersCustom[T][0], ...optionalArgs: AllButFirst<AddCallbackParametersCustom[T]>): void;
|
|
14
16
|
/**
|
|
15
17
|
* If the submitted function does not match any of the existing subscriptions, this method will do
|
|
16
18
|
* nothing.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomCallback.d.ts","sourceRoot":"","sources":["../../../../src/classes/private/CustomCallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomCallback.d.ts","sourceRoot":"","sources":["../../../../src/classes/private/CustomCallback.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sDAAsD,CAAC;AACnG,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,iBAAiB,IAAI,UAAU,CAC5D,2BAA2B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAClC,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,iBAAiB,IAAI,WAAW,CACjE,2BAA2B,CAAC,CAAC,CAAC,CAC/B,CAAC;AAQF;;;GAGG;AACH,8BAAsB,cAAc,CAClC,CAAC,SAAS,iBAAiB,CAC3B,SAAQ,OAAO;IACf,OAAO,CAAC,aAAa,CAA8B;IAE5C,aAAa,CAClB,QAAQ,EAAE,gBAAgB,GAAG,GAAG,EAChC,YAAY,EAAE,2BAA2B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC/C,GAAG,YAAY,EAAE,WAAW,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC,GAC3D,IAAI;IAUP;;;OAGG;IACI,gBAAgB,CAAC,QAAQ,EAAE,2BAA2B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;IAYnE,IAAI,gBACI,SAAS,CAAC,CAAC,KACvB,WAAW,2BAA2B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAc9C;IAEF;;;OAGG;IAEH,SAAS,CAAC,UAAU,EAAE,CACpB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EACrB,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,KAC1B,OAAO,CAAc;CAC3B"}
|
|
@@ -2,9 +2,12 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local __TS__Class = ____lualib.__TS__Class
|
|
3
3
|
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
4
4
|
local __TS__Spread = ____lualib.__TS__Spread
|
|
5
|
+
local __TS__ArraySort = ____lualib.__TS__ArraySort
|
|
5
6
|
local __TS__ArrayFindIndex = ____lualib.__TS__ArrayFindIndex
|
|
6
7
|
local __TS__ArraySplice = ____lualib.__TS__ArraySplice
|
|
7
8
|
local ____exports = {}
|
|
9
|
+
local ____sort = require("src.functions.sort")
|
|
10
|
+
local sortObjectArrayByKey = ____sort.sortObjectArrayByKey
|
|
8
11
|
local ____Feature = require("src.classes.private.Feature")
|
|
9
12
|
local Feature = ____Feature.Feature
|
|
10
13
|
--- The base class for a custom callback. Individual custom callbacks (and validation callbacks) will
|
|
@@ -19,7 +22,8 @@ function CustomCallback.prototype.____constructor(self, ...)
|
|
|
19
22
|
self.fire = function(____, ...)
|
|
20
23
|
local fireArgs = {...}
|
|
21
24
|
for ____, subscription in ipairs(self.subscriptions) do
|
|
22
|
-
local callbackFunc
|
|
25
|
+
local callbackFunc = subscription.callbackFunc
|
|
26
|
+
local optionalArgs = subscription.optionalArgs
|
|
23
27
|
if self:shouldFire(fireArgs, optionalArgs) then
|
|
24
28
|
local value = callbackFunc(
|
|
25
29
|
nil,
|
|
@@ -34,17 +38,21 @@ function CustomCallback.prototype.____constructor(self, ...)
|
|
|
34
38
|
end
|
|
35
39
|
self.shouldFire = function() return true end
|
|
36
40
|
end
|
|
37
|
-
function CustomCallback.prototype.addSubscriber(self, callbackFunc, ...)
|
|
41
|
+
function CustomCallback.prototype.addSubscriber(self, priority, callbackFunc, ...)
|
|
38
42
|
local optionalArgs = {...}
|
|
39
|
-
local subscription = {callbackFunc, optionalArgs}
|
|
43
|
+
local subscription = {priority = priority, callbackFunc = callbackFunc, optionalArgs = optionalArgs}
|
|
40
44
|
local ____self_subscriptions_0 = self.subscriptions
|
|
41
45
|
____self_subscriptions_0[#____self_subscriptions_0 + 1] = subscription
|
|
46
|
+
__TS__ArraySort(
|
|
47
|
+
self.subscriptions,
|
|
48
|
+
sortObjectArrayByKey(nil, "priority")
|
|
49
|
+
)
|
|
42
50
|
end
|
|
43
51
|
function CustomCallback.prototype.removeSubscriber(self, callback)
|
|
44
52
|
local subscriptionIndexMatchingCallback = __TS__ArrayFindIndex(
|
|
45
53
|
self.subscriptions,
|
|
46
54
|
function(____, subscription)
|
|
47
|
-
local subscriptionCallback = subscription
|
|
55
|
+
local subscriptionCallback = subscription.callbackFunc
|
|
48
56
|
return callback == subscriptionCallback
|
|
49
57
|
end
|
|
50
58
|
)
|
|
@@ -1,44 +1,2 @@
|
|
|
1
|
-
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
-
/// <reference types="isaac-typescript-definitions" />
|
|
3
|
-
import { ISCFeature } from "../enums/ISCFeature";
|
|
4
|
-
import { ModCallbackCustom } from "../enums/ModCallbackCustom";
|
|
5
|
-
import { ModUpgraded } from "../types/ModUpgraded";
|
|
6
|
-
type ISCFeatureTuple<T extends readonly ISCFeature[]> = ISCFeature extends T["length"] ? 'The list of features must be a tuple. Use the "as const" assertion when declaring the array.' : T;
|
|
7
|
-
/**
|
|
8
|
-
* Use this function to enable the custom callbacks and other optional features provided by
|
|
9
|
-
* `isaacscript-common`.
|
|
10
|
-
*
|
|
11
|
-
* For example:
|
|
12
|
-
*
|
|
13
|
-
* ```ts
|
|
14
|
-
* const modVanilla = RegisterMod("My Mod", 1);
|
|
15
|
-
* const mod = upgradeMod(modVanilla);
|
|
16
|
-
*
|
|
17
|
-
* // Subscribe to vanilla callbacks.
|
|
18
|
-
* mod.AddCallback(ModCallback.POST_UPDATE, postUpdate);
|
|
19
|
-
*
|
|
20
|
-
* // Subscribe to custom callbacks.
|
|
21
|
-
* mod.AddCallbackCustom(ModCallbackCustom.POST_ITEM_PICKUP, postItemPickup);
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* @param modVanilla The mod object returned by the `RegisterMod` function.
|
|
25
|
-
* @param features Optional. An array containing the optional standard library features that you
|
|
26
|
-
* want to enable, if any. Default is an empty array.
|
|
27
|
-
* @param customCallbacksUsed Optional. An array containing the custom callbacks that you will be
|
|
28
|
-
* subscribing to after you upgrade your mod. Specifying this will
|
|
29
|
-
* immediately initialize the callbacks (as opposed to lazy-initializing
|
|
30
|
-
* them when you first subscribe to the callback). This is only necessary
|
|
31
|
-
* if you the order of callback firing is important for your mod. (For
|
|
32
|
-
* example, you may want the `POST_NEW_ROOM` part of the
|
|
33
|
-
* `POST_GRID_ENTITY_INIT` callback to fire before your own
|
|
34
|
-
* `POST_NEW_ROOM` callbacks.)
|
|
35
|
-
* @param debug Optional. Whether to log additional output when a callback is fired. Default is
|
|
36
|
-
* false.
|
|
37
|
-
* @param timeThreshold Optional. If provided, will only log callbacks that take longer than the
|
|
38
|
-
* specified number of seconds (if the "--luadebug" launch flag is turned on)
|
|
39
|
-
* or milliseconds (if the "--luadebug" launch flag is turned off).
|
|
40
|
-
* @returns The upgraded mod object.
|
|
41
|
-
*/
|
|
42
|
-
export declare function upgradeMod<T extends readonly ISCFeature[] = never[]>(modVanilla: Mod, features?: ISCFeatureTuple<T>, customCallbacksUsed?: ModCallbackCustom[] | readonly ModCallbackCustom[], debug?: boolean, timeThreshold?: float): ModUpgraded<T>;
|
|
43
1
|
export {};
|
|
44
2
|
//# sourceMappingURL=upgradeMod.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgradeMod.d.ts","sourceRoot":"","sources":["../../../src/core/upgradeMod.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upgradeMod.d.ts","sourceRoot":"","sources":["../../../src/core/upgradeMod.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
-
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
3
2
|
local __TS__New = ____lualib.__TS__New
|
|
3
|
+
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
4
4
|
local ____exports = {}
|
|
5
|
-
local initOptionalFeatures
|
|
6
|
-
local
|
|
7
|
-
local
|
|
5
|
+
local initOptionalFeatures
|
|
6
|
+
local ____ModUpgraded = require("src.classes.ModUpgraded")
|
|
7
|
+
local ModUpgraded = ____ModUpgraded.ModUpgraded
|
|
8
8
|
local ____patchErrorFunctions = require("src.patchErrorFunctions")
|
|
9
9
|
local patchErrorFunction = ____patchErrorFunctions.patchErrorFunction
|
|
10
10
|
local ____shaderCrashFix = require("src.shaderCrashFix")
|
|
@@ -20,10 +20,46 @@ function initOptionalFeatures(self, mod, features)
|
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
--- Use this function to enable the custom callbacks and other optional features provided by
|
|
24
|
+
-- `isaacscript-common`.
|
|
25
|
+
--
|
|
26
|
+
-- For example:
|
|
27
|
+
--
|
|
28
|
+
-- ```ts
|
|
29
|
+
-- const modVanilla = RegisterMod("My Mod", 1);
|
|
30
|
+
-- const mod = upgradeMod(modVanilla);
|
|
31
|
+
--
|
|
32
|
+
-- // Subscribe to vanilla callbacks.
|
|
33
|
+
-- mod.AddCallback(ModCallback.POST_UPDATE, postUpdate);
|
|
34
|
+
--
|
|
35
|
+
-- // Subscribe to custom callbacks.
|
|
36
|
+
-- mod.AddCallbackCustom(ModCallbackCustom.POST_ITEM_PICKUP, postItemPickup);
|
|
37
|
+
-- ```
|
|
38
|
+
--
|
|
39
|
+
-- @param modVanilla The mod object returned by the `RegisterMod` function.
|
|
40
|
+
-- @param features Optional. An array containing the optional standard library features that you
|
|
41
|
+
-- want to enable, if any. Default is an empty array.
|
|
42
|
+
-- @param debug Optional. Whether to log additional output when a callback is fired. Default is
|
|
43
|
+
-- false.
|
|
44
|
+
-- @param timeThreshold Optional. If provided, will only log callbacks that take longer than the
|
|
45
|
+
-- specified number of seconds (if the "--luadebug" launch flag is turned on)
|
|
46
|
+
-- or milliseconds (if the "--luadebug" launch flag is turned off).
|
|
47
|
+
-- @returns The upgraded mod object.
|
|
48
|
+
-- @notExported
|
|
49
|
+
-- @rename upgradeMod
|
|
50
|
+
local function upgradeModDocumentation(self, modVanilla, features, ____debug, timeThreshold)
|
|
51
|
+
if features == nil then
|
|
52
|
+
features = {}
|
|
26
53
|
end
|
|
54
|
+
if ____debug == nil then
|
|
55
|
+
____debug = false
|
|
56
|
+
end
|
|
57
|
+
print(modVanilla)
|
|
58
|
+
print(features)
|
|
59
|
+
print(____debug)
|
|
60
|
+
print(timeThreshold)
|
|
61
|
+
local mod = RegisterMod("", 1)
|
|
62
|
+
return __TS__New(ModUpgraded, mod, false)
|
|
27
63
|
end
|
|
28
64
|
--- Use this function to enable the custom callbacks and other optional features provided by
|
|
29
65
|
-- `isaacscript-common`.
|
|
@@ -44,27 +80,17 @@ end
|
|
|
44
80
|
-- @param modVanilla The mod object returned by the `RegisterMod` function.
|
|
45
81
|
-- @param features Optional. An array containing the optional standard library features that you
|
|
46
82
|
-- want to enable, if any. Default is an empty array.
|
|
47
|
-
-- @param customCallbacksUsed Optional. An array containing the custom callbacks that you will be
|
|
48
|
-
-- subscribing to after you upgrade your mod. Specifying this will
|
|
49
|
-
-- immediately initialize the callbacks (as opposed to lazy-initializing
|
|
50
|
-
-- them when you first subscribe to the callback). This is only necessary
|
|
51
|
-
-- if you the order of callback firing is important for your mod. (For
|
|
52
|
-
-- example, you may want the `POST_NEW_ROOM` part of the
|
|
53
|
-
-- `POST_GRID_ENTITY_INIT` callback to fire before your own
|
|
54
|
-
-- `POST_NEW_ROOM` callbacks.)
|
|
55
83
|
-- @param debug Optional. Whether to log additional output when a callback is fired. Default is
|
|
56
84
|
-- false.
|
|
57
85
|
-- @param timeThreshold Optional. If provided, will only log callbacks that take longer than the
|
|
58
86
|
-- specified number of seconds (if the "--luadebug" launch flag is turned on)
|
|
59
87
|
-- or milliseconds (if the "--luadebug" launch flag is turned off).
|
|
60
88
|
-- @returns The upgraded mod object.
|
|
61
|
-
|
|
89
|
+
-- @internal
|
|
90
|
+
function ____exports.upgradeMod(self, modVanilla, features, ____debug, timeThreshold)
|
|
62
91
|
if features == nil then
|
|
63
92
|
features = {}
|
|
64
93
|
end
|
|
65
|
-
if customCallbacksUsed == nil then
|
|
66
|
-
customCallbacksUsed = {}
|
|
67
|
-
end
|
|
68
94
|
if ____debug == nil then
|
|
69
95
|
____debug = false
|
|
70
96
|
end
|
|
@@ -75,10 +101,9 @@ function ____exports.upgradeMod(self, modVanilla, features, customCallbacksUsed,
|
|
|
75
101
|
end
|
|
76
102
|
end
|
|
77
103
|
patchErrorFunction(nil)
|
|
78
|
-
local mod = __TS__New(
|
|
104
|
+
local mod = __TS__New(ModUpgraded, modVanilla, ____debug, timeThreshold)
|
|
79
105
|
applyShaderCrashFix(nil, mod)
|
|
80
106
|
initOptionalFeatures(nil, mod, features)
|
|
81
|
-
initCallbacksEarly(nil, mod, customCallbacksUsed)
|
|
82
107
|
return mod
|
|
83
108
|
end
|
|
84
109
|
return ____exports
|
package/dist/src/features.lua
CHANGED
|
@@ -113,8 +113,8 @@ local ____ISCFeature = require("src.enums.ISCFeature")
|
|
|
113
113
|
local ISCFeature = ____ISCFeature.ISCFeature
|
|
114
114
|
local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
|
|
115
115
|
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
116
|
-
local
|
|
117
|
-
local validateInterfaceMatchesEnum =
|
|
116
|
+
local ____enums = require("src.functions.enums")
|
|
117
|
+
local validateInterfaceMatchesEnum = ____enums.validateInterfaceMatchesEnum
|
|
118
118
|
validateInterfaceMatchesEnum(nil)
|
|
119
119
|
function ____exports.getFeatures(self, mod, callbacks)
|
|
120
120
|
local gameReorderedCallbacks = __TS__New(
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper function to see if a particular command is a vanilla console command. This is useful
|
|
3
|
+
* because the `EXECUTE_CMD` callback will not fire for any vanilla commands.
|
|
4
|
+
*/
|
|
5
|
+
export declare function isVanillaConsoleCommand(commandName: string): boolean;
|
|
6
|
+
/** Helper function to print whether something was enabled or disabled to the in-game console. */
|
|
7
|
+
export declare function printEnabled(enabled: boolean, description: string): void;
|
|
8
|
+
//# sourceMappingURL=console.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../src/functions/console.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAEpE;AAED,iGAAiG;AACjG,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAGxE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____consoleCommandsSet = require("src.sets.consoleCommandsSet")
|
|
3
|
+
local CONSOLE_COMMANDS_SET = ____consoleCommandsSet.CONSOLE_COMMANDS_SET
|
|
4
|
+
--- Helper function to see if a particular command is a vanilla console command. This is useful
|
|
5
|
+
-- because the `EXECUTE_CMD` callback will not fire for any vanilla commands.
|
|
6
|
+
function ____exports.isVanillaConsoleCommand(self, commandName)
|
|
7
|
+
return CONSOLE_COMMANDS_SET:has(commandName)
|
|
8
|
+
end
|
|
9
|
+
--- Helper function to print whether something was enabled or disabled to the in-game console.
|
|
10
|
+
function ____exports.printEnabled(self, enabled, description)
|
|
11
|
+
local enabledText = enabled and "Enabled" or "Disabled"
|
|
12
|
+
print(((enabledText .. " ") .. description) .. ".")
|
|
13
|
+
end
|
|
14
|
+
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepCopy.d.ts","sourceRoot":"","sources":["../../../src/functions/deepCopy.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"deepCopy.d.ts","sourceRoot":"","sources":["../../../src/functions/deepCopy.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAwB7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAExB,KAAK,EAAE,CAAC,EACR,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,IAAI,EAC1C,oBAAoB,CAAC,EAAE,MAAM,EAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAC5C,SAAS,CAAC,EAAE,OAAO,GAClB,CAAC,CAAC;AACL,wBAAgB,QAAQ,CAEtB,KAAK,EAAE,OAAO,EACd,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,CAAC,EAAE,MAAM,EAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAC5C,SAAS,CAAC,EAAE,OAAO,GAClB,OAAO,CAAC"}
|