Skip to content

Commit

Permalink
Merge pull request #137 from Kyusung4698/develop
Browse files Browse the repository at this point in the history
- 0.5.6
  • Loading branch information
Kyusung4698 committed Jan 25, 2020
2 parents ae2e191 + 7545782 commit af77b04
Show file tree
Hide file tree
Showing 20 changed files with 21,126 additions and 20,844 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.6 (2020-01-25)

* add vaal support (#134)
* add value range support for quality and gem level (#129)
* add pseudo total energy shield and increased energy shield (#135)
* update evaluate dialog position calculation to be based on actual item values (#131)
* update active check to use executable name instead of window name (#132)
* update poe assets to patch `3.9.2c`
* update default indexed range to 3 days
* fix `clipboard empty...` even though the game is focused (#133)

## 0.5.5 (2020-01-23)

* add autohide overlay if poe is not active (#60, #61, #122)
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.5
# PoE Overlay 0.5.6

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 @@ -78,9 +78,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.5.exe`
3. Run `poe-overlay 0.5.6.exe`
4. Start Path of Exile
5. Wait until you can see `POE Overlay 0.5.5` in the bottom left corner
5. Wait until you can see `POE Overlay 0.5.6` in the bottom left corner
6. Hit `f7` and set `Language` and `League` to meet your game settings

#### Shortcuts
Expand Down
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": {
"name": "Kyusung4698"
},
"version": "0.5.5",
"version": "0.5.6",
"scripts": {
"postinstall": "electron-builder install-app-deps",
"ng:serve": "ng serve",
Expand Down Expand Up @@ -40,9 +40,9 @@
"@angular/router": "~8.2.14",
"@swimlane/ngx-charts": "^13.0.1",
"hammerjs": "^2.0.8",
"hotkeys": "git+https://github.com/Kyusung4698/hotkeys.git#80fa26af5abf8b5b7b31ac54b39a95b912ba0714",
"hotkeys": "git+https://github.com/Kyusung4698/hotkeys.git#4046b404654f4d23cc89fe3bf1de12cc247e6390",
"localforage": "^1.7.3",
"robotjs": "git+https://github.com/Kyusung4698/robotjs.git",
"robotjs": "git+https://github.com/Kyusung4698/robotjs.git#81ca63005b48acb7b4fdb495d90cd17ac1a48e49",
"rxjs": "~6.4.0",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
Expand Down Expand Up @@ -79,4 +79,4 @@
"browser": {
"fs": false
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class EvaluateDialogComponent implements OnInit, AfterViewInit {
const currencies$ = this.data.settings.evaluateCurrencyIds.map(id => this.currencyService.searchById(id));
return forkJoin(
this.itemSearchService.search(item, {
indexed: this.data.settings.evaluateQueryIndexed,
indexed: this.data.settings.evaluateQueryIndexedRange,
online: this.data.settings.evaluateQueryOnline,
}),
forkJoin(currencies$)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</div>
<mat-form-field>
<mat-label>Listing Max Age</mat-label>
<mat-select [(value)]="settings.evaluateQueryIndexed">
<mat-select [(value)]="settings.evaluateQueryIndexedRange">
<mat-option value="any"> Any Time </mat-option>
<mat-option value="1day"> Up to a day ago </mat-option>
<mat-option value="3days"> Up to 3 days ago </mat-option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface EvaluateUserSettings extends UserSettings {
evaluateQueryDefaultType: boolean;
evaluateQueryDefaultStats: any;
evaluateQueryOnline: boolean;
evaluateQueryIndexed: ItemSearchIndexed;
evaluateQueryIndexedRange: ItemSearchIndexed;
evaluateModifierRange: number;
evaluateModifierDisableMaxRange: boolean;
}
Expand Down
3 changes: 2 additions & 1 deletion src/app/modules/evaluate/evaluate.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ export class EvaluateModule implements FeatureModule {
'pseudo.pseudo_total_resistance': true,
'pseudo.pseudo_total_strength': true,
'pseudo.pseudo_total_life': true,
'pseudo.pseudo_total_energy_shield': true,
'explicit.stat_1479533453': true,
'enchant.stat_290368246': true
},
evaluateQueryIndexed: ItemSearchIndexed.UpTo2WeeksAgo,
evaluateQueryIndexedRange: ItemSearchIndexed.UpTo3DaysAgo,
evaluateQueryOnline: true,
evaluateModifierRange: 10,
evaluateModifierDisableMaxRange: true,
Expand Down
128 changes: 123 additions & 5 deletions src/app/modules/evaluate/service/evaluate-dialog.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,36 @@ import { MatDialog } from '@angular/material/dialog';
import { WindowService } from '@app/service';
import { DialogsService } from '@app/service/input/dialogs.service';
import { Point } from '@app/type';
import { Item, Language } from '@shared/module/poe/type';
import { StatsService } from '@shared/module/poe/service';
import { Item, Language, StatType } from '@shared/module/poe/type';
import { Observable } from 'rxjs';
import { tap } from 'rxjs/operators';
import { EvaluateDialogComponent, EvaluateDialogData } from '../component/evaluate-dialog/evaluate-dialog.component';
import { EvaluateUserSettings } from '../component/evaluate-settings/evaluate-settings.component';

const DIALOG_MIN_WIDTH = 400;
const DIALOG_LINE_HEIGHT = 19;
const DIALOG_DIVIDER_HEIGHT = 8;
const DIALOG_AVG_CHAR_WIDTH = 7.6;
const DIALOG_AVG_VALUE_WIDTH = 36;

@Injectable({
providedIn: 'root'
})
export class EvaluateDialogService {
constructor(
private readonly dialog: MatDialog,
private readonly window: WindowService,
private readonly dialogs: DialogsService) {
private readonly dialogs: DialogsService,
private readonly stats: StatsService) {
}

public open(point: Point, item: Item, settings: EvaluateUserSettings, language?: Language): Observable<void> {
const width = 400;
const avgHeight = 500;
const { width, height } = this.estimateBounds(item, language);

const bounds = this.window.getBounds();
const left = Math.min(Math.max(point.x - width * 0.5, bounds.x), bounds.x + bounds.width - width);
const top = Math.min(Math.max(point.y - avgHeight * 0.5, bounds.y), bounds.y + bounds.height - avgHeight);
const top = Math.min(Math.max(point.y - height * 0.5, bounds.y), bounds.y + bounds.height - height);

const data: EvaluateDialogData = {
item,
Expand All @@ -51,4 +58,115 @@ export class EvaluateDialogService {
this.dialogs.remove(close);
}));
}

private estimateBounds(item: Item, language: Language): { width: number, height: number } {
let width = 4; // padding
let height = 4; // padding

if (item.nameId) {
height += 20;
}
if (item.typeId) {
height += 33;
}

if (item.damage || item.properties) {
if (item.damage) {
if (item.damage.dps) {
height += DIALOG_LINE_HEIGHT;
}
if (item.damage.edps) {
height += DIALOG_LINE_HEIGHT;
}
if (item.damage.edps) {
height += DIALOG_LINE_HEIGHT;
}
}
if (item.properties) {
Object.getOwnPropertyNames(item.properties).forEach(key => {
if (item.properties[key]) {
height += DIALOG_LINE_HEIGHT;
}
});
}
height += DIALOG_DIVIDER_HEIGHT;
}

if (item.level || item.requirements) {
if (item.level) {
height += DIALOG_LINE_HEIGHT;
}
if (item.requirements) {
height += DIALOG_LINE_HEIGHT;
}
height += DIALOG_DIVIDER_HEIGHT;
}

if (item.sockets) {
const length = item.sockets.length;
const socketHeight = Math.floor((length + 1) / 2) * 34;
const linkHeight = length >= 3
? Math.floor((length - 1) / 2) * 22
: 0;
height += socketHeight + linkHeight;
height += DIALOG_DIVIDER_HEIGHT;
}

if (item.stats) {
height += item.stats.reduce((a) => a + DIALOG_LINE_HEIGHT, 0);

item.stats.forEach(stat => {
const parts = this.stats.transform(stat, language);
const count = parts.reduce((a, b) => a + b.length, 0);
const size = count * DIALOG_AVG_CHAR_WIDTH + stat.values.length * DIALOG_AVG_VALUE_WIDTH;
if (size >= width) {
width = size;
}
});

const unique = {};
item.stats.forEach(stat => unique[stat.type] = true);
if (unique[StatType.Enchant]) {
height += DIALOG_DIVIDER_HEIGHT;
}
if (unique[StatType.Implicit]) {
height += DIALOG_DIVIDER_HEIGHT;
}
if (unique[StatType.Explicit] || unique[StatType.Crafted] || unique[StatType.Fractured]) {
height += DIALOG_DIVIDER_HEIGHT;
}
if (unique[StatType.Pseudo]) {
height += DIALOG_DIVIDER_HEIGHT;
}
}

if (item.veiled || item.corrupted) {
if (item.veiled) {
height += DIALOG_LINE_HEIGHT;
}
if (item.corrupted) {
height += DIALOG_LINE_HEIGHT;
}
height += DIALOG_DIVIDER_HEIGHT;
}

if (item.influences) {
height += DIALOG_LINE_HEIGHT;
height += DIALOG_DIVIDER_HEIGHT;
}

// price / graph
height += DIALOG_DIVIDER_HEIGHT;

const price = 64;
height += price;

const graph = 200;
height += graph;

return {
width: Math.max(width, DIALOG_MIN_WIDTH),
height
};
}
}
Loading

0 comments on commit af77b04

Please sign in to comment.