seed history small style change

This commit is contained in:
Azgaar 2022-01-16 19:49:20 +03:00
parent 214bc7a40d
commit fbc0158736
2 changed files with 8 additions and 10 deletions

View file

@ -947,7 +947,7 @@
<tr data-tip="Map seed number. Seed produces the same map only if canvas size and options are the same">
<td>
<i data-tip="Show seed history to apply a previous seed" id="optionsMapHistory" class="icon-history"></i>
<i data-tip="Show seed history to apply a previous seed" id="optionsMapHistory" class="icon-hourglass-1"></i>
</td>
<td>Map seed</td>
<td>

View file

@ -288,18 +288,16 @@ function generateMapWithSeed(source) {
}
function showSeedHistoryDialog() {
const alert = mapHistory
.map(function (h, i) {
const created = new Date(h.created).toLocaleTimeString();
const button = `<i data-tip"Click to generate a map with this seed" onclick="restoreSeed(${i})" class="icon-history optionsSeedRestore"></i>`;
return `<div>${i + 1}. Seed: ${h.seed} ${button}. Size: ${h.width}x${h.height}. Template: ${h.template}. Created: ${created}</div>`;
})
.join("");
alertMessage.innerHTML = alert;
const lines = mapHistory.map((h, i) => {
const created = new Date(h.created).toLocaleTimeString();
const button = `<i data-tip="Click to generate a map with this seed" onclick="restoreSeed(${i})" class="icon-history optionsSeedRestore"></i>`;
return `<li>Seed: ${h.seed} ${button}. Size: ${h.width}x${h.height}. Template: ${h.template}. Created: ${created}</li>`;
});
alertMessage.innerHTML = `<ol style="margin: 0; padding-left: 1.5em">${lines.join("")}</ol>`;
$("#alert").dialog({
resizable: false,
title: "Seed history",
width: fitContent(),
position: {my: "center", at: "center", of: "svg"}
});
}