mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
basic resource editor screen - icons
This commit is contained in:
parent
9c7894d6ed
commit
4d74081821
3 changed files with 26 additions and 9 deletions
14
index.css
14
index.css
|
|
@ -1448,6 +1448,20 @@ div.states > .coaIcon > use {
|
|||
pointer-events: none;
|
||||
}
|
||||
|
||||
div.states > .icon {
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div.states > .model {
|
||||
width: 7em;
|
||||
}
|
||||
|
||||
div.states > .icon > * {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#diplomacyBodySection > div {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
|
|||
12
index.html
12
index.html
|
|
@ -3003,12 +3003,12 @@
|
|||
|
||||
<div id="resourcesEditor" class="dialog stable" style="display: none">
|
||||
<div id="resourcesHeader" class="header">
|
||||
<div style="left:1.8em" data-tip="Click to sort by resource name" class="sortable alphabetically" data-sortby="name">Resource </div>
|
||||
<div style="left:12.6em" data-tip="Click to sort by resource type" class="sortable alphabetically" data-sortby="type">Type </div>
|
||||
<div style="left:18em" data-tip="Click to sort by resource basic value" class="sortable" data-sortby="value">Value </div>
|
||||
<div style="left:25.1em" data-tip="Click to sort by generation chance" class="sortable" data-sortby="chance">Chance </div>
|
||||
<div style="left:42.1em" data-tip="Click to sort spread model" class="sortable alphabetically" data-sortby="model">Model </div>
|
||||
<div style="left:47em" data-tip="Click to sort by number of cells" class="sortable icon-sort-number-down" data-sortby="cells">Cells </div>
|
||||
<div style="left:2.8em" data-tip="Click to sort by resource name" class="sortable alphabetically" data-sortby="name">Resource </div>
|
||||
<div style="left:8.8em" data-tip="Click to sort by resource type" class="sortable alphabetically" data-sortby="type">Type </div>
|
||||
<div style="left:14em" data-tip="Click to sort spread model" class="sortable alphabetically" data-sortby="model">Model </div>
|
||||
<div style="left:20em" data-tip="Click to sort by resource basic value" class="sortable" data-sortby="value">Value </div>
|
||||
<div style="left:23.6em" data-tip="Click to sort by generation chance" class="sortable" data-sortby="chance">Chance </div>
|
||||
<div style="left:28em" data-tip="Click to sort by number of cells" class="sortable icon-sort-number-down" data-sortby="cells">Cells </div>
|
||||
</div>
|
||||
<div id="resourcesBody" class="table" data-type="absolute"></div>
|
||||
|
||||
|
|
|
|||
|
|
@ -29,13 +29,16 @@ function editResources() {
|
|||
// // {i: 33, name: "Saltpeter", icon: "resource-saltpeter", color: "#e6e3e3", value: 8, chance: 2, model: "habitability", bonus: {artillery: 3}}
|
||||
for (const r of pack.resources) {
|
||||
lines += `<div class="states resources" data-id=${r.i} data-name="${r.name}" data-color="${r.color}" data-chance="${r.chance}" data-value="${r.value}" data-model="${r.model}" data-cells="${r.cells}">
|
||||
<svg data-tip="Resource background color. Click to change" width=".9em" height=".9em" style="margin-bottom:-1px"><rect x="0" y="0" width="100%" height="100%" fill="${r.color}" class="fillRect pointer"></svg>
|
||||
<svg data-tip="Resource icon. Click to change" width="2em" height="2em" class="icon">
|
||||
<circle cx="50%" cy="50%" r="42%" fill="${r.color}" stroke="${r.stroke}"/>
|
||||
<use href="#${r.icon}" x="10%" y="10%" width="80%" height="80%"/>
|
||||
</svg>
|
||||
<input data-tip="Resource name. Click and type to change" class="resourceName" value="${r.name}" autocorrect="off" spellcheck="false">
|
||||
<select data-tip="Resource type. Select to change" class="resourceType">No data</select>
|
||||
<select data-tip="Resource type. Select to change" class="resourceType"><option selected>No data</option></select>
|
||||
<input data-tip="Resource spread model. Select to change" value="${r.model}" class="model"/>
|
||||
|
||||
<input data-tip="Resource basic value. Click and type to change" value="${r.value}" type="number">
|
||||
<input data-tip="Resource generation chance in eligible cell. Click and type to change" value="${r.chance}" type="number">
|
||||
<input data-tip="Resource spread model. Select to change" value="${r.model}">
|
||||
<div data-tip="Number of cells with resource" class="cells">${r.cells}</div>
|
||||
|
||||
<span data-tip="Remove resource" class="icon-trash-empty hide"></span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue