From dada419f20ee15b690a9436b3dc5cc5dd605330b Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sun, 8 Jan 2023 14:38:52 +0300 Subject: [PATCH] Add the ability to lock states, provinces, cultures, and religions: refactoring (#910) * Add the ability to lock states, provinces, cultures, and religions (#902) * Add the basis for locking everything, code and test the culture locking * Got the religion generator working, but not the tree. There are cycles being generated * Religions work now, including the tree view * Got the states and provinces working as well, all good and ready * Refresh the province editor when regenerating * Implement the versioning steps * Fix the state naming and color changing even when locked * The fix did not work with loaded maps, fix that too * Fix a few more bugs and address the PR feedback * Fix the state expanding event when they're locked bug * Implement some logic to ignore state being locked when regenerating provinces directly. * refactor(#902): start with states regenertion * refactor(#902): locked states cells to be assigned on start * refactor(#902): lock state - keep label * refactor(#902): lock provinces * refactor(#902): regenerate states - update provinces * refactor(#902): regenerate cultures * refactor(#902): regenerate religions Co-authored-by: Guillaume St-Pierre Co-authored-by: Azgaar --- index.css | 4 +- index.html | 27 +- modules/burgs-and-states.js | 158 ++++++----- modules/cultures-generator.js | 60 ++++- modules/dynamic/editors/cultures-editor.js | 15 ++ modules/dynamic/editors/religions-editor.js | 18 ++ modules/dynamic/editors/states-editor.js | 13 + modules/markers-generator.js | 2 +- modules/religions-generator.js | 277 +++++++++++--------- modules/ui/general.js | 2 +- modules/ui/layers.js | 1 + modules/ui/provinces-editor.js | 10 + modules/ui/tools.js | 185 ++++++++----- versioning.js | 6 +- 14 files changed, 497 insertions(+), 281 deletions(-) diff --git a/index.css b/index.css index ae603566..bfd1ed67 100644 --- a/index.css +++ b/index.css @@ -1437,7 +1437,9 @@ div.states .icon-trash-empty, div.states .icon-eye, div.states .icon-pin, div.states .icon-flag-empty, -div.states .icon-cw { +div.states .icon-cw, +div.states .icon-lock, +div.states .icon-lock-open { cursor: pointer; } diff --git a/index.html b/index.html index 1ce9cc88..b852ad3c 100644 --- a/index.html +++ b/index.html @@ -108,7 +108,7 @@ } - + @@ -2017,11 +2017,14 @@ - - - + + -