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:
Copilot 2026-02-26 19:35:09 +01:00 committed by GitHub
parent 439caced87
commit 4149374d31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 54 additions and 9 deletions

View file

@ -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)