Use GetSprinklerTiles
for Default Sprinkler Coverage for higher compatibility
#5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, RangeHighlight leverages
GetModifiedRangeForSprinkler
to calculate the mask for sprinklers. SMAPI (and Stardew), also expose aGetSprinklerTiles
method, though which already has the exact covered tiles as output -- this method is significantly easier for Mod Authors to override, which means leveraging this vanilla function will make it much easier to be compatible with more mods. Note that this is the method used by UIInfoSuite 2, as well.Why?
My interest here is building compatibility with Line Sprinklers Redux (my mod). Given the purpose of the mod (spiritual successor to hootless' Line Sprinklers mod), I can't leverage GetModifiedRangeForSprinkler.
Testing
![TestGif](https://camo.githubusercontent.com/45070b16852d2cc428663f11376026bfe0186a3ad591e8c33dd10dddf60822e0/68747470733a2f2f692e696d6775722e636f6d2f58764549446e692e706e67)
Image of my changes working correctly for both vanilla sprinklers and my modded sprinklers, with and without pressure nozzles: