mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-03-23 23:57:23 +01:00
Improve Merge States dialog: hover highlight + color boxes + clearer instructions (#1336)
* Initial plan * Improve Merge States dialog: add hover highlight and clearer instructions Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com> * Address review feedback: remove duplicate header, set width 600px, add reverse map-hover highlight Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com> * Fix reverse highlight clearing; add state color fill-box to merge dialog rows Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com> * Fix highlightEditorLine to clear all .hovered elements, not just .states.hovered Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com> * Bump version to 1.113.1 Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com> * Update file hashes for index.css and general.js to 1.113.1 Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>
This commit is contained in:
parent
439caced87
commit
4149374d31
5 changed files with 54 additions and 9 deletions
|
|
@ -238,6 +238,7 @@ function showMapTooltip(point, e, i, g) {
|
|||
if (document.getElementById("diplomacyEditor")?.offsetParent) highlightEditorLine(diplomacyEditor, state);
|
||||
if (document.getElementById("militaryOverview")?.offsetParent) highlightEditorLine(militaryOverview, state);
|
||||
if (document.getElementById("provincesEditor")?.offsetParent) highlightEditorLine(provincesEditor, province);
|
||||
if (document.getElementById("mergeStatesForm")?.offsetParent) highlightEditorLine(byId("mergeStatesForm"), state);
|
||||
} else if (layerIsOn("toggleCultures") && pack.cells.culture[i]) {
|
||||
const culture = pack.cells.culture[i];
|
||||
tip("Culture: " + pack.cultures[culture].name);
|
||||
|
|
@ -246,7 +247,7 @@ function showMapTooltip(point, e, i, g) {
|
|||
}
|
||||
|
||||
function highlightEditorLine(editor, id, timeout = 10000) {
|
||||
Array.from(editor.getElementsByClassName("states hovered")).forEach(el => el.classList.remove("hovered")); // clear all hovered
|
||||
Array.from(editor.getElementsByClassName("hovered")).forEach(el => el.classList.remove("hovered")); // clear all hovered
|
||||
const hovered = Array.from(editor.querySelectorAll("div")).find(el => el.dataset.id == id);
|
||||
if (hovered) hovered.classList.add("hovered"); // add hovered class
|
||||
if (timeout)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue