diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-12-25 18:59:49 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2024-04-16 00:38:17 +0900 |
| commit | 89d25568036a31f58fa40e3209a1b9dd05277c65 (patch) | |
| tree | b51387e3d136d5d459de54f79004bb58088d0db9 /api/src/main/java/me | |
| parent | b0b36e7b82272b938098fb700faea4af4ec253c9 (diff) | |
| download | RoughlyEnoughItems-89d25568036a31f58fa40e3209a1b9dd05277c65.tar.gz RoughlyEnoughItems-89d25568036a31f58fa40e3209a1b9dd05277c65.tar.bz2 RoughlyEnoughItems-89d25568036a31f58fa40e3209a1b9dd05277c65.zip | |
Fix #1281
Diffstat (limited to 'api/src/main/java/me')
| -rw-r--r-- | api/src/main/java/me/shedaniel/rei/api/client/config/ConfigObject.java | 10 | ||||
| -rw-r--r-- | api/src/main/java/me/shedaniel/rei/api/client/favorites/CompoundFavoriteRenderer.java | 5 |
2 files changed, 13 insertions, 2 deletions
diff --git a/api/src/main/java/me/shedaniel/rei/api/client/config/ConfigObject.java b/api/src/main/java/me/shedaniel/rei/api/client/config/ConfigObject.java index 94e119eae..818bea9d5 100644 --- a/api/src/main/java/me/shedaniel/rei/api/client/config/ConfigObject.java +++ b/api/src/main/java/me/shedaniel/rei/api/client/config/ConfigObject.java @@ -119,9 +119,19 @@ public interface ConfigObject { * * @return whether favorites motions are animated */ + @Deprecated(forRemoval = true) boolean isFavoritesAnimated(); /** + * Returns whether motions are reduced. + * + * @return whether motions are reduced + * @since 8.4 + */ + @ApiStatus.Experimental + boolean isReducedMotion(); + + /** * Returns whether a toast is shown on screen when a display identifier is copied. * * @return whether a toast is shown on screen when a display identifier is copied diff --git a/api/src/main/java/me/shedaniel/rei/api/client/favorites/CompoundFavoriteRenderer.java b/api/src/main/java/me/shedaniel/rei/api/client/favorites/CompoundFavoriteRenderer.java index 4c25a2e94..c7bddf768 100644 --- a/api/src/main/java/me/shedaniel/rei/api/client/favorites/CompoundFavoriteRenderer.java +++ b/api/src/main/java/me/shedaniel/rei/api/client/favorites/CompoundFavoriteRenderer.java @@ -29,6 +29,7 @@ import me.shedaniel.clothconfig2.api.ScissorsHandler; import me.shedaniel.clothconfig2.api.animator.NumberAnimator; import me.shedaniel.clothconfig2.api.animator.ValueAnimator; import me.shedaniel.math.Rectangle; +import me.shedaniel.rei.api.client.config.ConfigObject; import me.shedaniel.rei.api.client.gui.AbstractRenderer; import me.shedaniel.rei.api.client.gui.Renderer; import net.fabricmc.api.EnvType; @@ -115,10 +116,10 @@ public class CompoundFavoriteRenderer extends AbstractRenderer { } if (Util.getMillis() - nextSwitch > 1000) { nextSwitch = Util.getMillis(); - offset.setTo((offset.target().intValue() + 1) % count, 500); + offset.setTo((offset.target().intValue() + 1) % count, ConfigObject.getInstance().isReducedMotion() ? 0 : 500); } } else { - offset.setTo(supplier.getAsInt() % count, 500); + offset.setTo(supplier.getAsInt() % count, ConfigObject.getInstance().isReducedMotion() ? 0 : 500); } } } |
