This commit is contained in:
Mirco Wittrien 2023-04-21 09:05:58 +02:00
parent 05fbbcb3a1
commit 737b0820fe
2 changed files with 17 additions and 20 deletions

View File

@ -2,7 +2,7 @@
* @name CompleteTimestamps
* @author DevilBro
* @authorId 278543574059057154
* @version 1.6.6
* @version 1.6.7
* @description Replaces Timestamps with your own custom Timestamps
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -14,12 +14,7 @@
module.exports = (_ => {
const changeLog = {
"improved": {
"RelativeTimestamps": "Now works with the Plugin 'RelativeTimestamps"
},
"added": {
"User Member Info": "Hovering over the User Member Info (Member Since) will show a full Timestamp"
}
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
@ -102,19 +97,16 @@ module.exports = (_ => {
onStart () {
BDFDB.LibraryModules.MessageParser && BDFDB.LibraryModules.MessageParser.defaultRules && BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.MessageParser.defaultRules.timestamp, "react", {after: e => {
const date = 1e3*Number(e.methodArguments[0].timestamp);
const date = 1e3 * Number(e.methodArguments[0].timestamp);
if (this.settings.places.markup && e.methodArguments[0].formatted == BDFDB.LibraryModules.MessageParser.defaultRules.timestamp.parse([null, e.methodArguments[0].timestamp, "f"]).formatted) {
if (tooltipIsSame) e.returnValue.props.delay = 99999999999999999999;
let timestamp = this.formatTimestamp(this.settings.dates.timestampDate, date);
let renderChildren = e.returnValue.props.children;
e.returnValue.props.children = (...args) => {
let renderedChildren = renderChildren(...args);
if (BDFDB.ArrayUtils.is(renderedChildren.props.children)) renderedChildren.props.children[1] = timestamp;
else renderedChildren.props.children = timestamp;
return renderedChildren;
};
if (e.returnValue.props.node) e.returnValue.props.node.formatted = timestamp;
}
if (this.settings.tooltips.markup) {
e.returnValue.props.text = this.formatTimestamp(this.settings.dates.tooltipDate, date);
if (e.returnValue.props.node) e.returnValue.props.node.full = e.returnValue.props.text;
}
if (this.settings.tooltips.markup) e.returnValue.props.text = this.formatTimestamp(this.settings.dates.tooltipDate, date);
}});
this.forceUpdateAll();

View File

@ -2,7 +2,7 @@
* @name NotificationSounds
* @author DevilBro
* @authorId 278543574059057154
* @version 3.7.9
* @version 3.8.0
* @description Allows you to replace the native Sounds with custom Sounds
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -179,17 +179,20 @@ module.exports = (_ => {
src: src,
mute: id.startsWith("call_") ? null : false,
streamMute: false,
invisibleMute: false,
force: id == "message1" ? false : null,
focus: id == "message1" ? true : false
};
if (id == "message1") {
types[id].mute = true;
types[id].streamMute = false;
types[id].invisibleMute = false;
for (let subType in message1Types) types[subType] = {
name: message1Types[subType].name,
src: BDFDB.LibraryModules.SoundParser(message1Types[subType].src),
mute: true,
streamMute: false,
invisibleMute: false,
force: message1Types[subType].force,
focus: message1Types[subType].focus
}
@ -439,7 +442,7 @@ module.exports = (_ => {
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsLabel, {
label: types[type].name
}),
["force", "focus", "mute", "streamMute"].some(n => types[type][n] !== null) && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
["force", "focus", "mute", "streamMute", "invisibleMute"].some(n => types[type][n] !== null) && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
onClick: event => BDFDB.ContextMenuUtils.open(this, event, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
children: [
{key: "force", label: "Force Play", hint: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
@ -459,7 +462,8 @@ module.exports = (_ => {
})
})},
{key: "mute", label: ["Mute in", BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.StatusComponents.Status, {style: {marginLeft: 6}, size: 12, status: BDFDB.LibraryComponents.StatusComponents.Types.DND})]},
{key: "streamMute", label: ["Mute while", BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.StatusComponents.Status, {style: {marginLeft: 6}, size: 12, status: BDFDB.LibraryComponents.StatusComponents.Types.STREAMING})]},
{key: "invisibleMute", label: ["Mute in", BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.StatusComponents.Status, {style: {marginLeft: 6}, size: 12, status: BDFDB.LibraryComponents.StatusComponents.Types.INVISIBLE})]},
{key: "streamMute", label: ["Mute while", BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.StatusComponents.Status, {style: {marginLeft: 6}, size: 12, status: BDFDB.LibraryComponents.StatusComponents.Types.STREAMING})]}
].map(n => types[type][n.key] !== null && BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuCheckboxItem, {
label: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
align: BDFDB.LibraryComponents.Flex.Align.CENTER,
@ -677,6 +681,7 @@ module.exports = (_ => {
volume: 100,
mute: types[type].mute,
streamMute: types[type].streamMute,
invisibleMute: types[type].invisibleMute,
focus: types[type].focus
};
choices[type] = choice;
@ -707,7 +712,7 @@ module.exports = (_ => {
dontPlayAudio (type) {
let status = BDFDB.UserUtils.getStatus();
return choices[type] && (choices[type].mute && status == "dnd" || choices[type].streamMute && status == "streaming");
return choices[type] && (choices[type].mute && status == "dnd" || choices[type].streamMute && status == "streaming" || choices[type].invisibleMute && (status == "offline" || status == "invisible"));
}
fireEvent (type) {