public void backSpace() { if (save.name.length() > 0) { save.name = save.name.substring(0, save.name.length() - 1); text = (save.tag.hasNoTags() ? "Save " : "Load ") + save.name; updatePosition(); } }
public void keyTyped(char c, int key) { if (key == Keyboard.KEY_BACK) { backSpace(); } if (Character.isDigit(c) || Character.isLetter(c)) { save.name += c; text = (save.tag.hasNoTags() ? "Save " : "Load ") + save.name; updatePosition(); } }
public void reset() { xVisible = false; save.tag = new NBTTagCompound(); text = "Save " + save.name; updatePosition(); }