mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-21 20:21:38 +00:00
Support setting referent properties via attributes (#843)
Co-authored-by: Kenneth Loeffler <kenloef@gmail.com>
This commit is contained in:
parent
a7b45ee859
commit
7e2bab921a
64 changed files with 942 additions and 7 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue