[1.3] [KV] Save Storage, Outfit, Crafting, Drug & Operation Settings [ModSync]

Started by Kiame, June 28, 2017, 02:37:48 AM

Previous topic - Next topic

Kiame

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:

        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

Lex Silvas

XoXo

LWM

You could do both? You could have a harmony patch that checks if the mod author has already specified a SaveStorageSettingsGizmoUtil and if not, adds the gizmo and specifies by defName (so save settings apply to that type of thing).

As it is, some mod authors (for example me ;) ) are reluctant to go through all the trouble of maintaining support for a mod we don't use and adding anything that slows the game.

Kiame

I can assure you this will in no way slow the game as it's not run except for when the user clicks the save/load/append gizmo  ;)

Kiame

LWM, I decided to play around and see if i could add support for SaveStorageSettings into Deep Storage. I went ahead and made the SaveStorageSettingsUtil into a nuget package. After including that I was able to add support in CompDeepStorage.CompGetGizmosExtra. I've posted a pull request on github.


Kiame

Update:
Expanded the number of buildings this mod will apply to. It will not apply load/save buttons to all "Building_Storage" types

TechFa

Very good mod, thank you for your contribution. But it can't work with Project-RimFactory-Revived. I saw someone successfully support your mod after modification, but I don't have the ability to modify it. Can you add support for PRF? Thanks
https://github.com/zymex22/Project-RimFactory-Revived/pull/116

Kiame

Quote from: TechFa on May 04, 2021, 08:48:06 PM
Very good mod, thank you for your contribution. But it can't work with Project-RimFactory-Revived. I saw someone successfully support your mod after modification, but I don't have the ability to modify it. Can you add support for PRF? Thanks
https://github.com/zymex22/Project-RimFactory-Revived/pull/116

Do you have the latest version of this mod? It should add support to all storage building types. 1.2
If you don't see anything when you update the mod also verify the mod's settings are enabled to allow all storage buildings.

Also consider grabbing ModSync - https://ludeon.com/forums/index.php?topic=41634.0
You can check to see if any manually downloaded mods that support ModSync have updates.

TechFa

Quote from: Kiame on May 04, 2021, 11:42:10 PM
Do you have the latest version of this mod? It should add support to all storage building types. 1.2
If you don't see anything when you update the mod also verify the mod's settings are enabled to allow all storage buildings.

Also consider grabbing ModSync - https://ludeon.com/forums/index.php?topic=41634.0
You can check to see if any manually downloaded mods that support ModSync have updates.

Yes, I am using the latest version. Any storage-related buildings can be compatible with your MOD.
But Project RimFactory Revived has a special production building called assembler.
It needs to add bill to produce like Machining table. After adding bills, I cannot find the icon of Save bills.
I have also noticed other MODs, Rimatomics Machining table is compatible with your MOD. Only PRF's assembler cannot
Maybe something is wrong, I don't understand.

By the way, I can't find the option for "Save Storage, Outfit, Crafting, Drug, & Operation Settings" in MOD Settings

Kiame

Oops my bad. I had considered adding that as a mod option but i decided it wasnt worth it. Sorry for the confusion!

I've added some additional notes in the RimFactory Revived thread explaining that I do have a util that can be used to add the Save/Load buttons to any Building type if they'd like to add support.



Kiame

Update 1.3.0.2:
Fixing an issue where Loading/Saving crafting bills was returning errors in the logs.

Kiame

Update: 1.3.1.0
Fixing an issue where saved operations to install body parts was loading every body part as left.