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"> <tr data-tip="Map seed number. Seed produces the same map only if canvas size and options are the same">
<td> <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>
<td>Map seed</td> <td>Map seed</td>
<td> <td>

View file

@ -288,18 +288,16 @@ function generateMapWithSeed(source) {
} }
function showSeedHistoryDialog() { function showSeedHistoryDialog() {
const alert = mapHistory const lines = mapHistory.map((h, i) => {
.map(function (h, i) { const created = new Date(h.created).toLocaleTimeString();
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>`;
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>`;
return `<div>${i + 1}. Seed: ${h.seed} ${button}. Size: ${h.width}x${h.height}. Template: ${h.template}. Created: ${created}</div>`; });
}) alertMessage.innerHTML = `<ol style="margin: 0; padding-left: 1.5em">${lines.join("")}</ol>`;
.join("");
alertMessage.innerHTML = alert;
$("#alert").dialog({ $("#alert").dialog({
resizable: false, resizable: false,
title: "Seed history", title: "Seed history",
width: fitContent(),
position: {my: "center", at: "center", of: "svg"} position: {my: "center", at: "center", of: "svg"}
}); });
} }