From a5aef882042ff5eb0268cec92b0589e990332f2c Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 9 Oct 2024 15:57:19 -0400 Subject: [PATCH] v2.2.0 --- package.json | 2 +- src/renderer/components/scrcpy.vue | 15 ++++++++++++--- src/renderer/components/scrcpyPlusInfo.vue | 2 -- src/renderer/nuxt.config.js | 3 +-- src/renderer/pages/settings.vue | 14 +++----------- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 62e7064..d8e2a2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scrcpy-plus", - "version": "2.1.1", + "version": "2.2.0", "description": "A GUI for scrcpy", "main": "./dist/main/index.js", "scripts": { diff --git a/src/renderer/components/scrcpy.vue b/src/renderer/components/scrcpy.vue index 0b98034..a0ccbfb 100644 --- a/src/renderer/components/scrcpy.vue +++ b/src/renderer/components/scrcpy.vue @@ -94,15 +94,16 @@ export default { methods: { - async scrcpy() { this.loading = true; // Disable 'Start' Button - let flags = new String(); for (const i in this.selectedArgs) { flags += ' '+this.selectedArgs[i].arg; } - //console.log("scrcpy"+flags); + + //--- Save SCRCPY Flags ---// + if (localStorage.getItem("setting.save_scrcpy_settings") == 'true') localStorage.setItem('scrcpy_settings', JSON.stringify(this.selectedArgs)); + //-----------------------------// this.$execute(`scrcpy --video-bit-rate ${this.bitrate}M`+flags) .catch(err => { @@ -122,7 +123,15 @@ export default { }, 1000); } + }, + mounted() { + if (localStorage.getItem("setting.save_scrcpy_settings") == 'true') { + const data = JSON.parse(localStorage.getItem("scrcpy_settings") || '[]'); + for (const i in data) { + this.selectedArgs.push(data[i]); + } + } }, data() { diff --git a/src/renderer/components/scrcpyPlusInfo.vue b/src/renderer/components/scrcpyPlusInfo.vue index 2697828..96c65ae 100644 --- a/src/renderer/components/scrcpyPlusInfo.vue +++ b/src/renderer/components/scrcpyPlusInfo.vue @@ -20,12 +20,10 @@ Discord - diff --git a/src/renderer/nuxt.config.js b/src/renderer/nuxt.config.js index 119fd95..875f345 100644 --- a/src/renderer/nuxt.config.js +++ b/src/renderer/nuxt.config.js @@ -7,9 +7,8 @@ module.exports = { env: { - version: "2.1.1", + version: "2.2.0", scrcpyPath: "resources/scrcpy/", - releasesUrl: "https://api.github.com/repos/Frontesque/scrcpy-plus/releases", devicePollRate: 1250, }, diff --git a/src/renderer/pages/settings.vue b/src/renderer/pages/settings.vue index e0bc8ad..5a6bb72 100644 --- a/src/renderer/pages/settings.vue +++ b/src/renderer/pages/settings.vue @@ -11,14 +11,6 @@
- - - - {{ item.tooltip }} - -
@@ -30,8 +22,8 @@ export default { data() { return { settings: [ - { key: "set-mirror", description: "Use 'Mirror' engine", tooltip: "Replace SCRCPY with a custom renderer known as Mirror Engine" }, - { key: "set-rememberSettings", description: "Remember SCRCPY settings" }, + //{ key: "setting.mirror", description: "Use 'Mirror' engine" }, + { key: "setting.save_scrcpy_settings", description: "Remember SCRCPY settings", data: false }, ] } }, @@ -39,7 +31,7 @@ export default { mounted() { const vm = this; for (let key of Object.keys(localStorage)) { - if(!key.startsWith("set-")) continue; + if(!key.startsWith("setting.")) continue; for (const i in this.settings) { if (key == this.settings[i].key) { vm.settings[i].data = (localStorage.getItem(key) == 'true' ? true : false);