-
Notifications
You must be signed in to change notification settings - Fork 0
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
15 changed files
with
144 additions
and
51 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
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
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
[tools] | ||
wally = "UpliftGames/[email protected]" | ||
argon = "argon-rbx/[email protected].14" | ||
argon = "argon-rbx/[email protected].17" | ||
wally-package-types = "johnnymorganz/[email protected]" | ||
stylua = "johnnymorganz/[email protected]" | ||
lune = "lune-org/[email protected].7" | ||
lune = "lune-org/[email protected].8" |
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,24 @@ | ||
-- Variables | ||
|
||
local HttpService = game:GetService("HttpService") | ||
local plugin: Plugin = script:FindFirstAncestorWhichIsA("Plugin") | ||
|
||
-- Functions | ||
|
||
local function new( | ||
name: string, | ||
description: string, | ||
icon: string, | ||
callback: () -> (), | ||
allowBinding: boolean? | ||
): PluginAction | ||
local Action = plugin:CreatePluginAction(HttpService:GenerateGUID(false), name, description, icon, allowBinding) | ||
Action.Triggered:Connect(callback) | ||
return Action | ||
end | ||
|
||
-- Module | ||
|
||
return { | ||
new = new, | ||
} |
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,64 @@ | ||
-- Variables | ||
|
||
local HttpService = game:GetService("HttpService") | ||
local plugin: Plugin = script:FindFirstAncestorWhichIsA("Plugin") | ||
|
||
local Types = require(script.Parent.Parent.Types) | ||
|
||
local Index = {} | ||
Index.__index = Index | ||
|
||
-- Functions | ||
|
||
local function PluginMenu(name: string, children: Types.MenuChildren, icon: string) | ||
local Menu = plugin:CreatePluginMenu(HttpService:GenerateGUID(false), name, icon) | ||
for index, metadata in children do | ||
if type(metadata) == "table" then | ||
if type((metadata :: any)[1]) == "table" then | ||
Menu:AddMenu( | ||
PluginMenu( | ||
(metadata :: any)[1][2], | ||
metadata :: any, | ||
(metadata :: any)[1][3] | ||
) | ||
) | ||
continue | ||
end | ||
if (metadata :: any)[1] == "_Menu" then | ||
continue | ||
end | ||
Menu:AddNewAction((metadata :: any)[1], (metadata :: any)[2], (metadata :: any)[3]) | ||
else | ||
Menu:AddAction((metadata :: any)[1]) | ||
end | ||
end | ||
return Menu | ||
end | ||
|
||
local function new(name: string, children: Types.MenuChildren, icon: string?) | ||
local self = setmetatable({ | ||
Menu = PluginMenu(name, children, icon or ""), | ||
}, Index) | ||
return self | ||
end | ||
|
||
function Index.Append(self: any, children: Types.MenuChildren) | ||
self.Menu:AddMenu() | ||
end | ||
|
||
function Index.Clear(self: any) | ||
self.Menu:Clear() | ||
end | ||
|
||
function Index.Show(self: any, callback: (id: PluginAction) -> ()) | ||
local Identifier = self.Menu:ShowAsync() | ||
if Identifier then | ||
callback(Identifier) | ||
end | ||
end | ||
|
||
-- Module | ||
|
||
return { | ||
new = new, | ||
} |
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,5 @@ | ||
export type MenuChildren = { | ||
{ string } | MenuChildren | PluginAction | ||
} | ||
|
||
return {} |
Empty file.
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 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,28 @@ | ||
local Framework = require(script.Parent.plugin_framework) | ||
local Bool = Instance.new("BoolValue") | ||
|
||
local Menu = Framework.Menu.new("TestingMenu", { | ||
{ "ActionA", "A", "rbxasset://textures/loading/robloxTiltRed.png" }, | ||
{ "ActionB", "B", "rbxasset://textures/loading/robloxTilt.png" }, | ||
{ | ||
{ "_Menu", "C", "rbxasset://textures/explosion.png" }, | ||
{ "ActionD", "D", "rbxasset://textures/whiteCircle.png" }, | ||
{ "ActionE", "E", "rbxasset://textures/icon_ROBUX.png" }, | ||
}, | ||
}) | ||
|
||
Bool.Changed:Connect(function() | ||
if Bool.Value then | ||
Bool.Value = false | ||
Menu:Show(function(selected) | ||
print(selected.Text, selected.ActionId) | ||
end) | ||
end | ||
end) | ||
|
||
Bool.Name = "Toggle Menu" | ||
Bool.Parent = game | ||
|
||
Framework.Action.new("Shortcut", "A test shortcut", "rbxasset://textures/whiteCircle.png", function() | ||
print("You did it!") | ||
end) |