round out queue and call with individual call input and clearing
This commit is contained in:
+83
-65
@@ -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
|
||||
Reference in New Issue
Block a user