mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-23 06:05:24 +00:00
Add SnapshotSource property
This commit is contained in:
@@ -39,6 +39,7 @@ impl SnapshotMiddleware for SnapshotCsv {
|
||||
|
||||
Ok(Some(InstanceSnapshot {
|
||||
snapshot_id: None,
|
||||
source: None, // TODO
|
||||
name: Cow::Owned(instance_name),
|
||||
class_name: Cow::Borrowed("LocalizationTable"),
|
||||
properties: hashmap! {
|
||||
|
||||
@@ -43,6 +43,7 @@ impl SnapshotMiddleware for SnapshotDir {
|
||||
|
||||
Ok(Some(InstanceSnapshot {
|
||||
snapshot_id: None,
|
||||
source: None, // TODO
|
||||
name: Cow::Owned(instance_name),
|
||||
class_name: Cow::Borrowed("Folder"),
|
||||
properties: HashMap::new(),
|
||||
|
||||
@@ -120,6 +120,7 @@ impl JsonModelCore {
|
||||
|
||||
InstanceSnapshot {
|
||||
snapshot_id: None,
|
||||
source: None, // TODO
|
||||
name: Cow::Owned(name),
|
||||
class_name: Cow::Owned(class_name),
|
||||
properties,
|
||||
@@ -169,6 +170,7 @@ mod test {
|
||||
instance_snapshot,
|
||||
InstanceSnapshot {
|
||||
snapshot_id: None,
|
||||
source: None, // TODO
|
||||
name: Cow::Borrowed("foo"),
|
||||
class_name: Cow::Borrowed("IntValue"),
|
||||
properties: hashmap! {
|
||||
@@ -178,6 +180,7 @@ mod test {
|
||||
},
|
||||
children: vec![InstanceSnapshot {
|
||||
snapshot_id: None,
|
||||
source: None, // TODO
|
||||
name: Cow::Borrowed("The Child"),
|
||||
class_name: Cow::Borrowed("StringValue"),
|
||||
properties: HashMap::new(),
|
||||
|
||||
@@ -90,6 +90,7 @@ fn snapshot_lua_file<F: ImfsFetcher>(
|
||||
|
||||
Ok(Some(InstanceSnapshot {
|
||||
snapshot_id: None,
|
||||
source: None, // TODO
|
||||
name: Cow::Owned(instance_name.to_owned()),
|
||||
class_name: Cow::Borrowed(class_name),
|
||||
properties,
|
||||
|
||||
@@ -131,6 +131,7 @@ fn snapshot_project_node<F: ImfsFetcher>(
|
||||
|
||||
Ok(Some(InstanceSnapshot {
|
||||
snapshot_id: None,
|
||||
source: None, // TODO
|
||||
name,
|
||||
class_name,
|
||||
properties,
|
||||
|
||||
@@ -49,6 +49,7 @@ impl SnapshotMiddleware for SnapshotRbxm {
|
||||
if children.len() == 1 {
|
||||
let mut snapshot = InstanceSnapshot::from_tree(&temp_tree, children[0]);
|
||||
snapshot.name = Cow::Owned(instance_name);
|
||||
// TODO: Assign snapshot.source
|
||||
|
||||
Ok(Some(snapshot))
|
||||
} else {
|
||||
|
||||
@@ -45,6 +45,7 @@ impl SnapshotMiddleware for SnapshotRbxmx {
|
||||
if children.len() == 1 {
|
||||
let mut snapshot = InstanceSnapshot::from_tree(&temp_tree, children[0]);
|
||||
snapshot.name = Cow::Owned(instance_name);
|
||||
// TODO: Assign snapshot.source
|
||||
|
||||
Ok(Some(snapshot))
|
||||
} else {
|
||||
|
||||
@@ -51,6 +51,7 @@ impl SnapshotMiddleware for SnapshotTxt {
|
||||
|
||||
Ok(Some(InstanceSnapshot {
|
||||
snapshot_id: None,
|
||||
source: None, // TODO
|
||||
name: Cow::Owned(instance_name),
|
||||
class_name: Cow::Borrowed("StringValue"),
|
||||
properties,
|
||||
|
||||
Reference in New Issue
Block a user