Added GuiRenderSettings to customize rendering

This commit is contained in:
CrushedPixel
2015-05-24 01:26:01 +02:00
parent 18f22f57d0
commit 2b3bc2787a
8 changed files with 384 additions and 22 deletions

View File

@@ -1,6 +1,5 @@
package eu.crushedpixel.replaymod.gui;
import eu.crushedpixel.replaymod.ReplayMod;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
@@ -49,16 +48,19 @@ public class GuiVideoQualitySlider extends GuiButton {
f = snapValue(f);
sliderValue = normalizeValue(f);
this.displayString = displayKey + ": " + translate(f);
ReplayMod.replaySettings.setVideoQuality(f);
}
mc.getTextureManager().bindTexture(buttonTextures);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.drawTexturedModalRect(this.xPosition + (int) (sliderValue * (float) (this.width - 8)), this.yPosition, 0, 66, 4, 20);
this.drawTexturedModalRect(this.xPosition + (int) (sliderValue * (float) (this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20);
this.drawTexturedModalRect(this.xPosition + (int)Math.ceil(sliderValue * (float) (this.width - 8)), this.yPosition, 0, 66, 4, 20);
this.drawTexturedModalRect(this.xPosition + (int)Math.ceil(sliderValue * (float) (this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20);
}
}
public float getQuality() {
return snapValue(denormalizeValue(sliderValue));
}
private float snapValue(float val) {
int i = Math.round(val * 10);
return i / 10f;