-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplugin_bc_template.lua
More file actions
103 lines (98 loc) · 4.24 KB
/
plugin_bc_template.lua
File metadata and controls
103 lines (98 loc) · 4.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
if pluginManager.installingPlugin == true then
--[[
---------------------------------------
pluginManager.installingPluginName = "Menu Name"
Set the name that appears in the main menu for your plugin.
---------------------------------------
]] --
pluginManager.installingPluginName = "Template Plugin"
--[[
---------------------------------------
pluginManager.installingPluginTable = "changeMeToUniqueName"
Set the name of the main table for your plugin that contains your home() menu.
---------------------------------------
]] --
pluginManager.installingPluginTable = "changeMeToUniqueName"
else
changeMeToUniqueName = {
--[[
---------------------------------------
changeMeToUniqueName.home(passed_data)
The home menu or main function of your plugin.
Data can be passed to your plugin from other plugins
with passed_data.
---------------------------------------
]] --
home = function(passed_data)
--[[
---------------------------------------
Sets toolbox to return to your plugin. See below for more information.
---------------------------------------
]] --
pluginManager.returnHome = true
pluginManager.returnPluginTable = "changeMeToUniqueName"
if passed_data then
--[[
---------------------------------------
Do something with passed data here
---------------------------------------
]] --
gg.alert(passed_data)
else
local menu = gg.choice({"Call a plugin and pass data",
"Call the default plugin for method search results",
"Exit and stop returning to your plugin menu"},
nil,
"ℹ️ BadCase's Toolbox Plugin Template ℹ️")
if menu ~= nil then
if menu == 1 then
--[[
---------------------------------------
pluginManager.callPlugin(plugin_path, function_table, passed_data)
Calls a plugin and optionally passes data to it.
plugin_path and function_table are required.
---------------------------------------
]] --
pluginManager.callPlugin(pluginsDataPath .. "plugin_bc_template.lua", "changeMeToUniqueName", "Hello World !!!")
end
if menu == 2 then
--[[
---------------------------------------
pluginManager.defaultHandler(handler, passed_data)
Calls a default plugin and optionally passes data to it.
handler is required.
Handlers: method_results, class_results, enum_results, field_results
---------------------------------------
]] --
pluginManager.defaultHandler("class_results", "isUnlocked")
end
if menu == 3 then
--[[
---------------------------------------
Exit your scripts menu and return normal functionality to the floating [Sx] button.
See below for more details.
---------------------------------------
]] --
pluginManager.returnHome = false
end
end
end
end
}
--[[
---------------------------------------
pluginManager.returnHome = boolean
true : makes GG return to your plugins menu when the floating [Sx] button is pressed
false : set to false when you want normal functionality to return to the floating [Sx] button
---------------------------------------
]] --
pluginManager.returnHome = true
--[[
---------------------------------------
pluginManager.returnPluginTable = "table_name"
When setting pluginManager.returnHome to true set your plugins table name to this variable
---------------------------------------
]] --
pluginManager.returnPluginTable = "changeMeToUniqueName"
changeMeToUniqueName.home()
end