mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 18:11:24 +01:00
refactor(styles): update burg styles for presets
This commit is contained in:
parent
4a08f617bb
commit
c16d292304
18 changed files with 230 additions and 1785 deletions
|
|
@ -74,17 +74,17 @@ async function fetchSystemPreset(preset) {
|
|||
function applyStyle(styleJSON) {
|
||||
for (const selector in styleJSON) {
|
||||
if (selector.startsWith("#burgLabels")) {
|
||||
const group = selector.replace("#burgLabels > g#", "");
|
||||
const group = selector.split("#").pop();
|
||||
style.burgLabels[group] = styleJSON[selector];
|
||||
}
|
||||
|
||||
if (selector.startsWith("#burgIcons")) {
|
||||
const group = selector.replace("#burgIcons > g#", "");
|
||||
const group = selector.split("#").pop();
|
||||
style.burgIcons[group] = styleJSON[selector];
|
||||
}
|
||||
|
||||
if (selector.startsWith("#anchors")) {
|
||||
const group = selector.replace("#anchors > g#", "");
|
||||
const group = selector.split("#").pop();
|
||||
style.anchors[group] = styleJSON[selector];
|
||||
}
|
||||
|
||||
|
|
@ -142,6 +142,10 @@ async function changeStyle(desiredPreset) {
|
|||
localStorage.setItem("presetStyle", presetName);
|
||||
applyStyleWithUiRefresh(style);
|
||||
if (layerIsOn("toggleBurgIcons")) drawBurgIcons();
|
||||
if (layerIsOn("toggleLabels")) {
|
||||
drawBurgLabels();
|
||||
drawStateLabels();
|
||||
}
|
||||
}
|
||||
|
||||
function applyStyleWithUiRefresh(style) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue