diff --git a/src/main/java/noppes/npcs/client/gui/SubGuiAnimationFrame.java b/src/main/java/noppes/npcs/client/gui/SubGuiAnimationFrame.java index 9518f0977..62837a495 100644 --- a/src/main/java/noppes/npcs/client/gui/SubGuiAnimationFrame.java +++ b/src/main/java/noppes/npcs/client/gui/SubGuiAnimationFrame.java @@ -37,6 +37,9 @@ public class SubGuiAnimationFrame extends SubGuiInterface implements ITextfieldL this.getTextField(13).integersOnly = true; this.getTextField(13).setMinMaxDefault(1, Integer.MAX_VALUE, 50); } + + this.addLabel(new GuiNpcLabel(14, "Comment", guiLeft + 5, guiTop + 106)); + this.addTextField(new GuiNpcTextField(14, this, guiLeft + 50, guiTop + 101, 120, 15, editingFrame.getComment())); } @Override @@ -66,6 +69,8 @@ public class SubGuiAnimationFrame extends SubGuiInterface implements ITextfieldL this.editingFrame.speed = textfield.getFloat(); } else if (textfield.id == 13) { this.editingFrame.tickDuration = textfield.getInteger(); + } else if (textfield.id == 14) { + this.editingFrame.setComment(textfield.getText()); } } } diff --git a/src/main/java/noppes/npcs/controllers/data/Frame.java b/src/main/java/noppes/npcs/controllers/data/Frame.java index c59fd0ec8..461d41d23 100644 --- a/src/main/java/noppes/npcs/controllers/data/Frame.java +++ b/src/main/java/noppes/npcs/controllers/data/Frame.java @@ -21,6 +21,7 @@ public class Frame implements IFrame { public byte smooth = 0; private int colorMarker = 0xFFFFFF; + private String comment = ""; public Frame(){} @@ -120,11 +121,22 @@ public class Frame implements IFrame { this.colorMarker = color; } + public String getComment() { + return this.comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + public void readFromNBT(NBTTagCompound compound){ duration = compound.getInteger("Duration"); if (compound.hasKey("ColorMarker")) { this.setColorMarker(compound.getInteger("ColorMarker")); } + if (compound.hasKey("Comment")) { + this.comment = compound.getString("Comment"); + } // Customized = TRUE if Speed or Smooth Exist if(compound.hasKey("Speed")){ @@ -169,6 +181,7 @@ public class Frame implements IFrame { NBTTagCompound compound = new NBTTagCompound(); compound.setInteger("Duration", duration); compound.setInteger("ColorMarker", this.colorMarker); + compound.setString("Comment", this.comment); if(customized){ compound.setFloat("Speed", speed);