Skip to content

Commit

Permalink
- added trade go to hideout action
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyusung4698 committed Jun 24, 2020
1 parent 0b7fe4c commit 0c97013
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/app/modules/trade/class/trade-message-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export enum TradeMessageAction {
Trade = 'trade',
ItemHighlight = 'item-highlight',
Whisper = 'whisper',
Finished = 'finished'
Finished = 'finished',
Hideout = 'hideout'
}

export interface TradeMessageActionState {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
<mat-icon *ngSwitchCase="'finished'">done</mat-icon>
<mat-icon *ngSwitchCase="'dismiss'">close</mat-icon>
<mat-icon *ngSwitchCase="'interested'">hearing</mat-icon>
<mat-icon *ngSwitchCase="'hideout'">exit_to_app</mat-icon>
</ng-container>
</button>
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export class TradeMessageComponent implements OnInit {
} else {
this.toggle$.next(true);
this.visible[TradeMessageAction.Resend] = true;
this.visible[TradeMessageAction.Hideout] = true;
this.visible[TradeMessageAction.Finished] = true;
this.visible[TradeMessageAction.ItemHighlight] = this.message.type === TradeParserType.TradeMap;
}
Expand Down Expand Up @@ -124,6 +125,9 @@ export class TradeMessageComponent implements OnInit {
this.kick();
this.close();
break;
case TradeMessageAction.Hideout:
this.chat.hideout(this.message.name);
break;
}
}

Expand Down
9 changes: 7 additions & 2 deletions src/app/shared/module/poe/chat/chat.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export class ChatService {
this.queue$.next({ message, send: true });
}

public hideout(name: string): void {
const message = this.generateMessage('/hideout', name);
this.queue$.next({ message, send: true });
}

private init(): void {
this.queue$.pipe(
windowTime(350),
Expand All @@ -55,9 +60,9 @@ export class ChatService {
delay(10),
flatMap(text => of(text).pipe(
tap(() => OWUtils.sendKeyStroke('Enter')),
delay(10),
delay(15),
tap(() => OWUtils.sendKeyStroke('Ctrl+V')),
delay(10),
delay(15),
tap(() => {
if (event.send) {
OWUtils.sendKeyStroke('Enter');
Expand Down

0 comments on commit 0c97013

Please sign in to comment.