Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
functional settings
Browse files Browse the repository at this point in the history
  • Loading branch information
smartfrigde committed Jul 14, 2024
1 parent e864a42 commit cb70209
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
1 change: 1 addition & 0 deletions plugins/armcordSettings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ let settingsPages = [

export function onLoad() {
refreshSettings()
store.i18n = window.armcord.translations
log("ArmCord Settings")
settingsPages
}
Expand Down
24 changes: 19 additions & 5 deletions plugins/armcordSettings/pages/SettingsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,24 @@ export function SettingsPage() {
return(
<>
<Header tag={HeaderTags.H1}>Settings</Header>
<Divider mt mb="30px"/>
<Divider mt mb/>
<Header tag={HeaderTags.H5}>Mods</Header>
<SwitchItem note="placeholder" value={store.settings.armcordCSP} onChange={(e) => set("armcordCSP", e)}>ArmCord CSP</SwitchItem>
<SwitchItem note="placeholder" value={store.settings.autoScroll}>Vencord</SwitchItem>
<SwitchItem note={store.i18n["settings-csp-desc"]} value={store.settings.armcordCSP} onChange={(e) => set("armcordCSP", e)}>ArmCord CSP</SwitchItem>
<SwitchItem note={store.i18n["settings-mod-vencord"]} value={store.settings.autoScroll}>Vencord</SwitchItem>
<SwitchItem note={store.i18n["settings-invitewebsocket-desc"]} value={store.settings.inviteWebsocket} onChange={(e) => set("inviteWebsocket", e)}>Rich Presence</SwitchItem>
<Header tag={HeaderTags.H5}>Look and feel</Header>
<SwitchItem note={store.i18n["settings-skipSplash-desc"]} value={store.settings.skipSplash} onChange={(e) => set("skipSplash", e)}>Skip splash screen</SwitchItem>
<SwitchItem note={store.i18n["settings-dynamicIcon-desc"]} value={store.settings.dynamicIcon} onChange={(e) => set("dynamicIcon", e)}>Dynamic icon</SwitchItem>
<SwitchItem note={store.i18n["settings-mobileMode-desc"]} value={store.settings.mobileMode} onChange={(e) => set("mobileMode", e)}>Mobile Mode</SwitchItem>
<Header tag={HeaderTags.H5}>Behaviour</Header>
<SwitchItem note={store.i18n["settings-MultiInstance-desc"]} value={store.settings.multiInstance} onChange={(e) => set("multiInstance", e)}>Multi Instance</SwitchItem>
<SwitchItem note={store.i18n["settings-mintoTray-desc"]} value={store.settings.minimizeToTray} onChange={(e) => set("minimizeToTray", e)}>Work in background</SwitchItem>
<SwitchItem note={store.i18n["settings-tray-desc"]} value={store.settings.tray} onChange={(e) => set("tray", e)}>Tray</SwitchItem>
<SwitchItem note={store.i18n["settings-startMinimized-desc"]} value={store.settings.startMinimized} onChange={(e) => set("startMinimized", e)}>Start minimized</SwitchItem>
<SwitchItem note={store.i18n["settings-smoothScroll-desc"]} value={store.settings.smoothScroll} onChange={(e) => set("smoothScroll", e)}>Smooth scrolling</SwitchItem>
<SwitchItem note={store.i18n["settings-autoScroll-desc"]} value={store.settings.autoScroll} onChange={(e) => set("autoScroll", e)}>Allow auto-scroll</SwitchItem>
<SwitchItem note={store.i18n["settings-spellcheck-desc"]} value={store.settings.spellcheck} onChange={(e) => set("spellcheck", e)}>Spellcheck</SwitchItem>
<Header tag={HeaderTags.H5}>Legacy features</Header>
<SwitchItem note={store.i18n["settings-useLegacyCapturer-desc"]} value={store.settings.useLegacyCapturer} onChange={(e) => set("useLegacyCapturer", e)}>Use legacy capturer</SwitchItem>
</>
)
}
)}
3 changes: 2 additions & 1 deletion plugins/armcordSettings/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export function refreshSettings() {
console.log(store.settings)
}
export function set(key, value) {
store.settings[key] = value;
console.log(store.settings[key])
armcord.settings.setConfig(key, value)
refreshSettings()
}

0 comments on commit cb70209

Please sign in to comment.