stuff
This commit is contained in:
parent
5058b647ff
commit
506fbd229e
|
@ -2,7 +2,7 @@
|
||||||
* @name ServerDetails
|
* @name ServerDetails
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 1.1.3
|
* @version 1.1.4
|
||||||
* @description Shows Server Details in the Server List Tooltip
|
* @description Shows Server Details in the Server List Tooltip
|
||||||
* @invite Jx3TjNS
|
* @invite Jx3TjNS
|
||||||
* @donate https://www.paypal.me/MircoWittrien
|
* @donate https://www.paypal.me/MircoWittrien
|
||||||
|
@ -61,7 +61,7 @@ module.exports = (_ => {
|
||||||
const GuildDetailsComponent = class GuildDetails extends BdApi.React.Component {
|
const GuildDetailsComponent = class GuildDetails extends BdApi.React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {fetchedOwner: false, delayed: false, repositioned: false};
|
this.state = {fetchedOwner: false, delayed: false, repositioned: false, forced: false};
|
||||||
}
|
}
|
||||||
componentDidUpdate() {
|
componentDidUpdate() {
|
||||||
if (_this.settings.amounts.tooltipDelay && this.state.delayed && !this.state.repositioned) {
|
if (_this.settings.amounts.tooltipDelay && this.state.delayed && !this.state.repositioned) {
|
||||||
|
@ -70,7 +70,30 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
if (_this.settings.general.onlyShowOnShift && !this.props.shiftKey) return null;
|
if (_this.settings.general.onlyShowOnShift) {
|
||||||
|
let addListener = expanded => {
|
||||||
|
if (this.props.tooltipContainer && this.props.tooltipContainer.tooltip) BDFDB.DOMUtils.toggleClass(this.props.tooltipContainer.tooltip.firstElementChild, BDFDB.disCN._serverdetailstooltip, expanded);
|
||||||
|
let triggered = false, listener = event => {
|
||||||
|
if (!this.updater.isMounted(this)) return document.removeEventListener(expanded ? "keyup" : "keydown", listener);
|
||||||
|
if (triggered) return;
|
||||||
|
if (event.which != 16 || triggered) return;
|
||||||
|
triggered = true;
|
||||||
|
document.removeEventListener(expanded ? "keyup" : "keydown", listener);
|
||||||
|
this.props.shiftKey = !expanded;
|
||||||
|
this.state.forced = !expanded;
|
||||||
|
this.state.repositioned = false;
|
||||||
|
BDFDB.ReactUtils.forceUpdate(this);
|
||||||
|
};
|
||||||
|
document.addEventListener(expanded ? "keyup" : "keydown", listener);
|
||||||
|
};
|
||||||
|
if (!this.props.shiftKey) {
|
||||||
|
addListener(false);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
addListener(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
let owner = BDFDB.LibraryStores.UserStore.getUser(this.props.guild.ownerId);
|
let owner = BDFDB.LibraryStores.UserStore.getUser(this.props.guild.ownerId);
|
||||||
if (!owner && !this.state.fetchedOwner) {
|
if (!owner && !this.state.fetchedOwner) {
|
||||||
this.state.fetchedOwner = true;
|
this.state.fetchedOwner = true;
|
||||||
|
@ -81,7 +104,7 @@ module.exports = (_ => {
|
||||||
this.state.delayed = true;
|
this.state.delayed = true;
|
||||||
if (this.props.tooltipContainer && this.props.tooltipContainer.tooltip) BDFDB.DOMUtils.addClass(this.props.tooltipContainer.tooltip.firstElementChild, BDFDB.disCN._serverdetailstooltip);
|
if (this.props.tooltipContainer && this.props.tooltipContainer.tooltip) BDFDB.DOMUtils.addClass(this.props.tooltipContainer.tooltip.firstElementChild, BDFDB.disCN._serverdetailstooltip);
|
||||||
BDFDB.ReactUtils.forceUpdate(this);
|
BDFDB.ReactUtils.forceUpdate(this);
|
||||||
}, _this.settings.amounts.tooltipDelay * 1000);
|
}, this.state.forced ? 0 : (_this.settings.amounts.tooltipDelay * 1000));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
let src = this.props.guild.getIconURL(4096, this.props.guild.icon && BDFDB.LibraryModules.IconUtils.isAnimatedIconHash(this.props.guild.icon));
|
let src = this.props.guild.getIconURL(4096, this.props.guild.icon && BDFDB.LibraryModules.IconUtils.isAnimatedIconHash(this.props.guild.icon));
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* @name ServerFolders
|
* @name ServerFolders
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 7.0.6
|
* @version 7.0.7
|
||||||
* @description Changes Discord's Folders, Servers open in a new Container, also adds extra Features to more easily organize, customize and manage your Folders
|
* @description Changes Discord's Folders, Servers open in a new Container, also adds extra Features to more easily organize, customize and manage your Folders
|
||||||
* @invite Jx3TjNS
|
* @invite Jx3TjNS
|
||||||
* @donate https://www.paypal.me/MircoWittrien
|
* @donate https://www.paypal.me/MircoWittrien
|
||||||
|
@ -513,6 +513,7 @@ module.exports = (_ => {
|
||||||
opacity: 0.5 !important;
|
opacity: 0.5 !important;
|
||||||
z-index: 10000 !important;
|
z-index: 10000 !important;
|
||||||
}
|
}
|
||||||
|
${BDFDB.dotCNS._serverfoldershassidebar + BDFDB.dotCN.guildfolderwrapper} > [role="group"],
|
||||||
${BDFDB.dotCNS._serverfoldershassidebar + BDFDB.dotCN.guildfolderexpandedbackground} {
|
${BDFDB.dotCNS._serverfoldershassidebar + BDFDB.dotCN.guildfolderexpandedbackground} {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
@ -748,11 +749,6 @@ module.exports = (_ => {
|
||||||
BDFDB.ReactUtils.forceUpdate(folderGuildContent);
|
BDFDB.ReactUtils.forceUpdate(folderGuildContent);
|
||||||
}
|
}
|
||||||
folderStates[e.instance.props.folderNode.id] = state;
|
folderStates[e.instance.props.folderNode.id] = state;
|
||||||
|
|
||||||
e.instance.props.folderNode = Object.assign({}, e.instance.props.folderNode, {
|
|
||||||
_childCount: e.instance.props.folderNode.children.length,
|
|
||||||
children: this.settings.general.extraColumn && e.instance.props.expanded ? [] : e.instance.props.folderNode.children
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
processFolderHeader (e) {
|
processFolderHeader (e) {
|
||||||
|
@ -774,9 +770,9 @@ module.exports = (_ => {
|
||||||
if (this.settings.general.showCountBadge) {
|
if (this.settings.general.showCountBadge) {
|
||||||
let mask = BDFDB.ReactUtils.findChild(e.returnvalue, {name: "BlobMask"});
|
let mask = BDFDB.ReactUtils.findChild(e.returnvalue, {name: "BlobMask"});
|
||||||
if (mask) {
|
if (mask) {
|
||||||
mask.props.upperLeftBadgeWidth = BDFDB.LibraryComponents.Badges.NumberBadge.prototype.getBadgeWidthForValue(e.instance.props.folderNode._childCount);
|
mask.props.upperLeftBadgeWidth = BDFDB.LibraryComponents.Badges.NumberBadge.prototype.getBadgeWidthForValue(e.instance.props.folderNode.children.length);
|
||||||
mask.props.upperLeftBadge = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Badges.NumberBadge, {
|
mask.props.upperLeftBadge = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Badges.NumberBadge, {
|
||||||
count: e.instance.props.folderNode._childCount,
|
count: e.instance.props.folderNode.children.length,
|
||||||
style: {backgroundColor: "var(--bdfdb-blurple)"}
|
style: {backgroundColor: "var(--bdfdb-blurple)"}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue