GuiAssetAdder now allows to add/remove/edit Assets in a Replay. These Assets are not being saved yet.

This commit is contained in:
CrushedPixel
2015-07-06 16:39:30 +02:00
parent bf7b28d53c
commit 948803571d
14 changed files with 283 additions and 62 deletions

View File

@@ -15,12 +15,9 @@ public class GuiNumberInput extends GuiTextField {
this.minimum = minimum;
this.maximum = maximum;
this.acceptFloats = acceptFloats;
setCursorPositionZero();
if(defaultValue != null) {
if(acceptFloats) {
setText("" + defaultValue);
} else {
setText("" + (int)Math.round(defaultValue));
}
setValue(defaultValue);
}
}
@@ -29,6 +26,15 @@ public class GuiNumberInput extends GuiTextField {
this(id, fontRenderer, xPos, yPos, width, (double) minimum, (double) maximum, (double) defaultValue, acceptFloats);
}
public void setValue(double value) {
if(acceptFloats) {
setText("" + value);
} else {
setText("" + (int)Math.round(value));
}
setCursorPositionZero();
}
@Override
public void writeText(String text) {
String textBefore = getText();