heightmapSelect - make default select element non-clickable

This commit is contained in:
Azgaar 2022-05-29 02:05:42 +03:00
parent 5a6b5b4c95
commit c9fd598c9c
3 changed files with 20 additions and 12 deletions

View file

@ -1318,13 +1318,13 @@
</td> </td>
</tr> </tr>
<tr data-tip="Select heightmap generation template or precreated heightmap"> <tr data-tip="Select template or precreated heightmap to be used on generation">
<td> <td>
<i data-locked="0" id="lock_template" class="icon-lock-open"></i> <i data-locked="0" id="lock_template" class="icon-lock-open"></i>
</td> </td>
<td>Heightmap</td> <td>Heightmap</td>
<td> <td id="templateInputContainer" class="pointer">
<select id="templateInput" data-stored="template" disabled style="opacity: 1; color: unset"></select> <select id="templateInput" data-stored="template" style="pointer-events: none"></select>
</td> </td>
<td></td> <td></td>
</tr> </tr>

View file

@ -69,13 +69,18 @@ function appendStyleSheet() {
.heightmap-selection_options { .heightmap-selection_options {
display: grid; display: grid;
grid-template-columns: 2fr 1fr; grid-template-columns: 2fr 1fr;
justify-items: start;
} }
.heightmap-selection_options > div:first-child { .heightmap-selection_options > div:first-child {
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr 1fr;
align-items: center; align-items: center;
justify-self: start;
justify-items: start;
}
.heightmap-selection_options > div:last-child {
justify-self: end;
} }
.heightmap-selection article { .heightmap-selection article {
@ -127,23 +132,27 @@ function appendStyleSheet() {
function insertEditorHtml() { function insertEditorHtml() {
const heightmapSelectionHtml = /* html */ `<div id="heightmapSelection" class="dialog stable"> const heightmapSelectionHtml = /* html */ `<div id="heightmapSelection" class="dialog stable">
<div class="heightmap-selection"> <div class="heightmap-selection">
<section> <section data-tip="Select heightmap template template provides unique, but similar-looking maps on generation">
<header><h1>Heightmap templates</h1></header> <header><h1>Heightmap templates</h1></header>
<div class="heightmap-selection_container"></div> <div class="heightmap-selection_container"></div>
</section> </section>
<section> <section data-tip="Select precreated heightmap it will be the same for each map">
<header><h1>Pre-created heightmaps</h1></header> <header><h1>Precreated heightmaps</h1></header>
<div class="heightmap-selection_container"></div> <div class="heightmap-selection_container"></div>
</section> </section>
<section> <section>
<header><h1>Options</h1></header> <header><h1>Options</h1></header>
<div class="heightmap-selection_options"> <div class="heightmap-selection_options">
<div> <div>
<label data-tip="Rerender all preview images" class="checkbox-label" id="heightmapSelectionRedrawPreview">
<i class="icon-cw"></i>
Redraw preview
</label>
<div> <div>
<input id="heightmapSelectionRenderOcean" class="checkbox" type="checkbox" /> <input id="heightmapSelectionRenderOcean" class="checkbox" type="checkbox" />
<label for="heightmapSelectionRenderOcean" class="checkbox-label">Render ocean heights</label> <label data-tip="Draw heights of water cells" for="heightmapSelectionRenderOcean" class="checkbox-label">Render ocean heights</label>
</div> </div>
<div> <div data-tip="Color scheme used for heightmap preview">
Color scheme Color scheme
<select id="heightmapSelectionColorScheme"> <select id="heightmapSelectionColorScheme">
<option value="bright" selected>Bright</option> <option value="bright" selected>Bright</option>
@ -154,7 +163,6 @@ function insertEditorHtml() {
</div> </div>
</div> </div>
<div> <div>
<button data-tip="Rerender all preview images" id="heightmapSelectionRedrawPreview">Redraw preview</button>
<button data-tip="Open Template Editor" data-tool="templateEditor" id="heightmapSelectionEditTemplates">Edit Templates</button> <button data-tip="Open Template Editor" data-tool="templateEditor" id="heightmapSelectionEditTemplates">Edit Templates</button>
<button data-tip="Open Image Converter" data-tool="imageConverter" id="heightmapSelectionImportHeightmap">Import Heightmap</button> <button data-tip="Open Image Converter" data-tool="imageConverter" id="heightmapSelectionImportHeightmap">Import Heightmap</button>
</div> </div>

View file

@ -142,7 +142,7 @@ optionsContent.addEventListener("click", function (event) {
else if (id === "optionsMapHistory") showSeedHistoryDialog(); else if (id === "optionsMapHistory") showSeedHistoryDialog();
else if (id === "optionsCopySeed") copyMapURL(); else if (id === "optionsCopySeed") copyMapURL();
else if (id === "optionsEraRegenerate") regenerateEra(); else if (id === "optionsEraRegenerate") regenerateEra();
else if (id === "templateInput") openTemplateSelectionDialog(); else if (id === "templateInputContainer") openTemplateSelectionDialog();
else if (id === "zoomExtentDefault") restoreDefaultZoomExtent(); else if (id === "zoomExtentDefault") restoreDefaultZoomExtent();
else if (id === "translateExtent") toggleTranslateExtent(event.target); else if (id === "translateExtent") toggleTranslateExtent(event.target);
else if (id === "speakerTest") testSpeaker(); else if (id === "speakerTest") testSpeaker();