-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building Tree View #88
Comments
Design has changed a bit since I originally wrote this. You can ignore the last paragraph! |
Though doing add/remove child and having the siblings behave like a stack would have been doable. |
I understand this is to be part of the building UI, where in the building UI does it fit? Not sure I understand what the 'add child' options are. A real example might help (ie a tree data with actual values). Are we talking something along the lines of:-
|
So, the design of this is really up in the air. For now all I really need is the tree control, with callbacks when the selected item in the tree changes, and the add/remove buttons. When you click on Add button, we need to determine what to add. The only existing options are 'scale' and 'cylinder'. To future proof it (some), we should also probably add 'rotate'. These can be a different control, like a droplist or something, that is fine. Or even 3 Add buttons, one for each. I'm thinking we should keep it as simple as possible for now, until I better know what we need. It should be a new floating/resizable window, like the other parts of the Building UI. |
Gotcha |
How are IDs and Remove Child going to work? If we go 1_2_1 for StepChild (or 1-0 in zero based, root node implied) and I remove GrandSon, GrandDaughter and Child, then StepChild is now 0-0 not 1-0. If you can generate a unique ID for each node, the client doesn't have to then worry about it, and an Add Child request would simply specify the unique ID of the parent. I would probably need to be given the generated ID as the response to the Add, so I have it if a child is also added to that before receiving an update from the server for the whole tree. |
Proposed OnBuildingTreeChanged parameter format (TreeThingNode):-
id: string - anything as long as it is unique within the tree Can be expanded/changed as necessary. Having a name?: string might be an option, so we can have name and value pairs, and the tree would display as name: value. |
Question: Is [ Remove Child ] really a remove child or a remove node function? ie. Remove Child:- I am on a parent and press Remove Child, I remove the last child added and call Remove Node:- I am on a node, and press [ Remove Node ]. I remove that node and call |
It should remove whichever node you currently have selected. Not its child as it could have multiple children and that would be ambiguous. So yes, the button should probably not be labeled "Remove Child". Good catch! |
https://github.com/Mehuge/Camelot-Unchained/tree/cu-tree-control Don't know if you want me to PR this yet or you can checkout from my branch while we are still ironing out the details. |
submit it to this repo on a branch please. Then I can get something set up for Brad to test it. |
At the very basic I need something like this.
The tree will be small, so the whole thing can be pushed to the UI anytime it is changed. I just need to know what format that would take. Also, when the selected item changes, I would need some callback with some form of identifier. I'm not sure how that works in TypeScript or whatever. I can keep a map of unique name to tree position on my side if necessary. Or we could encode position in the name by something like Grandson == 1_1_1 and StepChild = 1_2_1. Doesn't matter.
The more complicated problem is when you click on 'Add Child', I need to be able to let the user decide what to add. At the simplest this could just be a couple droplist that you select before clicking 'Add Child' but the permutations are large.
Here are the options:
Even more complicated is they transforms can be a stack (not tree) themselves. So you could combine a Rotate and Skew or something. Initially we can just have them add another child on the tree above but that means an extra, unused Morph. Not a problem for prototyping. I'm just putting it out there for consideration.Thanks,
--Brad
The text was updated successfully, but these errors were encountered: