|
|
|
@@ -24,10 +24,17 @@ import online.astradev.plus.editor.network.EditorConnection;
|
|
|
|
|
/** Ghost slots edit a draft only. Click selects an item; drag swaps slots; right-click clears. */
|
|
|
|
|
public final class RecipeEditorScreen extends EditorScreen {
|
|
|
|
|
private record Cell(int index, int x, int y, String label) {}
|
|
|
|
|
private record Decoration(ItemStack stack, int x, int y, String label) {}
|
|
|
|
|
private record Label(String text, int x, int y, int width) {}
|
|
|
|
|
private final Screen parent;
|
|
|
|
|
private final EditorConnection connection;
|
|
|
|
|
private final ContentDraft draft;
|
|
|
|
|
private final List<Cell> cells = new ArrayList<>();
|
|
|
|
|
private final List<Decoration> decorations = new ArrayList<>();
|
|
|
|
|
private final List<Label> labels = new ArrayList<>();
|
|
|
|
|
private final Map<String, String> typed = new HashMap<>(), errors = new HashMap<>();
|
|
|
|
|
private int parameterPage, boardX, boardY, panelX, selectedSlot;
|
|
|
|
|
private net.minecraft.client.gui.components.Button saveButton;
|
|
|
|
|
private final Map<String, CatalogIcon> icons = new HashMap<>();
|
|
|
|
|
private final Set<String> requested = new HashSet<>();
|
|
|
|
|
private int pending, pressed = -2;
|
|
|
|
@@ -41,20 +48,21 @@ public final class RecipeEditorScreen extends EditorScreen {
|
|
|
|
|
var id = addRenderableWidget(new EditBox(font, 12, 40, width - 24, 20, Component.literal("ID рецепта")));
|
|
|
|
|
id.setMaxLength(256); id.setValue(draft.id()); id.setEditable(draft.fresh()); id.setResponder(value -> draft.string(value, "id"));
|
|
|
|
|
String station = draft.text("crafting", "station");
|
|
|
|
|
button(RecipeDraft.STATIONS.get(station).name() + "…", 12, 68, Math.max(90, (width - 32) / 2), () -> {
|
|
|
|
|
var names = RecipeDraft.STATIONS.values().stream().map(RecipeDraft.Station::name).sorted().toList();
|
|
|
|
|
minecraft.gui.setScreen(new ChoiceScreen(this, "Блок рецепта", names, name -> {
|
|
|
|
|
RecipeDraft.STATIONS.entrySet().stream().filter(e -> e.getValue().name().equals(name)).findFirst().ifPresent(e -> RecipeDraft.station(draft, e.getKey()));
|
|
|
|
|
}));
|
|
|
|
|
});
|
|
|
|
|
button("Параметры…", 20 + (width - 32) / 2, 68, (width - 32) / 2, () -> minecraft.gui.setScreen(new SettingsScreen(this,
|
|
|
|
|
"Параметры рецепта", draft.document(), RecipeDraft::fields, draft::replace, List.of(), "Настройки относятся только к выбранному блоку.")));
|
|
|
|
|
panelX = Math.max(226, width / 2);
|
|
|
|
|
button(RecipeDraft.STATIONS.get(station).name() + "…", 36, 68, panelX - 52,
|
|
|
|
|
() -> minecraft.gui.setScreen(new RecipeStationPicker(this, type -> {
|
|
|
|
|
RecipeDraft.station(draft, type); parameterPage = 0; selectedSlot = 0; typed.clear(); errors.clear(); status("", false);
|
|
|
|
|
})));
|
|
|
|
|
layout();
|
|
|
|
|
button("Сохранить", 12, height - 27, 100, this::save).active = !saving;
|
|
|
|
|
parameters();
|
|
|
|
|
slotQuantity();
|
|
|
|
|
saveButton = button("Сохранить", 12, height - 27, 100, this::save); saveButton.active = !saving && errors.isEmpty();
|
|
|
|
|
button("Назад", width - 112, height - 27, 100, this::onClose);
|
|
|
|
|
}
|
|
|
|
|
private void layout() {
|
|
|
|
|
cells.clear(); int x = width / 2 - 90, y = height < 300 ? 99 : 117; String station = draft.text("crafting", "station");
|
|
|
|
|
cells.clear(); decorations.clear();
|
|
|
|
|
boardX = 12 + (panelX - 24 - 192) / 2; boardY = 98;
|
|
|
|
|
int x = boardX, y = boardY; String station = draft.text("crafting", "station");
|
|
|
|
|
switch (station) {
|
|
|
|
|
case "crafting" -> { for (int i = 0; i < 9; i++) cells.add(new Cell(i, x + (i % 3) * 24, y + (i / 3) * 24, "Ингредиент " + (i + 1))); }
|
|
|
|
|
case "smithing" -> { for (int i = 0; i < 3; i++) cells.add(new Cell(i, x + i * 30, y + 24, List.of("Шаблон", "Основа", "Добавка").get(i))); }
|
|
|
|
@@ -64,13 +72,110 @@ public final class RecipeEditorScreen extends EditorScreen {
|
|
|
|
|
}
|
|
|
|
|
case "brewing" -> {
|
|
|
|
|
cells.add(new Cell(1, x + 30, y, "Добавка"));
|
|
|
|
|
decorations.add(new Decoration(new ItemStack(net.minecraft.world.item.Items.BLAZE_POWDER), x - 1, y, "Топливо: огненный порошок (ванильное)"));
|
|
|
|
|
for (int i = 0; i < 3; i++) cells.add(new Cell(0, x + i * 30, y + 42 + (i == 1 ? 5 : 0), "Основа зелья — одинаковый рецепт для каждой бутылки"));
|
|
|
|
|
}
|
|
|
|
|
case "anvil" -> { cells.add(new Cell(0, x, y + 24, "Левый предмет")); cells.add(new Cell(1, x + 60, y + 24, "Правый предмет")); }
|
|
|
|
|
case "grindstone", "cartography" -> { cells.add(new Cell(0, x + 30, y, "Основной предмет")); cells.add(new Cell(1, x + 30, y + 42, "Дополнительный предмет")); }
|
|
|
|
|
case "smelting", "smoking", "blasting" -> {
|
|
|
|
|
cells.add(new Cell(0, x + 30, y, "Ингредиент"));
|
|
|
|
|
decorations.add(new Decoration(new ItemStack(net.minecraft.world.item.Items.COAL), x + 30, y + 44, "Пример топлива; используется ванильное топливо"));
|
|
|
|
|
}
|
|
|
|
|
default -> cells.add(new Cell(0, x + 30, y + 12, "Ингредиент"));
|
|
|
|
|
}
|
|
|
|
|
if (!station.equals("composting")) cells.add(new Cell(-1, x + 144, y + 24, "Результат"));
|
|
|
|
|
else decorations.add(new Decoration(new ItemStack(net.minecraft.world.item.Items.BONE_MEAL), x + 144, y + 24, "Результат полного компостирования: костная мука"));
|
|
|
|
|
nativeLayout(station);
|
|
|
|
|
}
|
|
|
|
|
private void nativeLayout(String station) {
|
|
|
|
|
int[][] positions = switch (station) {
|
|
|
|
|
case "crafting" -> new int[][]{{30,17},{48,17},{66,17},{30,35},{48,35},{66,35},{30,53},{48,53},{66,53},{124,35}};
|
|
|
|
|
case "smithing" -> new int[][]{{8,48},{26,48},{44,48},{98,48}};
|
|
|
|
|
case "loom" -> new int[][]{{13,26},{33,26},{23,45},{143,57}};
|
|
|
|
|
case "brewing" -> new int[][]{{79,17},{56,51},{79,58},{102,51},{145,51}};
|
|
|
|
|
case "anvil" -> new int[][]{{27,47},{76,47},{134,47}};
|
|
|
|
|
case "grindstone" -> new int[][]{{49,19},{49,40},{129,34}};
|
|
|
|
|
case "cartography" -> new int[][]{{15,15},{15,52},{145,39}};
|
|
|
|
|
case "stonecutting" -> new int[][]{{20,33},{143,33}};
|
|
|
|
|
case "smelting", "smoking", "blasting" -> new int[][]{{56,17},{116,35}};
|
|
|
|
|
default -> null;
|
|
|
|
|
};
|
|
|
|
|
if (positions != null) for (int i = 0; i < cells.size(); i++) {
|
|
|
|
|
var cell = cells.get(i); cells.set(i, new Cell(cell.index, boardX + positions[i][0] - 1, boardY + positions[i][1] - 1, cell.label));
|
|
|
|
|
}
|
|
|
|
|
if (!decorations.isEmpty() && !station.equals("composting")) {
|
|
|
|
|
var decoration = decorations.getFirst(); boolean brewing = station.equals("brewing");
|
|
|
|
|
decorations.set(0, new Decoration(decoration.stack, boardX + (brewing ? 16 : 55), boardY + (brewing ? 16 : 52), decoration.label));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private void background(GuiGraphicsExtractor graphics, String station) {
|
|
|
|
|
String texture = switch (station) {
|
|
|
|
|
case "crafting" -> "crafting_table"; case "smithing" -> "smithing";
|
|
|
|
|
case "brewing" -> "brewing_stand"; case "smelting" -> "furnace";
|
|
|
|
|
case "smoking" -> "smoker"; case "blasting" -> "blast_furnace";
|
|
|
|
|
case "stonecutting" -> "stonecutter"; case "cartography" -> "cartography_table";
|
|
|
|
|
case "anvil", "grindstone", "loom" -> station; default -> null;
|
|
|
|
|
};
|
|
|
|
|
if (texture != null) graphics.blit(net.minecraft.client.renderer.RenderPipelines.GUI_TEXTURED,
|
|
|
|
|
Identifier.withDefaultNamespace("textures/gui/container/" + texture + ".png"), boardX, boardY, 0, 0, 176, 83, 256, 256);
|
|
|
|
|
else {
|
|
|
|
|
graphics.fill(boardX, boardY, boardX + 176, boardY + 83, 0xFFC6C6C6);
|
|
|
|
|
graphics.item(new ItemStack(BuiltInRegistries.ITEM.getValue(Identifier.withDefaultNamespace(RecipeDraft.STATIONS.get(station).block()))), boardX + 80, boardY + 27);
|
|
|
|
|
graphics.text(font, "→", boardX + 113, boardY + 31, 0xFF404040);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private void parameters() {
|
|
|
|
|
labels.clear();
|
|
|
|
|
var fields = RecipeDraft.fields(draft); int rows = Math.max(1, (height - 180) / 40 + 1);
|
|
|
|
|
int pages = Math.max(1, (fields.size() + rows - 1) / rows); parameterPage = Math.min(parameterPage, pages - 1);
|
|
|
|
|
int fieldWidth = width - panelX - 12;
|
|
|
|
|
labels.add(new Label("Параметры" + (pages > 1 ? " " + (parameterPage + 1) + "/" + pages : ""), panelX, 74, fieldWidth - (pages > 1 ? 66 : 0)));
|
|
|
|
|
if (pages > 1) {
|
|
|
|
|
button("←", width - 74, 68, 28, () -> { parameterPage--; rebuildWidgets(); }).active = parameterPage > 0;
|
|
|
|
|
button("→", width - 42, 68, 28, () -> { parameterPage++; rebuildWidgets(); }).active = parameterPage + 1 < pages;
|
|
|
|
|
}
|
|
|
|
|
for (int i = parameterPage * rows; i < Math.min(fields.size(), (parameterPage + 1) * rows); i++) {
|
|
|
|
|
var field = fields.get(i); int y = 110 + (i % rows) * 40;
|
|
|
|
|
labels.add(new Label(field.label(), panelX, y - 11, fieldWidth));
|
|
|
|
|
if (field.cycle()) button(display(field.read().get()), panelX, y, fieldWidth, field.hint(), () -> {
|
|
|
|
|
int selected = field.choices().indexOf(field.read().get());
|
|
|
|
|
edit(field, field.choices().get((selected + 1) % field.choices().size())); rebuildWidgets();
|
|
|
|
|
});
|
|
|
|
|
else {
|
|
|
|
|
var box = addRenderableWidget(new EditBox(font, panelX, y, fieldWidth, 20, Component.literal(field.label())));
|
|
|
|
|
box.setMaxLength(field.key().equals("name") ? 128 : 32); box.setValue(typed.getOrDefault(field.key(), field.read().get()));
|
|
|
|
|
box.setTooltip(net.minecraft.client.gui.components.Tooltip.create(Component.literal(field.hint())));
|
|
|
|
|
box.setResponder(value -> edit(field, value));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private void slotQuantity() {
|
|
|
|
|
int index = selectedSlot;
|
|
|
|
|
String key = "input.count." + index;
|
|
|
|
|
var field = online.astradev.plus.editor.form.FormField.text(key, "Количество в слоте " + (index + 1), "Предметов в этом слоте на один рецепт", () -> RecipeDraft.slot(draft, index).get("count").getAsString(), value -> {
|
|
|
|
|
int count;
|
|
|
|
|
try { count = Integer.parseInt(value); } catch (NumberFormatException error) { throw new IllegalArgumentException("Введите целое число"); }
|
|
|
|
|
var slot = RecipeDraft.slot(draft, index).deepCopy(); var icon = icon(slot);
|
|
|
|
|
int max = icon == null ? 64 : icon.stack().getMaxStackSize();
|
|
|
|
|
if (draft.text("", "station").equals("brewing") && index == 0) max = 1;
|
|
|
|
|
if (count < 1 || count > max) throw new IllegalArgumentException("От 1 до " + max);
|
|
|
|
|
slot.addProperty("count", count); RecipeDraft.slot(draft, index, slot);
|
|
|
|
|
});
|
|
|
|
|
labels.add(new Label("Слот " + (index + 1) + ": количество", 12, 192, panelX - 78));
|
|
|
|
|
var box = addRenderableWidget(new EditBox(font, panelX - 62, 187, 46, 18, Component.literal(field.label())));
|
|
|
|
|
box.setMaxLength(2); box.setValue(typed.getOrDefault(key, field.read().get()));
|
|
|
|
|
box.setEditable(!RecipeDraft.slot(draft, index).get("id").getAsString().isEmpty());
|
|
|
|
|
box.setResponder(value -> edit(field, value));
|
|
|
|
|
}
|
|
|
|
|
private static String display(String value) {
|
|
|
|
|
return switch (value) { case "true" -> "Да"; case "false" -> "Нет"; case "water" -> "Вода";
|
|
|
|
|
case "lava" -> "Лава"; case "powder_snow" -> "Рыхлый снег"; case "empty" -> "Пустой котёл"; default -> value; };
|
|
|
|
|
}
|
|
|
|
|
private void edit(online.astradev.plus.editor.form.FormField field, String value) {
|
|
|
|
|
try { field.write().accept(value); typed.remove(field.key()); errors.remove(field.key()); }
|
|
|
|
|
catch (IllegalArgumentException error) { typed.put(field.key(), value); errors.put(field.key(), field.label() + ": " + error.getMessage()); }
|
|
|
|
|
status(errors.isEmpty() ? "" : errors.values().iterator().next(), !errors.isEmpty());
|
|
|
|
|
if (saveButton != null) saveButton.active = !saving && errors.isEmpty();
|
|
|
|
|
}
|
|
|
|
|
private CatalogIcon icon(JsonObject slot) {
|
|
|
|
|
String id = slot.get("id").getAsString(); if (id.isEmpty()) return null;
|
|
|
|
@@ -92,46 +197,39 @@ public final class RecipeEditorScreen extends EditorScreen {
|
|
|
|
|
}
|
|
|
|
|
@Override public void extractRenderState(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) {
|
|
|
|
|
super.extractRenderState(graphics, mouseX, mouseY, a);
|
|
|
|
|
String station = draft.text("crafting", "station"); int x = width / 2 - 90;
|
|
|
|
|
int shift = height < 300 ? -18 : 0;
|
|
|
|
|
if (height >= 300) graphics.text(font, font.plainSubstrByWidth(draft.text("Новый рецепт", "name"), width - 24), 12, 99, 0xFFE0F4F4);
|
|
|
|
|
graphics.fill(x - 12, 111 + shift, x + 180, 193 + shift, 0xFF24343D);
|
|
|
|
|
graphics.text(font, "→", x + 111, 149 + shift, 0xFFE0F4F4);
|
|
|
|
|
String station = draft.text("crafting", "station"); int x = boardX;
|
|
|
|
|
graphics.item(new ItemStack(BuiltInRegistries.ITEM.getValue(Identifier.parse("minecraft:" + RecipeDraft.STATIONS.get(station).block()))), 14, 70);
|
|
|
|
|
background(graphics, station);
|
|
|
|
|
labels.forEach(label -> graphics.text(font, font.plainSubstrByWidth(label.text, label.width), label.x, label.y, 0xFFB9CDD3));
|
|
|
|
|
for (Cell cell : cells) {
|
|
|
|
|
boolean hovered = contains(cell, mouseX, mouseY);
|
|
|
|
|
graphics.fill(cell.x, cell.y, cell.x + 22, cell.y + 22, hovered ? 0xFF8AA9AD : 0xFF64747A);
|
|
|
|
|
graphics.fill(cell.x + 1, cell.y + 1, cell.x + 21, cell.y + 21, 0xFF101C23);
|
|
|
|
|
graphics.fill(cell.x, cell.y, cell.x + 18, cell.y + 18, hovered ? 0xFF8AA9AD : cell.index == selectedSlot ? 0xFFE5C06A : 0xFF373737);
|
|
|
|
|
graphics.fill(cell.x + 1, cell.y + 1, cell.x + 17, cell.y + 17, 0xFF8B8B8B);
|
|
|
|
|
var slot = RecipeDraft.slot(draft, cell.index); var icon = icon(slot);
|
|
|
|
|
if (icon != null) {
|
|
|
|
|
graphics.item(icon.stack(), cell.x + 3, cell.y + 3);
|
|
|
|
|
graphics.item(icon.stack(), cell.x + 1, cell.y + 1);
|
|
|
|
|
int count = slot.has("count") ? slot.get("count").getAsInt() : 1;
|
|
|
|
|
if (count > 1) graphics.text(font, String.valueOf(count), cell.x + 13, cell.y + 14, 0xFFFFFFFF);
|
|
|
|
|
graphics.text(font, String.valueOf(count), cell.x + 17 - font.width(String.valueOf(count)), cell.y + 9, 0xFFFFFFFF);
|
|
|
|
|
}
|
|
|
|
|
if (hovered && !dragging) graphics.setTooltipForNextFrame(font, Component.literal(cell.label + "\n"
|
|
|
|
|
+ (icon == null ? "Пустой слот" : icon.stack().getHoverName().getString()) + "\nНажать — выбрать; тянуть — переместить; ПКМ — очистить"), mouseX, mouseY);
|
|
|
|
|
}
|
|
|
|
|
if (List.of("smelting", "smoking", "blasting", "brewing").contains(station)) {
|
|
|
|
|
var fuel = new ItemStack(station.equals("brewing") ? net.minecraft.world.item.Items.BLAZE_POWDER : net.minecraft.world.item.Items.COAL);
|
|
|
|
|
graphics.item(fuel, x - 5, 169 + shift);
|
|
|
|
|
for (var decoration : decorations) {
|
|
|
|
|
graphics.fill(decoration.x, decoration.y, decoration.x + 18, decoration.y + 18, 0xFF373737);
|
|
|
|
|
graphics.fill(decoration.x + 1, decoration.y + 1, decoration.x + 17, decoration.y + 17, 0xFF8B8B8B);
|
|
|
|
|
graphics.item(decoration.stack, decoration.x + 1, decoration.y + 1);
|
|
|
|
|
int count = station.equals("brewing") ? Math.max(1, Integer.parseInt(draft.text("0", "brewingPowder"))) : 1;
|
|
|
|
|
graphics.text(font, String.valueOf(count), decoration.x + 17 - font.width(String.valueOf(count)), decoration.y + 9, 0xFFFFFFFF);
|
|
|
|
|
if (mouseX >= decoration.x && mouseX < decoration.x + 18 && mouseY >= decoration.y && mouseY < decoration.y + 18)
|
|
|
|
|
graphics.setTooltipForNextFrame(font, Component.literal(decoration.label), mouseX, mouseY);
|
|
|
|
|
}
|
|
|
|
|
if (station.equals("composting")) graphics.item(new ItemStack(net.minecraft.world.item.Items.BONE_MEAL), x + 146, 143 + shift);
|
|
|
|
|
if (height >= 300) graphics.text(font, font.plainSubstrByWidth(hint(station), width - 24), 12, 203, 0xFF9AAFB8);
|
|
|
|
|
if (dragging && pressed != -2) { var icon = icon(RecipeDraft.slot(draft, pressed)); if (icon != null) graphics.item(icon.stack(), mouseX - 8, mouseY - 8); }
|
|
|
|
|
}
|
|
|
|
|
private String hint(String station) {
|
|
|
|
|
return switch (station) {
|
|
|
|
|
case "smelting", "smoking", "blasting" -> "Топливо — ванильное. Время и опыт — в параметрах.";
|
|
|
|
|
case "brewing" -> "3 бутылки, огненный порошок, 20 секунд. Результат — для каждой бутылки.";
|
|
|
|
|
case "composting" -> "Предмет → слой компоста. Шанс — в параметрах. Выход — костная мука.";
|
|
|
|
|
case "cauldron" -> "Содержимое, уровень и расход жидкости — в параметрах.";
|
|
|
|
|
case "loom" -> "Знамя + краситель; узор при необходимости. Узор не расходуется.";
|
|
|
|
|
default -> "Нажмите слот для выбора предмета или перетащите предмет между слотами.";
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
private boolean contains(Cell cell, double x, double y) { return x >= cell.x && x < cell.x + 22 && y >= cell.y && y < cell.y + 22; }
|
|
|
|
|
private boolean contains(Cell cell, double x, double y) { return x >= cell.x && x < cell.x + 18 && y >= cell.y && y < cell.y + 18; }
|
|
|
|
|
@Override public boolean mouseClicked(MouseButtonEvent event, boolean doubleClick) {
|
|
|
|
|
for (Cell cell : cells) if (contains(cell, event.x(), event.y())) {
|
|
|
|
|
if (event.button() == 1) { RecipeDraft.slot(draft, cell.index, RecipeDraft.empty()); return true; }
|
|
|
|
|
if (cell.index >= 0) selectedSlot = cell.index;
|
|
|
|
|
if (event.button() == 1) { RecipeDraft.slot(draft, cell.index, RecipeDraft.empty()); clearSlotError(cell.index); rebuildWidgets(); return true; }
|
|
|
|
|
if (event.button() == 0) { pressed = cell.index; pressX = event.x(); pressY = event.y(); dragging = false; return true; }
|
|
|
|
|
}
|
|
|
|
|
return super.mouseClicked(event, doubleClick);
|
|
|
|
@@ -144,9 +242,10 @@ public final class RecipeEditorScreen extends EditorScreen {
|
|
|
|
|
if (pressed != -2) {
|
|
|
|
|
int source = pressed; pressed = -2;
|
|
|
|
|
for (Cell target : cells) if (contains(target, event.x(), event.y())) {
|
|
|
|
|
if (dragging && source != target.index) RecipeDraft.swap(draft, source, target.index);
|
|
|
|
|
if (dragging && source != target.index) { RecipeDraft.swap(draft, source, target.index); rebuildWidgets(); }
|
|
|
|
|
else if (!dragging && source == target.index) minecraft.gui.setScreen(new RecipeItemPicker(this, connection, row -> {
|
|
|
|
|
var selection = row.getAsJsonObject("selection"); RecipeDraft.slot(draft, source, selection);
|
|
|
|
|
clearSlotError(source);
|
|
|
|
|
icons.put(selection.get("id").getAsString(), new CatalogIcon(row));
|
|
|
|
|
}));
|
|
|
|
|
break;
|
|
|
|
@@ -155,8 +254,12 @@ public final class RecipeEditorScreen extends EditorScreen {
|
|
|
|
|
}
|
|
|
|
|
return super.mouseReleased(event);
|
|
|
|
|
}
|
|
|
|
|
private void clearSlotError(int index) {
|
|
|
|
|
String key = index < 0 ? "result.count" : "input.count." + index;
|
|
|
|
|
typed.remove(key); errors.remove(key); status(errors.isEmpty() ? "" : errors.values().iterator().next(), !errors.isEmpty());
|
|
|
|
|
}
|
|
|
|
|
private void save() {
|
|
|
|
|
if (saving) return;
|
|
|
|
|
if (saving || !errors.isEmpty()) return;
|
|
|
|
|
saving = true; var request = new JsonObject(); request.addProperty("id", draft.id()); request.addProperty("revision", draft.revision()); request.add("document", draft.document());
|
|
|
|
|
connection.request("recipe_save", request, response -> {
|
|
|
|
|
saving = false;
|
|
|
|
|