vilmibm / tildemush

a modern mush tailored to tilde town
GNU General Public License v3.0
42 stars 12 forks source link

WITCH scripts represent live state of database #170

Closed vilmibm closed 5 years ago

vilmibm commented 5 years ago

This PR augments WITCH scripts being pulled up for editing with a (has ...) section that reflects an object's key value data and updates that key value data when saving a script.

This means that updating things like name and description actually have a meaningful effect (though you might have to drop/pick up the edited item before the UI reflects a name change...)

The one caveat to this PR is that when (has ...) is written back out, it runs the whole map together on one line. I couldn't think of a great, easy way to fix this so I'm leaving it alone for now.

This PR also includes a check in the call to (set-data k v) that avoids messing with the object's data if it's currently being edited.