Skip to content

Commit

Permalink
add functions, Windows: optimize packaging
Browse files Browse the repository at this point in the history
fix getPride function, add getCommentatorCountry and getCommentatorPride functions
Windows: add files to ignore during packaging
  • Loading branch information
Oolonk committed Sep 27, 2023
1 parent 871d14b commit 971509b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
31 changes: 28 additions & 3 deletions js/class/piio-connector.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,14 @@ class PiioConnector {
playerNum = this.getSelectedPlayer(teamNum);
}
let po = this.getPlayer(teamNum, playerNum);
if (po && this.cache.pride.hasOwnProperty(po.pride))
return this.cache.pride[po.pride];
return null;
let po2 = this.cache.pride;
po2 = Object.keys(po2)
.filter(key => po.pride.includes(key))
.reduce((obj, key) => {
obj[key] = po2[key];
return obj;
}, {});
return Object.values(po2);
}

getPort(teamNum, playerNum) {
Expand Down Expand Up @@ -280,6 +285,26 @@ class PiioConnector {
return null;
}

getCasterCountry(casterNum) {
let po = this.getCaster(casterNum);
if (po && this.cache.country.hasOwnProperty(po.country))
return this.cache.country[po.country];
return null;
}

getCasterPride(casterNum) {
let po = this.getCaster(casterNum);
let po2 = this.cache.pride;
po2 = Object.keys(po2)
.filter(key => po.pride.includes(key))
.reduce((obj, key) => {
obj[key] = po2[key];
return obj;
}, {});
return Object.values(po2);
}


getGame() {
if (!this.cache.scoreboard.hasOwnProperty("game")) {
return null;
Expand Down
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
]
},
"packagerConfig": {
"ignore": [
".gitignore",
"regions.json",
"changelog.txt",
"README.md",
"scoreboard.json"
],
"executableName": "piio",
"icon": "./app/logo.ico"
},
Expand Down Expand Up @@ -94,4 +101,4 @@
"rxjs": "^7.8.0",
"ws": "^6.1.0"
}
}
}

0 comments on commit 971509b

Please sign in to comment.