I have very interesting task. I'm new in the gamedev that is why asking for your help.
I need to make some kind of extention of the GuiTreeViewCtrl class.
The task is:
- Map chosen Xml file into a Tree.
I worked a bit with the SimXMLDocument() class. I tried an example from the documentation - mapped a small Xml to the GuiTextListCtrl.
I used TorqueScript for that. It works.
Now I need to try GuiTreeViewCtrl instead GuiTextListCtrl.
Ok. I will do it to understand better how GuiTreeViewCtrl works.
But what I can not image right now is about additional task:
- There should be new control class that has tree to show and a field where the information from the selected item is shown.
I'm thinking about few steps:
- Inherit from the GuiTreeViewCtrl;
- Add a string(or const char*) variable for a path to the xml file - "xmlPath";
- Add a setter - setXmlPath(const char*);
These are very first steps.
Here I have questions:
- After making this 3 steps whould I have access from the Gui Editor to call the setXmlPath() method(so via TorqueScript)?
- How to add new gui field to this class? Erm.. maybe GuiTextField to this class?