Skip to content

Commit

Permalink
Stream quality settings (off by default), warning
Browse files Browse the repository at this point in the history
  • Loading branch information
cafeed28 committed Feb 6, 2023
1 parent 91d18f9 commit 7ce0b55
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Use some Nitro features without wasting your money!
- - Can use emojis if they are unavailable due to a lack of boosts (they are unavaiable with nitro,
use this plugin even if you have nitro 😼)
- - Removes unavailable emoji tint in emoji picker
- Stream in 1080p/Source 60 fps quality
- Stream in 1080p/Source 60 fps quality (use at your own risk! may lead to account ban)
- Doesn't spoof premiumType

![image](https://cdn.discordapp.com/emojis/962730564840996964.png?size=20)
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"discordID": "942752356595023874",
"github": "cafeed28"
},
"version": "2.0.2",
"version": "2.0.3",
"updater": {
"type": "github",
"id": "cafeed28/replugged-nitrospoof"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "replugged-nitrospoof",
"version": "2.0.2",
"version": "2.0.3",
"description": "Use some Nitro features without wasting your money!",
"engines": {
"node": ">=14.0.0"
Expand Down
9 changes: 9 additions & 0 deletions src/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const { Category, FormItem, Radio, Slider, SwitchItem } = components;
export function Settings() {
const emojiHideLinks = util.useSetting(config, "emojiHideLinks");
const emojiStaticExtension = util.useSetting(config, "emojiStaticExtension");
const streamQualityEnable = util.useSetting(config, "streamQualityEnable");

// TODO: i18n
return (
Expand Down Expand Up @@ -49,6 +50,14 @@ export function Settings() {
/>
</FormItem>
</Category>
<Category title="Miscellaneous" note="Miscellaneous settings">
<SwitchItem
value={streamQualityEnable.value!}
onChange={streamQualityEnable.onChange}
hideBorder>
Spoof stream quality (Use at your own risk! May lead to account ban)
</SwitchItem>
</Category>
</div>
);
}
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ export async function start(): Promise<void> {
injector.instead(emojiInfo, "getEmojiUnavailableReason", () => null);

// Stream quality
injector.instead(premiumInfo, "canStreamHighQuality", () => true);
injector.instead(premiumInfo, "canStreamMidQuality", () => true);
injector.instead(premiumInfo, "canStreamHighQuality", () => config.get("streamQualityEnable"));
injector.instead(premiumInfo, "canStreamMidQuality", () => config.get("streamQualityEnable"));
}

export function stop(): void {
Expand Down
1 change: 1 addition & 0 deletions src/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const config = await settings.init<Config>("com.cafeed28.NitroSpoof", {
emojiSize: 48,
emojiStaticExtension: "png",
emojiHideLinks: false,
streamQualityEnable: false,
});

export const HIDE_TEXT_SPOILERS = "||\u200b||".repeat(199);
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export type Config = {
emojiSize: number;
emojiStaticExtension: EmojiStaticExtension;
emojiHideLinks: boolean;
streamQualityEnable: boolean;
};

export enum PremiumType {
Expand Down

0 comments on commit 7ce0b55

Please sign in to comment.