Skip to content

Commit

Permalink
fix: add back rpc stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
KraXen72 committed Jun 21, 2022
1 parent 6645128 commit b2917ed
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
### [1.5.7](https://github.com/KraXen72/crankshaft/compare/1.5.6...1.5.7) (2022-06-21)


### Features

* improve RPC hooks ([f4c3572](https://github.com/KraXen72/crankshaft/commit/f4c35722f8abb60b01c0b02565b079ff2fae7834))


### Bug Fixes

* Devtools now work again on linux machines ([e7d37ea](https://github.com/KraXen72/crankshaft/commit/e7d37ea338957fbb11ca3aefd4cd0cc206582a03))
* wait 500 ms for devtools regardless of os ([6645128](https://github.com/KraXen72/crankshaft/commit/66451288601acca9810fc5a784d0b7b2ad6f5503))

### [1.5.6](https://github.com/KraXen72/crankshaft/compare/1.5.5...1.5.6) (2022-06-21)


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": "crankshaft",
"version": "1.5.6",
"version": "1.5.7",
"description": "Crankshaft Krunker Client by KraXen72",
"main": "./app/main.js",
"scripts": {
Expand Down
19 changes: 9 additions & 10 deletions src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,16 @@ ipcRenderer.on('initDiscordRPC', () => {

// updating rpc
ipcRenderer.on('main_did-finish-load', updateRPC);
window.addEventListener('load', updateRPC);
window.addEventListener('load', () => {
updateRPC();
setTimeout(() => {
// hook elements that update rpc
try { document.getElementById('windowCloser').addEventListener('click', updateRPC); } catch (e) { strippedConsole.error("didn't hook wincloser", e); }
try { document.getElementById('customizeButton').addEventListener('click', updateRPC); } catch (e) { strippedConsole.error("didn't hook customizeButton", e); }
}, 4000);
});
document.addEventListener('pointerlockchange', updateRPC); // thank God this exists

// this stuff is not needed since pointerlock hook is good enough. it also lags on first customizeButton click
/*
* setTimeout(() => {
* // hook elements that update rpc
* try { document.getElementById('windowCloser').addEventListener('click', updateRPC); } catch (e) { strippedConsole.error("didn't hook wincloser", e); }
* try { document.getElementById('customizeButton').addEventListener('click', updateRPC); } catch (e) { strippedConsole.error("didn't hook customizeButton", e); }
* }, 4000);
*/

});

ipcRenderer.on('main_sends_userscriptPath', (event, recieved_userscriptsPath: string) => {
Expand Down

0 comments on commit b2917ed

Please sign in to comment.