Add display names where symbols or capitals are necessary

This commit is contained in:
Suffocate 2025-02-10 09:58:02 +00:00
parent e48e0922d1
commit d4f13c3e2f
12 changed files with 28 additions and 6 deletions

View file

@ -83,7 +83,8 @@ const enum TimestampMode {
const settings = definePluginSettings({ const settings = definePluginSettings({
appID: { appID: {
type: OptionType.STRING, type: OptionType.STRING,
description: "Application ID (required)", displayName: "Application ID (required)",
description: "Application ID from the Discord Developer Portal",
onChange: onChange, onChange: onChange,
isValid: (value: string) => { isValid: (value: string) => {
if (!value) return "Application ID is required."; if (!value) return "Application ID is required.";
@ -230,7 +231,8 @@ const settings = definePluginSettings({
}, },
buttonOneText: { buttonOneText: {
type: OptionType.STRING, type: OptionType.STRING,
description: "Button 1 text", displayName: "Button 1 Text",
description: "The text to display on button 1",
onChange: onChange, onChange: onChange,
isValid: (value: string) => { isValid: (value: string) => {
if (value && value.length > 31) return "Button 1 text must be not longer than 31 characters."; if (value && value.length > 31) return "Button 1 text must be not longer than 31 characters.";
@ -239,12 +241,14 @@ const settings = definePluginSettings({
}, },
buttonOneURL: { buttonOneURL: {
type: OptionType.STRING, type: OptionType.STRING,
description: "Button 1 URL", displayName: "Button 1 URL",
description: "The URL to open when clicking button 1",
onChange: onChange onChange: onChange
}, },
buttonTwoText: { buttonTwoText: {
type: OptionType.STRING, type: OptionType.STRING,
description: "Button 2 text", displayName: "Button 2 Text",
description: "The text to display on button 2",
onChange: onChange, onChange: onChange,
isValid: (value: string) => { isValid: (value: string) => {
if (value && value.length > 31) return "Button 2 text must be not longer than 31 characters."; if (value && value.length > 31) return "Button 2 text must be not longer than 31 characters.";
@ -253,7 +257,8 @@ const settings = definePluginSettings({
}, },
buttonTwoURL: { buttonTwoURL: {
type: OptionType.STRING, type: OptionType.STRING,
description: "Button 2 URL", displayName: "Button 2 URL",
description: "The URL to open when clicking button 2",
onChange: onChange onChange: onChange
} }
}); });

View file

@ -49,6 +49,7 @@ const settings = definePluginSettings({
default: false default: false
}, },
applyColorOnlyInDms: { applyColorOnlyInDms: {
displayName: "Apply Color Only In DMs",
description: "Apply colors only in direct messages; do not apply colors in servers.", description: "Apply colors only in direct messages; do not apply colors in servers.",
restartNeeded: false, restartNeeded: false,
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,

View file

@ -106,6 +106,7 @@ const settings = definePluginSettings({
type: OptionType.STRING, type: OptionType.STRING,
}, },
apiKey: { apiKey: {
displayName: "API Key",
description: "last.fm api key", description: "last.fm api key",
type: OptionType.STRING, type: OptionType.STRING,
}, },
@ -186,7 +187,8 @@ const settings = definePluginSettings({
], ],
}, },
showLastFmLogo: { showLastFmLogo: {
description: "show the Last.fm logo by the album cover", displayName: "Show Last.fm Logo",
description: "Show the Last.fm logo by the album cover",
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
default: true, default: true,
} }

View file

@ -16,6 +16,7 @@ import { User } from "discord-types/general";
const settings = definePluginSettings({ const settings = definePluginSettings({
showAtSymbol: { showAtSymbol: {
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
displayName: "Show @ Symbol",
description: "Whether the the @ symbol should be displayed on user mentions", description: "Whether the the @ symbol should be displayed on user mentions",
default: true default: true
} }

View file

@ -114,6 +114,7 @@ const settings = definePluginSettings({
] ]
}, },
idList: { idList: {
displayName: "ID List",
description: "Guild/channel/user IDs to blacklist or whitelist (separate with comma)", description: "Guild/channel/user IDs to blacklist or whitelist (separate with comma)",
type: OptionType.STRING, type: OptionType.STRING,
default: "" default: ""

View file

@ -25,6 +25,7 @@ import type { MouseEvent } from "react";
interface URLReplacementRule { interface URLReplacementRule {
match: RegExp; match: RegExp;
replace: (...matches: string[]) => string; replace: (...matches: string[]) => string;
displayName?: string;
description: string; description: string;
shortlinkMatch?: RegExp; shortlinkMatch?: RegExp;
accountViewReplace?: (userId: string) => string; accountViewReplace?: (userId: string) => string;
@ -59,6 +60,7 @@ const UrlReplacementRules: Record<string, URLReplacementRule> = {
itunes: { itunes: {
match: /^https:\/\/(?:geo\.)?music\.apple\.com\/([a-z]{2}\/)?(album|artist|playlist|song|curator)\/([^/?#]+)\/?([^/?#]+)?(?:\?.*)?(?:#.*)?$/, match: /^https:\/\/(?:geo\.)?music\.apple\.com\/([a-z]{2}\/)?(album|artist|playlist|song|curator)\/([^/?#]+)\/?([^/?#]+)?(?:\?.*)?(?:#.*)?$/,
replace: (_, lang, type, name, id) => id ? `itunes://music.apple.com/us/${type}/${name}/${id}` : `itunes://music.apple.com/us/${type}/${name}`, replace: (_, lang, type, name, id) => id ? `itunes://music.apple.com/us/${type}/${name}/${id}` : `itunes://music.apple.com/us/${type}/${name}`,
displayName: "iTunes",
description: "Open Apple Music links in the iTunes app" description: "Open Apple Music links in the iTunes app"
}, },
}; };
@ -67,6 +69,7 @@ const pluginSettings = definePluginSettings(
Object.entries(UrlReplacementRules).reduce((acc, [key, rule]) => { Object.entries(UrlReplacementRules).reduce((acc, [key, rule]) => {
acc[key] = { acc[key] = {
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
displayName: rule.displayName,
description: rule.description, description: rule.description,
default: true, default: true,
}; };

View file

@ -48,11 +48,13 @@ export const settings = definePluginSettings({
}, },
canCollapseDmSection: { canCollapseDmSection: {
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
displayName: "Can Collapse DM Section",
description: "Allow uncategorised DMs section to be collapsable", description: "Allow uncategorised DMs section to be collapsable",
default: false default: false
}, },
dmSectionCollapsed: { dmSectionCollapsed: {
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
displayName: "DM Section Collapsed",
description: "Collapse DM section", description: "Collapse DM section",
default: false, default: false,
hidden: true hidden: true

View file

@ -29,6 +29,7 @@ const settings = definePluginSettings({
placeholder: "Google" placeholder: "Google"
}, },
customEngineURL: { customEngineURL: {
displayName: "Custom Engine URL",
description: "The URL of your Engine", description: "The URL of your Engine",
type: OptionType.STRING, type: OptionType.STRING,
placeholder: "https://google.com/search?q=" placeholder: "https://google.com/search?q="

View file

@ -51,6 +51,7 @@ export const settings = definePluginSettings({
}, },
tryHljs: { tryHljs: {
type: OptionType.SELECT, type: OptionType.SELECT,
displayName: "Try Highlight.js",
description: "Use the more lightweight default Discord highlighter and theme.", description: "Use the more lightweight default Discord highlighter and theme.",
options: [ options: [
{ {

View file

@ -63,6 +63,7 @@ export const settings = definePluginSettings({
}, },
deeplApiKey: { deeplApiKey: {
type: OptionType.STRING, type: OptionType.STRING,
displayName: "DeepL API Key",
description: "DeepL API key", description: "DeepL API key",
default: "", default: "",
placeholder: "Get your API key from https://deepl.com/your-account", placeholder: "Get your API key from https://deepl.com/your-account",

View file

@ -62,6 +62,7 @@ const settings = definePluginSettings({
}, },
imgSize: { imgSize: {
type: OptionType.SELECT, type: OptionType.SELECT,
displayName: "Image Size",
description: "The image size to use", description: "The image size to use",
options: ["128", "256", "512", "1024", "2048", "4096"].map(n => ({ label: n, value: n, default: n === "1024" })) options: ["128", "256", "512", "1024", "2048", "4096"].map(n => ({ label: n, value: n, default: n === "1024" }))
} }

View file

@ -104,6 +104,7 @@ const settings = definePluginSettings({
}, },
preferUDP: { preferUDP: {
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
displayName: "Prefer UDP",
description: "Enable if you use an older build of XSOverlay unable to connect through websockets. This setting is ignored on web.", description: "Enable if you use an older build of XSOverlay unable to connect through websockets. This setting is ignored on web.",
default: false, default: false,
disabled: () => IS_WEB disabled: () => IS_WEB
@ -120,11 +121,13 @@ const settings = definePluginSettings({
}, },
dmNotifications: { dmNotifications: {
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
displayName: "DM Notifications",
description: "Allow Direct Message notifications", description: "Allow Direct Message notifications",
default: true default: true
}, },
groupDmNotifications: { groupDmNotifications: {
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
displayName: "Group DM Notifications",
description: "Allow Group DM notifications", description: "Allow Group DM notifications",
default: true default: true
}, },