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

winclone() child elements of windows #1448

Merged
merged 2 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions OpenDreamClient/Interface/Descriptors/ControlDescriptors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ public override ElementDescriptor CreateCopy(ISerializationManager serialization
var copy = serializationManager.CreateCopy(this, notNullableOverride: true);

copy._id = id;
foreach(var child in this.ControlDescriptors)
copy.ControlDescriptors.Add(serializationManager.CreateCopy(child, notNullableOverride: false));
return copy;
}

Expand Down
3 changes: 3 additions & 0 deletions OpenDreamClient/Interface/DreamInterfaceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,9 @@ public void WinClone(string controlId, string cloneId) {
}

LoadDescriptor(elementDescriptor);
if(elementDescriptor is WindowDescriptor && Windows.TryGetValue(cloneId, out var window)){
window.CreateChildControls();
}
}

private void LoadInterface(InterfaceDescriptor descriptor) {
Expand Down