@rbxts/app-forge 0.3.9 → 0.4.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/out/index.d.ts +1 -1
- package/out/init.luau +6 -2
- package/package.json +1 -1
package/out/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export default class AppForge {
|
|
|
5
5
|
binds: Map<string, [React.Binding<boolean>, (T: boolean) => void]>;
|
|
6
6
|
loaded: Map<string, React.Element<any, string | React.JSXElementConstructor<any>>>;
|
|
7
7
|
private rulesManager;
|
|
8
|
-
getBind(name: AppNames[number]):
|
|
8
|
+
getBind(name: AppNames[number]): React.Binding<boolean> | undefined;
|
|
9
9
|
getState(name: AppNames[number]): boolean | undefined;
|
|
10
10
|
set(name: AppNames[number], value: boolean): void;
|
|
11
11
|
open(name: AppNames[number]): void;
|
package/out/init.luau
CHANGED
|
@@ -12,6 +12,7 @@ local App = _decorator.App
|
|
|
12
12
|
local AppContainer = TS.import(script, script, "container").AppContainer
|
|
13
13
|
-- Classes
|
|
14
14
|
local RulesManager = TS.import(script, script, "rules").default
|
|
15
|
+
local RunService = TS.import(script, TS.getModule(script, "@rbxts", "services")).RunService
|
|
15
16
|
local AppForge
|
|
16
17
|
do
|
|
17
18
|
AppForge = setmetatable({}, {
|
|
@@ -30,10 +31,13 @@ do
|
|
|
30
31
|
self.rulesManager = RulesManager.new(self)
|
|
31
32
|
end
|
|
32
33
|
function AppForge:getBind(name)
|
|
34
|
+
if not RunService:IsRunning() then
|
|
35
|
+
return nil
|
|
36
|
+
end
|
|
33
37
|
local _binds = self.binds
|
|
34
38
|
local _name = name
|
|
35
39
|
if not (_binds[_name] ~= nil) then
|
|
36
|
-
|
|
40
|
+
error(`App "{name}" has no binding`)
|
|
37
41
|
end
|
|
38
42
|
local _binds_1 = self.binds
|
|
39
43
|
local _name_1 = name
|
|
@@ -56,7 +60,7 @@ do
|
|
|
56
60
|
local _ = _binding[1]
|
|
57
61
|
local setBinding = _binding[2]
|
|
58
62
|
if not setBinding then
|
|
59
|
-
|
|
63
|
+
error(`App "{name}" has no binding setter`)
|
|
60
64
|
end
|
|
61
65
|
setBinding(value)
|
|
62
66
|
end
|