-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
78 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
-- Variables | ||
local Packages = script.Parent.Parent.Parent.Parent.Packages | ||
local Utility = script.Parent.Utility | ||
local Keys = require(Utility.Keys) | ||
local Debugger = require(Packages.debugger) | ||
|
||
-- Module | ||
|
||
--[=[ | ||
Connects a callback to a certain property change event. | ||
[Learn More](https://luminlabsdev.github.io/ui-framework/api/keys/#change) | ||
]=] | ||
return function(prop: string) | ||
if not Keys["Change"] then | ||
Keys["Change"] = function(instance: Instance, callback: (...any) -> ()) | ||
local Success, Event = pcall(instance.GetPropertyChangedSignal, instance :: any, prop :: any) | ||
if not Success or type(callback) ~= "function" then | ||
Debugger.Fatal("") | ||
end | ||
Event:Connect(callback) | ||
end | ||
end | ||
return Keys["Change"] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
-- Variables | ||
local Packages = script.Parent.Parent.Parent.Parent.Packages | ||
local Utility = script.Parent.Utility | ||
local FindProp = require(Utility.FindProp) | ||
local Keys = require(Utility.Keys) | ||
local Debugger = require(Packages.debugger) | ||
|
||
-- Module | ||
|
||
--[=[ | ||
Connects a callback to an event on the instance. | ||
[Learn More](https://luminlabsdev.github.io/ui-framework/api/keys/#event) | ||
]=] | ||
return function(event: string) | ||
if not Keys["Event"] then | ||
Keys["Event"] = function(instance: Instance, callback: (...any) -> ()) | ||
local Success, Event = pcall(FindProp, instance :: any, event :: any) | ||
if not Success or type(callback) ~= "function" then | ||
Debugger.Fatal("") | ||
end | ||
Event:Connect(callback) | ||
end | ||
end | ||
return Keys["Event"] | ||
end |
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-- Variables | ||
local Utility = script.Parent.Utility | ||
local Keys = require(Utility.Keys) | ||
|
||
-- Module | ||
|
||
--[=[ | ||
Adds a tag with the provided name to the instance. | ||
[Learn More](https://luminlabsdev.github.io/ui-framework/api/keys/#tag) | ||
]=] | ||
return function() | ||
if not Keys["Tag"] then | ||
Keys["Tag"] = function(instance: Instance, name: string) | ||
instance:AddTag(name) | ||
end | ||
end | ||
return Keys["Tag"] | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
return { | ||
|
||
IncompatibleType = "Data type '%s' is incompatible", | ||
NotAnimatable = "%s is not an animatable object", | ||
FailedCreation = "%s could not be created; '%s'", | ||
|
||
InvalidType = "Expected type %s; got '%s'", | ||
InvalidKey = "Expected valid key type; got '%s'", | ||
InvalidClass = "'%s' is not an instance class name", | ||
} |
This file was deleted.
Oops, something went wrong.