mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-05-15 22:30:38 +08:00
Add custom world info filter mode
This commit is contained in:
38
panel.js
38
panel.js
@@ -1983,6 +1983,21 @@ function _refreshConfigTab() {
|
||||
"bme-setting-notice-display-mode",
|
||||
settings.noticeDisplayMode ?? "normal",
|
||||
);
|
||||
_setInputValue(
|
||||
"bme-setting-wi-filter-mode",
|
||||
settings.worldInfoFilterMode || "default",
|
||||
);
|
||||
_setInputValue(
|
||||
"bme-setting-wi-filter-keywords",
|
||||
settings.worldInfoFilterCustomKeywords || "",
|
||||
);
|
||||
const wiFilterCustomSection = panelEl?.querySelector(
|
||||
"#bme-wi-filter-custom-section",
|
||||
);
|
||||
if (wiFilterCustomSection) {
|
||||
wiFilterCustomSection.style.display =
|
||||
(settings.worldInfoFilterMode || "default") === "custom" ? "" : "none";
|
||||
}
|
||||
|
||||
_setInputValue("bme-setting-extract-every", settings.extractEvery ?? 1);
|
||||
_setInputValue(
|
||||
@@ -2337,6 +2352,29 @@ function _bindConfigControls() {
|
||||
});
|
||||
noticeDisplayModeEl.dataset.bmeBound = "true";
|
||||
}
|
||||
const wiFilterModeEl = document.getElementById("bme-setting-wi-filter-mode");
|
||||
if (wiFilterModeEl && wiFilterModeEl.dataset.bmeBound !== "true") {
|
||||
wiFilterModeEl.addEventListener("change", () => {
|
||||
const nextValue = wiFilterModeEl.value || "default";
|
||||
_patchSettings({ worldInfoFilterMode: nextValue });
|
||||
const section = panelEl?.querySelector("#bme-wi-filter-custom-section");
|
||||
if (section) {
|
||||
section.style.display = nextValue === "custom" ? "" : "none";
|
||||
}
|
||||
});
|
||||
wiFilterModeEl.dataset.bmeBound = "true";
|
||||
}
|
||||
const wiFilterKeywordsEl = document.getElementById(
|
||||
"bme-setting-wi-filter-keywords",
|
||||
);
|
||||
if (wiFilterKeywordsEl && wiFilterKeywordsEl.dataset.bmeBound !== "true") {
|
||||
wiFilterKeywordsEl.addEventListener("change", () => {
|
||||
_patchSettings({
|
||||
worldInfoFilterCustomKeywords: wiFilterKeywordsEl.value || "",
|
||||
});
|
||||
});
|
||||
wiFilterKeywordsEl.dataset.bmeBound = "true";
|
||||
}
|
||||
|
||||
bindNumber("bme-setting-extract-every", 1, 1, 50, (value) =>
|
||||
_patchSettings({ extractEvery: value }),
|
||||
|
||||
Reference in New Issue
Block a user