mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-25 04:54:07 +00:00
Handle moving (very sloppily)
This commit is contained in:
parent
e4f35b29bd
commit
a30937f009
1 changed files with 19 additions and 0 deletions
|
|
@ -162,6 +162,25 @@ impl RbxSession {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
FileChange::Moved(from_route, to_route) => {
|
FileChange::Moved(from_route, to_route) => {
|
||||||
|
let mut messages = Vec::new();
|
||||||
|
|
||||||
|
match self.instances_by_route.get(from_route) {
|
||||||
|
Some(id) => {
|
||||||
|
self.instances.remove(id);
|
||||||
|
messages.push(Message::InstanceChanged { id: *id });
|
||||||
|
},
|
||||||
|
None => (),
|
||||||
|
}
|
||||||
|
|
||||||
|
let file_item = vfs_session.get_by_route(to_route).unwrap();
|
||||||
|
let partition = self.config.partitions.get(&to_route.partition).unwrap();
|
||||||
|
let (_, changed_ids) = file_to_instances(file_item, partition, &mut self.instances, &mut self.instances_by_route);
|
||||||
|
|
||||||
|
for id in changed_ids {
|
||||||
|
messages.push(Message::InstanceChanged { id });
|
||||||
|
}
|
||||||
|
|
||||||
|
self.message_session.push_messages(&messages);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue