mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Implement Syncback to support converting Roblox files to a Rojo project (#937)
This is a very large commit. Consider checking the linked PR for more information.
This commit is contained in:
parent
071b6e7e23
commit
9b5a07191b
239 changed files with 5325 additions and 225 deletions
|
|
@ -73,6 +73,13 @@ impl RojoTree {
|
|||
self.inner.root_ref()
|
||||
}
|
||||
|
||||
/// Returns the root Instance of this tree.
|
||||
#[inline]
|
||||
pub fn root(&self) -> InstanceWithMeta<'_> {
|
||||
self.get_instance(self.get_root_id())
|
||||
.expect("RojoTrees should have a root")
|
||||
}
|
||||
|
||||
pub fn get_instance(&self, id: Ref) -> Option<InstanceWithMeta<'_>> {
|
||||
if let Some(instance) = self.inner.get_by_ref(id) {
|
||||
let metadata = self.metadata_map.get(&id).unwrap();
|
||||
|
|
@ -322,6 +329,10 @@ impl<'a> InstanceWithMeta<'a> {
|
|||
pub fn metadata(&self) -> &'a InstanceMetadata {
|
||||
self.metadata
|
||||
}
|
||||
|
||||
pub fn inner(&self) -> &Instance {
|
||||
self.instance
|
||||
}
|
||||
}
|
||||
|
||||
/// RojoTree's equivalent of `&'a mut Instance`.
|
||||
|
|
@ -371,6 +382,14 @@ impl InstanceWithMetaMut<'_> {
|
|||
pub fn metadata(&self) -> &InstanceMetadata {
|
||||
self.metadata
|
||||
}
|
||||
|
||||
pub fn inner(&self) -> &Instance {
|
||||
self.instance
|
||||
}
|
||||
|
||||
pub fn inner_mut(&mut self) -> &mut Instance {
|
||||
self.instance
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue