@quenty/coreguienabler 12.18.2-canary.547.ba47c62.0 → 12.18.3-canary.550.afa1b3b.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/CHANGELOG.md +9 -1
- package/LICENSE.md +1 -1
- package/package.json +7 -7
- package/src/Client/CoreGuiEnabler.lua +22 -14
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [12.18.
|
|
6
|
+
## [12.18.3-canary.550.afa1b3b.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/coreguienabler@12.18.2...@quenty/coreguienabler@12.18.3-canary.550.afa1b3b.0) (2025-04-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/coreguienabler
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [12.18.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/coreguienabler@12.18.0...@quenty/coreguienabler@12.18.2) (2025-04-07)
|
|
7
15
|
|
|
8
16
|
|
|
9
17
|
### Bug Fixes
|
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2014-
|
|
3
|
+
Copyright (c) 2014-2025 James Onnen (Quenty)
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/coreguienabler",
|
|
3
|
-
"version": "12.18.
|
|
3
|
+
"version": "12.18.3-canary.550.afa1b3b.0",
|
|
4
4
|
"description": "Key based CoreGuiEnabler, singleton Use this class to load/unload CoreGuis / other GUIs, by disabling based upon keys Keys are additive, so if you have more than 1 disabled, it's ok.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
"Quenty"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@quenty/characterutils": "12.18.
|
|
28
|
-
"@quenty/loader": "10.8.
|
|
29
|
-
"@quenty/maid": "3.4.
|
|
30
|
-
"@quenty/rx": "13.17.
|
|
31
|
-
"@quenty/symbol": "3.4.2
|
|
27
|
+
"@quenty/characterutils": "12.18.3-canary.550.afa1b3b.0",
|
|
28
|
+
"@quenty/loader": "10.8.3-canary.550.afa1b3b.0",
|
|
29
|
+
"@quenty/maid": "3.4.3-canary.550.afa1b3b.0",
|
|
30
|
+
"@quenty/rx": "13.17.3-canary.550.afa1b3b.0",
|
|
31
|
+
"@quenty/symbol": "3.4.2"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "afa1b3b99b862698c3ab46009497bd507150867c"
|
|
37
37
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
--!strict
|
|
1
2
|
--[=[
|
|
2
3
|
Key based CoreGuiEnabler, singleton
|
|
3
4
|
Use this class to load/unload CoreGuis / other GUIs, by disabling based upon keys
|
|
4
5
|
Keys are additive, so if you have more than 1 disabled, it's ok.
|
|
5
6
|
|
|
6
7
|
```lua
|
|
7
|
-
|
|
8
8
|
local CoreGuiEnabler = require("CoreGuiEnabler")
|
|
9
9
|
|
|
10
10
|
-- Disable the backpack for 5 seconds
|
|
@@ -35,13 +35,22 @@ local CoreGuiEnabler = {}
|
|
|
35
35
|
CoreGuiEnabler.__index = CoreGuiEnabler
|
|
36
36
|
CoreGuiEnabler.ClassName = "CoreGuiEnabler"
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
export type CoreGuiEnabler = typeof(setmetatable(
|
|
39
|
+
{} :: {
|
|
40
|
+
_maid: Maid.Maid,
|
|
41
|
+
_states: { [any]: { lastState: boolean, onChangeCallback: (boolean) -> (), disabledBy: { [any]: any } } },
|
|
42
|
+
_stateSubs: ObservableSubscriptionTable.ObservableSubscriptionTable<boolean>,
|
|
43
|
+
},
|
|
44
|
+
{} :: typeof({ __index = CoreGuiEnabler })
|
|
45
|
+
))
|
|
46
|
+
|
|
47
|
+
function CoreGuiEnabler.new(): CoreGuiEnabler
|
|
48
|
+
local self: CoreGuiEnabler = setmetatable({} :: any, CoreGuiEnabler)
|
|
40
49
|
|
|
41
50
|
self._maid = Maid.new()
|
|
42
51
|
self._states = {}
|
|
43
52
|
|
|
44
|
-
self._stateSubs = self._maid:Add(ObservableSubscriptionTable.new())
|
|
53
|
+
self._stateSubs = self._maid:Add(ObservableSubscriptionTable.new() :: any)
|
|
45
54
|
|
|
46
55
|
self:AddState(Enum.CoreGuiType.Backpack, function(isEnabled)
|
|
47
56
|
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, isEnabled)
|
|
@@ -136,12 +145,11 @@ function CoreGuiEnabler:ObserveIsEnabled(coreGuiState)
|
|
|
136
145
|
error(string.format("[CoreGuiEnabler] - State '%s' does not exist.", tostring(coreGuiState)))
|
|
137
146
|
end
|
|
138
147
|
|
|
139
|
-
return self._stateSubs:Observe(coreGuiState)
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
})
|
|
148
|
+
return self._stateSubs:Observe(coreGuiState):Pipe({
|
|
149
|
+
Rx.startFrom(function()
|
|
150
|
+
return { self:IsEnabled(coreGuiState) }
|
|
151
|
+
end),
|
|
152
|
+
})
|
|
145
153
|
end
|
|
146
154
|
|
|
147
155
|
--[=[
|
|
@@ -154,9 +162,9 @@ function CoreGuiEnabler:AddState(coreGuiState, onChangeCallback)
|
|
|
154
162
|
assert(self._states[coreGuiState] == nil, "state already exists")
|
|
155
163
|
|
|
156
164
|
self._states[coreGuiState] = {
|
|
157
|
-
lastState = true
|
|
158
|
-
onChangeCallback = onChangeCallback
|
|
159
|
-
disabledBy = {}
|
|
165
|
+
lastState = true,
|
|
166
|
+
onChangeCallback = onChangeCallback,
|
|
167
|
+
disabledBy = {},
|
|
160
168
|
}
|
|
161
169
|
end
|
|
162
170
|
|
|
@@ -225,4 +233,4 @@ function CoreGuiEnabler:Enable(key, coreGuiState)
|
|
|
225
233
|
self:_setDisabledByKey(coreGuiState, key, nil)
|
|
226
234
|
end
|
|
227
235
|
|
|
228
|
-
return CoreGuiEnabler.new()
|
|
236
|
+
return CoreGuiEnabler.new()
|