GlobalBadges: Merge ShowPrefix & ShowSuffix

This commit is contained in:
thororen1234 2026-07-04 16:13:07 -04:00
parent 601d132727
commit 55e29f986b
No known key found for this signature in database
4 changed files with 13 additions and 26 deletions

View file

@ -335,7 +335,7 @@ export function migrateSettingsFromPlugin(newPlugin: string, oldPlugin: string,
SettingsStore.markAsChanged();
}
export function migrateOldSettingToNewPlugin(newPlugin: string, newSetting: string, oldPlugin: string, oldSetting: string,) {
export function migrateOldSettingToNewPlugin(newPlugin: string, newSetting: string, oldPlugin: string, oldSetting: string) {
const { plugins } = SettingsStore.plain;
const oldSettings = plugins[oldPlugin];
const newSettings = plugins[newPlugin];

View file

@ -7,7 +7,6 @@
import "./styles.css";
import { BadgePosition, ProfileBadge } from "@api/Badges";
import { migratePluginSetting } from "@api/Settings";
import { Button } from "@components/Button";
import { BadgeContextMenu } from "@plugins/_api/badges";
import { Devs, EquicordDevs } from "@utils/constants";
@ -20,7 +19,6 @@ import { cl, GlobalBadges, INVITE_LINK, loadBadges } from "./utils";
let intervalId: any;
migratePluginSetting("GlobalBadges", "showRaincord", "showRa1ncord");
export default definePlugin({
name: "GlobalBadges",
description: "Adds global badges from other client mods",

View file

@ -60,27 +60,15 @@ function ShowXSettings() {
}
export const settings = definePluginSettings({
showPrefix: {
type: OptionType.BOOLEAN,
description: "Shows the Mod as Prefix",
default: true,
restartNeeded: false,
onChange: (e => {
if (e && settings.store.showSuffix) {
settings.store.showSuffix = false;
}
})
},
showSuffix: {
type: OptionType.BOOLEAN,
description: "Shows the Mod as Suffix",
default: false,
restartNeeded: false,
onChange: (e => {
if (e && settings.store.showPrefix) {
settings.store.showPrefix = false;
}
})
showModStyle: {
type: OptionType.SELECT,
description: "Mod Style",
default: "none",
options: [
{ label: "Don't Show Mod", value: "none" },
{ label: "Show Mod as Prefix", value: "prefix" },
{ label: "Show Mod as Suffix", value: "suffix" },
]
},
apiUrl: {
type: OptionType.STRING,

View file

@ -70,8 +70,9 @@ export async function loadBadges() {
return true;
}).map(b => {
const modFormatted = serviceMap[b.mod];
const prefix = settings.store.showPrefix ? `${modFormatted} - ` : "";
const suffix = settings.store.showSuffix ? ` - ${modFormatted}` : "";
const prefix = settings.store.showModStyle === "prefix" ? `${modFormatted} - ` : "";
const suffix = settings.store.showModStyle === "suffix" ? ` - ${modFormatted}` : "";
const tooltip = prefix + b.tooltip + suffix;
return {
...b,