Skip to content

Commit

Permalink
Merge pull request #482 from Kyusung4698/develop
Browse files Browse the repository at this point in the history
0.6.14 (2020-03-26)
  • Loading branch information
Kyusung4698 authored Mar 26, 2020
2 parents 03549b2 + 4b74749 commit 5ced41b
Show file tree
Hide file tree
Showing 24 changed files with 1,767 additions and 1,109 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Changelog

## 0.6.14 (2020-03-26)

- add nonunique rarity support (#477)
- add changelog as tray entry and show after update (#471)
- add display trade page error message (#468)
- add renderer logging support log to file (#468)
- update data to 3.10.1
- fix auto update by calling quit and install even after normal quit (#474)
- fix invisible values at map info (#472)

## 0.6.13 (2020-03-25)

- add loading animations
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![GitHub Release Date](https://img.shields.io/github/release-date/Kyusung4698/PoE-Overlay)
<a href="https://www.patreon.com/bePatron?u=30666721"><img src="https://c5.patreon.com/external/logo/become_a_patron_button.png" alt="Become a Patron" width="85px" height="20px"></a>

# PoE Overlay 0.6.13
# PoE Overlay 0.6.14

An Overlay for Path of Exile. The ***core aspect*** is to blend in with the game. Built with Electron and Angular.

Expand Down Expand Up @@ -74,11 +74,11 @@ These instructions will set you up to run and enjoy the overlay.
#### Installing

1. Head over to [Releases](https://github.com/Kyusung4698/PoE-Overlay/releases) and download one of the following files
1. `poe-overlay-Setup-0.6.13.exe` to install locally. This supports auto update/ auto launch.
2. `poe-overlay-0.6.13.exe` portable version. This does not support auto update/ auto launch.
1. `poe-overlay-Setup-0.6.14.exe` to install locally. This supports auto update/ auto launch.
2. `poe-overlay-0.6.14.exe` portable version. This does not support auto update/ auto launch.
2. Run either of your downloaded file
3. Start Path of Exile
4. Wait until you can see `PoE Overlay 0.6.13` in the bottom left corner
4. Wait until you can see `PoE Overlay 0.6.14` in the bottom left corner
5. Hit `f7` and set `Language` and `League` to meet your game settings

#### Shortcuts
Expand Down
28 changes: 15 additions & 13 deletions hook.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Window, windowManager, addon } from 'node-window-manager';
import { addon, Window, windowManager } from 'node-window-manager';
import { IRectangle } from 'node-window-manager/dist/interfaces';
import { Subject, Subscription } from 'rxjs';
import { throttleTime } from 'rxjs/operators';
Expand Down Expand Up @@ -55,18 +55,20 @@ function checkActive(): void {
let orgBounds = bounds;

const possibleWindow = windowManager.getActiveWindow();
if (possibleWindow.path) {
const lowerPath = possibleWindow.path.toLowerCase();
active = lowerPath.endsWith('pathofexile_x64_kg.exe') || lowerPath.endsWith('pathofexile_kg.exe')
|| lowerPath.endsWith('pathofexile_x64steam.exe') || lowerPath.endsWith('pathofexilesteam.exe')
|| lowerPath.endsWith('pathofexile_x64.exe') || lowerPath.endsWith('pathofexile.exe');


if (active) {
activeWindow = possibleWindow;

if (addon) {
bounds = addon.getWindowBounds(activeWindow.id);
if (possibleWindow?.path) {
const title = possibleWindow.getTitle();
if (title === 'Path of Exile') {
const lowerPath = possibleWindow.path.toLowerCase();
active = lowerPath.endsWith('pathofexile_x64_kg.exe') || lowerPath.endsWith('pathofexile_kg.exe')
|| lowerPath.endsWith('pathofexile_x64steam.exe') || lowerPath.endsWith('pathofexilesteam.exe')
|| lowerPath.endsWith('pathofexile_x64.exe') || lowerPath.endsWith('pathofexile.exe');

if (active) {
activeWindow = possibleWindow;

if (addon) {
bounds = addon.getWindowBounds(activeWindow.id);
}
}
}
}
Expand Down
57 changes: 50 additions & 7 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ log.info('App starting...');
let animationPath = path.join(app.getPath('userData'), 'animation.flag');
let animationExists = fs.existsSync(animationPath);

log.info(`App checking for animation flag: ${animationExists}.`);
log.info(`App checking animation flag: ${animationExists}.`);

if (animationExists) {
app.disableHardwareAcceleration();
Expand All @@ -43,9 +43,23 @@ if (animationExists) {
let keyboardPath = path.join(app.getPath('userData'), 'keyboard.flag');
let keyboardExists = fs.existsSync(keyboardPath);

log.info(`App checking for keyboard flag: ${keyboardExists}.`);
log.info(`App checking keyboard flag: ${keyboardExists}.`);

let versionPath = path.join(app.getPath('userData'), 'version.txt');
let versionExists = fs.existsSync(versionPath);

let versionUpdated = true;
if (versionExists) {
const version = fs.readFileSync(versionPath, 'utf-8').trim();
versionUpdated = version !== app.getVersion();
log.info(`App checking version: ${version} -> ${app.getVersion()}, ${versionUpdated}`);
}
if (versionUpdated) {
fs.writeFileSync(versionPath, app.getVersion())
}

autoUpdater.logger = log;
autoUpdater.autoInstallOnAppQuit = true;

const args = process.argv.slice(1);
const serve = args.some(val => val === '--serve');
Expand Down Expand Up @@ -84,6 +98,13 @@ function send(channel: string, ...args: any[]) {
}
}

/* log */

ipcMain.on('log', (event, level, message, ...args) => {
log[level](message, ...args);
event.returnValue = true;
});

/* robot js */

ipcMain.on('click-at', (event, button, position) => {
Expand Down Expand Up @@ -116,7 +137,9 @@ ipcMain.on('set-keyboard-delay', (event, delay) => {
/* hook */

ipcMain.on('force-active', event => {
gameWindow?.bringToTop();
if (keyboardExists) {
gameWindow?.bringToTop();
}
event.returnValue = true;
})

Expand All @@ -133,7 +156,7 @@ ipcMain.on('register-active-change', event => {
win.setAlwaysOnTop(true, 'pop-up-menu', 1);
win.setVisibleOnAllWorkspaces(true);

if (bounds) {
if (JSON.stringify(bounds) !== JSON.stringify(win.getBounds())) {
win.setBounds(bounds);
log.info('set bounds to: ', win.getBounds());
}
Expand Down Expand Up @@ -224,8 +247,8 @@ ipcMain.on('app-download-update', event => {
event.returnValue = true;
});

ipcMain.on('app-quit-and-install', event => {
autoUpdater.quitAndInstall(false, true);
ipcMain.on('app-quit-and-install', (event, restart) => {
autoUpdater.quitAndInstall(false, restart);
event.returnValue = true;
});

Expand All @@ -248,6 +271,16 @@ ipcMain.on('app-auto-launch-change', (event, enabled) => {
.catch(() => event.sender.send('app-auto-launch-change-result', false));
})

/* change log */
function showChangelog() {
const changelog = new BrowserWindow({
modal: true,
parent: win,
});
changelog.removeMenu();
changelog.loadURL('https://github.com/Kyusung4698/PoE-Overlay/blob/master/CHANGELOG.md#Changelog');
}

/* main window */

function createWindow(): BrowserWindow {
Expand Down Expand Up @@ -278,6 +311,12 @@ function createWindow(): BrowserWindow {
win.setAlwaysOnTop(true, 'pop-up-menu', 1);
win.setVisibleOnAllWorkspaces(true);

win.once('show', () => {
if (versionUpdated) {
showChangelog();
}
})

loadApp(win);

win.on('closed', () => {
Expand Down Expand Up @@ -398,9 +437,13 @@ function createTray(): Tray {
send('app-relaunch');
}
},
{
label: 'Changelog', type: 'normal',
click: () => showChangelog(),
},
{
label: 'Exit', type: 'normal',
click: () => app.quit()
click: () => send('app-quit')
}
];

Expand Down
Loading

0 comments on commit 5ced41b

Please sign in to comment.