Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #13 from zombodotcom/Stash-Branch
Browse files Browse the repository at this point in the history
Stash branch
  • Loading branch information
zombodotcom authored Nov 6, 2019
2 parents 1bf7451 + 5784648 commit 3c0061a
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 28 deletions.
7 changes: 4 additions & 3 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,10 @@ ipcMain.on("ping-async", (event, message) => {
// get all stash data
let promisesurls = [];
// ## CHANGE HERE FOR RATE LIMIT
// for (let x = 0; x < stashurlsFull.length; x++) { ## CHANGE HERE FOR RATE LIMIT
// ## CHANGE HERE FOR RATE LIMIT
for (let x = 0; x < 5; x++) {
for (let x = 0; x < stashurlsFull.length; x++) {
// CHANGE HERE FOR RATE LIMIT
// ## CHANGE HERE FOR RATE LIMIT
// for (let x = 0; x < 5; x++) {
promisesurls.push(
axios.get(stashurlsFull[x], {
headers: {
Expand Down
30 changes: 19 additions & 11 deletions src/app/displaylist/displaylist.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,27 @@
<button type="submit" mat-mini-fab color="primary">Send2</button>
</form> -->

<!-- <div> -->





<mat-tab-group [animationDuration]="'0ms'">
<mat-tab label="Stash">

<ng-container *ngIf="fullstashdataBigBoiArray">
<ng-container *ngIf="fullstashdataBigBoiArray" >

{{networth}} <img src="https://web.poecdn.com/image/Art/2DItems/Currency/CurrencyRerollRare.png?scale=1&w=1&h=1" style="height:-80%;"/> Net Worth
<br>
<mat-form-field>
<input matInput (keyup)="applyFilterStash($event.target.value)" placeholder="Filter">
</mat-form-field>
<div class="mat-elevation-z8" style="float: left">
<table mat-table [dataSource]="fullstashDataResponseSource" #MatSortstash="matSort" matSort>

<div class="example-container mat-elevation-z8">
<mat-table [dataSource]="fullstashDataResponseSource" #MatSortstash="matSort" matSort>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Name</th>
<th mat-header-cell *matHeaderCellDef mat-sort-header >Name</th>
<td mat-cell *matCellDef="let element">
<ng-container *ngIf="element.name || element.typeLine">
{{element.name ? element.name : element.typeLine}}
Expand All @@ -66,8 +74,8 @@
</ng-container>

<ng-container matColumnDef="stackSize">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Count</th>
<td mat-cell *matCellDef="let element">
<th mat-header-cell *matHeaderCellDef mat-sort-header >Count</th>
<td mat-cell *matCellDef="let element" >
{{element.stackSize}}
</td>
</ng-container>
Expand All @@ -83,22 +91,22 @@

<ng-container matColumnDef="inventoryId">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Stash</th>
<td mat-cell *matCellDef="let element">
{{ element.inventoryId }}
<td mat-cell *matCellDef="let element" >
{{ element.inventoryId }} :
</td>
</ng-container>
<ng-container matColumnDef="worth">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Worth</th>
<td mat-cell *matCellDef="let element">
<!-- {{worthfinder(element)}} -->
{{element.worth}}
{{element.worth}} <img src="https://web.poecdn.com/image/Art/2DItems/Currency/CurrencyRerollRare.png?scale=1&w=1&h=1" style="height:50%;" />
</td>

</ng-container>

<tr mat-header-row *matHeaderRowDef="disptest; sticky: true"></tr>
<tr mat-header-row *matHeaderRowDef="disptest; sticky: true "></tr>
<tr mat-row *matRowDef="let row; columns: disptest"></tr>
</table>
</mat-table>
<mat-paginator #paginatorstash [length]="100" [pageSize]="10" [pageSizeOptions]="[5, 10, 25, 100]">
</mat-paginator>
</div>
Expand Down
50 changes: 47 additions & 3 deletions src/app/displaylist/displaylist.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,50 @@
// flex: 0 0 30%;
// }

// mat-cell:nth-child(1),
// mat-header-cell:nth-child(1) {
// flex: 0 0 30%;
// }

// mat-cell:nth-child(5),
// mat-header-cell:nth-child(5) {
// flex: 0 0 30%;
// }

// .mat-table__wrapper .mat-table {
// min-width: auto !important;
// width: 100% !important;
// }

// .mat-header-row {
// width: 100%;
// }

// .mat-row {
// width: 100%;
// }

// .mat-column {
// flex: 0 0 25% !important;
// min-width: 104px !important;
// }
// .customWidthClass{
// flex: 0 0 75px;
// }

.mat-cell:nth-child(1),
.mat-header-cell:nth-child(1) {
flex: 0 0 10%;
}
.mat-cell:nth-child(5),
.mat-header-cell:nth-child(5) {
flex: 0 0 20%;
}

// .mat-column-stash2 {
// flex: 0 0 300px;
// }

* {
transition: none;
}
Expand All @@ -23,9 +67,9 @@
pointer-events: none !important;
}

.mat-column-explicitModifiers {
width: 100px;
}
// .mat-column {
// width: 100px;
// }
::ng-deep .tooltip-inner {
background-color: #000000;
// opacity: 0.6;
Expand Down
64 changes: 53 additions & 11 deletions src/app/displaylist/displaylist.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ export class DisplaylistComponent implements OnInit {
essenceDataResponse;
incubatorDataResponse;
giantpoeninjaarray;
public networth = 0;
hide = true;
public POESESSID;
public accountName;
Expand Down Expand Up @@ -268,8 +269,9 @@ export class DisplaylistComponent implements OnInit {
itemheaders: string[] = ["id", "name"];
currencyHeaders: string[] = [
"icon",
"chaosEquivalent",
"currencyTypeName",
"chaosEquivalent",

"detailsId",
// "lowConfidencePaySparkLine",
// "lowConfidenceReceiveSparkLine",
Expand Down Expand Up @@ -630,6 +632,19 @@ export class DisplaylistComponent implements OnInit {
: 0;
// console.log(comparething, "comparething");
// console.log(this.giantpoeninjaarray[i], "giantindex", item);
// if (item.explicitMods) {
// if (
// item.explicitMods[0] !=
// this.giantpoeninjaarray[i].explicitModifiers[0]
// ) {
// console.log("explicit mods dont match");
// console.log(
// [item, "item"],
// [item.explicitMods, this.giantpoeninjaarray[i].explicitModifiers]
// );
// continue;
// }
// }
if (comparething == item.typeLine || comparething == item.name) {
console.log(
[this.giantpoeninjaarray[i], "arr"],
Expand All @@ -642,7 +657,7 @@ export class DisplaylistComponent implements OnInit {
[item, "item"]
);
if (item.sockets) {
if (item.sockets.length != this.giantpoeninjaarray[i].links) {
if (item.sockets.length < this.giantpoeninjaarray[i].links) {
console.log("continue");
continue;
}
Expand All @@ -661,20 +676,45 @@ export class DisplaylistComponent implements OnInit {
return count[a] > count[b] ? a : b;
});

let linkcount = count[maxlinks];
if (linkcount < 5) {
linkcount = 0;
}
if (linkcount != this.giantpoeninjaarray[i].links) {
console.log("continue");
console.log([
linkcount + " linkcount",
this.giantpoeninjaarray[i].links,
" ppoeninja.links"
]);
continue;
}
console.log(
[maxlinks, "maxlinks"],
["group " + maxlinks, "maxlinks"],
[grouparray, "grouparray"],
[count, "count"],
[count[maxlinks], "count[maxlinks]"]
[linkcount, "count[maxlinks] < 5"]
);

if (count[maxlinks] >= 5) {
if (count[maxlinks] == this.giantpoeninjaarray[i].links) {
return this.giantpoeninjaarray[i].chaosValue
? this.giantpoeninjaarray[i].chaosValue
: this.giantpoeninjaarray[i].chaosEquivalent;
}
if (linkcount == this.giantpoeninjaarray[i].links) {
return this.giantpoeninjaarray[i].chaosValue
? this.giantpoeninjaarray[i].chaosValue
: this.giantpoeninjaarray[i].chaosEquivalent;
}
// if (count[maxlinks] >= 5) {
// console.log("inside 5+");
// if (count[maxlinks] == this.giantpoeninjaarray[i].links) {
// return this.giantpoeninjaarray[i].chaosValue
// ? this.giantpoeninjaarray[i].chaosValue
// : this.giantpoeninjaarray[i].chaosEquivalent;
// }
// }
// if (count[maxlinks] < 5) {
// console.log("inside below 5");

// return this.giantpoeninjaarray[i].chaosValue
// ? this.giantpoeninjaarray[i].chaosValue
// : this.giantpoeninjaarray[i].chaosEquivalent;
// }
}

return this.giantpoeninjaarray[i].chaosValue
Expand Down Expand Up @@ -856,8 +896,10 @@ export class DisplaylistComponent implements OnInit {
this.fullstashdataBigBoiArray[x].worth = this.worthfinder2(
this.fullstashdataBigBoiArray[x]
);
this.networth += Number(this.fullstashdataBigBoiArray[x].worth);
// console.log(this.fullstashdataBigBoiArray[x], "afterpush");
}

this.fullstashDataResponseSource = new MatTableDataSource(
this.fullstashdataBigBoiArray
);
Expand Down

0 comments on commit 3c0061a

Please sign in to comment.