Open
Description
Using instance variables is possible in style
section of preset definition, it gets automatically updated with instance name. Using the same approach whilst defining actions and feedbacks would be useful as well.
One thing to consider is whether to implement it "as such" and always translate it into instance variable after detecting variable format or adding some other way of marking such option as variable in order to avoid translating something that the user didn't want to transform into variable (but would the user use variable format then?)
presets.push({
type: 'button',
category: `${String(i).padStart(3, '0')} - ${portName}`,
name: `${portName} - talk to selected`,
style: {
text: `Talk to:\\n$(generic-module:port_${i}_selected_port)`, // here it is possible to use instance variable
size: 'auto',
color: combineRgb(255, 255, 255),
bgcolor: combineRgb(0, 0, 0),
},
steps: [
{
down: [
{
actionId: 'talk',
options: {
port: i,
talk_to: "custom",
custom_talk_to: `$(generic-module:port_${i}_selected_port)`, // here it is not possible to use instance variable
mode: "toggle",
},
},
],
up: [],
500: [
{
actionId: 'talk',
options: {
port: i,
talk_to: "custom",
custom_talk_to: `$(generic-module:port_${i}_selected_port)`, // here it is not possible to use instance variable
mode: "off",
},
},
],
},
],
feedbacks: [
{
feedbackId: 'is_talking',
options: {
port: i,
talk_to: "custom",
custom_talk_to: `$(generic-module:port_${i}_selected_port)`, // here it is not possible to use instance variable
},
style: {
bgcolor: combineRgb(255, 0, 0),
},
},
],
})
Metadata
Metadata
Assignees
Labels
No labels