forked from rojo-rbx/rojo
Support setting referent properties via attributes (#843)
Co-authored-by: Kenneth Loeffler <kenloef@gmail.com>
This commit is contained in:
@@ -12,6 +12,7 @@ use crate::{
|
||||
path_serializer,
|
||||
project::ProjectNode,
|
||||
snapshot_middleware::{emit_legacy_scripts_default, Middleware},
|
||||
RojoRef,
|
||||
};
|
||||
|
||||
/// Rojo-specific metadata that can be associated with an instance or a snapshot
|
||||
@@ -58,6 +59,9 @@ pub struct InstanceMetadata {
|
||||
/// that instance's instigating source is snapshotted directly, the same
|
||||
/// context will be passed into it.
|
||||
pub context: InstanceContext,
|
||||
|
||||
/// Indicates the ID used for Ref properties pointing to this Instance.
|
||||
pub specified_id: Option<RojoRef>,
|
||||
}
|
||||
|
||||
impl InstanceMetadata {
|
||||
@@ -67,6 +71,7 @@ impl InstanceMetadata {
|
||||
instigating_source: None,
|
||||
relevant_paths: Vec::new(),
|
||||
context: InstanceContext::default(),
|
||||
specified_id: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,6 +102,13 @@ impl InstanceMetadata {
|
||||
..self
|
||||
}
|
||||
}
|
||||
|
||||
pub fn specified_id(self, id: Option<RojoRef>) -> Self {
|
||||
Self {
|
||||
specified_id: id,
|
||||
..self
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for InstanceMetadata {
|
||||
|
||||
Reference in New Issue
Block a user