Removed some unneeded methods.
- Removed "isImplemented" field from GameMod as all of the base mods have been implemented. - Removed Utils.getBoundedValue() methods in preference for Utils.clamp(). Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
@@ -460,7 +460,7 @@ public class MenuButton {
|
||||
return;
|
||||
|
||||
int d = delta * (autoAnimationForward ? 1 : -1);
|
||||
if (Utils.getBoundedValue(time, d, 0, animationDuration) == time) {
|
||||
if (Utils.clamp(time + d, 0, animationDuration) == time) {
|
||||
if (reverseAtEnd)
|
||||
autoAnimationForward = !autoAnimationForward;
|
||||
else {
|
||||
|
||||
@@ -263,7 +263,7 @@ public class UI {
|
||||
*/
|
||||
public static void changeVolume(int units) {
|
||||
final float UNIT_OFFSET = 0.05f;
|
||||
Options.setMasterVolume(container, Utils.getBoundedValue(Options.getMasterVolume(), UNIT_OFFSET * units, 0f, 1f));
|
||||
Options.setMasterVolume(container, Utils.clamp(Options.getMasterVolume() + (UNIT_OFFSET * units), 0f, 1f));
|
||||
if (volumeDisplay == -1)
|
||||
volumeDisplay = 0;
|
||||
else if (volumeDisplay >= VOLUME_DISPLAY_TIME / 10)
|
||||
|
||||
@@ -105,7 +105,7 @@ public class AnimatedValue {
|
||||
* @return true if an update was applied, false if the animation was not updated
|
||||
*/
|
||||
public boolean update(int delta) {
|
||||
int newTime = Utils.getBoundedValue(time, delta, 0, duration);
|
||||
int newTime = Utils.clamp(time + delta, 0, duration);
|
||||
if (time != newTime) {
|
||||
this.time = newTime;
|
||||
updateValue();
|
||||
|
||||
Reference in New Issue
Block a user