Map<String, Expansion> expansions = this.mod.getExpansionList();
int id = 0;
{
final VolumeUpdatable globalVolumeControl = this.mod.getGlobalVolumeControl();
HGuiSliderControl sliderControl =
new HGuiSliderControl(
id, _LEFT, _MIX, _ELEMENT_WIDTH, _UNIT, "", globalVolumeControl.getVolume() * 0.5f);
sliderControl.setListener(new HSliderListener() {
@Override
public void sliderValueChanged(HGuiSliderControl slider, float value)
{
globalVolumeControl.setVolumeAndUpdate(value * 2);
slider.updateDisplayString();
MAtGuiMenu.this.mod.getConfig().setProperty("globalvolume.scale", globalVolumeControl.getVolume());
}
@Override
public void sliderPressed(HGuiSliderControl hGuiSliderControl)
{
}
@Override
public void sliderReleased(HGuiSliderControl hGuiSliderControl)
{
}
});
sliderControl.setDisplayStringProvider(new HDisplayStringProvider() {
@Override
public String provideDisplayString()
{
return "Global Volume Control: " + (int) Math.floor(globalVolumeControl.getVolume() * 100) + "%";
}
});
sliderControl.updateDisplayString();
this.buttonList.add(sliderControl);