Skip to content

Commit 8bf174b

Browse files
committed
fix many lots
1 parent f9036e8 commit 8bf174b

File tree

15 files changed

+37
-31
lines changed

15 files changed

+37
-31
lines changed

src/allActivities/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const webpackModules: Record<string, ExtensionWebpackModule> = {
4646
{ id: "discord/Constants" },
4747
{ id: "discord/components/common/index" },
4848
{ ext: "componentEditor", id: "memberList" },
49-
'applicationStreamingPreviewWrapper:"applicationStreamingPreviewWrapper_',
49+
'applicationStreamingPreviewWrapper:"',
5050
{ id: "discord/modules/user_profile/web/UserProfileActivityCardWrapper" }
5151
]
5252
}

src/allActivities/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://moonlight-mod.github.io/manifest.schema.json",
33
"id": "allActivities",
4-
"version": "1.1.1",
4+
"version": "1.1.2",
55
"meta": {
66
"name": "Activity Icons",
77
"tagline": "Shows activity icons in the member list (and activity viewing/sending related tweaks) (formerly All Activities)",
@@ -10,7 +10,7 @@
1010
"tags": ["profiles"],
1111
"source": "https://github.com/Cynosphere/moonlight-extensions",
1212
"donate": "https://ko-fi.com/Cynosphere",
13-
"changelog": "Disable only sending one (1) playing activity"
13+
"changelog": "Fixes for latest Discord"
1414
},
1515
"dependencies": ["spacepack", "common", "componentEditor"],
1616
"apiLevel": 2

src/allActivities/style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
filter: drop-shadow(0 0 1px black);
2828
}
2929

