Got argument edits to save/load/update
This commit is contained in:
parent
c04830ebc4
commit
59b1382134
3 changed files with 2 additions and 4 deletions
|
@ -18,6 +18,7 @@ public class ArgumentData implements ISaveObj
|
|||
{
|
||||
this.name = name;
|
||||
this.defaultValue = defaultValue;
|
||||
this.currentValue = defaultValue;
|
||||
}
|
||||
|
||||
/** Sets the value
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -167,6 +167,7 @@ public class GuiEditTask extends GuiBase implements IMessageBoxDialog
|
|||
this.argTextBoxes[i].setText("");
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
this.gui.getTile().updateTask(this.editTask);
|
||||
|
|
Loading…
Reference in a new issue