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

@@ -0,0 +1,32 @@
package eu.crushedpixel.replaymod.gui.elements;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
public class GuiNumberInputWithText extends GuiNumberInput {
private final Minecraft mc = Minecraft.getMinecraft();
private String suffix;
public GuiNumberInputWithText(int id, FontRenderer fontRenderer,
int xPos, int yPos, int width, Double minimum, Double maximum, Double defaultValue,
boolean acceptFloats, String suffix) {
super(id, fontRenderer, xPos, yPos, width, minimum, maximum, defaultValue, acceptFloats);
if(suffix == null) suffix = "";
this.suffix = suffix;
}
@Override
public void drawTextBox() {
int index = getCursorPosition();
String textBefore = getText();
setText(textBefore + suffix);
setCursorPosition(index);
super.drawTextBox();
setText(textBefore);
setCursorPosition(index);
}
}