round out queue and call with individual call input and clearing

This commit is contained in:
2026-05-02 00:11:02 +00:00
parent 453940146b
commit 3f19c32acc
2 changed files with 234 additions and 193 deletions
+83 -65
View File
@@ -1,66 +1,84 @@
PluginInfo = {
Name = "Caller",
Version = "0.1.0-master",
Id = "Caller.plugin.0.1.0-master",
Description = "Plugin for taking a name and input and producing a call output",
Author = "Joel Wetzell"
}
require("json")
function GetPrettyName()
return "Caller"
end
function GetProperties()
local props = {}
return props
end
function RectifyProperties(props)
return props
end
function GetControls(props)
local controls = {
{
Name = "QueueUp",
ControlType = "Button",
ButtonType = "Toggle",
PinStyle = "Both",
UserPin = true
},
{
Name = "CallOut",
ControlType = "Text",
PinStyle = "Output",
UserPin = true
},
{
Name = "CallerName",
ControlType = "Text",
PinStyle = "Input",
UserPin = true
}
}
return controls
end
function Initialize()
end
function SetupControlHandlers()
Controls["QueueUp"].EventHandler = function (ctrl)
local call = {
Queue = ctrl.Boolean,
Name = Controls["CallerName"].String,
Time = os.time()
}
local callString = json.encode(call)
Controls["CallOut"].String = json.encode(call)
end
end
if(Controls) then
Initialize()
SetupControlHandlers()
PluginInfo = {
Name = "Caller",
Version = "0.1.0-master",
Id = "Caller.plugin.0.1.0-master",
Description = "Plugin for taking a name and input and producing a call output",
Author = "Joel Wetzell"
}
require("json")
function GetPrettyName()
return "Caller"
end
function GetProperties()
local props = {}
return props
end
function RectifyProperties(props)
return props
end
function GetControls(props)
local controls = {
{
Name = "Clear",
ControlType = "Button",
ButtonType = "Trigger",
PinStyle = "Input",
UserPin = true
},
{
Name = "QueueUp",
ControlType = "Button",
ButtonType = "Toggle",
PinStyle = "Both",
UserPin = true
},
{
Name = "CallOut",
ControlType = "Text",
PinStyle = "Output",
UserPin = true
},
{
Name = "CallerName",
ControlType = "Text",
PinStyle = "Input",
UserPin = true
}
}
return controls
end
function Initialize()
end
function CreateCall(name, queue)
local call = {
Queue = queue,
Name = name,
Time = os.time()
}
return call
end
function SetupControlHandlers()
Controls["QueueUp"].EventHandler = function (ctrl)
local call = CreateCall(Controls["CallerName"].String, Controls["QueueUp"].Boolean)
Controls["CallOut"].String = json.encode(call)
end
Controls["Clear"].EventHandler = function (ctrl)
Controls["QueueUp"].Boolean = false
local call = CreateCall(Controls["CallerName"].String, false)
Controls["CallOut"].String = json.encode(call)
end
end
if(Controls) then
Initialize()
SetupControlHandlers()
end