Super secret stuff

This commit is contained in:
Sollace 2018-10-21 17:19:00 +02:00
parent c8179df19d
commit 358691570f
2 changed files with 28 additions and 1 deletions

View file

@ -1,5 +1,7 @@
package com.minelittlepony;
import net.minecraft.util.math.MathHelper;
import com.google.gson.annotations.Expose;
import com.minelittlepony.pony.data.PonyLevel;
import com.minelittlepony.settings.SensibleConfig;
@ -42,6 +44,8 @@ public class PonyConfig extends SensibleConfig implements Exposable {
@Expose public boolean guardians = true;
@Expose public boolean endermen = true;
@Expose private float globalScaleFactor = 0.9F;
/**
* Gets the current PonyLevel. That is the level of ponies you would like to see.
*
@ -74,7 +78,14 @@ public class PonyConfig extends SensibleConfig implements Exposable {
}
}
public void setGlobalScaleFactor(float f) {
globalScaleFactor = Math.round(MathHelper.clamp(f, 0.1F, 1) * 100) / 100F;
}
/**
* Gets the universal scale factor used to determine how tall ponies are.
*/
public float getGlobalScaleFactor() {
return showscale ? 0.9F : 1;
return showscale ? globalScaleFactor : 1;
}
}

View file

@ -45,6 +45,22 @@ public class GuiPonySettings extends SettingsPanel {
return (float)level.ordinal();
}));
if (isCtrlKeyDown() && isShiftKeyDown()) {
addButton(new Label(LEFT, row += 30, OPTIONS_PREFIX + "global_scale", -1));
addButton(new Slider(LEFT, row += 15, 0.1F, 1, config.getGlobalScaleFactor(), (int id, String name, float value) -> {
if (value >= 1) {
return "Scale: Default";
}
if (value == 0.9F) {
return "Scale: Show Accurate";
}
return String.format("Scale: %f", value);
}, v -> {
config.setGlobalScaleFactor(v);
return config.getGlobalScaleFactor();
}));
}
row += 15;
addButton(new Label(LEFT, row += 15, OPTIONS_PREFIX + "options", -1));
for (PonySettings i : PonySettings.values()) {