Skip to content

Commit 294ee02

Browse files
committed
Add a way to open dev tools to allow debugging while loading
1 parent daa90c5 commit 294ee02

File tree

6 files changed

+45
-32
lines changed

6 files changed

+45
-32
lines changed

main.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const launchWindows = require('./src/loading/windows.js');
1313
const launchMain = launchWindows.mainWindow;
1414
const launchLoading = launchWindows.loadingWindow;
1515
const { openServer } = launchWindows;
16-
16+
let loadingRef = null;
1717
/**
1818
* Keep a reference to the main window
1919
*/
@@ -30,6 +30,11 @@ ipcMain.on('open-machinima-studio', () => {
3030
launchMain(mainWindow, electron);
3131
});
3232

33+
ipcMain.on('open-dev-tools', (event) => {
34+
console.log('Opening dev tools');
35+
loadingRef.webContents.openDevTools();
36+
});
37+
3338
ipcMain.on('open-machinima-studio-server', (event) => {
3439
openServer((err) => {
3540
if (err) {
@@ -44,7 +49,7 @@ ipcMain.on('open-machinima-studio-server', (event) => {
4449
* is ready to render and launch windows
4550
*/
4651
app.on('ready', () => {
47-
launchLoading(mainWindow, electron);
52+
loadingRef = launchLoading(mainWindow, electron);
4853
});
4954

5055
/**

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "machinima-studio",
3-
"version": "2.0.1",
4-
"description": "Machinima Studio 2.0",
3+
"version": "2.0.2",
4+
"description": "Machinima Studio 2.0.2",
55
"main": "main.js",
66
"scripts": {
77
"start": "electron-forge start",

src/gw2/src/camera.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Tweenable.prototype.formula.linear = pos => pos;
88

99
module.exports = (process, module, memory, window, player, sendMessage) => {
1010
const that = {};
11-
11+
// To enable free camera mode of internal game just go to offsets.camera.offset and look at the upper bytes
1212
const { Mouse, Keyboard } = robot;
1313

1414
const cameraReadPosition = Buffer.alloc(0xC);

src/gw2/src/ptrs.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
11
{
22
"debug": {
3-
"original": "0x024821D4"
3+
"original": "0x02DCF954"
44
},
55
"camera": {
6-
"offset": "0x01969CC4",
6+
"offset": "0x01986B54",
77
"instructions": {
88
"patch_1": {
9-
"original": "0x004BE796"
9+
"original": "0x004BEF66"
1010
},
1111
"patch_2": {
12-
"original": "0x004BE6CF"
12+
"original": "0x004BEE9F"
1313
},
1414
"patch_3": {
15-
"original": "0x004BE66A"
15+
"original": "0x004BEE3A"
1616
},
1717
"patch_4": {
18-
"original": "0x004BE5CF"
18+
"original": "0x004BED9F"
1919
},
2020
"patch_5": {
21-
"original": "0x004BE380"
21+
"original": "0x004BEB50"
2222
},
2323
"patch_6": {
24-
"original": "0x004BE4DF"
24+
"original": "0x004BECAF"
2525
},
2626
"patch_7": {
27-
"original": "0x004BDAF3"
27+
"original": "0x004BE2C3"
2828
}
2929
}
3030
},
3131
"player": {
3232
"original": "0x00000NAN",
3333
"movement": {
34-
"original": "0x004A8863"
34+
"original": "0x004A9133"
3535
}
3636
},
3737
"environment": {
3838
"fog": {
39-
"original": "0x01717F18"
39+
"original": "0x01734E18"
4040
},
4141
"enableTimeOfDay": "0x00000NAN",
4242
"rendering": {
43-
"audio": "0x00A8250C",
44-
"blocks": "0x00A82566",
45-
"decal": "0x00A82595",
46-
"environment": "0x00A825DD",
47-
"river": "0x00A8261A",
48-
"under_water": "0x00A8267A",
49-
"zone": "0x00A826B1",
50-
"lights": "0x00A826E9",
51-
"shadows": "0x00A82730",
52-
"terrain": "0x00A8275F",
53-
"cube_map": "0x00A82799",
54-
"props": "0x00A827E2",
55-
"animation": "0x004A873B",
56-
"highlight_effect": "0x004A890A"
43+
"audio": "0x00A95F8C",
44+
"blocks": "0x00A95FE6",
45+
"decal": "0x00A96015",
46+
"environment": "0x00A9605D",
47+
"river": "0x00A9609A",
48+
"under_water": "0x00A960FA",
49+
"zone": "0x00A96131",
50+
"lights": "0x00A96169",
51+
"shadows": "0x00A961B0",
52+
"terrain": "0x00A961DF",
53+
"cube_map": "0x00A96219",
54+
"props": "0x00A96262",
55+
"animation": "0x004A900B",
56+
"highlight_effect": "0x004A91DA"
5757
}
5858
},
59-
"ViewAdvanceModel": "0x00B03A9A"
59+
"ViewAdvanceModel": "0x00B1840A"
6060
}

src/loading/index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@
7070
margin: auto;
7171
margin-top: 5%;
7272
}
73-
73+
.devTools {
74+
color: rgba(250, 235, 215, 0.37);
75+
text-decoration: none;
76+
cursor: pointer;
77+
font-size: 0.8rem;
78+
}
7479
</style>
7580
</head>
7681
<body>
@@ -90,6 +95,7 @@
9095
<div class="stick"></div>
9196
<h1 id="status" class="fade">Updating offsets...</h1>
9297
</div>
98+
<div style="text-align: center"><a href="#" class="devTools" onclick="javascript:ipcRenderer.send('open-dev-tools', 1);">Click to open dev tools.</a></div>
9399
</div>
94100
</div>
95101
<link rel="stylesheet" href="loading.css">

src/loading/windows.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ const loadingWindow = (mainWindow, electron) => {
9090
});
9191

9292
mainWindow.loadFile('./src/loading/index.html');
93+
94+
return mainWindow;
9395
};
9496

9597
module.exports = {

0 commit comments

Comments
 (0)