Skip to content

Commit f9036e8

Browse files
committed
platformIcons: vr, betterTags: fix app to bot
1 parent e23b6b7 commit f9036e8

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

src/betterTags/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export const patches: Patch[] = [
77
{
88
find: ".BOT:default:",
99
replace: {
10-
match: "9RNkeH", // APP_TAG
11-
replacement: "PQt9z8" // BOT_TAG_BOT
10+
match: "9RNkeF", // APP_TAG
11+
replacement: "PQt9z6" // BOT_TAG_BOT
1212
},
1313
prerequisite: () => moonlight.getConfigOption<boolean>("betterTags", "appToBot") ?? true
1414
},

src/betterTags/manifest.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"$schema": "https://moonlight-mod.github.io/manifest.schema.json",
33
"id": "betterTags",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"meta": {
66
"name": "Better Tags",
77
"tagline": "Reverts App back to Bot and adds webhook tags",
88
"authors": ["Cynosphere"],
99
"tags": ["qol", "chat"],
1010
"source": "https://github.com/Cynosphere/moonlight-extensions",
11-
"donate": "https://ko-fi.com/Cynosphere"
11+
"donate": "https://ko-fi.com/Cynosphere",
12+
"changelog": "Fix App To Bot"
1213
},
1314
"settings": {
1415
"appToBot": {

src/platformIcons/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": "platformIcons",
4-
"version": "1.0.8",
4+
"version": "1.0.9",
55
"meta": {
66
"name": "Platform Icons",
77
"tagline": "Shows what platform(s) a user is on",
88
"authors": ["Cynosphere"],
99
"tags": ["qol", "chat"],
1010
"source": "https://github.com/Cynosphere/moonlight-extensions",
1111
"donate": "https://ko-fi.com/Cynosphere",
12-
"changelog": "Fix profile patch"
12+
"changelog": "Fallback to nothing for platforms with no icon, add icon for VR"
1313
},
1414
"dependencies": ["spacepack", "common", "componentEditor"],
1515
"settings": {

src/platformIcons/webpackModules/icons.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@ import Messages from "@moonlight-mod/wp/componentEditor_messages";
1515

1616
import { AuthenticationStore, PresenceStore, SessionsStore } from "@moonlight-mod/wp/common_stores";
1717

18-
type Platforms = "desktop" | "mobile" | "web" | "embedded" | "unknown";
18+
const VrHeadsetIcon = (Object.values(
19+
spacepack.findByCode("M8.46 8.64a1 1 0 0 1 1 1c0 .44-.3.8-.72.92l-.11.07c-.08.06-.2.19-.2.41a.99.99")[0]?.exports
20+
)?.[0] ?? (() => {})) as React.ComponentType<IconsProps>;
21+
22+
type Platforms = "desktop" | "mobile" | "web" | "embedded" | "vr" | "unknown";
1923
const IconsForPlatform: Record<Exclude<Platforms, "unknown">, React.ComponentType<IconsProps>> = {
2024
desktop: ScreenIcon,
2125
mobile: MobilePhoneIcon,
2226
web: GlobeEarthIcon,
23-
embedded: GameControllerIcon
27+
embedded: GameControllerIcon,
28+
vr: VrHeadsetIcon
2429
};
2530

2631
const { humanizeStatus } = spacepack.findByCode("humanizeStatus:")[0].exports.ZP;
@@ -71,11 +76,13 @@ export default function PlatformIcons({ user, extraClasses, configKey, size = "x
7176
for (const platform of Object.keys(platforms)) {
7277
const status = platforms[platform];
7378

79+
let platformName = `${platform.charAt(0).toUpperCase()}${platform.slice(1)}`;
80+
if (platform === "vr") platformName = "VR";
7481
const props = {
75-
text: `${humanizeStatus(status, false)} on ${platform.charAt(0).toUpperCase()}${platform.slice(1)}`,
82+
text: `${humanizeStatus(status, false)} ${platform === "vr" ? "i" : "o"}n ${platformName}`,
7683
key: `platform-icons-tooltip-${platform}`
7784
};
78-
const Icon = IconsForPlatform[platform as Exclude<Platforms, "unknown">];
85+
const Icon = IconsForPlatform[platform as Exclude<Platforms, "unknown">] ?? (() => {});
7986
const color = StatusColors[status as Exclude<Statuses, "offline" | "invisible">];
8087

8188
elements.push(

0 commit comments

Comments
 (0)