Skip to content

Commit

Permalink
Merge pull request #457 from Kyusung4698/develop
Browse files Browse the repository at this point in the history
0.6.12 (2020-03-24)
  • Loading branch information
Kyusung4698 authored Mar 24, 2020
2 parents f18a5a4 + d82e756 commit 46a0f18
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 25 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.6.12 (2020-03-24)

- fix not covering the game correctly (#453, #456)
- fix poe losing focus after alt + tabbing (#455)

## 0.6.11 (2020-03-24)

- add league as fast toggle option (#273)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,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.11
# PoE Overlay 0.6.12

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 @@ -73,11 +73,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.11.exe` to install locally. This supports auto update/ auto launch.
2. `poe-overlay-0.6.11.exe` portable version. This does not support auto update/ auto launch.
1. `poe-overlay-Setup-0.6.12.exe` to install locally. This supports auto update/ auto launch.
2. `poe-overlay-0.6.12.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.11` in the bottom left corner
4. Wait until you can see `PoE Overlay 0.6.12` in the bottom left corner
5. Hit `f7` and set `Language` and `League` to meet your game settings

#### Shortcuts
Expand Down
30 changes: 18 additions & 12 deletions hook.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Window, windowManager } from 'node-window-manager';
import { Window, windowManager, addon } from 'node-window-manager';
import { IRectangle } from 'node-window-manager/dist/interfaces';
import { Subject, Subscription } from 'rxjs';
import { throttleTime } from 'rxjs/operators';

Expand All @@ -18,7 +19,9 @@ interface WheelEvent {

let active = false;
let activeWindow: Window = null;
let activeChangeFn: (active: boolean, game: Window) => void;
let bounds: IRectangle = null;

let activeChangeFn: (active: boolean, game: Window, bounds: IRectangle) => void;
let wheelChangeFn: (event: WheelEvent) => void;

const activeCheck$ = new Subject<void>();
Expand Down Expand Up @@ -47,8 +50,9 @@ function onMouseclick(event: WheelEvent): void {
}

function checkActive(): void {
let orgActive = active;
let orgActive = active;
let orgActiveWindow = activeWindow;
let orgBounds = bounds;

const possibleWindow = windowManager.getActiveWindow();
if (possibleWindow.path) {
Expand All @@ -57,19 +61,21 @@ function checkActive(): void {
|| lowerPath.endsWith('pathofexile_x64steam.exe') || lowerPath.endsWith('pathofexilesteam.exe')
|| lowerPath.endsWith('pathofexile_x64.exe') || lowerPath.endsWith('pathofexile.exe');


if (active) {
activeWindow = possibleWindow;
}

if (!active) {
active = process.pid === possibleWindow.processId;
console.log('overlay active', active);

if (addon) {
bounds = addon.getWindowBounds(activeWindow.id);
}
}
}

if (orgActive !== active || orgActiveWindow !== activeWindow) {
if (orgActive !== active ||
orgActiveWindow?.processId !== activeWindow?.processId ||
JSON.stringify(orgBounds) !== JSON.stringify(bounds)) {
if (activeChangeFn) {
activeChangeFn(active, activeWindow);
activeChangeFn(active, activeWindow, bounds);
}
}
}
Expand All @@ -78,14 +84,14 @@ export function getActive(): boolean {
return active;
}

export function on(event: 'change', callback: (active: boolean, game: Window) => void): void;
export function on(event: 'change', callback: (active: boolean, game: Window, bounds: IRectangle) => void): void;
export function on(event: 'wheel', callback: (event: WheelEvent) => void): void;

export function on(event: string, callback: any) {
switch (event) {
case 'change':
activeChangeFn = callback;
activeChangeFn(active, activeWindow);
activeChangeFn(active, activeWindow, bounds);
break;
case 'wheel':
wheelChangeFn = callback;
Expand Down
10 changes: 4 additions & 6 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ ipcMain.on('force-active', event => {
})

ipcMain.on('register-active-change', event => {
hook.on('change', (active, activeWindow) => {
hook.on('change', (active, activeWindow, bounds) => {
gameWindow = activeWindow;

send('active-change', serve ? true : active);
Expand All @@ -128,11 +128,9 @@ ipcMain.on('register-active-change', event => {
win.setAlwaysOnTop(true, 'pop-up-menu', 1);
win.setVisibleOnAllWorkspaces(true);

if (activeWindow) {
win.setBounds({
...activeWindow.getBounds()
});
log.verbose('set bounds to: ', win.getBounds());
if (bounds) {
win.setBounds(bounds);
log.info('set bounds to: ', win.getBounds());
}
}

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": "poe-overlay",
"version": "0.6.11",
"version": "0.6.12",
"private": true,
"description": "A Overlay for Path of Exile. Built with Electron and Angular.",
"main": "main.js",
Expand Down
6 changes: 4 additions & 2 deletions src/app/layout/page/overlay/overlay.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ChangeDetectionStrategy, Component, HostListener, Inject, OnDestroy, OnInit } from '@angular/core';
import { AppService, AppTranslateService, RendererService, WindowService } from '@app/service';
import { AppService, AppTranslateService, RendererService, WindowService, GameService } from '@app/service';
import { DialogRefService } from '@app/service/dialog';
import { ShortcutService } from '@app/service/input';
import { FEATURE_MODULES } from '@app/token';
Expand All @@ -8,7 +8,7 @@ import { SnackBarService } from '@shared/module/material/service';
import { ContextService } from '@shared/module/poe/service';
import { Context } from '@shared/module/poe/type';
import { BehaviorSubject, Observable } from 'rxjs';
import { distinctUntilChanged, flatMap, tap } from 'rxjs/operators';
import { distinctUntilChanged, flatMap, tap, debounceTime } from 'rxjs/operators';
import { UserSettingsService } from '../../service/user-settings.service';
import { UserSettings } from '../../type';

Expand All @@ -30,6 +30,7 @@ export class OverlayComponent implements OnInit, OnDestroy {
private readonly userSettingsService: UserSettingsService,
private readonly context: ContextService,
private readonly app: AppService,
private readonly game: GameService,
private readonly translate: AppTranslateService,
private readonly snackBar: SnackBarService,
private readonly window: WindowService,
Expand Down Expand Up @@ -102,6 +103,7 @@ export class OverlayComponent implements OnInit, OnDestroy {
this.window.hide();
} else {
this.window.show();
this.game.forceActive();
}
});
this.app.triggerVisibleChange();
Expand Down

0 comments on commit 46a0f18

Please sign in to comment.