Skip to content
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

GuiControl clone is partially broken #211

Open
capnlove opened this issue Jun 22, 2014 · 4 comments
Open

GuiControl clone is partially broken #211

capnlove opened this issue Jun 22, 2014 · 4 comments

Comments

@capnlove
Copy link
Contributor

When using Guicontrol.clone(), some information from the original Guicontrol is copied over to the new object while other elements are not.

Elements not being copied to the clone :

  • Profile
  • HorizSizing and VertSizing.

This occurs regardless of the boolean argument passed to the function, which is supposed to determine if dynamic fields are copied to the new object.

@lilligreen
Copy link
Contributor

I'm surprised that any of the static fields specific to GuiControl are being copied - there is no copyTo method for GuiControl or any other Gui class. Only the fields that get inherited from SimObject have this implemented.

I haven't tried a fix yet, but as a starting point I would look at how the copyTo methods are built for scene objects and assets and write a similar function that would apply to GuiControl.

@capnlove
Copy link
Contributor Author

The advantage of this would be to use .taml Gui profiles as templates, from which you could easily instance copies of.

@lilligreen
Copy link
Contributor

Small update: I have a local branch where the profile field is successfully cloned. Next step is to implement copying for the rest of the fields. This is actually a massive amount of work - in addition to reformatting I'm also going back and adding missing script methods as well (hello getProfile). Writing out to Taml is still completely broken.

@capnlove
Copy link
Contributor Author

capnlove commented Jul 7, 2014

I wouldn't list this as a priority, just a "would be nice to have" feature. Maybe documenting the work required would help someone who wants to get their hands dirty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants