use of betterquesting.client.gui.editors.json.GuiJsonTypeMenu in project BetterQuesting by Funwayguy.
the class ScrollingJsonEntry method onActionPerformed.
public void onActionPerformed(GuiButtonThemed btn) {
if (// Delete Entry
je != null && btn.id == 3) {
if (json.getId() == 10) {
((NBTTagCompound) json).removeTag(key);
host.getEntryList().remove(this);
host.refresh();
return;
} else if (json.getId() == 9) {
((NBTTagList) json).removeTag(idx);
host.getEntryList().remove(this);
host.refresh();
return;
}
}
if (btn.id == 2) {
if (json.getId() == 9) {
mc.displayGuiScreen(new GuiJsonAdd(mc.currentScreen, (NBTTagList) json, idx));
return;
} else if (json.getId() == 10) {
mc.displayGuiScreen(new GuiJsonAdd(mc.currentScreen, (NBTTagCompound) json));
return;
}
} else if (je != null && je.getId() == 10) {
NBTTagCompound jo = (NBTTagCompound) je;
IJsonDoc childDoc = jDoc == null ? null : jDoc.getChildDoc(key);
if (// Main
btn.id == 0) {
if (!(JsonHelper.isItem(jo) || JsonHelper.isFluid(jo) || JsonHelper.isEntity(jo))) {
mc.displayGuiScreen(new GuiJsonEditor(mc.currentScreen, jo, childDoc));
} else if (JsonHelper.isItem(jo)) {
mc.displayGuiScreen(new GuiJsonItemSelection(mc.currentScreen, new JsonItemCallback(jo), JsonHelper.JsonToItemStack(jo)));
} else if (JsonHelper.isFluid(jo)) {
mc.displayGuiScreen(new GuiJsonFluidSelection(mc.currentScreen, new JsonFluidCallback(jo), JsonHelper.JsonToFluidStack(jo)));
} else if (JsonHelper.isEntity(jo)) {
mc.displayGuiScreen(new GuiJsonEntitySelection(mc.currentScreen, new JsonEntityCallback(jo), JsonHelper.JsonToEntity(jo, mc.world, true)));
}
} else if (// Advanced
btn.id == 1) {
mc.displayGuiScreen(new GuiJsonTypeMenu(mc.currentScreen, jo));
}
} else if (je != null && je.getId() == 9) {
mc.displayGuiScreen(new GuiJsonEditor(mc.currentScreen, (NBTTagList) je, jDoc));
}
/* else if(je != null && je.isJsonPrimitive() && je.getAsJsonPrimitive().isBoolean())
{
if(json.isJsonObject())
{
json.getAsJsonObject().addProperty(key, !je.getAsBoolean());
host.refresh();
return;
} else if(json.isJsonArray())
{
JsonHelper.GetUnderlyingArray(json.getAsJsonArray()).set(idx, new JsonPrimitive(!je.getAsBoolean()));
host.refresh();
return;
}
}*/
}
Aggregations