From 738ae30f2b9f6fbac8bdfa3aa5d95398c873fb01 Mon Sep 17 00:00:00 2001 From: Misode Date: Sun, 29 Dec 2019 01:59:17 +0100 Subject: [PATCH] Add rewards --- custom.css | 2 +- locales/en.json | 10 ++++++++++ schemas/1.15.json | 31 ++++++++++++++++++++++++++++++- view.js | 2 +- 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/custom.css b/custom.css index 870ef5c3..987606eb 100644 --- a/custom.css +++ b/custom.css @@ -111,7 +111,7 @@ body[data-style="dark"] #source { } body[data-style="dark"] .form-control { - background-color: #343a40; + background-color: #343a40 !important; color: #ddd; border-color: #24282c; } diff --git a/locales/en.json b/locales/en.json index 065fa34a..26e47bf6 100644 --- a/locales/en.json +++ b/locales/en.json @@ -99,6 +99,7 @@ "criteria.slots.occupied": "Slots Occupied", "criteria.slots.full": "Slots Full", "criteria.items": "Items", + "criteria.items_add": "Add Item", "criteria.delta": "Delta", "criteria.durability": "Durability", "criteria.item": "Item", @@ -136,6 +137,9 @@ "display.title": "Title", "display.description": "Description", "display.frame": "Frame", + "display.frame.challenge": "Challenge", + "display.frame.goal": "Goal", + "display.frame.task": "Task", "display.background": "Background", "display.show_toast": "Show Toast", "display.announce_to_chat": "Announce To Chat", @@ -303,6 +307,7 @@ "item.nbt": "NBT", "item.potion": "Potion", "item.tag": "Item Tag", + "item_remove": "Remove Item", "location.biome": "Biome", "location.block": "Block", "location.block.block": "Block ID", @@ -361,6 +366,11 @@ "range.uniform": "Uniform", "remove": "Remove", "requirements": "Requirements", + "rewards": "Rewards", + "rewards.loot": "Loot Tables", + "rewards.function": "Function", + "rewards.recipes": "Recipes", + "rewards.experience": "Experience", "share": "Share", "show_source": "Show Source", "slot.chest": "Chest", diff --git a/schemas/1.15.json b/schemas/1.15.json index 69e048ef..32aae5e0 100644 --- a/schemas/1.15.json +++ b/schemas/1.15.json @@ -81,7 +81,7 @@ { "id": "frame", "translate": "display.frame", - "translateValue": "", + "translateValue": "display.frame", "type": "enum", "unset": true, "values": [ @@ -117,6 +117,35 @@ "translate": "parent", "type": "string" }, + { + "id": "rewards", + "translate": "rewards", + "type": "object", + "collapse": true, + "color": "secondary", + "fields": [ + { + "id": "function", + "translate": "rewards.function", + "type": "string" + }, + { + "id": "loot", + "translate": "rewards.loot", + "type": "string-list" + }, + { + "id": "recipes", + "translate": "rewards.recipes", + "type": "string-list" + }, + { + "id": "experience", + "translate": "rewards.experience", + "type": "int" + } + ] + }, { "id": "criteria", "translate": "criteria", diff --git a/view.js b/view.js index cfe5468c..e6cf5542 100644 --- a/view.js +++ b/view.js @@ -370,7 +370,7 @@ function generateArray(data, struct) { let $el = $('
').addClass('mt-3'); let child = components.find(e => e.id === struct.values); for (let i = 0; i < data.length; i += 1) { - let {out: outValue, component: $child} = generateObject(data[i], child, {header: true}); + let {out: outValue, component: $child} = generateComponent(data[i], child, {header: true}); out.push(outValue); $child.attr('data-index', i); $child.removeAttr('data-type');