Skip to content

Commit 65d09e1

Browse files
committed
feat: Use ValueObject activation
1 parent dca25af commit 65d09e1

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/actionmanager/src/Client/BaseAction.lua

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ local ContextActionService = game:GetService("ContextActionService")
1515
local Signal = require("Signal")
1616
local Maid = require("Maid")
1717
local EnabledMixin = require("EnabledMixin")
18+
local ValueObject = require("ValueObject")
1819

1920
local BaseAction = {}
2021
BaseAction.__index = BaseAction
@@ -35,9 +36,7 @@ function BaseAction.new(actionData)
3536
self.Activated = self._maid:Add(Signal.new()) -- :Fire(actionMaid, ... (activateData))
3637
self.Deactivated = self._maid:Add(Signal.new()) -- :Fire()
3738

38-
self.IsActivatedValue = Instance.new("BoolValue")
39-
self.IsActivatedValue.Value = false
40-
self._maid:GiveTask(self.IsActivatedValue)
39+
self.IsActivatedValue = self._maid:Add(ValueObject.new(false, "boolean"))
4140

4241
self:InitEnabledMixin()
4342

@@ -101,12 +100,6 @@ function BaseAction:_updateShortcuts()
101100
if self:IsEnabled() then
102101
ContextActionService:BindAction(self._contextActionKey, function(_, userInputState, _)
103102
if userInputState == Enum.UserInputState.Begin then
104-
if self._actionData.CanActivateShortcutCallback then
105-
if not self._actionData.CanActivateShortcutCallback() then
106-
return
107-
end
108-
end
109-
110103
self:ToggleActivate()
111104
end
112105
end, false, unpack(shortcuts))

0 commit comments

Comments
 (0)