Create separate menu for history

spaceboots
21 Sept 2021, 20:06

I want a separate drop-down menu to display on the right side along with places/objects and inventory, and I want it to contain a collection of history objects which can be examined once certain conditions are met (someone joins the party who knows local politics, so now you can read the history of the local government). I have the whole thing working as just a container within the inventory, but it would be massively enhanced by having a dedicated menu as it would help with clarity. I don't want history objects in the same list as inventory items, and if it's possible to literally add a second inventory and menu, that would be ideal. If anyone's done something similar in the past or has any ideas of how I could do this, I would greatly appreciate it, thanks!


mrangel
21 Sept 2021, 21:08

I'd suggest making an objectlist to keep the list of what history items you can see, rather than putting them in the inventory. The scope for a command can be the name of an objectlist attribute, so that it will use that list.

You can then use Javascript to create an extra pane on the sidebar. Have a turnscript to update the list of objects to display in the pane. You can pass a stringlist to a JS function, so you don't have any trouble with escaping it. Would you want this new pane to have its own verb buttons? Or just a single button?


spaceboots
21 Sept 2021, 22:12

I wouldn't need multiple verbs, simply clicking on the list item to print its history would be all the functionality I'd need.