a text parameter type, which could be useful for (eg.) in-menu OSC path declarations or writing text in the params window which cannot be edited
separate parameter UI for the text param type
some adjustments of the parameters window text layouts:
drawing a 180 pixel line under every separator (vs default 127)
truncating parameter names over 100 pixels wide
truncating text parameters over 90 pixels wide
left-justifying parameter values
a quick fix for .pmap file restores on parameters which don't exist
text param type details
invoke with params:add_text(id, name, txt, locked, check)
id: string; no spaces
name: string; display name, spaces fine
txt: string; default text, spaces fine
locked: boolean; determines whether the user can edit the text in the params UI
check: function; optional function displays a message of warning or success based on text
in params UI, hit ENTER to enter the text editor
note: i'm not sure how to allow modified entries like ! without manually mapping each input. @ryleelyman , is there something you'd recommend? or should we just make affordances for _ and call it a day?
test script
function checker(txt)
if string.len(txt) > 30 then
return "too long"
else
return ("remaining: " .. 30 - string.len(txt))
end
end
function init()
params:add_separator("my_separator", "script params")
params:add_number("test_num", "percentage", 1, 100, 30, "%")
params:add_text("truncate", "here is a title that goes on and on", "some text", false, checker)
params:add_text("no_edit", "you can't edit this", "sorryyyyyy", true)
params:add_separator("test_sep2", "here's a very very very much much longer name")
end
screenshots
just to show the stuff!
new dimensions:
text param UI (with optional check argument active):
lmk how it all looks, @ryleelyman ! i think i've got one or two more PR's before i'm done (lololol) but just wanna chunk changes <3
summary
this PR includes:
text
parameter type, which could be useful for (eg.) in-menu OSC path declarations or writing text in the params window which cannot be editedtext
param type.pmap
file restores on parameters which don't existtext
param type detailsinvoke with
params:add_text(id, name, txt, locked, check)
id
: string; no spacesname
: string; display name, spaces finetxt
: string; default text, spaces finelocked
: boolean; determines whether the user can edit the text in the params UIcheck
: function; optional function displays a message of warning or success based on textin params UI, hit ENTER to enter the text editor
note: i'm not sure how to allow modified entries like
!
without manually mapping each input. @ryleelyman , is there something you'd recommend? or should we just make affordances for_
and call it a day?test script
screenshots
just to show the stuff!
new dimensions:
text
param UI (with optionalcheck
argument active):lmk how it all looks, @ryleelyman ! i think i've got one or two more PR's before i'm done (lololol) but just wanna chunk changes <3