mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Maybe fix migration for metadata containing mods, also fix negative values in mod collection settings causing problems.
This commit is contained in:
parent
7409d0bc2f
commit
3b2876a6e4
3 changed files with 15 additions and 5 deletions
|
|
@ -70,6 +70,8 @@ public partial class Configuration
|
|||
return;
|
||||
}
|
||||
|
||||
// Ensure the right meta files are loaded.
|
||||
Penumbra.CharacterUtility.LoadCharacterResources();
|
||||
ResettleSortOrder();
|
||||
ResettleCollectionSettings();
|
||||
ResettleForcedCollection();
|
||||
|
|
@ -180,8 +182,8 @@ public partial class Configuration
|
|||
var modName = ( string )setting[ "FolderName" ]!;
|
||||
var enabled = ( bool )setting[ "Enabled" ]!;
|
||||
var priority = ( int )setting[ "Priority" ]!;
|
||||
var settings = setting[ "Settings" ]!.ToObject< Dictionary< string, uint > >()
|
||||
?? setting[ "Conf" ]!.ToObject< Dictionary< string, uint > >();
|
||||
var settings = setting[ "Settings" ]!.ToObject< Dictionary< string, long > >()
|
||||
?? setting[ "Conf" ]!.ToObject< Dictionary< string, long > >();
|
||||
|
||||
dict[ modName ] = new ModSettings.SavedSettings()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,6 +11,13 @@ public unsafe class CharacterUtility : IDisposable
|
|||
[Signature( "48 8B 0D ?? ?? ?? ?? E8 ?? ?? ?? 00 48 8D 8E ?? ?? 00 00 E8 ?? ?? ?? 00 33 D2", ScanType = ScanType.StaticAddress )]
|
||||
private readonly Structs.CharacterUtility** _characterUtilityAddress = null;
|
||||
|
||||
// Only required for migration anymore.
|
||||
[Signature( "E8 ?? ?? ?? 00 48 8D 8E ?? ?? 00 00 E8 ?? ?? ?? 00 33 D2" )]
|
||||
public readonly Action< IntPtr >? LoadCharacterResourcesFunc;
|
||||
|
||||
public void LoadCharacterResources()
|
||||
=> LoadCharacterResourcesFunc?.Invoke( ( IntPtr )_characterUtilityAddress );
|
||||
|
||||
public Structs.CharacterUtility* Address
|
||||
=> *_characterUtilityAddress;
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ public class ModSettings
|
|||
// A simple struct conversion to easily save settings by name instead of value.
|
||||
public struct SavedSettings
|
||||
{
|
||||
public Dictionary< string, uint > Settings;
|
||||
public Dictionary< string, long > Settings;
|
||||
public int Priority;
|
||||
public bool Enabled;
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ public class ModSettings
|
|||
{
|
||||
Priority = settings.Priority;
|
||||
Enabled = settings.Enabled;
|
||||
Settings = new Dictionary< string, uint >( mod.Groups.Count );
|
||||
Settings = new Dictionary< string, long >( mod.Groups.Count );
|
||||
settings.AddMissingSettings( mod.Groups.Count );
|
||||
|
||||
foreach( var (group, setting) in mod.Groups.Zip( settings.Settings ) )
|
||||
|
|
@ -183,7 +183,8 @@ public class ModSettings
|
|||
{
|
||||
if( Settings.TryGetValue( group.Name, out var config ) )
|
||||
{
|
||||
var actualConfig = FixSetting( group, config );
|
||||
var castConfig = ( uint )Math.Clamp( config, 0, uint.MaxValue );
|
||||
var actualConfig = FixSetting( group, castConfig );
|
||||
list.Add( actualConfig );
|
||||
if( actualConfig != config )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue