Fixed the Clouds toggle text never updating and made the cloud height slider more user friendly
parent
39f49c5a9c
commit
b0e4a3e9dc
|
@ -17,6 +17,9 @@ public class ModSlider extends Button {
|
|||
this.defaultText = label;
|
||||
this.changeEvent = changeEvent;
|
||||
this.text = this.defaultText + "" + String.format("%.2f", this.value);
|
||||
if (this.id == 301) {
|
||||
this.text = this.getCloudHeightString();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,8 +40,13 @@ public class ModSlider extends Button {
|
|||
this.value = 1.0F;
|
||||
}
|
||||
|
||||
this.changeEvent.changeValue(this.value);
|
||||
this.text = this.defaultText + "" + String.format("%.2f", this.value);
|
||||
|
||||
this.changeEvent.changeValue(this.value);
|
||||
|
||||
if (this.id == 301) {
|
||||
this.text = this.getCloudHeightString();
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
@ -68,6 +76,10 @@ public class ModSlider extends Button {
|
|||
}
|
||||
}
|
||||
|
||||
private String getCloudHeightString() {
|
||||
return this.defaultText + "" + String.format("%.2f", 108.0f + (108.0f * 2.0f * this.value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased(int i, int j) {
|
||||
this.dragged = false;
|
||||
|
|
|
@ -27,6 +27,7 @@ public class VideoSettingsScreenMixin extends ScreenMixin {
|
|||
if (btn.active) {
|
||||
if (btn.id == 300) {
|
||||
ModConfig.ENABLE_CLOUDS.set(!ModConfig.ENABLE_CLOUDS.get());
|
||||
btn.text = this.getCloudsLabel();
|
||||
ci.cancel();
|
||||
}
|
||||
else if(btn.id == 301) {
|
||||
|
|
Loading…
Reference in New Issue