mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Add condition field to plugin cleaning data metadata
This commit is contained in:
@@ -317,6 +317,7 @@ impl PluginCleaningData {
|
||||
deleted_reference_count: Option<u32>,
|
||||
deleted_navmesh_count: Option<u32>,
|
||||
detail: Option<Vec<&MessageContent>>,
|
||||
condition: Option<String>,
|
||||
) -> Result<Self, VerboseError> {
|
||||
let mut data = libloot::metadata::PluginCleaningData::new(crc, cleaning_utility);
|
||||
|
||||
@@ -337,6 +338,10 @@ impl PluginCleaningData {
|
||||
data = data.with_detail(detail)?;
|
||||
}
|
||||
|
||||
if let Some(condition) = condition {
|
||||
data = data.with_condition(condition);
|
||||
}
|
||||
|
||||
Ok(Self(data))
|
||||
}
|
||||
|
||||
@@ -369,6 +374,11 @@ impl PluginCleaningData {
|
||||
pub fn detail(&self) -> Vec<MessageContent> {
|
||||
self.0.detail().iter().cloned().map(Into::into).collect()
|
||||
}
|
||||
|
||||
#[napi(getter)]
|
||||
pub fn condition(&self) -> Option<&str> {
|
||||
self.0.condition()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<libloot::metadata::PluginCleaningData> for PluginCleaningData {
|
||||
|
||||
Reference in New Issue
Block a user