Closed FerusGrim closed 6 months ago
I could not figure out how to properly import this project, so I don't want to make a PR with, likely, broken code. However, I believe this should solve this issue:
internal bool IsSameConfig(BaseConfigItem configItem)
{
var isSameSection;
var isSameKey;
if (configItem is GenericButtonConfigItem otherButton && this is GenericButtonConfigItem button)
{
isSameSection = otherButton.ButtonOptions.Section == button.ButtonOptions.Section;
isSameKey = otherButton.ButtonOptions.Name == button.ButtonOptions.Name;
}
else
{
isSameSection = configItem.UnderlyingSection == UnderlyingSection;
isSameKey = configItem.UnderlyingName == UnderlyingName;
}
var isSameMod = configItem.Owner.modInfo.GUID == Owner.modInfo.GUID;
return isSameSection && isSameKey && isSameMod;
}
}
Please, if you can, test with the latest version (1.4.0).
Thank you very much! Issue has been resolved as of edff15e1b40d4d89f22330b1740a9045319f8fc4!
When creating a GenericButtonConfigItem, the first one registers fine, but the second is discarded as a duplicate.
There is no way I can see to differentiate these two items, other than the section and name, yet the second is not being identified as a separate item.
I'm sure I'm missing something, but I'm at a loss. :)