robbielyman / seamstress

seamstress is an art engine
GNU General Public License v3.0
129 stars 12 forks source link

add 'text' parameter + adjust params window UI #48

Closed dndrks closed 1 year ago

dndrks commented 1 year ago

summary

this PR includes:

text param type details

invoke with params:add_text(id, name, txt, locked, check)

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:

image

text param UI (with optional check argument active):

image

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

dndrks commented 1 year ago

ooo wait wait, one more thing to fix, sryryryry

dndrks commented 1 year ago

ok, we back :)

robbielyman commented 1 year ago

gosh, this is so great. thank you!! gonna wait for further PRs before moving on to 0.19.0