Skip to content

Commit

Permalink
修复 SimPad v2 极速模式错误
Browse files Browse the repository at this point in the history
  • Loading branch information
iamapig120 committed Dec 19, 2018
1 parent dba9096 commit aa162f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions app/devices/simpadv2/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ let device
let deviceInfo
let devices

/**
* @type {Document}
*/
let document
let getLang

Expand Down Expand Up @@ -105,6 +108,7 @@ const getAllSettings = (dev = device) => {
.then(() => getSettings(7, dev))
.then(() => getSettings(8, dev))
.then(() => getSettings(9, dev))
.then(() => getSettings(10, dev))
.then(
() =>
new Promise(r => {
Expand Down Expand Up @@ -250,12 +254,12 @@ const initSettings = () => {
getVersion()
updateKeyCodeText()
//极速模式
if (settingsSet[10][1]) {
if (settingsSet[10][0]) {
document.getElementById('superSpeedOn').style.display = 'none'
document.getElementById('superSpeedOff').removeAttribute('style')
} else {
document.getElementById('superSpeedOff').removeAttribute('style')
document.getElementById('superSpeedOff').style.display = 'none'
document.getElementById('superSpeedOn').removeAttribute('style')
}
countChanges()
}
Expand Down Expand Up @@ -430,6 +434,7 @@ const useSettings = () => {
if (changesBool.filter(e => e).length > 0) {
var promiseObj = new Promise(r => {
page4Init()
jumpPage(3)
r()
})
for (let i = 0; i < changesBool.length; i++) {
Expand Down Expand Up @@ -460,7 +465,6 @@ const useSettings = () => {
}, 300)
})
})
jumpPage(3)
}
}

Expand Down Expand Up @@ -689,7 +693,7 @@ const funs = (documentElement, deviceObj, funs) => {
})

document.getElementById('superSpeedOn').addEventListener('click', e => {
settingChanged[0x0a][1] = 0x01
settingChanged[10][0] = 0x01
countChanges()
// sendData([0x0a, 0x01, 0x00, 0x00, 0x00, 0x01]).then(() => {
// page4Init()
Expand All @@ -699,7 +703,7 @@ const funs = (documentElement, deviceObj, funs) => {
})

document.getElementById('superSpeedOff').addEventListener('click', e => {
settingChanged[0x0a][1] = 0x01
settingChanged[10][0] = 0x00
countChanges()
// sendData([0x0a, 0x00, 0x00, 0x00, 0x00, 0x00]).then(() => {
// page4Init()
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": "SimPad_Settings",
"version": "0.146.0",
"version": "0.148.0",
"main": "main.js",
"package": "electron-packager ./ SimPad_Settings --all --out ./OutApp --version 2.0.0 --overwrite",
"dependencies": {
Expand Down

0 comments on commit aa162f7

Please sign in to comment.