GlobalBadges: Merge ShowPrefix & ShowSuffix
This commit is contained in:
parent
601d132727
commit
55e29f986b
4 changed files with 13 additions and 26 deletions
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue