Skip to content

Commit

Permalink
Merge pull request #189 from Kyusung4698/develop
Browse files Browse the repository at this point in the history
0.5.13 (2020-02-04)
  • Loading branch information
Kyusung4698 authored Feb 4, 2020
2 parents 1940845 + de747c4 commit e5ed637
Show file tree
Hide file tree
Showing 15 changed files with 158 additions and 106 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 0.5.13 (2020-02-04)

* add divination card header
* add delay before registering hotkeys after showing window (#177)
* update pseudo mod behaviour
* use pseudo value instead of single value (#182)
* remove stat from list if used as pseudo stat (#175)
* increase command throttle time (#188)
* fix authenticated request hitting rate limit (#185)
* fix exchange rate using 6L if no links are present (#187)

## 0.5.12 (2020-02-03)

* add kakao client support (#181)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PoE Overlay 0.5.12
# PoE Overlay 0.5.13

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 @@ -79,9 +79,9 @@ These instructions will set you up to run and enjoy the overlay.

1. Head over to [Releases](https://github.com/Kyusung4698/PoE-Overlay/releases) and download the latest zip
2. Extract zip
3. Run `poe-overlay 0.5.12.exe`
3. Run `poe-overlay 0.5.13.exe`
4. Start Path of Exile
5. Wait until you can see `POE Overlay 0.5.12` in the bottom left corner
5. Wait until you can see `POE Overlay 0.5.13` in the bottom left corner
6. Hit `f7` and set `Language` and `League` to meet your game settings

#### Shortcuts
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": {
"name": "Kyusung4698"
},
"version": "0.5.12",
"version": "0.5.13",
"scripts": {
"postinstall": "electron-builder install-app-deps",
"ng:serve": "ng serve",
Expand Down
16 changes: 12 additions & 4 deletions src/app/data/poe/service/trade-http.service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { HttpClient, HttpParams, HttpResponse } from '@angular/common/http';
import { HttpClient, HttpErrorResponse, HttpParams, HttpResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { environment } from '@env/environment';
import { Language } from '@shared/module/poe/type';
import { Observable } from 'rxjs';
import { map, retry } from 'rxjs/operators';
import { Observable, of, throwError } from 'rxjs';
import { delay, flatMap, map, retry, retryWhen } from 'rxjs/operators';
import { TradeFetchResult, TradeItemsResult, TradeLeaguesResult, TradeResponse, TradeSearchRequest, TradeSearchResponse, TradeStaticResult, TradeStatsResult } from '../schema/trade';

const RETRY_COUNT = 3;
const RETRY_LIMIT_DELAY = 100;

@Injectable({
providedIn: 'root'
Expand Down Expand Up @@ -54,7 +55,14 @@ export class TradeHttpService {
query: queryId
}
})
}).pipe(retry(RETRY_COUNT));
}).pipe(retryWhen(errors => errors.pipe(
flatMap((error: HttpErrorResponse) => {
if (error.status === 429) {
return of(error).pipe(delay(RETRY_LIMIT_DELAY));
}
return throwError(error);
})
)));
}

private getApiUrl(postfix: string, language: Language): string {
Expand Down
102 changes: 56 additions & 46 deletions src/app/layout/page/overlay/overlay.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { TranslateService } from '@ngx-translate/core';
import { ContextService } from '@shared/module/poe/service';
import { Context, Language } from '@shared/module/poe/type';
import { Observable } from 'rxjs';
import { delay, distinctUntilChanged, filter, map } from 'rxjs/operators';
import { version } from '../../../../../package.json';
import { UserSettingsService } from '../../service/user-settings.service';
import { UserSettings } from '../../type';
Expand Down Expand Up @@ -45,7 +46,6 @@ export class OverlayComponent implements OnInit, OnDestroy {
}

public ngOnInit(): void {
this.registerAutoHide();
this.checkVersion();
this.initSettings();
}
Expand All @@ -54,50 +54,80 @@ export class OverlayComponent implements OnInit, OnDestroy {
this.unregisterShortcuts();
}

private checkVersion(): void {
this.releasesHttpService.getLatestRelease().subscribe(release => {
if (release && release.tag_name !== version && release.assets && release.assets[0].browser_download_url) {
if (confirm(`A new version: '${release.tag_name}' is available. Go to download Page?`)) {
this.browser.open(release.html_url);
}
}
});
}

private initSettings(): void {
this.userSettingsService.init(this.modules).subscribe(settings => {
this.translate.use(`${settings.language}`);
this.context.init(this.getContext(settings));
this.registerShortcuts(settings);
this.registerVisibleChange();
this.renderer.on('show-user-settings').subscribe(() => {
this.openUserSettings();
});
});
}

private registerShortcuts(settings: UserSettings): void {
this.registerFeatures(settings);
this.registerSettings(settings);
this.registerExit(settings);
this.dialogs.registerShortcuts();
}
private registerVisibleChange(): void {
this.app.visibleChange().pipe(
map(flag => {
if (flag === VisibleFlag.None) {
this.window.hide();
} else {
this.window.show();
}

private checkVersion(): void {
this.releasesHttpService.getLatestRelease().subscribe(release => {
if (release && release.tag_name !== version && release.assets && release.assets[0].browser_download_url) {
if (confirm(`A new version: '${release.tag_name}' is available. Go to download Page?`)) {
this.browser.open(release.html_url);
const visible = (flag & VisibleFlag.Game) === VisibleFlag.Game;
if (!visible) {
this.unregisterShortcuts();
}
}
return visible;
}),
distinctUntilChanged(),
filter(x => x),
delay(500)
).subscribe(() => {
this.registerShortcuts();
});
}

private registerAutoHide(): void {
this.app.visibleChange().subscribe(flag => {
if (flag === VisibleFlag.None) {
this.window.hide();
} else {
this.window.show();
}
private openUserSettings(): void {
if (!this.userSettingsOpen) {
this.unregisterShortcuts();
this.userSettingsOpen = this.renderer.open('user-settings');

if ((flag & VisibleFlag.Game) !== VisibleFlag.Game) {
this.dialogs.unregisterShortcuts();
} else {
this.dialogs.registerShortcuts();
}
this.userSettingsOpen.subscribe(() => {
this.userSettingsOpen = null;
this.userSettingsService.get().subscribe(settings => {
this.translate.use(`${settings.language}`);
this.context.update(this.getContext(settings));
this.registerShortcuts();
});
}, () => this.userSettingsOpen = null);
}
}

private registerShortcuts(): void {
this.userSettingsService.get().subscribe(settings => {
this.registerFeatures(settings);
this.registerSettings(settings);
this.registerExit(settings);
this.dialogs.registerShortcuts();
});
}

private unregisterShortcuts(): void {
this.shortcut.unregisterAll();
this.dialogs.unregisterShortcuts();
}

private registerFeatures(settings: UserSettings): void {
this.modules.forEach(mod => {
const features = mod.getFeatures(settings);
Expand All @@ -123,26 +153,6 @@ export class OverlayComponent implements OnInit, OnDestroy {
}
}

private unregisterShortcuts(): void {
this.shortcut.unregisterAll();
}

private openUserSettings(): void {
if (!this.userSettingsOpen) {
this.unregisterShortcuts();
this.userSettingsOpen = this.renderer.open('user-settings');

this.userSettingsOpen.subscribe(() => {
this.userSettingsOpen = null;
this.userSettingsService.get().subscribe(settings => {
this.translate.use(`${settings.language}`);
this.context.update(this.getContext(settings));
this.registerShortcuts(settings);
});
}, () => this.userSettingsOpen = null);
}
}

private getContext(settings: UserSettings): Context {
const context: Context = {
language: settings.language,
Expand Down
4 changes: 2 additions & 2 deletions src/app/modules/command/service/command.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class CommandService {

private init(): void {
this.command$.pipe(
throttleTime(150),
throttleTime(350),
map(command => {
const text = this.clipboard.readText();
this.clipboard.writeText(command);
Expand All @@ -31,7 +31,7 @@ export class CommandService {
this.keyboard.keyTap('enter');
return text;
}),
delay(50),
delay(200),
tap(text => {
this.clipboard.writeText(text);
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
align-items: center;
justify-content: center;
overflow: hidden;
overscroll-behavior: none;
padding-left: 60px;
max-width: 340px;
margin: 0 auto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@
}
}

&.divinationcard {
background: url(../../../../../../assets/poe/item/header-card-left.png) top left no-repeat,
url(../../../../../../assets/poe/item/header-card-right.png) top right no-repeat,
url(../../../../../../assets/poe/item/header-card-middle.png) top center repeat-x;

> .name {
color: #000;
}
}

&.gem {
background: url(../../../../../../assets/poe/item/header-gem-left.png) top left no-repeat,
url(../../../../../../assets/poe/item/header-gem-right.png) top right no-repeat,
Expand Down
84 changes: 39 additions & 45 deletions src/app/shared/module/poe/config/pseudo.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export enum ModifierType {
export interface Modifier {
id: string;
type: ModifierType;
count?: number;
}

export interface PseudoModifier {
Expand Down Expand Up @@ -58,30 +59,27 @@ export const PSEUDO_MODIFIERS: {
},
pseudo_total_strength: {
mods: [
{ id: 'additional_strength', type: ModifierType.Addition },
{ id: 'additional_strength_and_dexterity', type: ModifierType.Addition },
{ id: 'additional_strength_and_intelligence', type: ModifierType.Addition },
{ id: 'additional_all_attributes', type: ModifierType.Addition },
],
count: 2
{ id: 'additional_strength', type: ModifierType.Addition, count: 1 },
{ id: 'additional_strength_and_dexterity', type: ModifierType.Addition, count: 2 },
{ id: 'additional_strength_and_intelligence', type: ModifierType.Addition, count: 2 },
{ id: 'additional_all_attributes', type: ModifierType.Addition, count: 2 },
]
},
pseudo_total_dexterity: {
mods: [
{ id: 'additional_dexterity', type: ModifierType.Addition },
{ id: 'additional_strength_and_dexterity', type: ModifierType.Addition },
{ id: 'additional_dexterity_and_intelligence', type: ModifierType.Addition },
{ id: 'additional_all_attributes', type: ModifierType.Addition },
],
count: 2
{ id: 'additional_dexterity', type: ModifierType.Addition, count: 1 },
{ id: 'additional_strength_and_dexterity', type: ModifierType.Addition, count: 2 },
{ id: 'additional_dexterity_and_intelligence', type: ModifierType.Addition, count: 2 },
{ id: 'additional_all_attributes', type: ModifierType.Addition, count: 2 },
]
},
pseudo_total_intelligence: {
mods: [
{ id: 'additional_intelligence', type: ModifierType.Addition },
{ id: 'additional_strength_and_intelligence', type: ModifierType.Addition },
{ id: 'additional_dexterity_and_intelligence', type: ModifierType.Addition },
{ id: 'additional_all_attributes', type: ModifierType.Addition },
],
count: 2
{ id: 'additional_intelligence', type: ModifierType.Addition, count: 1 },
{ id: 'additional_strength_and_intelligence', type: ModifierType.Addition, count: 2 },
{ id: 'additional_dexterity_and_intelligence', type: ModifierType.Addition, count: 2 },
{ id: 'additional_all_attributes', type: ModifierType.Addition, count: 2 },
]
},
pseudo_total_all_attributes: {
mods: [
Expand Down Expand Up @@ -117,33 +115,30 @@ export const PSEUDO_MODIFIERS: {
},
pseudo_total_fire_resistance: {
mods: [
{ id: 'base_fire_damage_resistance_%', type: ModifierType.Addition },
{ id: 'base_resist_all_elements_%', type: ModifierType.Addition },
{ id: 'fire_and_chaos_damage_resistance_%', type: ModifierType.Addition },
{ id: 'fire_and_cold_damage_resistance_%', type: ModifierType.Addition },
{ id: 'fire_and_lightning_damage_resistance_%', type: ModifierType.Addition },
],
count: 2
{ id: 'base_fire_damage_resistance_%', type: ModifierType.Addition, count: 1 },
{ id: 'base_resist_all_elements_%', type: ModifierType.Addition, count: 2 },
{ id: 'fire_and_chaos_damage_resistance_%', type: ModifierType.Addition, count: 2 },
{ id: 'fire_and_cold_damage_resistance_%', type: ModifierType.Addition, count: 2 },
{ id: 'fire_and_lightning_damage_resistance_%', type: ModifierType.Addition, count: 2 },
]
},
pseudo_total_lightning_resistance: {
mods: [
{ id: 'base_lightning_damage_resistance_%', type: ModifierType.Addition },
{ id: 'base_resist_all_elements_%', type: ModifierType.Addition },
{ id: 'lightning_and_chaos_damage_resistance_%', type: ModifierType.Addition },
{ id: 'fire_and_lightning_damage_resistance_%', type: ModifierType.Addition },
{ id: 'cold_and_lightning_damage_resistance_%', type: ModifierType.Addition },
],
count: 2
{ id: 'base_lightning_damage_resistance_%', type: ModifierType.Addition, count: 1 },
{ id: 'base_resist_all_elements_%', type: ModifierType.Addition, count: 2 },
{ id: 'lightning_and_chaos_damage_resistance_%', type: ModifierType.Addition, count: 2 },
{ id: 'fire_and_lightning_damage_resistance_%', type: ModifierType.Addition, count: 2 },
{ id: 'cold_and_lightning_damage_resistance_%', type: ModifierType.Addition, count: 2 },
]
},
pseudo_total_cold_resistance: {
mods: [
{ id: 'base_cold_damage_resistance_%', type: ModifierType.Addition },
{ id: 'base_resist_all_elements_%', type: ModifierType.Addition },
{ id: 'cold_and_chaos_damage_resistance_%', type: ModifierType.Addition },
{ id: 'fire_and_cold_damage_resistance_%', type: ModifierType.Addition },
{ id: 'cold_and_lightning_damage_resistance_%', type: ModifierType.Addition },
],
count: 2
{ id: 'base_cold_damage_resistance_%', type: ModifierType.Addition, count: 1 },
{ id: 'base_resist_all_elements_%', type: ModifierType.Addition, count: 2 },
{ id: 'cold_and_chaos_damage_resistance_%', type: ModifierType.Addition, count: 2 },
{ id: 'fire_and_cold_damage_resistance_%', type: ModifierType.Addition, count: 2 },
{ id: 'cold_and_lightning_damage_resistance_%', type: ModifierType.Addition, count: 2 },
]
},
pseudo_total_elemental_resistance: {
mods: [
Expand All @@ -162,12 +157,11 @@ export const PSEUDO_MODIFIERS: {
},
pseudo_total_chaos_resistance: {
mods: [
{ id: 'base_chaos_damage_resistance_%', type: ModifierType.Addition },
{ id: 'fire_and_chaos_damage_resistance_%', type: ModifierType.Addition },
{ id: 'lightning_and_chaos_damage_resistance_%', type: ModifierType.Addition },
{ id: 'cold_and_chaos_damage_resistance_%', type: ModifierType.Addition },
],
count: 2
{ id: 'base_chaos_damage_resistance_%', type: ModifierType.Addition, count: 1 },
{ id: 'fire_and_chaos_damage_resistance_%', type: ModifierType.Addition, count: 2 },
{ id: 'lightning_and_chaos_damage_resistance_%', type: ModifierType.Addition, count: 2 },
{ id: 'cold_and_chaos_damage_resistance_%', type: ModifierType.Addition, count: 2 },
]
},
pseudo_total_resistance: {
mods: [
Expand Down
Loading

0 comments on commit e5ed637

Please sign in to comment.