diff --git a/src/plugins/rpcEditor/ReplaceSettings.tsx b/src/plugins/rpcEditor/ReplaceSettings.tsx
index 1bba4a097..8f93e6619 100644
--- a/src/plugins/rpcEditor/ReplaceSettings.tsx
+++ b/src/plugins/rpcEditor/ReplaceSettings.tsx
@@ -62,7 +62,7 @@ export function ReplaceTutorial() {
:name:, :details:, :state:
- :large_image::large_text:, :small_image:, :small_text:
+ :large_image:, :large_text:, :small_image:, :small_text:
>
@@ -93,16 +93,19 @@ export function ReplaceSettings({ appIds, update, save }: SettingsProps) {
{
appIds.map((setting, i) =>
- {
- onChange(value, i, "enabled");
- }}
- className={Margins.bottom16}
- hideBorder={true}
- >
- Enable editing of {setting.appName}
-
+ {
+ setting.appName !== "Unknown" ?
+ {
+ onChange(value, i, "enabled");
+ }}
+ className={Margins.bottom8}
+ hideBorder={true}
+ >
+ Edit the {setting.appName} app
+ : Add new application
+ }
Application ID
- {setting.activityType === ActivityType.STREAMING &&
- <>
- Stream URL
- {
- onChange(v, i, "streamUrl");
- }}
- validate={st => !/https?:\/\/(www\.)?(twitch\.tv|youtube\.com)\/\w+/.test(st) && "Only Twitch and Youtube URLs will work." || true}
- />
- >}
- New activity type
-
)
}
diff --git a/src/plugins/rpcEditor/index.tsx b/src/plugins/rpcEditor/index.tsx
index 7bf363782..d84dbc0b7 100644
--- a/src/plugins/rpcEditor/index.tsx
+++ b/src/plugins/rpcEditor/index.tsx
@@ -17,10 +17,16 @@ const APP_IDS_KEY = "ReplaceActivityType_appids";
export type AppIdSetting = {
appName: string;
appId: string;
- swapNameAndDetails: boolean;
- activityType: ActivityType;
- streamUrl: string;
enabled: boolean;
+ newActivityType: ActivityType;
+ newName: string,
+ newDetails: string,
+ newState: string,
+ newLargeImageUrl: string,
+ newLargeImageText: string,
+ newSmallImageUrl: string,
+ newSmallImageText: string;
+ newStreamUrl: string;
};
export interface Activity {
@@ -58,12 +64,18 @@ export const enum ActivityType {
}
export const makeEmptyAppId: () => AppIdSetting = () => ({
- appId: "",
appName: "Unknown",
- streamUrl: "",
- swapNameAndDetails: false,
- activityType: ActivityType.PLAYING,
- enabled: true
+ appId: "",
+ enabled: true,
+ newActivityType: ActivityType.PLAYING,
+ newName: "",
+ newDetails: "",
+ newState: "",
+ newLargeImageUrl: "",
+ newLargeImageText: "",
+ newSmallImageUrl: "",
+ newSmallImageText: "",
+ newStreamUrl: "",
});
let appIds = [makeEmptyAppId()];
@@ -112,16 +124,10 @@ export default definePlugin({
console.log(activity);
appIds.forEach(app => {
if (app.enabled && app.appId === activity.application_id) {
- activity.type = app.activityType;
+ activity.type = app.newActivityType;
- if (app.activityType === ActivityType.STREAMING && app.streamUrl) {
- activity.url = app.streamUrl;
- }
-
- if (app.swapNameAndDetails) {
- const media = activity.details;
- activity.details = activity.name;
- activity.name = media;
+ if (app.newActivityType === ActivityType.STREAMING && app.newStreamUrl) {
+ activity.url = app.newStreamUrl;
}
}