Skip to content

Commit

Permalink
v2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Oct 9, 2024
1 parent e7e1b40 commit a5aef88
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
15 changes: 12 additions & 3 deletions src/renderer/components/scrcpy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -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() {
Expand Down
2 changes: 0 additions & 2 deletions src/renderer/components/scrcpyPlusInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@
<img src="@/assets/discord-icon.svg" style="width: 1.8em; margin-right: 1em;" />
Discord
</v-btn>
<!--
<v-btn rounded to="/settings" class="primaryButton">
<v-icon>mdi-cog</v-icon>
Settings
</v-btn>
-->
</v-card-actions>
</section>

Expand Down
3 changes: 1 addition & 2 deletions src/renderer/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
14 changes: 3 additions & 11 deletions src/renderer/pages/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@
<section>
<div v-for="item, i in settings" :key="i" style="display: flex;">
<v-switch inset :label="item.description" style="margin: 0;" @change="updateSetting(item.key, this)" v-model="item.data" />

<v-tooltip top v-if="item.tooltip" style="padding: 0;">
<template v-slot:activator="{ on, attrs }">
<v-icon v-bind="attrs" v-on="on" color="#999" small style="margin-left: 0.25em; height: 2em;">mdi-help-circle-outline</v-icon>
</template>
<span>{{ item.tooltip }}</span>
</v-tooltip>

</div>
</section>

Expand All @@ -30,16 +22,16 @@ 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 },
]
}
},
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);
Expand Down

0 comments on commit a5aef88

Please sign in to comment.