Skip to content

Commit

Permalink
remove some redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
jltaylor-us committed Mar 9, 2024
1 parent d2d16e3 commit fc0a0df
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions RangeHighlight/Integrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void setRange() {
() => theMod.config.ShowJunimoRange,
() => theMod.config.ShowJunimoRangeKey,
blueprint => {
if (blueprint.name == "Junimo Hut") {
if (blueprint.Id == "Junimo Hut") {
setRange();
return new Tuple<Color, bool[,], int, int>(theMod.config.JunimoRangeTint, theMod.defaultShapes.junimoHut, 1, 1);
} else {
Expand All @@ -58,6 +58,7 @@ void setRange() {
building => {
setRange();
if (building is JunimoHut) {
// junimoHut.cropHarvestRadius can be set per-building in SDV 1.6, but who knows what Better Junimos is doing with that
setRange();
return new Tuple<Color, bool[,], int, int>(theMod.config.JunimoRangeTint, theMod.defaultShapes.junimoHut, 1, 1);
} else {
Expand Down Expand Up @@ -127,19 +128,16 @@ private void IntegrateSprinklerCommon(string highlighterName, Func<IDictionary<i
private void IntegrateBetterSprinklers() {
IBetterSprinklersApi? api = theMod.helper.ModRegistry.GetApi<IBetterSprinklersApi>("Speeder.BetterSprinklers");
if (api == null) return;
theMod.api.RemoveItemRangeHighlighter("jltaylor-us.RangeHighlight/sprinkler");
IntegrateSprinklerCommon("jltaylor-us.RangeHighlight/better-sprinkler", api.GetSprinklerCoverage, false);
}
private void IntegrateSimpleSprinklers() {
ISimplerSprinklerApi? api = theMod.helper.ModRegistry.GetApi<ISimplerSprinklerApi>("tZed.SimpleSprinkler");
if (api == null) return;
theMod.api.RemoveItemRangeHighlighter("jltaylor-us.RangeHighlight/sprinkler");
IntegrateSprinklerCommon("jltaylor-us.RangeHighlight/simple-sprinkler", api.GetNewSprinklerCoverage, false);
}
private void IntegrateLineSprinklers() {
ILineSprinklersApi? api = theMod.helper.ModRegistry.GetApi<ILineSprinklersApi>("hootless.LineSprinklers");
if (api == null) return;
theMod.api.RemoveItemRangeHighlighter("jltaylor-us.RangeHighlight/sprinkler");
IntegrateSprinklerCommon("jltaylor-us.RangeHighlight/line-sprinkler", api.GetSprinklerCoverage, true);
}
private bool[,] PointsToMask(Vector2[] points) {
Expand Down

0 comments on commit fc0a0df

Please sign in to comment.