diff --git a/index.html b/index.html index 717debf3..fb49d6bc 100644 --- a/index.html +++ b/index.html @@ -4466,21 +4466,16 @@ data-tip="Save state relations matrix as a text file (.csv)" class="icon-download" > - -
- + diff --git a/modules/ui/diplomacy-editor.js b/modules/ui/diplomacy-editor.js index 5a53b578..7db83605 100644 --- a/modules/ui/diplomacy-editor.js +++ b/modules/ui/diplomacy-editor.js @@ -85,7 +85,6 @@ function editDiplomacy() { document.getElementById("diplomacyShowMatrix").addEventListener("click", showRelationsMatrix); document.getElementById("diplomacyHistory").addEventListener("click", showRelationsHistory); document.getElementById("diplomacyExport").addEventListener("click", downloadDiplomacyData); - //document.getElementById("diplomacyImport").addEventListener("click", uploadDiplomacyData); document.getElementById("diplomacyBatchEdit").addEventListener("click", toggleDiplomacyCheckbox); document.getElementById("diplomacyBatchEditConfirm").addEventListener("click", ConfirmDiplomacyBatch); @@ -121,10 +120,8 @@ function editDiplomacy() { function diplomacyEditorAddLines() { const states = pack.states; const selectedLine = body.querySelector("div.Self"); - const selectedId = selectedLine ? +selectedLine.dataset.id : states.find(s => s.i && !s.removed).i; const selectedName = states[selectedId].name; - const toggleState = modules.batchEditDiplomacy ? 'inline-block' : 'none'; COArenderer.trigger("stateCOA" + selectedId, states[selectedId].coa); @@ -146,8 +143,6 @@ function editDiplomacy() { const name = state.fullName.length < 23 ? state.fullName : state.name; COArenderer.trigger("stateCOA" + state.i, state.coa); - - lines += /* html */ `
@@ -465,10 +460,7 @@ function editDiplomacy() { const name = getFileName("Relations") + ".csv"; downloadFile(data, name); } - - function uploadDiplomacyData() { - } - + function closeDiplomacyEditor() { restoreDefaultEvents(); clearMainTip(); @@ -482,6 +474,7 @@ function editDiplomacy() { function toggleDiplomacyCheckbox(){ modules.batchEditDiplomacy = !modules.batchEditDiplomacy; + BatchEditHr.style.display = (modules.batchEditDiplomacy?"block":"none"); diplomacyRelationSelect.style.display = (modules.batchEditDiplomacy?"inline-block":"none"); diplomacyBatchEditConfirm.style.display = (modules.batchEditDiplomacy?"inline-block":"none"); diplomacyHeader.style['grid-template-columns'] = (modules.batchEditDiplomacy?"1.5em 15em 6em":"15em 6em"); @@ -495,9 +488,7 @@ function editDiplomacy() { document.querySelectorAll(".diploDivChk > input.diploChk:checked").forEach(function(ipt){ const objectId = +body.querySelector("div.Self").dataset.id; const subjectId =ipt.value; - changeRelation(subjectId, objectId, states[subjectId].diplomacy[objectId], diplomacyRelationSelect.value); - }); //Clear selection waiting for next batch document.querySelectorAll(".diploDivChk").forEach(el => (el.checked = false));