mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
v1.0
This commit is contained in:
parent
5f9cab4f84
commit
cab429a346
58 changed files with 6413 additions and 1489 deletions
|
|
@ -12,8 +12,8 @@ function editReliefIcon() {
|
|||
updateReliefSizeInput();
|
||||
|
||||
$("#reliefEditor").dialog({
|
||||
title: "Edit Relief Icons", resizable: false,
|
||||
position: {my: "center top+40", at: "top", of: d3.event, collision: "fit"},
|
||||
title: "Edit Relief Icons", resizable: false, width: 294,
|
||||
position: {my: "left top", at: "left+10 top+10", of: "#map"},
|
||||
close: closeReliefEditor
|
||||
});
|
||||
|
||||
|
|
@ -27,6 +27,7 @@ function editReliefIcon() {
|
|||
|
||||
document.getElementById("reliefSize").addEventListener("input", changeIconSize);
|
||||
document.getElementById("reliefSizeNumber").addEventListener("input", changeIconSize);
|
||||
document.getElementById("reliefEditorSet").addEventListener("change", changeIconsSet);
|
||||
reliefIconsDiv.querySelectorAll("svg").forEach(el => el.addEventListener("click", changeIcon));
|
||||
|
||||
document.getElementById("reliefCopy").addEventListener("click", copyIcon);
|
||||
|
|
@ -53,8 +54,13 @@ function editReliefIcon() {
|
|||
|
||||
function updateReliefIconSelected() {
|
||||
const type = elSelected.attr("data-type");
|
||||
const button = reliefIconsDiv.querySelector("svg[data-type='"+type+"']");
|
||||
|
||||
reliefIconsDiv.querySelectorAll("svg.pressed").forEach(b => b.classList.remove("pressed"));
|
||||
reliefIconsDiv.querySelector("svg[data-type='"+type+"']").classList.add("pressed");
|
||||
button.classList.add("pressed");
|
||||
reliefIconsDiv.querySelectorAll("div").forEach(b => b.style.display = "none");
|
||||
button.parentNode.style.display = "block";
|
||||
reliefEditorSet.value = button.parentNode.dataset.type;
|
||||
}
|
||||
|
||||
function updateReliefSizeInput() {
|
||||
|
|
@ -196,6 +202,12 @@ function editReliefIcon() {
|
|||
elSelected.attr("x", x-shift).attr("y", y-shift);
|
||||
}
|
||||
|
||||
function changeIconsSet() {
|
||||
const set = reliefEditorSet.value;
|
||||
reliefIconsDiv.querySelectorAll("div").forEach(b => b.style.display = "none");
|
||||
reliefIconsDiv.querySelector("div[data-type='" + set + "']").style.display = "block";
|
||||
}
|
||||
|
||||
function changeIcon() {
|
||||
if (this.classList.contains("pressed")) return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue