Quote from: LWM on July 11, 2020, 12:10:16 PM
Why not do a Harmony Postfix() patch on Building_Storage's GetGizmos?
Then authors wouldn't have to add a dependency to their code base to support your mod; it would happen automagically.
The main reason is i didn't want the settings of one building type to show up for another type but be able to support different building types to share load/saves. That's why there are pre-defined save types as well as the option to specify custom ones.
To a lesser extent I don't like mods that add unintended functionality to other mods (i know from experience of supporting other mods when they modify my own)
The dll to include is here: https://github.com/KiameV/rimworld-SaveStorageSettings/releases/download/1.1util/SaveStorageSettingsUtil.zip
To add support for a new building storage the code is:
Code Select
public override IEnumerable<Gizmo> GetGizmos()
{
List<Gizmo> l = new List<Gizmo>(base.GetGizmos());
return SaveStorageSettingsGizmoUtil.AddSaveLoadGizmos(l, [storage type name], this.settings.filter);
}
Where storage type name can either be a unique string or one of the pre-defined types in the SaveTypeEnum