mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-22 21:55:15 +00:00
Simplify usage of attributes. (#574)
* Support implicit values for primitive attributes This commit adds support for strings, numbers, and booleans to be implicitly typed in attribute maps, reducing the redundancy of needing to specify their types. I also quietly adjusted one of the tests to use a more stable class/property pair. Since SourceAssetId is locked to Roblox, it could potentially disappear at any time. * Apply formatting. * Address feedback * Backwards compatible format usage. * Axe UnresolvedValueMap in favor of $attributes Attributes can be defined directly on instances, with support for unambiguous types. * Adjust test. * to_string() -> into() * Made attribute test more concise. * small cleanup * Update src/resolution.rs * Update src/resolution.rs * Update src/resolution.rs * Update src/resolution.rs Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
This commit is contained in:
@@ -229,6 +229,13 @@ pub struct ProjectNode {
|
||||
)]
|
||||
pub properties: HashMap<String, UnresolvedValue>,
|
||||
|
||||
#[serde(
|
||||
rename = "$attributes",
|
||||
default,
|
||||
skip_serializing_if = "HashMap::is_empty"
|
||||
)]
|
||||
pub attributes: HashMap<String, UnresolvedValue>,
|
||||
|
||||
/// Defines the behavior when Rojo encounters unknown instances in Roblox
|
||||
/// Studio during live sync. `$ignoreUnknownInstances` should be considered
|
||||
/// a large hammer and used with care.
|
||||
|
||||
Reference in New Issue
Block a user