Slightly improve formatting on the scaling slider

This commit is contained in:
Sollace 2019-08-01 23:00:44 +02:00
parent fc734c2334
commit 94091f1ae4
6 changed files with 46 additions and 32 deletions

View file

@ -91,7 +91,7 @@ public class GuiPonySettings extends GameGui {
content.addButton(new Label(LEFT, row += 30)).getStyle().setText("minelp.debug.scale");
content.addButton(new Slider(LEFT, row += 15, 0.1F, 3, config.getGlobalScaleFactor())
.onChange(config::setGlobalScaleFactor)
.setFormatter(value -> I18n.translate("minelp.debug.scale.value", I18n.translate(describeCurrentScale(value)))));
.setFormatter(value -> describeCurrentScale(value)));
content.addButton(new Label(LEFT, row += 30)).getStyle().setText("minelp.debug.size");
content.addButton(new EnumSlider<>(LEFT, row += 15, config.sizeOverride.get())
.onChange(config.sizeOverride::set));
@ -127,21 +127,26 @@ public class GuiPonySettings extends GameGui {
public String describeCurrentScale(float value) {
if (value >= 3) {
return I18n.translate("minelp.debug.scale.meg");
return "minelp.debug.scale.meg";
}
if (value == 2) {
return I18n.translate("minelp.debug.scale.max");
return "minelp.debug.scale.max";
}
if (value == 1) {
return I18n.translate("minelp.debug.scale.mid");
return "minelp.debug.scale.mid";
}
if (value == 0.9F) {
return I18n.translate("minelp.debug.scale.sa");
return "minelp.debug.scale.sa";
}
if (value <= 0.1F) {
return I18n.translate("minelp.debug.scale.min");
return "minelp.debug.scale.min";
}
return String.format("%f", value);
value *= 100F;
value = Math.round(value);
value /= 100F;
return I18n.translate("minelp.debug.scale.value", value);
}
@Override

View file

@ -47,8 +47,17 @@ public class PonyConfig extends JsonConfig {
if (f > 2.95) {
f = 3;
}
if (f > 1.97 && f < 2.03) {
f = 2;
}
if (f > 0.97 && f < 1.03) {
f = 1;
}
if (f > 0.87 && f < 0.93) {
f = 0.9F;
}
f = Math.round(MathHelper.clamp(f, 0.1F, 3) * 100) / 100F;
f = Math.round(MathHelper.clamp(f, 0.1F, 3) * 100F) / 100F;
scaleFactor.set(f);
showscale.set(f != 1);

View file

@ -23,10 +23,10 @@
"minelp.mode.wet": "See Pony",
"minelp.debug.reload_models.message": "Pony texturen neu Laden...",
"minelp.debug.scale": "Gößenfaktor",
"minelp.debug.scale.value": "Größe: %s",
"minelp.debug.scale.meg": "Mega",
"minelp.debug.scale.max": "Doppelt",
"minelp.debug.scale.mid": "Normal",
"minelp.debug.scale.sa": "Genau anzeigen",
"minelp.debug.scale.min": "Miniscule"
"minelp.debug.scale.value": "Größe: %.2f",
"minelp.debug.scale.meg": "Größe: Mega",
"minelp.debug.scale.max": "Größe: Doppelt",
"minelp.debug.scale.mid": "Größe: Normal",
"minelp.debug.scale.sa": "Größe: Genau anzeigen",
"minelp.debug.scale.min": "Größe: Miniscule"
}

View file

@ -26,11 +26,11 @@
"minelp.mode.wet": "Maremaid",
"minelp.debug.reload_models.message": "Plunderin' yer horsies...",
"minelp.debug.scale": "Sailing Factor",
"minelp.debug.scale.value": "Ship Size: %s",
"minelp.debug.scale.meg": "Enormous",
"minelp.debug.scale.max": "Huge",
"minelp.debug.scale.mid": "Big",
"minelp.debug.scale.sa": "Normal",
"minelp.debug.scale.min": "Miniscule",
"minelp.debug.scale.value": "Ship Size: %.2f",
"minelp.debug.scale.meg": "Ship Size: Enormous",
"minelp.debug.scale.max": "Ship Size: Huge",
"minelp.debug.scale.mid": "Ship Size: Big",
"minelp.debug.scale.sa": "Ship Size: Normal",
"minelp.debug.scale.min": "Ship Size: Miniscule",
"minelp.debug.size": "Bow Width"
}

View file

@ -26,11 +26,11 @@
"minelp.mode.wet": "Sea pony",
"minelp.debug.reload_models.message": "Reloading pony models...",
"minelp.debug.scale": "Scaling Factor",
"minelp.debug.scale.value": "Scale: %s",
"minelp.debug.scale.meg": "Mega",
"minelp.debug.scale.max": "Double",
"minelp.debug.scale.mid": "Default",
"minelp.debug.scale.sa": "Show Accurate",
"minelp.debug.scale.min": "Miniscule",
"minelp.debug.scale.value": "Scale: %.2f",
"minelp.debug.scale.meg": "Scale: Mega",
"minelp.debug.scale.max": "Scale: Double",
"minelp.debug.scale.mid": "Scale: Default",
"minelp.debug.scale.sa": "Scale: Show Accurate",
"minelp.debug.scale.min": "Scale: Miniscule",
"minelp.debug.size": "Size Override"
}

View file

@ -23,10 +23,10 @@
"minelp.mode.wet": "Пони под водой",
"minelp.debug.reload_models.message": "Перезагрузка моделей пони...",
"minelp.debug.scale": "Коэффициент масштабирования",
"minelp.debug.scale.value": "Масштаб: %s",
"minelp.debug.scale.meg": "Мега",
"minelp.debug.scale.max": "Удвоенный",
"minelp.debug.scale.mid": "Стандартный",
"minelp.debug.scale.sa": "Каноничный",
"minelp.debug.scale.min": "Миниатюрный"
"minelp.debug.scale.value": "Масштаб: %.2f",
"minelp.debug.scale.meg": "Масштаб: Мега",
"minelp.debug.scale.max": "Масштаб: Удвоенный",
"minelp.debug.scale.mid": "Масштаб: Стандартный",
"minelp.debug.scale.sa": "Масштаб: Каноничный",
"minelp.debug.scale.min": "Масштаб: Миниатюрный"
}