Fix meta change counting and reloading on manual meta change edits.

This commit is contained in:
Ottermandias 2021-07-26 17:45:01 +02:00
parent bf355114f2
commit 1eee89ab4c
5 changed files with 23 additions and 13 deletions

View file

@ -22,8 +22,8 @@ namespace Penumbra.Meta
// Store total number of manipulations for some ease of access.
[JsonProperty]
public int Count { get; private set; } = 0;
[JsonIgnore]
internal int Count = 0;
// Return an enumeration of all active meta manipulations for a given mod with given settings.
@ -216,6 +216,12 @@ namespace Penumbra.Meta
var collection = JsonConvert.DeserializeObject< MetaCollection >( text,
new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } );
if( collection != null )
{
collection.Count = collection.DefaultData.Count
+ collection.GroupData.Values.SelectMany( kvp => kvp.Values ).Sum( l => l.Count );
}
return collection;
}
catch( Exception e )