mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-11 02:16:23 +00:00
Added disable assets option
This commit is contained in:
parent
09c42e3c51
commit
077e668234
2 changed files with 53 additions and 33 deletions
|
@ -153,6 +153,9 @@ export function ReplaceSettings({ appIds, update, save }: SettingsProps) {
|
||||||
onChange(v, i, "newState");
|
onChange(v, i, "newState");
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
{
|
||||||
|
!setting.disableAssets &&
|
||||||
|
<>
|
||||||
<Forms.FormText style={{ fontSize: "1.05rem", fontWeight: "500" }} className={Margins.top8}>Large image</Forms.FormText>
|
<Forms.FormText style={{ fontSize: "1.05rem", fontWeight: "500" }} className={Margins.top8}>Large image</Forms.FormText>
|
||||||
<Forms.FormTitle className={Margins.top8}>Text {setting.newActivityType !== ActivityType.PLAYING && "(also third line)"}</Forms.FormTitle>
|
<Forms.FormTitle className={Margins.top8}>Text {setting.newActivityType !== ActivityType.PLAYING && "(also third line)"}</Forms.FormTitle>
|
||||||
<TextInput
|
<TextInput
|
||||||
|
@ -187,6 +190,19 @@ export function ReplaceSettings({ appIds, update, save }: SettingsProps) {
|
||||||
onChange(v, i, "newSmallImageUrl");
|
onChange(v, i, "newSmallImageUrl");
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
<Switch
|
||||||
|
value={setting.disableAssets}
|
||||||
|
onChange={value => {
|
||||||
|
onChange(value, i, "disableAssets");
|
||||||
|
}}
|
||||||
|
className={Margins.top8}
|
||||||
|
hideBorder={true}
|
||||||
|
style={{ marginBottom: "0" }}
|
||||||
|
>
|
||||||
|
Hide assets (large & small images)
|
||||||
|
</Switch>
|
||||||
<Switch
|
<Switch
|
||||||
value={setting.disableTimestamps}
|
value={setting.disableTimestamps}
|
||||||
onChange={value => {
|
onChange={value => {
|
||||||
|
|
|
@ -16,6 +16,7 @@ import { parse } from "path";
|
||||||
|
|
||||||
const APP_IDS_KEY = "ReplaceActivityType_appids";
|
const APP_IDS_KEY = "ReplaceActivityType_appids";
|
||||||
export type AppIdSetting = {
|
export type AppIdSetting = {
|
||||||
|
disableAssets: boolean;
|
||||||
disableTimestamps: boolean;
|
disableTimestamps: boolean;
|
||||||
appId: string;
|
appId: string;
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
|
@ -76,7 +77,8 @@ export const makeEmptyAppId: () => AppIdSetting = () => ({
|
||||||
newSmallImageUrl: "",
|
newSmallImageUrl: "",
|
||||||
newSmallImageText: "",
|
newSmallImageText: "",
|
||||||
newStreamUrl: "",
|
newStreamUrl: "",
|
||||||
disableTimestamps: false
|
disableTimestamps: false,
|
||||||
|
disableAssets: false
|
||||||
});
|
});
|
||||||
|
|
||||||
let appIds = [makeEmptyAppId()];
|
let appIds = [makeEmptyAppId()];
|
||||||
|
@ -144,6 +146,8 @@ export default definePlugin({
|
||||||
if (app.newLargeImageUrl) activity.assets.large_image = this.parseField(app.newLargeImageUrl, oldActivity);
|
if (app.newLargeImageUrl) activity.assets.large_image = this.parseField(app.newLargeImageUrl, oldActivity);
|
||||||
if (app.newSmallImageText) activity.assets.small_text = this.parseField(app.newSmallImageText, oldActivity);
|
if (app.newSmallImageText) activity.assets.small_text = this.parseField(app.newSmallImageText, oldActivity);
|
||||||
if (app.newSmallImageUrl) activity.assets.small_image = this.parseField(app.newSmallImageUrl, oldActivity);
|
if (app.newSmallImageUrl) activity.assets.small_image = this.parseField(app.newSmallImageUrl, oldActivity);
|
||||||
|
// @ts-ignore here we are intentionally nulling assets
|
||||||
|
if (app.disableAssets) activity.assets = {};
|
||||||
if (app.disableTimestamps) activity.timestamps = {};
|
if (app.disableTimestamps) activity.timestamps = {};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue