Originally Posted by
Trenloe
Very cool. Great idea.
One Issue I've seen - it only saves one type of window - you can't have two story windows saved. And if you have two masterindex window classes open - i.e. the base Story, NPCs, Images, etc. campaign data list windows opened from the desktop sidebar, you'll get an error on reload and the relevant windows will open completely empty, until you close them and restart the campaign.
Error when reloading after having two campaign data lists open = Script Error: [string "common/scripts/windowtitlebar.lua"]:48: bad argument #1 to 'setText' (string expected, got nil)
EDIT: I think these are both related to the two issues listed in post #1.
One of the main issues is that the child entry in the database is created with createChild(class, "string"); which results in the child XML key being the class name - which is not unique, hence clashing with previous entries as the createChild command will fetch the previous entry - the API doc says: "Create, or if it already exists fetch, the specified child node under the current node."
I'd suggest just using .createChild() (without any parameters) so that a unique id-XXXXX node is created - then store the class and db reference under that unique node.