QuickSettings
QuickSettings exposes an easy api to add a settings menu to your plugin. Settings are automatically saved when changed. The supported elements are heading
, boolean
, number
, and text
. All options can be seen below.
/** * @needsLib QuickSettings | https://raw.githubusercontent.com/Gimloader/client-plugins/refs/heads/main/libraries/QuickSettings/build/QuickSettings.js */
// Create a settings menu that this plugin can useconst settings = api.lib("QuickSettings")("MyPlugin", [ { type: "heading", text: "Some Settings" }, { type: "boolean", id: "bool", title: "A boolean!", default: true }, { type: "number", id: "num", title: "A number!", default: 10, min: 0, max: 100, step: 1 }, { type: "text", id: "name", title: "Your name", maxLength: 18, default: "Josh" }]);
// Listen to changes to settingssettings.listen("bool", (val) => console.log("bool changed to", val));settings.listen("num", (val) => console.log("num changed to", val));settings.listen("name", (val) => console.log("name changed to", val));
// Get the value of settingsconsole.log("The boolean is", settings.bool);console.log("The number is", settings.num);console.log("The name is", settings.name);
// Register the openSettingsMenu functionapi.openSettingsMenu(settings.openSettingsMenu);