Mostly Fix AllCallTimers

This commit is contained in:
thororen1234 2025-02-07 02:43:27 -05:00
parent 77fc5bfd84
commit 85598ddf9b
4 changed files with 7 additions and 34 deletions

View file

@ -64,7 +64,6 @@ export function SpecialCard({ title, subtitle, description, cardImage, backgroun
</div> </div>
{buttonTitle && ( {buttonTitle && (
<> <>
<Forms.FormDivider className={cl("seperator")} />
<Clickable onClick={onClick} className={cl("hyperlink")}> <Clickable onClick={onClick} className={cl("hyperlink")}>
<Forms.FormText className={cl("hyperlink-text")}> <Forms.FormText className={cl("hyperlink-text")}>
{buttonTitle} {buttonTitle}

View file

@ -84,7 +84,6 @@
width: 100px; width: 100px;
height: 100px; height: 100px;
border-radius: 50%; border-radius: 50%;
background-color: white;
} }
.vc-special-image { .vc-special-image {

View file

@ -105,20 +105,11 @@ export default definePlugin({
settings, settings,
patches: [ patches: [
{ {
find: "renderPrioritySpeaker", find: ".usernameSpeaking]",
replacement: [ replacement: [
{ {
match: /(render\(\)\{.+\}\),children:)\[(.+renderName\(\),)/, match: /function\(\)\{.+:""(?=.*?userId:(\i))/,
replace: "$&,$self.showClockInjection(this)," replace: "$&,$self.renderTimer($1.id),"
}
]
},
{
find: "renderPrioritySpeaker",
replacement: [
{
match: /(renderName\(\)\{.+:"")/,
replace: "$&,$self.showTextInjection(this),"
} }
] ]
} }
@ -225,26 +216,10 @@ export default definePlugin({
} }
}, },
showClockInjection(property: { props: { user: { id: string; }; }; }) { renderTimer(userId: string) {
if (settings.store.showWithoutHover) {
return "";
}
return this.showInjection(property);
},
showTextInjection(property: { props: { user: { id: string; }; }; }) {
if (!settings.store.showWithoutHover) { if (!settings.store.showWithoutHover) {
return ""; return "";
} }
return this.showInjection(property);
},
showInjection(property: { props: { user: { id: string; }; }; }) {
const userId = property.props.user.id;
return this.renderTimer(userId);
},
renderTimer(userId: string) {
// get the user join time from the users object // get the user join time from the users object
const joinTime = userJoinTimes.get(userId); const joinTime = userJoinTimes.get(userId);
if (!joinTime?.time) { if (!joinTime?.time) {

View file

@ -124,11 +124,11 @@ export default definePlugin({
}, },
// Voice Users // Voice Users
{ {
find: "renderPrioritySpeaker(){", find: ".usernameSpeaking]",
replacement: [ replacement: [
{ {
match: /renderName\(\){.+?usernameSpeaking\]:.+?(?=children)/, match: /usernameSpeaking\]:.+?(?=children)(?=.*?userId:(\i))(?=.*?contextGuildId:(\i))/,
replace: "$&style:$self.getColorStyle(this?.props?.user?.id,this?.props?.guildId)," replace: "$&style:$self.getColorStyle($1.id,$2),"
} }
], ],
predicate: () => settings.store.voiceUsers predicate: () => settings.store.voiceUsers