Add rewards

This commit is contained in:
Misode
2019-12-29 01:59:17 +01:00
parent 4aba8f81e2
commit 738ae30f2b
4 changed files with 42 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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",

View File

@@ -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",

View File

@@ -370,7 +370,7 @@ function generateArray(data, struct) {
let $el = $('<div/>').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');