Add help tooltips for maps

This commit is contained in:
Misode
2020-05-21 15:56:02 +02:00
parent 14747cae8a
commit 07bc9633b4
4 changed files with 9 additions and 1 deletions

View File

@@ -123,7 +123,7 @@
</div>
<input type="text" class="form-control">
<div class="input-group-append">
<button class="btn btn-dark" type="button" onclick="addToMap(this)" data-name="2"></button>
<button class="btn btn-dark rounded-right" type="button" onclick="addToMap(this)" data-name="2"></button>
</div>
</div>
</div>

View File

@@ -265,6 +265,9 @@ function generateMap(data, struct) {
$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="2"]').attr('data-i18n', struct.translate + '_add');
if (struct.help) {
$el.find('.input-group').append(generateTooltip(struct.translate));
}
$input.attr('data-i18n', `[placeholder]placeholder.${struct.translatePlaceholder}`);
$input.keypress((e) => {if (e.which == 13) addToMap(e.target);});
if (JSON.stringify(struct.default) === '{}') {

View File

@@ -383,6 +383,7 @@
"generator.settings.structures_add": "Add Structure",
"generator.settings.structures_remove": "Remove Structure",
"help.condition.time_period": "If present, time will be modulo-divided by this value. For example, if set to 24000, value will operate on a time period of days.",
"help.dimension": "The identifier used for \"/execute in\". Must be all lowercase.",
"help.dimension.type.ultrawarm": "If true, water cannot exist and sponges will dry.",
"help.dimension.type.shrunk": "Whether coordinates should be scaled down by a factor of 8.",
"help.display": "If present, advancement will be visible in the advancement tabs.",
@@ -395,6 +396,7 @@
"help.entry.type.loot_table": "Adds the contents of another loot table",
"help.entry.type.sequence": "Executes child entries until the first one that can't run due to conditions",
"help.entry.type.tag": "Adds the contents of an item tag",
"help.generator.settings.structures": "Not specifying a structure will cause it to spawn extremely frequently.",
"help.pool.rolls": "The amount of entries that are randomly chosen",
"hide_source": "Hide Source",
"item.count": "Count",

View File

@@ -26,6 +26,7 @@
"translate": "dimension",
"translatePlaceholder": "dimension",
"type": "map",
"help": true,
"values": {
"type": "object",
"value": "dimension"
@@ -410,6 +411,7 @@
"translate": "generator.settings.structures",
"translatePlaceholder": "structure",
"type": "map",
"help": true,
"default": {},
"values": {
"type": "object",
@@ -457,6 +459,7 @@
"translate": "generator.settings.structures",
"translatePlaceholder": "structure",
"type": "map",
"help": true,
"default": {},
"values": {
"type": "object",