mirror of
https://github.com/Shiewk/Widgets.git
synced 2026-04-28 11:34:17 +02:00
Allow changing RGBAColorWidgetSetting with arrow keys
This commit is contained in:
@@ -12,6 +12,7 @@ import net.minecraft.client.gui.cursor.StandardCursors;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder;
|
||||
import net.minecraft.client.gui.widget.ClickableWidget;
|
||||
import net.minecraft.client.input.KeyInput;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
@@ -305,6 +306,19 @@ public class RGBAColorWidgetSetting extends WidgetSettingOption {
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean keyPressed(KeyInput input) {
|
||||
if (input.isUp()) {
|
||||
setValue(getValue() + 1);
|
||||
return true;
|
||||
} else if (input.isDown()) {
|
||||
setValue(getValue() - 1);
|
||||
return true;
|
||||
} else {
|
||||
return super.keyPressed(input);
|
||||
}
|
||||
}
|
||||
|
||||
private int bottomColor() {
|
||||
return RGBAColorWidgetSetting.this.getColor() & ~componentMask();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user