mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-24 15:01:38 +00:00
fix: improve middleware selection for actor and other container classes
This commit is contained in:
parent
60d150f4c6
commit
020d72faef
1 changed files with 2 additions and 2 deletions
|
|
@ -301,6 +301,7 @@ pub fn get_best_middleware(snapshot: &SyncbackSnapshot) -> Middleware {
|
||||||
static JSON_MODEL_CLASSES: OnceLock<HashSet<&str>> = OnceLock::new();
|
static JSON_MODEL_CLASSES: OnceLock<HashSet<&str>> = OnceLock::new();
|
||||||
let json_model_classes = JSON_MODEL_CLASSES.get_or_init(|| {
|
let json_model_classes = JSON_MODEL_CLASSES.get_or_init(|| {
|
||||||
[
|
[
|
||||||
|
"Actor",
|
||||||
"Sound",
|
"Sound",
|
||||||
"SoundGroup",
|
"SoundGroup",
|
||||||
"Sky",
|
"Sky",
|
||||||
|
|
@ -333,8 +334,6 @@ pub fn get_best_middleware(snapshot: &SyncbackSnapshot) -> Middleware {
|
||||||
return override_middleware;
|
return override_middleware;
|
||||||
} else if let Some(old_middleware) = old_middleware {
|
} else if let Some(old_middleware) = old_middleware {
|
||||||
return old_middleware;
|
return old_middleware;
|
||||||
} else if json_model_classes.contains(inst.class.as_str()) {
|
|
||||||
middleware = Middleware::JsonModel;
|
|
||||||
} else {
|
} else {
|
||||||
middleware = match inst.class.as_str() {
|
middleware = match inst.class.as_str() {
|
||||||
"Folder" | "Configuration" | "Tool" => Middleware::Dir,
|
"Folder" | "Configuration" | "Tool" => Middleware::Dir,
|
||||||
|
|
@ -345,6 +344,7 @@ pub fn get_best_middleware(snapshot: &SyncbackSnapshot) -> Middleware {
|
||||||
"LocalizationTable" => Middleware::Csv,
|
"LocalizationTable" => Middleware::Csv,
|
||||||
// This isn't the ideal way to handle this but it works.
|
// This isn't the ideal way to handle this but it works.
|
||||||
name if name.ends_with("Value") => Middleware::JsonModel,
|
name if name.ends_with("Value") => Middleware::JsonModel,
|
||||||
|
_ if json_model_classes.contains(inst.class.as_str()) => Middleware::JsonModel,
|
||||||
_ => Middleware::Rbxm,
|
_ => Middleware::Rbxm,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue