mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-23 14:15:24 +00:00
Add 'route' to each RbxInstance, which tags how the instance was generated
This commit is contained in:
@@ -31,6 +31,7 @@ impl Plugin for DefaultPlugin {
|
|||||||
class_name: "StringValue".to_string(),
|
class_name: "StringValue".to_string(),
|
||||||
children: Vec::new(),
|
children: Vec::new(),
|
||||||
properties,
|
properties,
|
||||||
|
route: Some(vfs_item.route().to_vec()),
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
&VfsItem::Dir { ref children, .. } => {
|
&VfsItem::Dir { ref children, .. } => {
|
||||||
@@ -50,6 +51,7 @@ impl Plugin for DefaultPlugin {
|
|||||||
class_name: "Folder".to_string(),
|
class_name: "Folder".to_string(),
|
||||||
children: rbx_children,
|
children: rbx_children,
|
||||||
properties: HashMap::new(),
|
properties: HashMap::new(),
|
||||||
|
route: Some(vfs_item.route().to_vec()),
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ impl Plugin for JsonModelPlugin {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
rbx_item.route = Some(vfs_item.route().to_vec());
|
||||||
|
|
||||||
rbx_item.properties.insert("Name".to_string(), RbxValue::String {
|
rbx_item.properties.insert("Name".to_string(), RbxValue::String {
|
||||||
value: rbx_name,
|
value: rbx_name,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ impl Plugin for ScriptPlugin {
|
|||||||
class_name: class_name,
|
class_name: class_name,
|
||||||
children: Vec::new(),
|
children: Vec::new(),
|
||||||
properties,
|
properties,
|
||||||
|
route: Some(vfs_item.route().to_vec()),
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
&VfsItem::Dir { ref children, .. } => {
|
&VfsItem::Dir { ref children, .. } => {
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ pub struct RbxInstance {
|
|||||||
pub class_name: String,
|
pub class_name: String,
|
||||||
pub children: Vec<RbxInstance>,
|
pub children: Vec<RbxInstance>,
|
||||||
pub properties: HashMap<String, RbxValue>,
|
pub properties: HashMap<String, RbxValue>,
|
||||||
|
|
||||||
|
/// The route that this instance was generated from, if there was one.
|
||||||
|
pub route: Option<Vec<String>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Any kind value that can be used by Roblox
|
/// Any kind value that can be used by Roblox
|
||||||
|
|||||||
Reference in New Issue
Block a user