Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(5 edits) (+4)

itemlist contraption

This contraption lets you store a list of items. Basically it wraps a two-column grid, but the second column is hidden and replaced with a big text area.

The buttons at the top do the following:

  • -> "run", passes the current text to a configurable event handler on the card (run_event attribute contains the event name to trigger). Using shift-enter with the editor focused will also trigger this event, either on the entire item text or the selection. 
  • up/dn -> moves the current item up or down in the list of items
  • </> -> lets you navigate between the items in order. (you can click the names in the list to do this, but you can also hide the names by setting the list_width attribute to 0) 
  • - -> deletes the current item (shows a confirmation box first)
  • + -> adds a new item

There are also two helper functions you can use to get access to the underlying data:

  • .ls[] -> returns the entire items.value table
  • .current[] -> returns the current row from the table.

<couldn't get the widget to paste correctly. see comment below for link to a .deck>

It looks like the code might've been pasted wrong? I tried importing it into my deck and it didn't load correctly. I would love it if this was fixed since it does exactly what I need!

(+2)

I can't seem to get the widget by itself to paste correctly. I tried uploading it to another site but it just comes back blank.
Meanwhile, I just uploaded an entire deck with nothing but the widget:
https://gist.github.com/tangentstorm/37a26ebf0dc438eae1e765675b73ecd0

(+1)

tysm!! Using this to have a database card in my character sheet for the TTRPG I play with my friends :D