Skip to content

Commit

Permalink
Add a way to open dev tools to allow debugging while loading
Browse files Browse the repository at this point in the history
  • Loading branch information
karliky committed Aug 17, 2019
1 parent daa90c5 commit 294ee02
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 32 deletions.
9 changes: 7 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const launchWindows = require('./src/loading/windows.js');
const launchMain = launchWindows.mainWindow;
const launchLoading = launchWindows.loadingWindow;
const { openServer } = launchWindows;

let loadingRef = null;
/**
* Keep a reference to the main window
*/
Expand All @@ -30,6 +30,11 @@ ipcMain.on('open-machinima-studio', () => {
launchMain(mainWindow, electron);
});

ipcMain.on('open-dev-tools', (event) => {
console.log('Opening dev tools');
loadingRef.webContents.openDevTools();
});

ipcMain.on('open-machinima-studio-server', (event) => {
openServer((err) => {
if (err) {
Expand All @@ -44,7 +49,7 @@ ipcMain.on('open-machinima-studio-server', (event) => {
* is ready to render and launch windows
*/
app.on('ready', () => {
launchLoading(mainWindow, electron);
loadingRef = launchLoading(mainWindow, electron);
});

/**
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "machinima-studio",
"version": "2.0.1",
"description": "Machinima Studio 2.0",
"version": "2.0.2",
"description": "Machinima Studio 2.0.2",
"main": "main.js",
"scripts": {
"start": "electron-forge start",
Expand Down
2 changes: 1 addition & 1 deletion src/gw2/src/camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Tweenable.prototype.formula.linear = pos => pos;

module.exports = (process, module, memory, window, player, sendMessage) => {
const that = {};

// To enable free camera mode of internal game just go to offsets.camera.offset and look at the upper bytes
const { Mouse, Keyboard } = robot;

const cameraReadPosition = Buffer.alloc(0xC);
Expand Down
52 changes: 26 additions & 26 deletions src/gw2/src/ptrs.json
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
{
"debug": {
"original": "0x024821D4"
"original": "0x02DCF954"
},
"camera": {
"offset": "0x01969CC4",
"offset": "0x01986B54",
"instructions": {
"patch_1": {
"original": "0x004BE796"
"original": "0x004BEF66"
},
"patch_2": {
"original": "0x004BE6CF"
"original": "0x004BEE9F"
},
"patch_3": {
"original": "0x004BE66A"
"original": "0x004BEE3A"
},
"patch_4": {
"original": "0x004BE5CF"
"original": "0x004BED9F"
},
"patch_5": {
"original": "0x004BE380"
"original": "0x004BEB50"
},
"patch_6": {
"original": "0x004BE4DF"
"original": "0x004BECAF"
},
"patch_7": {
"original": "0x004BDAF3"
"original": "0x004BE2C3"
}
}
},
"player": {
"original": "0x00000NAN",
"movement": {
"original": "0x004A8863"
"original": "0x004A9133"
}
},
"environment": {
"fog": {
"original": "0x01717F18"
"original": "0x01734E18"
},
"enableTimeOfDay": "0x00000NAN",
"rendering": {
"audio": "0x00A8250C",
"blocks": "0x00A82566",
"decal": "0x00A82595",
"environment": "0x00A825DD",
"river": "0x00A8261A",
"under_water": "0x00A8267A",
"zone": "0x00A826B1",
"lights": "0x00A826E9",
"shadows": "0x00A82730",
"terrain": "0x00A8275F",
"cube_map": "0x00A82799",
"props": "0x00A827E2",
"animation": "0x004A873B",
"highlight_effect": "0x004A890A"
"audio": "0x00A95F8C",
"blocks": "0x00A95FE6",
"decal": "0x00A96015",
"environment": "0x00A9605D",
"river": "0x00A9609A",
"under_water": "0x00A960FA",
"zone": "0x00A96131",
"lights": "0x00A96169",
"shadows": "0x00A961B0",
"terrain": "0x00A961DF",
"cube_map": "0x00A96219",
"props": "0x00A96262",
"animation": "0x004A900B",
"highlight_effect": "0x004A91DA"
}
},
"ViewAdvanceModel": "0x00B03A9A"
"ViewAdvanceModel": "0x00B1840A"
}
8 changes: 7 additions & 1 deletion src/loading/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@
margin: auto;
margin-top: 5%;
}

.devTools {
color: rgba(250, 235, 215, 0.37);
text-decoration: none;
cursor: pointer;
font-size: 0.8rem;
}
</style>
</head>
<body>
Expand All @@ -90,6 +95,7 @@
<div class="stick"></div>
<h1 id="status" class="fade">Updating offsets...</h1>
</div>
<div style="text-align: center"><a href="#" class="devTools" onclick="javascript:ipcRenderer.send('open-dev-tools', 1);">Click to open dev tools.</a></div>
</div>
</div>
<link rel="stylesheet" href="loading.css">
Expand Down
2 changes: 2 additions & 0 deletions src/loading/windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ const loadingWindow = (mainWindow, electron) => {
});

mainWindow.loadFile('./src/loading/index.html');

return mainWindow;
};

module.exports = {
Expand Down

0 comments on commit 294ee02

Please sign in to comment.