experimental plugin settings API

typescript
Drake 2 years ago
parent f26043322b
commit 43e068ce43

2
dist/build.js vendored

File diff suppressed because one or more lines are too long

@ -7,6 +7,21 @@ import { React } from "../../common";
const SettingsView = webpack.findByDisplayName("SettingsView");
let pluginSettings = [
{
section: "HEADER",
label: "Demoncord"
},
{
section: "demoncord",
label: "Plugins",
element: plugins
},
{
section: "DIVIDER"
}
]
function init() {
css.createClass("demon-settings-url", {
"margin-top": "10px",
@ -63,18 +78,7 @@ function init() {
"getPredicateSections",
(args, sections) => {
sections.unshift(
{
section: "HEADER",
label: "Demoncord"
},
{
section: "demoncord",
label: "Plugins",
element: plugins
},
{
section: "DIVIDER"
}
...pluginSettings
);
return sections;
}
@ -104,4 +108,15 @@ function init() {
}
}
function addPluginEntry(name, ele) {
const idx = pluginSettings.push({
section: "demoncord-plugins",
label: "name",
element: ele
}) - 1
return () => {
delete pluginSettings[idx]
}
}
export default { init };

Loading…
Cancel
Save