mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-29 17:32:43 +00:00
Support placeholders in maps
This commit is contained in:
@@ -273,6 +273,12 @@
|
|||||||
"nbt_operation.target": "Target",
|
"nbt_operation.target": "Target",
|
||||||
"nbt_operation_add": "Add Operation",
|
"nbt_operation_add": "Add Operation",
|
||||||
"nbt_operation_remove": "Remove Operation",
|
"nbt_operation_remove": "Remove Operation",
|
||||||
|
"placeholder.advancement": "An advancement ID",
|
||||||
|
"placeholder.block_state": "A block state key",
|
||||||
|
"placeholder.effect": "An status effect ID",
|
||||||
|
"placeholder.fluid_state": "A fluid state key",
|
||||||
|
"placeholder.objective": "An scoreboard objective",
|
||||||
|
"placeholder.recipe": "An recipe ID",
|
||||||
"pool.bonus_rolls": "Bonus Rolls",
|
"pool.bonus_rolls": "Bonus Rolls",
|
||||||
"pool.rolls": "Rolls",
|
"pool.rolls": "Rolls",
|
||||||
"pool_add": "Add Pool",
|
"pool_add": "Add Pool",
|
||||||
|
|||||||
@@ -270,6 +270,12 @@
|
|||||||
"nbt_operation.target": "复制目标",
|
"nbt_operation.target": "复制目标",
|
||||||
"nbt_operation_add": "添加操作",
|
"nbt_operation_add": "添加操作",
|
||||||
"nbt_operation_remove": "移除操作",
|
"nbt_operation_remove": "移除操作",
|
||||||
|
"placeholder.advancement": "一个进度 ID",
|
||||||
|
"placeholder.block_state": "一个方块状态键",
|
||||||
|
"placeholder.effect": "一个状态效果 ID",
|
||||||
|
"placeholder.fluid_state": "一个流体状态键",
|
||||||
|
"placeholder.objective": "一个记分项",
|
||||||
|
"placeholder.recipe": "一个配方 ID",
|
||||||
"pool.bonus_rolls": "每级幸运增加的抽取次数",
|
"pool.bonus_rolls": "每级幸运增加的抽取次数",
|
||||||
"pool.rolls": "抽取次数",
|
"pool.rolls": "抽取次数",
|
||||||
"pool_add": "添加随机池",
|
"pool_add": "添加随机池",
|
||||||
|
|||||||
@@ -638,6 +638,7 @@
|
|||||||
"id": "properties",
|
"id": "properties",
|
||||||
"type": "map",
|
"type": "map",
|
||||||
"translate": "condition.block_state",
|
"translate": "condition.block_state",
|
||||||
|
"translatePlaceholder": "placeholder.block_state",
|
||||||
"values": {
|
"values": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@@ -649,6 +650,7 @@
|
|||||||
"id": "scores",
|
"id": "scores",
|
||||||
"type": "map",
|
"type": "map",
|
||||||
"translate": "condition.score",
|
"translate": "condition.score",
|
||||||
|
"translatePlaceholder": "placeholder.objective",
|
||||||
"values": {
|
"values": {
|
||||||
"type": "range"
|
"type": "range"
|
||||||
},
|
},
|
||||||
@@ -967,6 +969,7 @@
|
|||||||
"id": "advancements",
|
"id": "advancements",
|
||||||
"type": "map",
|
"type": "map",
|
||||||
"translate": "entity.player.advancements",
|
"translate": "entity.player.advancements",
|
||||||
|
"translatePlaceholder": "placeholder.advancement",
|
||||||
"values": {
|
"values": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
@@ -975,6 +978,7 @@
|
|||||||
"id": "recipes",
|
"id": "recipes",
|
||||||
"type": "map",
|
"type": "map",
|
||||||
"translate": "entity.player.recipes",
|
"translate": "entity.player.recipes",
|
||||||
|
"translatePlaceholder": "placeholder.recipe",
|
||||||
"values": {
|
"values": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
@@ -992,6 +996,7 @@
|
|||||||
"id": "effects",
|
"id": "effects",
|
||||||
"type": "map",
|
"type": "map",
|
||||||
"translate": "entity.status_effect",
|
"translate": "entity.status_effect",
|
||||||
|
"translatePlaceholder": "placeholder.effect",
|
||||||
"values": {
|
"values": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"value": "status_effect"
|
"value": "status_effect"
|
||||||
@@ -1091,6 +1096,7 @@
|
|||||||
"id": "state",
|
"id": "state",
|
||||||
"type": "map",
|
"type": "map",
|
||||||
"translate": "location.block.state",
|
"translate": "location.block.state",
|
||||||
|
"translatePlaceholder": "placeholder.block_state",
|
||||||
"values": {
|
"values": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
@@ -1118,6 +1124,7 @@
|
|||||||
"id": "state",
|
"id": "state",
|
||||||
"type": "map",
|
"type": "map",
|
||||||
"translate": "location.fluid.state",
|
"translate": "location.fluid.state",
|
||||||
|
"translatePlaceholder": "placeholder.fluid_state",
|
||||||
"values": {
|
"values": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
|||||||
4
view.js
4
view.js
@@ -253,11 +253,13 @@ function generateSet(data, struct) {
|
|||||||
|
|
||||||
function generateMap(data, struct) {
|
function generateMap(data, struct) {
|
||||||
let $el = $('#components').find('[data-type="map"]').clone();
|
let $el = $('#components').find('[data-type="map"]').clone();
|
||||||
|
let $input = $el.find('input')
|
||||||
let out;
|
let out;
|
||||||
$el.attr('data-index', struct.id).attr('data-item-type', struct.values.type);
|
$el.attr('data-index', struct.id).attr('data-item-type', struct.values.type);
|
||||||
$el.find('[data-name="1"]').attr('data-i18n', struct.translate);
|
$el.find('[data-name="1"]').attr('data-i18n', struct.translate);
|
||||||
$el.find('[data-name="2"]').attr('data-i18n', struct.translate + '_add');
|
$el.find('[data-name="2"]').attr('data-i18n', struct.translate + '_add');
|
||||||
$el.find('input').keypress((e) => {if (e.which == 13) addToMap(e.target);});
|
$input.attr('data-i18n', `[placeholder]${struct.translatePlaceholder}`);
|
||||||
|
$input.keypress((e) => {if (e.which == 13) addToMap(e.target);});
|
||||||
if (data) {
|
if (data) {
|
||||||
for (let key of Object.keys(data)) {
|
for (let key of Object.keys(data)) {
|
||||||
out = out || {}
|
out = out || {}
|
||||||
|
|||||||
Reference in New Issue
Block a user