mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 15:27:29 +00:00
Clone Dialog Button
This commit is contained in:
1 parent
f5e5d569ea
commit
417fade180
1 file changed
+18
@@ -209,6 +209,24 @@ public class GuiNPCManageDialogs extends GuiNPCInterface2 implements IScrollGrou
|
||||
setSubGui(new SubGuiNpcDialog(this, dialog, category.id));
|
||||
}
|
||||
}
|
||||
// Clone Dialog
|
||||
if(id == 3) {
|
||||
saveType(true);
|
||||
if (dialogData.containsKey(dialogScroll.getSelected()) && dialog != null && dialog.id >= 0) {
|
||||
String name = dialog.title;
|
||||
while(dialogData.containsKey(name))
|
||||
name += "_";
|
||||
|
||||
if(dialogScroll != null){
|
||||
setPrevDialogName(name);
|
||||
}
|
||||
|
||||
Dialog dialog = new Dialog();
|
||||
dialog.readNBTPartial(this.dialog.writeToNBT(new NBTTagCompound()));
|
||||
dialog.title = name;
|
||||
Client.sendData(EnumPacketServer.DialogSave, category.id, dialog.writeToNBT(new NBTTagCompound()), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user