stuff
This commit is contained in:
parent
a55dfd87e0
commit
a005a0811c
|
@ -2,7 +2,7 @@
|
||||||
* @name BDFDB
|
* @name BDFDB
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 1.5.3
|
* @version 1.5.4
|
||||||
* @description Required Library for DevilBro's Plugins
|
* @description Required Library for DevilBro's Plugins
|
||||||
* @invite Jx3TjNS
|
* @invite Jx3TjNS
|
||||||
* @donate https://www.paypal.me/MircoWittrien
|
* @donate https://www.paypal.me/MircoWittrien
|
||||||
|
@ -22,7 +22,7 @@ module.exports = (_ => {
|
||||||
"info": {
|
"info": {
|
||||||
"name": "BDFDB",
|
"name": "BDFDB",
|
||||||
"author": "DevilBro",
|
"author": "DevilBro",
|
||||||
"version": "1.5.3",
|
"version": "1.5.4",
|
||||||
"description": "Required Library for DevilBro's Plugins"
|
"description": "Required Library for DevilBro's Plugins"
|
||||||
},
|
},
|
||||||
"rawUrl": `https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js`
|
"rawUrl": `https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js`
|
||||||
|
@ -2043,7 +2043,8 @@ module.exports = (_ => {
|
||||||
const pluginName = typeof plugin === "string" ? plugin : plugin.name;
|
const pluginName = typeof plugin === "string" ? plugin : plugin.name;
|
||||||
const pluginVersion = typeof plugin === "string" ? "" : plugin.version;
|
const pluginVersion = typeof plugin === "string" ? "" : plugin.version;
|
||||||
const pluginId = pluginName.toLowerCase();
|
const pluginId = pluginName.toLowerCase();
|
||||||
const patchPriority = BDFDB.ObjectUtils.is(plugin) && !isNaN(plugin.patchPriority) ? (plugin.patchPriority < 0 ? 0 : (plugin.patchPriority > 10 ? 10 : Math.round(plugin.patchPriority))) : 5;
|
let patchPriority = !isNaN(config.priority) ? config.priority : (BDFDB.ObjectUtils.is(plugin) && !isNaN(plugin.patchPriority) ? plugin.patchPriority : 5);
|
||||||
|
patchPriority = patchPriority < 1 ? (plugin == InternalBDFDB ? 0 : 1) : (patchPriority > 9 ? (plugin == InternalBDFDB ? 10 : 9) : Math.round(patchPriority));
|
||||||
if (!BDFDB.ObjectUtils.is(module.BDFDB_patches)) module.BDFDB_patches = {};
|
if (!BDFDB.ObjectUtils.is(module.BDFDB_patches)) module.BDFDB_patches = {};
|
||||||
methodNames = [methodNames].flat(10).filter(n => n);
|
methodNames = [methodNames].flat(10).filter(n => n);
|
||||||
let cancel = _ => {BDFDB.PatchUtils.unpatch(plugin, module, methodNames);};
|
let cancel = _ => {BDFDB.PatchUtils.unpatch(plugin, module, methodNames);};
|
||||||
|
@ -7868,6 +7869,13 @@ module.exports = (_ => {
|
||||||
}}, {noCache: true});
|
}}, {noCache: true});
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
BDFDB.PatchUtils.patch(BDFDB, (BDFDB.ModuleUtils.findByName("useCopyIdItem", false) || {}).exports, "default", {after: e => {
|
||||||
|
if (!e.returnValue) e.returnValue = false;
|
||||||
|
}}, {priority: 10});
|
||||||
|
BDFDB.PatchUtils.patch(BDFDB, (BDFDB.ModuleUtils.findByName("DeveloperContextMenu", false) || {}).exports, "default", {after: e => {
|
||||||
|
if (!e.returnValue.props.children) LibraryModules.ContextMenuUtils.closeContextMenu();
|
||||||
|
}}, {priority: 10});
|
||||||
|
|
||||||
InternalBDFDB.onSettingsClosed = function () {
|
InternalBDFDB.onSettingsClosed = function () {
|
||||||
if (InternalBDFDB.SettingsUpdated) {
|
if (InternalBDFDB.SettingsUpdated) {
|
||||||
delete InternalBDFDB.SettingsUpdated;
|
delete InternalBDFDB.SettingsUpdated;
|
||||||
|
|
|
@ -74,7 +74,7 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.patchPriority = 10;
|
this.patchPriority = 9;
|
||||||
|
|
||||||
this.patchedModules = {
|
this.patchedModules = {
|
||||||
after: {
|
after: {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* @name EditRoles
|
* @name EditRoles
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 1.0.1
|
* @version 1.0.2
|
||||||
* @description Allows you to locally edit Roles
|
* @description Allows you to locally edit Roles
|
||||||
* @invite Jx3TjNS
|
* @invite Jx3TjNS
|
||||||
* @donate https://www.paypal.me/MircoWittrien
|
* @donate https://www.paypal.me/MircoWittrien
|
||||||
|
@ -17,7 +17,7 @@ module.exports = (_ => {
|
||||||
"info": {
|
"info": {
|
||||||
"name": "EditRoles",
|
"name": "EditRoles",
|
||||||
"author": "DevilBro",
|
"author": "DevilBro",
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"description": "Allows you to locally edit Roles"
|
"description": "Allows you to locally edit Roles"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -60,13 +60,12 @@ module.exports = (_ => {
|
||||||
return template.content.firstElementChild;
|
return template.content.firstElementChild;
|
||||||
}
|
}
|
||||||
} : (([Plugin, BDFDB]) => {
|
} : (([Plugin, BDFDB]) => {
|
||||||
var changedRoles = {}, cachedDevMode;
|
var changedRoles = {};
|
||||||
|
|
||||||
return class EditRoles extends Plugin {
|
return class EditRoles extends Plugin {
|
||||||
onLoad () {
|
onLoad () {
|
||||||
this.patchedModules = {
|
this.patchedModules = {
|
||||||
before: {
|
before: {
|
||||||
DeveloperContextMenu: "default",
|
|
||||||
MemberListItem: "render",
|
MemberListItem: "render",
|
||||||
UserPopout: "render",
|
UserPopout: "render",
|
||||||
ChannelMembers: "render"
|
ChannelMembers: "render"
|
||||||
|
@ -141,7 +140,7 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
|
|
||||||
onDeveloperContextMenu (e) {
|
onDeveloperContextMenu (e) {
|
||||||
let guild = BDFDB.LibraryModules.FolderStore.getFlattenedGuilds().find(g => g.roles[e.instance.props.id]);
|
let guild = this.getGuildFromRoleId(e.instance.props.id);
|
||||||
if (guild) e.returnvalue.props.children = [
|
if (guild) e.returnvalue.props.children = [
|
||||||
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
|
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
|
||||||
children: BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
children: BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
||||||
|
@ -153,8 +152,6 @@ module.exports = (_ => {
|
||||||
label: this.labels.submenu_rolesettings,
|
label: this.labels.submenu_rolesettings,
|
||||||
id: BDFDB.ContextMenuUtils.createItemId(this.name, "settings-change"),
|
id: BDFDB.ContextMenuUtils.createItemId(this.name, "settings-change"),
|
||||||
action: _ => {
|
action: _ => {
|
||||||
BDFDB.LibraryModules.SettingsUtils.updateLocalSettings({"developerMode": cachedDevMode})
|
|
||||||
cachedDevMode = null;
|
|
||||||
this.openRoleSettingsModal(guild.roles[e.instance.props.id]);
|
this.openRoleSettingsModal(guild.roles[e.instance.props.id]);
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
@ -164,8 +161,6 @@ module.exports = (_ => {
|
||||||
color: BDFDB.LibraryComponents.MenuItems.Colors.DANGER,
|
color: BDFDB.LibraryComponents.MenuItems.Colors.DANGER,
|
||||||
disabled: !changedRoles[e.instance.props.id],
|
disabled: !changedRoles[e.instance.props.id],
|
||||||
action: event => {
|
action: event => {
|
||||||
BDFDB.LibraryModules.SettingsUtils.updateLocalSettings({"developerMode": cachedDevMode})
|
|
||||||
cachedDevMode = null;
|
|
||||||
let remove = _ => {
|
let remove = _ => {
|
||||||
BDFDB.DataUtils.remove(this, "roles", e.instance.props.id);
|
BDFDB.DataUtils.remove(this, "roles", e.instance.props.id);
|
||||||
this.forceUpdateAll(true);
|
this.forceUpdateAll(true);
|
||||||
|
@ -182,11 +177,6 @@ module.exports = (_ => {
|
||||||
].flat(10).filter(n => n);
|
].flat(10).filter(n => n);
|
||||||
}
|
}
|
||||||
|
|
||||||
processDeveloperContextMenu (e) {
|
|
||||||
cachedDevMode = BDFDB.LibraryModules.SettingsStore.developerMode;
|
|
||||||
BDFDB.LibraryModules.SettingsUtils.updateLocalSettings({"developerMode": true})
|
|
||||||
}
|
|
||||||
|
|
||||||
processMemberListItem (e) {
|
processMemberListItem (e) {
|
||||||
if (e.instance.props.user) {
|
if (e.instance.props.user) {
|
||||||
let member = BDFDB.LibraryModules.MemberStore.getMember(e.instance.props.guildId, e.instance.props.user.id);
|
let member = BDFDB.LibraryModules.MemberStore.getMember(e.instance.props.guildId, e.instance.props.user.id);
|
||||||
|
@ -211,6 +201,10 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getGuildFromRoleId (roleId) {
|
||||||
|
return BDFDB.LibraryModules.FolderStore.getFlattenedGuilds().find(g => g.roles[roleId]);
|
||||||
|
}
|
||||||
|
|
||||||
changeRolesInGuild (guild) {
|
changeRolesInGuild (guild) {
|
||||||
let changed = false, roles = Object.assign({}, guild.roles);
|
let changed = false, roles = Object.assign({}, guild.roles);
|
||||||
for (let id in guild.roles) {
|
for (let id in guild.roles) {
|
||||||
|
|
|
@ -76,7 +76,7 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.patchPriority = 10;
|
this.patchPriority = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
onStart () {
|
onStart () {
|
||||||
|
|
|
@ -197,7 +197,7 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.patchPriority = 10;
|
this.patchPriority = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
onStart () {
|
onStart () {
|
||||||
|
|
|
@ -190,7 +190,7 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.patchPriority = 10;
|
this.patchPriority = 9;
|
||||||
|
|
||||||
this.css = `
|
this.css = `
|
||||||
${BDFDB.dotCNS._serverdetailstooltip + BDFDB.dotCN.tooltipcontent} {
|
${BDFDB.dotCNS._serverdetailstooltip + BDFDB.dotCN.tooltipcontent} {
|
||||||
|
|
Loading…
Reference in New Issue