Full Version : Attachments Gump?
xmlspawner >>Q&A >>Attachments Gump?
<< Prev | Next >>
Lord Hog Fred- 07-31-2006
How would I go about making a book or some sort of item that a player could use that would display to them attachments that they have on them. However, I only want predefined attachments to be shown on the gump.
Ideally I want a book that would have buttons for different categories on the front page that when pressed displayed a page that would show attachments relevant to that category. For example the book would have a quest button and would show a page that had only predefined (in the script) quest attachments on.
I know this is aksing a bit much but I am hopeless when it comes to gumps.
Thanks ,
ArteGordon- 07-31-2006
there wouldnt be anything special about the gump code. It would be like coding any other gump.
To get a list of all attachments you can use the XmlAttach.FindAttachments method.
Take a look in XmlQuestHolderGumps which is where the gump for quest log that displays all quests is defined.
You can use these overloads to find all attachments on a target, or all attachments of a certain type, or all attachments of a certain type
public static ArrayList FindAttachments(object o)
public static ArrayList FindAttachments(object o, Type type)
like

CODE
ArrayList a = XmlAttach.FindAttachments(from, typeof(XmlQuestAttachment)); foreach(XmlAttachment i in a) { // do stuff with the attachments that you found }

to go through the list of all current xmlquestattachments on someone