Migrate shared tag to own config, address comments

Migrates the configuration for shared tags to a separate config file, and
addresses CR feedback.
This commit is contained in:
AeAstralis 2024-03-01 21:03:34 -05:00
parent 334be441f8
commit 282f6d4855
No known key found for this signature in database
6 changed files with 143 additions and 77 deletions

View file

@ -73,8 +73,6 @@ public class SettingsTab : ITab
if (_compactor.CanCompact)
_compactor.Enabled = _config.UseFileSystemCompression;
_sharedTagManager = sharedTagConfig;
if (sharedTagConfig.SharedTags.Count == 0 && _config.SharedTags != null)
sharedTagConfig.SharedTags = _config.SharedTags;
}
public void DrawHeader()
@ -916,14 +914,12 @@ public class SettingsTab : ITab
return;
var tagIdx = _sharedTags.Draw("Shared Tags: ",
"Tags that can be added/removed from mods with 1 click.", _sharedTagManager.SharedTags,
"Predefined tags that can be added or removed from mods with a single click.", _sharedTagManager.SharedTags,
out var editedTag);
if (tagIdx >= 0)
{
_sharedTagManager.ChangeSharedTag(tagIdx, editedTag);
_config.SharedTags = _sharedTagManager.SharedTags;
_config.Save();
}
}
}