Got argument edits to save/load/update

This commit is contained in:
DarkGuardsman 2013-12-02 07:49:48 -05:00
parent c04830ebc4
commit 59b1382134
3 changed files with 2 additions and 4 deletions

View file

@ -18,6 +18,7 @@ public class ArgumentData implements ISaveObj
{
this.name = name;
this.defaultValue = defaultValue;
this.currentValue = defaultValue;
}
/** Sets the value

View file

@ -135,17 +135,14 @@ public abstract class TaskBase implements ITask
{
this.col = nbt.getInteger("col");
this.row = nbt.getInteger("row");
System.out.println("\nLoading task data");
if (this.getArgs() != null)
{
NBTTagCompound parms = nbt.getCompoundTag("args");
for (ArgumentData arg : this.getArgs())
{
System.out.println("Loading data for " + arg.getName());
Object obj = NBTFileHelper.loadObject(parms, arg.getName());
if (arg.isValid(obj))
{
System.out.println("data is valid " + obj.toString());
arg.setData(obj);
}
}
@ -155,7 +152,6 @@ public abstract class TaskBase implements ITask
@Override
public void save(NBTTagCompound nbt)
{
System.out.println("\nSaving task data");
nbt.setInteger("col", this.col);
nbt.setInteger("row", this.row);
NBTTagCompound parms = new NBTTagCompound();

View file

@ -167,6 +167,7 @@ public class GuiEditTask extends GuiBase implements IMessageBoxDialog
this.argTextBoxes[i].setText("");
}
}
i++;
}
}
this.gui.getTile().updateTask(this.editTask);