stuff
This commit is contained in:
parent
00995fdc52
commit
185bc4e958
|
@ -2,7 +2,7 @@
|
||||||
* @name BDFDB
|
* @name BDFDB
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 2.3.7
|
* @version 2.3.8
|
||||||
* @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
|
||||||
|
@ -19,7 +19,7 @@ module.exports = (_ => {
|
||||||
"info": {
|
"info": {
|
||||||
"name": "BDFDB",
|
"name": "BDFDB",
|
||||||
"author": "DevilBro",
|
"author": "DevilBro",
|
||||||
"version": "2.3.7",
|
"version": "2.3.8",
|
||||||
"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"
|
||||||
|
@ -4808,7 +4808,7 @@ module.exports = (_ => {
|
||||||
},
|
},
|
||||||
onClick: this.props.disabled ? null : e => {
|
onClick: this.props.disabled ? null : e => {
|
||||||
if (!this.props.action) return false;
|
if (!this.props.action) return false;
|
||||||
!this.props.persisting && !hasPopout && this.props.onClose();
|
!this.props.persisting && !hasPopout && this.props.onClose && this.props.onClose();
|
||||||
this.props.action(e, this);
|
this.props.action(e, this);
|
||||||
},
|
},
|
||||||
onMouseEnter: this.props.disabled ? null : e => {
|
onMouseEnter: this.props.disabled ? null : e => {
|
||||||
|
@ -4821,6 +4821,12 @@ module.exports = (_ => {
|
||||||
},
|
},
|
||||||
"aria-disabled": this.props.disabled,
|
"aria-disabled": this.props.disabled,
|
||||||
children: [
|
children: [
|
||||||
|
this.props.icon && this.props.showIconFirst && BDFDB.ReactUtils.createElement("div", {
|
||||||
|
className: BDFDB.disCN.menuiconcontainerleft,
|
||||||
|
children: BDFDB.ReactUtils.createElement(this.props.icon, {
|
||||||
|
className: BDFDB.disCN.menuicon
|
||||||
|
})
|
||||||
|
}),
|
||||||
typeof this.props.render == "function" ? this.props.render(this) : this.props.render,
|
typeof this.props.render == "function" ? this.props.render(this) : this.props.render,
|
||||||
(this.props.label || this.props.subtext) && BDFDB.ReactUtils.createElement("div", {
|
(this.props.label || this.props.subtext) && BDFDB.ReactUtils.createElement("div", {
|
||||||
className: BDFDB.disCN.menulabel,
|
className: BDFDB.disCN.menulabel,
|
||||||
|
@ -4836,12 +4842,16 @@ module.exports = (_ => {
|
||||||
className: BDFDB.disCN.menuhintcontainer,
|
className: BDFDB.disCN.menuhintcontainer,
|
||||||
children: typeof this.props.hint == "function" ? this.props.hint(this) : this.props.hint
|
children: typeof this.props.hint == "function" ? this.props.hint(this) : this.props.hint
|
||||||
}),
|
}),
|
||||||
this.props.icon && BDFDB.ReactUtils.createElement("div", {
|
this.props.icon && !this.props.showIconFirst && BDFDB.ReactUtils.createElement("div", {
|
||||||
className: BDFDB.disCN.menuiconcontainer,
|
className: BDFDB.disCN.menuiconcontainer,
|
||||||
children: BDFDB.ReactUtils.createElement(this.props.icon, {
|
children: BDFDB.ReactUtils.createElement(this.props.icon, {
|
||||||
className: BDFDB.disCN.menuicon
|
className: BDFDB.disCN.menuicon
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
|
this.props.input && BDFDB.ReactUtils.createElement("div", {
|
||||||
|
className: BDFDB.disCN.menuiconcontainer,
|
||||||
|
children: this.props.input
|
||||||
|
}),
|
||||||
this.props.imageUrl && BDFDB.ReactUtils.createElement("div", {
|
this.props.imageUrl && BDFDB.ReactUtils.createElement("div", {
|
||||||
className: BDFDB.disCN.menuimagecontainer,
|
className: BDFDB.disCN.menuimagecontainer,
|
||||||
children: BDFDB.ReactUtils.createElement("img", {
|
children: BDFDB.ReactUtils.createElement("img", {
|
||||||
|
@ -4878,12 +4888,8 @@ module.exports = (_ => {
|
||||||
isFocused: this.state.hovered && !this.props.disabled
|
isFocused: this.state.hovered && !this.props.disabled
|
||||||
}));
|
}));
|
||||||
return isItem ? item : BDFDB.ReactUtils.createElement(Internal.LibraryComponents.Clickable, {
|
return isItem ? item : BDFDB.ReactUtils.createElement(Internal.LibraryComponents.Clickable, {
|
||||||
onMouseEnter: e => {
|
onMouseEnter: e => this.setState({hovered: true}),
|
||||||
this.setState({hovered: true});
|
onMouseLeave: e => this.setState({hovered: false}),
|
||||||
},
|
|
||||||
onMouseLeave: e => {
|
|
||||||
this.setState({hovered: false});
|
|
||||||
},
|
|
||||||
children: item
|
children: item
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -6625,8 +6631,16 @@ module.exports = (_ => {
|
||||||
BDFDB.ReactUtils.forceUpdate(this);
|
BDFDB.ReactUtils.forceUpdate(this);
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
return BDFDB.ReactUtils.createElement(Internal.NativeSubComponents.MenuCheckboxItem, Object.assign({}, this.props, {
|
return BDFDB.ReactUtils.createElement(Internal.MenuItem, Object.assign({}, this.props, {
|
||||||
checked: this.props.state && this.props.state.checked,
|
input: this.props.state && this.props.state.checked ? BDFDB.ReactUtils.createElement(Internal.LibraryComponents.SvgIcon, {
|
||||||
|
className: BDFDB.disCN.menuicon,
|
||||||
|
background: BDFDB.disCN.menucheckbox,
|
||||||
|
foreground: BDFDB.disCN.menucheck,
|
||||||
|
name: Internal.LibraryComponents.SvgIcon.Names.CHECKBOX
|
||||||
|
}) : BDFDB.ReactUtils.createElement(Internal.LibraryComponents.SvgIcon, {
|
||||||
|
className: BDFDB.disCN.menuicon,
|
||||||
|
name: Internal.LibraryComponents.SvgIcon.Names.CHECKBOX_EMPTY
|
||||||
|
}),
|
||||||
action: this.handleClick.bind(this)
|
action: this.handleClick.bind(this)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
|
@ -299,6 +299,7 @@
|
||||||
"Upload": {"class": "uploadmodal"},
|
"Upload": {"class": "uploadmodal"},
|
||||||
"UserHook": {"class": "auditloguserhook"},
|
"UserHook": {"class": "auditloguserhook"},
|
||||||
"UserMention": {"strings": ["inlinePreview", "getAvatarURL", "userId", "default.getName"]},
|
"UserMention": {"strings": ["inlinePreview", "getAvatarURL", "userId", "default.getName"]},
|
||||||
|
"UserPopoutAvatar": {"props": ["UserPopoutAvatar"]},
|
||||||
"UserProfileModal": {"lazyLoaded": true},
|
"UserProfileModal": {"lazyLoaded": true},
|
||||||
"UserProfileModalHeader": {"lazyLoaded": true},
|
"UserProfileModalHeader": {"lazyLoaded": true},
|
||||||
"UserSettingsAppearance": {"class": "usersettingsappearancepreview"}
|
"UserSettingsAppearance": {"class": "usersettingsappearancepreview"}
|
||||||
|
@ -2474,6 +2475,7 @@
|
||||||
"menuhintcontainer": ["Menu", "hintContainer"],
|
"menuhintcontainer": ["Menu", "hintContainer"],
|
||||||
"menuicon": ["Menu", "icon"],
|
"menuicon": ["Menu", "icon"],
|
||||||
"menuiconcontainer": ["Menu", "iconContainer"],
|
"menuiconcontainer": ["Menu", "iconContainer"],
|
||||||
|
"menuiconcontainerleft": ["Menu", "iconContainerLeft"],
|
||||||
"menuimage": ["Menu", "image"],
|
"menuimage": ["Menu", "image"],
|
||||||
"menuimagecontainer": ["Menu", "imageContainer"],
|
"menuimagecontainer": ["Menu", "imageContainer"],
|
||||||
"menuitem": ["Menu", "item"],
|
"menuitem": ["Menu", "item"],
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* @name GameActivityToggle
|
* @name GameActivityToggle
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 1.1.2
|
* @version 1.1.3
|
||||||
* @description Adds a Quick-Toggle Game Activity Button
|
* @description Adds a Quick-Toggle Game Activity Button
|
||||||
* @invite Jx3TjNS
|
* @invite Jx3TjNS
|
||||||
* @donate https://www.paypal.me/MircoWittrien
|
* @donate https://www.paypal.me/MircoWittrien
|
||||||
|
@ -17,12 +17,12 @@ module.exports = (_ => {
|
||||||
"info": {
|
"info": {
|
||||||
"name": "GameActivityToggle",
|
"name": "GameActivityToggle",
|
||||||
"author": "DevilBro",
|
"author": "DevilBro",
|
||||||
"version": "1.1.2",
|
"version": "1.1.3",
|
||||||
"description": "Adds a Quick-Toggle Game Activity Button"
|
"description": "Adds a Quick-Toggle Game Activity Button"
|
||||||
},
|
},
|
||||||
"changeLog": {
|
"changeLog": {
|
||||||
"fixed": {
|
"improved": {
|
||||||
"Account Switcher Overflow": "Fixed Issue, where the settings button would overflow in the account details, when the account switcher experiment was enabled, NOW FOR REAL"
|
"Menu Item Option": "Now allows you to add a Context Menu Item to the new User Account Popup in the bottom left"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -99,6 +99,8 @@ module.exports = (_ => {
|
||||||
|
|
||||||
this.defaults = {
|
this.defaults = {
|
||||||
general: {
|
general: {
|
||||||
|
showButton: {value: true, description: "Show Quick Toggle Button"},
|
||||||
|
showItem: {value: false, description: "Show Quick Toggle Item"},
|
||||||
playEnable: {value: true, description: "Play Enable Sound"},
|
playEnable: {value: true, description: "Play Enable Sound"},
|
||||||
playDisable: {value: true, description: "Play Disable Sound"}
|
playDisable: {value: true, description: "Play Disable Sound"}
|
||||||
},
|
},
|
||||||
|
@ -109,6 +111,9 @@ module.exports = (_ => {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.patchedModules = {
|
this.patchedModules = {
|
||||||
|
before: {
|
||||||
|
Menu: "default"
|
||||||
|
},
|
||||||
after: {
|
after: {
|
||||||
Account: "render"
|
Account: "render"
|
||||||
}
|
}
|
||||||
|
@ -206,7 +211,29 @@ module.exports = (_ => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
processMenu (e) {
|
||||||
|
if (!this.settings.general.showItem || e.instance.props.navId != "account") return;
|
||||||
|
let [_, oldIndex] = BDFDB.ContextMenuUtils.findItem(e.instance, {id: BDFDB.ContextMenuUtils.createItemId(this.name, "activity-toggle")});
|
||||||
|
if (oldIndex == -1) {
|
||||||
|
let [children, index] = BDFDB.ContextMenuUtils.findItem(e.instance, {id: ["custom-status", "set-custom-status", "edit-custom-status"]});
|
||||||
|
if (index > -1) {
|
||||||
|
let isChecked = BDFDB.DiscordUtils.getSettings("ShowCurrentGame");
|
||||||
|
children.push(BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuCheckboxItem, {
|
||||||
|
label: BDFDB.LanguageUtils.LanguageStrings.ACTIVITY_STATUS,
|
||||||
|
id: BDFDB.ContextMenuUtils.createItemId(this.name, "activity-toggle"),
|
||||||
|
icon: _ => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuIcon, {
|
||||||
|
icon: BDFDB.LibraryComponents.SvgIcon.Names.GAMEPAD
|
||||||
|
}),
|
||||||
|
showIconFirst: true,
|
||||||
|
checked: isChecked,
|
||||||
|
action: _ => this.toggle()
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
processAccount (e) {
|
processAccount (e) {
|
||||||
|
if (!this.settings.general.showButton) return;
|
||||||
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "PanelButton"});
|
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "PanelButton"});
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
e.returnvalue.props.className = BDFDB.DOMUtils.formatClassName(e.returnvalue.props.className, BDFDB.disCN._gameactivitytoggleadded);
|
e.returnvalue.props.className = BDFDB.DOMUtils.formatClassName(e.returnvalue.props.className, BDFDB.disCN._gameactivitytoggleadded);
|
||||||
|
|
Loading…
Reference in New Issue