PDA

View Full Version : Programmatically adding/removing items from a windowlist



AmadanNaBriona
April 8th, 2020, 15:32
As the title says - I want to script the addition of an item to a list that is normally added by the user.

E.g., there is a weapons and armor list on a character sheet. The character sheet also has an inventory list. If the character has weapons and armor in his inventory, I want it to be added or removed from the weapons/armor list when the user toggles the inventory item button between "Carried" and "Equipped."

Moon Wizard
April 9th, 2020, 04:49
There are two different ways to do this, depending on where in the interface/code. If you are in the UI where the windowlist exists and you want to add, then you use the windowlist.createWindow API. If you are adding to the data directly, you can use DB.createNode or databasenode.createChild.

Make sure to look at the developer guide on the wiki.

Regards,
JPG