Bpendragon / GreenhouseSprinklers

Greenhouse Sprinklers smapi mod. Pay Robin to install an automatic sprinkler system in the greenhouse
MIT License
4 stars 7 forks source link

[Feature Request] Water other greenhouse locations #11

Open tlitookilakin opened 2 years ago

tlitookilakin commented 2 years ago

Right now the mod only waters the greenhouse itself- if mods add other locations that are greenhouses (via the map property), they will not be watered. It would be nice if it worked with those.

Proposed methods-

Add a game content data file containing a list of location names, then run through it whenever watering is triggered. Pros: fast, can be edited with content patcher. Cons: requires manual support

When entering the world, scan all locations, then check if their map has the greenhouse property. Pros: plug-and-play, can be changed with content patcher Cons: slow, not dynamic.

Add a c# API that allows adding/removing locations. Pros: fast, simple Cons: Requires c# to add compatibility

Yariazen commented 2 years ago

Hello! I'd like to add compatibility between this mod and my Buildable Greenhouse Updated mod. After reviewing the code base, it appears that there will need to be a major change in the way this mod currently works in order for our mods to work well together.

My proposed method would be similar to the 2nd method @tlitookilakin suggested: OnWarp, scan all built buildings and update a list of "greenhouses". The reason for this is because I convert built buildings to a "BuildableGreenhouse" on warp so there would be no other time to get a updated list of greenhouses. Similarly, instead of using Game1.getFarm().buildings.OfType() to check for a valid building, you can use the list of greenhouses.

This 3rd method proposed is also an option with some changes: Add a c# API that allows adding/removing building types. While this is the more elegant solution, I don't see much reason for there to be multiple buildable greenhouse mods. I'm fairly certain my own mod is the only one currently being updated.

For these reasons, I believe my proposed method would be a good way to add compatibility between our mods. With that being the case how would you like to proceed? I'm willing to work with you on adding compatibility to your mod, or if you'd prefer, I could replicate the features of this mod in my own mod (Of course an api is still prefered and I'd be more than happy to work with you on that as well). Or if you have another idea, please let me know!