30-
[class^="member_"] > [class^="childContainer_"] {
30+
div[class*="-member"] > div[class*="-childContainer"] {
3131
/* hey discord, maybe you should like, actually learn how to position gradients instead of using padding */
3232
padding-right: 0;
3333

34-
& > [class^="memberInner_"] {
34+
& > div[class*="-memberInner"] {
3535
width: 100%;
3636

3737
/* controversal rule but w/e, i dont get why discord uses --space-16 on the right side only */

src/allActivities/webpackModules/icons.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ const ConnectionPlatforms = spacepack.findByCode("getByUrl(", "get(", "isSupport
1212
const UserProfileActivityCard = spacepack.findByCode(`location:${JSON.stringify("UserProfileActivityCard")},`)[0]
1313
.exports.Z;
1414

15-
const ActivityClasses = spacepack.findByCode(
16-
"applicationStreamingPreviewWrapper:" + '"applicationStreamingPreviewWrapper_'
17-
)[0].exports;
15+
const ActivityClasses = spacepack.findByCode('applicationStreamingPreviewWrapper:"')[0].exports;
1816

1917
const SpotifyIcon = ConnectionPlatforms.get(PlatformTypes.SPOTIFY).icon.lightSVG;
2018
const TwitchIcon = ConnectionPlatforms.get(PlatformTypes.TWITCH).icon.lightSVG;

src/betterUploadButton/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ import { ExtensionWebpackModule, Patch } from "@moonlight-mod/types";
22

33
export const patches: Patch[] = [
44
{
5-
find: '("ChannelAttachButton")',
5+
find: ".hasCurrentUserSentMessageSinceAppStart());",
66
replace: {
7-
match: /(?<="Invalid popout type provided"\)}},children:\i=>\(0,\i\.jsx\)\(\i\.\i,)(\i)\((\i)\({(look|ref):/,
8-
replacement: (_, defineProps, mergeProps, firstProp) =>
9-
`require("betterUploadButton_fixProps").default(${mergeProps}({${firstProp}:`
7+
match: /(?<="Invalid popout type provided"\)}},children:\i=>\(0,\i\.jsx\)\(\i\.\i,)(\i)\((\i)\({ref:/,
8+
replacement: (_, defineProps, mergeProps) => `require("betterUploadButton_fixProps").default(${mergeProps}({ref:`
109
}
1110
},
1211
{

src/betterUploadButton/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://moonlight-mod.github.io/manifest.schema.json",
33
"id": "betterUploadButton",
4-
"version": "1.0.2",
4+
"version": "1.0.3",
55
"meta": {
66
"name": "Better Upload Button",
77
"tagline": "Makes the upload button single click to upload and right click for other options",

src/colorConsistency/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ export const patches: Patch[] = [
1515

1616
// Typing
1717
{
18-
find: '("TypingUsers")',
18+
find: "this.handleDismissInviteEducation",
1919
replace: {
20-
match: /=>(\i\.\i\.getName\((\i),\i\.id,(\i)\))(?=.+?(\(0,(\i)\.jsxs\)))/,
21-
replacement: (_, name, guildId, user, createElement, React) =>
20+
match: /(?<=(\(0,(\i)\.jsx\)).+?)=>(\i\.\i\.getName\((\i\.guild_id),\i\.id,(\i)\))/,
21+
replacement: (_, createElement, React, name, guildId, user) =>
2222
`=>${createElement}(require("colorConsistency_wrapper")?.default??${React}.Fragment,{children:${name},userId:${user}.id,guildId:${guildId}})`
2323
},
2424
prerequisite: () => moonlight.getConfigOption<boolean>("colorConsistency", "typing") ?? true

src/colorConsistency/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"$schema": "https://moonlight-mod.github.io/manifest.schema.json",
33
"id": "colorConsistency",
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"meta": {
66
"name": "Color Consistency",
77
"tagline": "Add role colors to places missing them",
88
"authors": ["Cynosphere"],
99
"tags": ["qol", "chat", "accessibility", "appearance", "voice"],
1010
"source": "https://github.com/Cynosphere/moonlight-extensions",
1111
"donate": "https://ko-fi.com/Cynosphere",
12-
"changelog": "Fixes for latest Discord"
12+
"changelog": "Fixes for latest Discord, display name font support"
1313
},
1414
"settings": {
1515
"voice": {

src/colorConsistency/webpackModules/wrapper.tsx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
import React from "@moonlight-mod/wp/react";
1+
import React, { useState } from "@moonlight-mod/wp/react";
22
import spacepack from "@moonlight-mod/wp/spacepack_spacepack";
3-
import { GuildMemberStore } from "@moonlight-mod/wp/common_stores";
3+
import { GuildMemberStore, UserStore } from "@moonlight-mod/wp/common_stores";
44
import { useStateFromStores } from "@moonlight-mod/wp/discord/packages/flux";
55

66
const useGradient = spacepack.findFunctionByStrings(
7-
spacepack.findByCode('"--custom-gradient-color-1":null!=')?.[0]?.exports ?? {},
7+
spacepack.findByCode(`${'"--custom-gradient-color-2"'}:null!=`)?.[0]?.exports ?? {},
88
".useMemo("
99
);
10+
const useDisplayNameStylesFont = spacepack.findFunctionByStrings(
11+
spacepack.findByCode(".dnsFont")?.[0]?.exports ?? {},
12+
".dnsFont"
13+
);
1014

1115
const classnames = spacepack.require("classnames");
1216

@@ -27,9 +31,14 @@ export default function ColorConsistencyWrapper({
2731
userId,
2832
guildId
2933
]);
34+
const user = useStateFromStores([UserStore], () => UserStore.getUser(userId), [userId]);
35+
3036
const { colorString, colorStrings } = member ?? {};
3137
let gradientClassname, gradientStyle;
3238

39+
const displayNameStyles = member?.displayNameStyles ?? user?.displayNameStyles;
40+
const fontClass = useDisplayNameStylesFont?.({ displayNameStyles, inProfile: false });
41+
3342
try {
3443
const gradientRole =
3544
useGradient?.({ ...(colorStrings ?? {}), roleStyle: "username", includeConvenienceGlow: false }) ?? {};
@@ -39,7 +48,7 @@ export default function ColorConsistencyWrapper({
3948
// noop
4049
}
4150

42-
if (!member || !colorString) return children;
51+
if ((!member || !colorString) && !fontClass) return children;
4352

4453
return (
4554
<span
@@ -48,7 +57,7 @@ export default function ColorConsistencyWrapper({
4857
filter: speaking ? "brightness(1.75)" : null,
4958
...(gradientStyle ?? {})
5059
}}
51-
className={classnames("", gradientClassname ?? {})}
60+
className={classnames("", gradientClassname ?? {}, fontClass ?? "")}
5261
>
5362
{children}
5463
</span>

src/dmDates/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://moonlight-mod.github.io/manifest.schema.json",
33
"id": "dmDates",
4-
"version": "1.0.4",
4+
"version": "1.0.5",
55
"meta": {
66
"name": "DM Dates",
77
"tagline": "Implements dates next to direct messages like mobile",

0 commit comments

Comments
 (0)