Page 1 of 1
ent plugin system
Posted: Sat Sep 29, 2007 1:57 pm
by grimdoomer
how do you make an ent pugin system i have plugins in the application folder i have a button for it i just dont know how to actully set it up. ive looked in entity a bit but can figure it out.
Posted: Sat Sep 29, 2007 2:22 pm
by Prey
.ent is just a made up extension, it's origins being obvious. All it is inside is just an XML structure, which can be read from in C# using the XmlTextReader, I think it's called.
Anyway I just read the plug-in into a list, in which each item represents an element of the plug-in. For example a float in the plug-in, is parsed to the 'FloatNode' class, which in turn is based off of the 'BaseNode' class, making it compatible with my list, initialised as 'List<BaseNode>'.
The BaseNode class also contains a 'StructNode' member, which keeps track of which element is part of which reflexive. With base values obviously leaving this null.
Once 'tis all loaded into a list: I have another method that loops through them and calls their 'CreateControls' method, and add the resulting controls to my other list, this one for controls. Eventually I have the visual representation of the plug-in, which I then put on screen.
It's not really that hard to do, to be honest. Lengthy process though.