Experiments: add toggle for toolbar dev button
Co-Authored-By: F53 <fseusb@gmail.com>
This commit is contained in:
parent
64025bc523
commit
9de18ac8c7
|
@ -16,12 +16,13 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { disableStyle, enableStyle } from "@api/Styles";
|
import { disableStyle, enableStyle } from "@api/Styles";
|
||||||
import ErrorBoundary from "@components/ErrorBoundary";
|
import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { ErrorCard } from "@components/ErrorCard";
|
import { ErrorCard } from "@components/ErrorCard";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import { Margins } from "@utils/margins";
|
import { Margins } from "@utils/margins";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { findByPropsLazy } from "@webpack";
|
import { findByPropsLazy } from "@webpack";
|
||||||
import { Forms, React } from "@webpack/common";
|
import { Forms, React } from "@webpack/common";
|
||||||
|
|
||||||
|
@ -29,6 +30,15 @@ import hideBugReport from "./hideBugReport.css?managed";
|
||||||
|
|
||||||
const KbdStyles = findByPropsLazy("key", "removeBuildOverride");
|
const KbdStyles = findByPropsLazy("key", "removeBuildOverride");
|
||||||
|
|
||||||
|
const settings = definePluginSettings({
|
||||||
|
toolbarDevMenu: {
|
||||||
|
type: OptionType.BOOLEAN,
|
||||||
|
description: "Change the Help (?) toolbar button (top right in chat) to Discord's developer menu",
|
||||||
|
default: false,
|
||||||
|
restartNeeded: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "Experiments",
|
name: "Experiments",
|
||||||
description: "Enable Access to Experiments & other dev-only features in Discord!",
|
description: "Enable Access to Experiments & other dev-only features in Discord!",
|
||||||
|
@ -40,6 +50,8 @@ export default definePlugin({
|
||||||
Devs.Nuckyz
|
Devs.Nuckyz
|
||||||
],
|
],
|
||||||
|
|
||||||
|
settings,
|
||||||
|
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: "Object.defineProperties(this,{isDeveloper",
|
find: "Object.defineProperties(this,{isDeveloper",
|
||||||
|
@ -68,6 +80,16 @@ export default definePlugin({
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /\i\.isStaff\(\)/,
|
match: /\i\.isStaff\(\)/,
|
||||||
replace: "true"
|
replace: "true"
|
||||||
|
},
|
||||||
|
predicate: () => settings.store.toolbarDevMenu
|
||||||
|
},
|
||||||
|
|
||||||
|
// makes the Favourites Server experiment allow favouriting DMs and threads
|
||||||
|
{
|
||||||
|
find: "useCanFavoriteChannel",
|
||||||
|
replacement: {
|
||||||
|
match: /!\(\i\.isDM\(\)\|\|\i\.isThread\(\)\)/,
|
||||||
|
replace: "true",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -38,7 +38,7 @@ export const Devs = /* #__PURE__*/ Object.freeze({
|
||||||
id: 0n,
|
id: 0n,
|
||||||
},
|
},
|
||||||
Ven: {
|
Ven: {
|
||||||
name: "Vendicated",
|
name: "Vee",
|
||||||
id: 343383572805058560n
|
id: 343383572805058560n
|
||||||
},
|
},
|
||||||
Arjix: {
|
Arjix: {
|
||||||
|
@ -327,7 +327,7 @@ export const Devs = /* #__PURE__*/ Object.freeze({
|
||||||
id: 305288513941667851n
|
id: 305288513941667851n
|
||||||
},
|
},
|
||||||
ImLvna: {
|
ImLvna: {
|
||||||
name: "Luna <3",
|
name: "lillith <3",
|
||||||
id: 799319081723232267n
|
id: 799319081723232267n
|
||||||
},
|
},
|
||||||
rad: {
|
rad: {
|
||||||
|
|
Loading…
Reference in a new issue