Skip to content

Commit

Permalink
- added a new hotkey (default on F10) to manually capture replays
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyusung4698 committed Jul 8, 2020
1 parent 812192f commit 93870bb
Show file tree
Hide file tree
Showing 22 changed files with 171 additions and 33 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 1.0.8 (2020-07-05)

- added a new hotkey (default on F10) to manually capture replays
- fixed an issue at the market type filter resulting in a unknown category error

## 1.0.7 (2020-07-01)
Expand Down
7 changes: 6 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,14 @@
"action-type": "custom"
},
"misc-stash-highlight": {
"title": "Highlight Item in Stash",
"title": "Highlight a item in stash",
"action-type": "custom",
"default": "Alt+F"
},
"replay-manually": {
"title": "Capture a replay manually",
"action-type": "custom",
"default": "F10"
}
},
"externally_connectable": {
Expand Down
53 changes: 53 additions & 0 deletions overlay.babel
Original file line number Diff line number Diff line change
Expand Up @@ -11904,6 +11904,59 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>manually</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>de-DE</language>
<approved>false</approved>
</translation>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-ES</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-FR</language>
<approved>false</approved>
</translation>
<translation>
<language>ko-KR</language>
<approved>false</approved>
</translation>
<translation>
<language>pl-PL</language>
<approved>false</approved>
</translation>
<translation>
<language>pt-BR</language>
<approved>false</approved>
</translation>
<translation>
<language>ru-RU</language>
<approved>false</approved>
</translation>
<translation>
<language>th-TH</language>
<approved>false</approved>
</translation>
<translation>
<language>zh-CHS</language>
<approved>false</approved>
</translation>
<translation>
<language>zh-CHT</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>name</name>
<definition_loaded>false</definition_loaded>
Expand Down
3 changes: 2 additions & 1 deletion src/app/core/config/hotkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ export enum Hotkey {
Bookmark4 = 'bookmark4',
Bookmark5 = 'bookmark5',
Bookmark6 = 'bookmark6',
MiscStashHighlight = 'misc-stash-highlight'
MiscStashHighlight = 'misc-stash-highlight',
ReplayManually = 'replay-manually'
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
<div class="row">
<div class="col-md-6">
<div class="col">
<app-card [title]="'support.developer.title'">
<p>{{'support.developer.text' | translate}}</p>
<div>
<button mat-raised-button color="primary" (click)="onOpenSubscription()">
{{'support.developer.open' | translate}}
</button>
</div>
</app-card>
</div>
</div>
<div class="row">
<div class="col">
<app-card [title]="'support.question.title' | translate">
<p>{{'support.question.text' | translate}}</p>
<div>
<button mat-raised-button color="primary"
<button mat-raised-button
(click)="onOpenUrl('https://github.com/Kyusung4698/PoE-Overlay/issues/new/choose')">
{{'support.question.github' | translate}}
</button>
<button mat-raised-button color="primary" (click)="onOpenUrl('https://discord.gg/dbGFmSQ')">
<button mat-raised-button (click)="onOpenUrl('https://discord.gg/dbGFmSQ')">
{{'support.question.discord' | translate}}
</button>
</div>
</app-card>
</div>
<div class="col-md-6">
<app-card [title]="'support.developer.title'">
<p>{{'support.developer.text' | translate}}</p>
<div>
<button mat-raised-button color="primary" (click)="onOpenSubscription()">
{{'support.developer.open' | translate}}
</button>
</div>
</app-card>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
p {
color: $label-color;
font-size: 13px;
margin: 0 0 $gutter 0;
height: 40px;
margin: 0 0 $gutter * 2 0;
}

button {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "../../../../styles/variables";

.tab-content {
padding: 12px 12px 0px 12px;
padding: 12px;
}

::ng-deep {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
<app-card [title]="'replay.manually' | translate" appAnnotation="replay">
<div class="row">
<div class="col">
<mat-slide-toggle [checked]="settings.replayCaptureManually"
(change)="settings.replayCaptureManually = $event.checked" (change)="onCaptureChange()">
{{'replay.capture' | translate}}
</mat-slide-toggle>
</div>
</div>
<div class="row">
<div class="col">
<mat-form-field>
<mat-label>{{'app.hotkey' | translate}}</mat-label>
<input matInput [value]="'replay-manually' | hotkey" readonly>
<a matSuffix [href]="'replay-manually' | hotkeyUrl">
<mat-icon> keyboard </mat-icon>
</a>
</mat-form-field>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="value-range">
<label class="label"> {{'replay.past-duration' | translate}}:
{{displayDuration(settings.replayCaptureManuallyPastDuration)}}
</label>
<div class="slider">
<mat-slider min="3" max="15" step="1" tickInterval="1" invert [displayWith]="displayDuration"
[(value)]="settings.replayCaptureManuallyPastDuration" (valueChange)="onDurationChange()">
</mat-slider>
</div>
</div>
</div>
<div class="col-md-6">
<div class="value-range">
<label class="label"> {{'replay.future-duration' | translate}}:
{{displayDuration(settings.replayCaptureManuallyFutureDuration)}}
</label>
<div class="slider">
<mat-slider min="0" max="5" step="1" tickInterval="1" [displayWith]="displayDuration"
[(value)]="settings.replayCaptureManuallyFutureDuration" (valueChange)="onDurationChange()">
</mat-slider>
</div>
</div>
</div>
</div>
</app-card>

<app-card [title]="'replay.death' | translate" appAnnotation="replay">
<div class="row">
<div class="col">
Expand Down
3 changes: 3 additions & 0 deletions src/app/modules/replay/replay-feature-settings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { FeatureSettings } from '@app/feature';

export interface ReplayFeatureSettings extends FeatureSettings {
replayCaptureManually?: boolean;
replayCaptureManuallyPastDuration?: number;
replayCaptureManuallyFutureDuration?: number;
replayCaptureDeath?: boolean;
replayCaptureDeathPastDuration?: number;
replayCaptureDeathFutureDuration?: number;
Expand Down
32 changes: 27 additions & 5 deletions src/app/modules/replay/replay.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NgModule } from '@angular/core';
import { Hotkey } from '@app/config';
import { Feature, FeatureConfig, FeatureModule, FEATURE_MODULES } from '@app/feature';
import { NotificationService } from '@app/notification';
import { GameEvent, RunningGameInfo } from '@app/odk';
Expand Down Expand Up @@ -35,25 +36,46 @@ export class ReplayModule implements FeatureModule<ReplayFeatureSettings> {
replayCaptureDeathPastDuration: 8,
replayCaptureKill: false,
replayCaptureKillFutureDuration: 3,
replayCaptureKillPastDuration: 5
replayCaptureKillPastDuration: 5,
replayCaptureManually: false,
replayCaptureManuallyFutureDuration: 0,
replayCaptureManuallyPastDuration: 10,
}
};
return config;
}

public getFeatures(): Feature[] {
const features: Feature[] = [];
const features: Feature[] = [
{ hotkey: Hotkey.ReplayManually }
];
return features;
}

public onSettingsChange(settings: ReplayFeatureSettings): void {
const shouldCapture = settings.replayCaptureDeath || settings.replayCaptureKill;
const shouldCapture = settings.replayCaptureManually || settings.replayCaptureDeath || settings.replayCaptureKill;
if (shouldCapture !== this.shouldCapture) {
this.shouldCapture = shouldCapture;
this.updateCapturing();
}
}

public onKeyPressed(hotkey: Hotkey, settings: ReplayFeatureSettings): void {
switch (hotkey) {
case Hotkey.ReplayManually:
if (settings.replayCaptureManually) {
this.replay.capture(
settings.replayCaptureManuallyPastDuration,
settings.replayCaptureManuallyFutureDuration
).subscribe(() => { }, error => {
console.warn('Could not capture a manually triggered event.', error);
this.notification.show('replay.capture-error');
});
}
break;
}
}

public onGameEvent(event: GameEvent, settings: ReplayFeatureSettings): void {
switch (event?.name) {
case 'death':
Expand Down Expand Up @@ -82,12 +104,12 @@ export class ReplayModule implements FeatureModule<ReplayFeatureSettings> {
}

public onInfo(info: RunningGameInfo, settings: ReplayFeatureSettings): void {
const shouldCapture = settings.replayCaptureDeath || settings.replayCaptureKill;
const shouldCapture = settings.replayCaptureManually || settings.replayCaptureDeath || settings.replayCaptureKill;
const { isRunning } = info;
if (shouldCapture !== this.shouldCapture
|| isRunning !== this.isRunning) {
this.isRunning = info.isRunning;
this.shouldCapture = settings.replayCaptureDeath || settings.replayCaptureKill;
this.shouldCapture = shouldCapture;
this.updateCapturing();
}
}
Expand Down
13 changes: 3 additions & 10 deletions src/app/shared/module/odk/component/header/header.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -119,27 +119,20 @@ $border-color: #1a1a1a;

.content {
width: 100%;

&:not(.inline) {
&.has-footer {
height: calc(100% - #{$footer-size} - #{$header-size});
}

height: calc(100% - #{$header-size});
}
height: 100%;

&.fixed {
padding: $header-size 0 0 0;

&.has-footer {
padding: $header-size 0 $footer-size - 1px 0;
padding: $header-size 0 $footer-size 0;
}

&.reverse {
padding: 0 0 $header-size 0;

&.has-footer {
padding: $footer-size 0 $header-size - 1px 0;
padding: $footer-size 0 $header-size 0;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/english.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@
"death": "Death event",
"future-duration": "Future duration",
"kill": "Kill event",
"manually": "Manually",
"name": "Replay",
"past-duration": "Past duration",
"start-error": "The events capturing could not be started.",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/french.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@
"death": "Événement de décès",
"future-duration": "Durée future",
"kill": "Tuer l'événement",
"manually": "Manuellement",
"name": "Rejouer",
"past-duration": "Durée passée",
"start-error": "La capture des événements n'a pas pu démarrer.",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/german.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@
"death": "Todesereignis",
"future-duration": "Zukünftige Dauer",
"kill": "Tötungsereignis",
"manually": "Manuell",
"name": "Wiederholung",
"past-duration": "Vergangene Dauer",
"start-error": "Die Ereigniserfassung konnte nicht gestartet werden.",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/korean.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@
"death": "죽음의 사건",
"future-duration": "향후 기간",
"kill": "킬 이벤트",
"manually": "수동으로",
"name": "다시 하다",
"past-duration": "지난 기간",
"start-error": "이벤트 캡처를 시작할 수 없습니다.",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/polish.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@
"death": "Zdarzenie śmierci",
"future-duration": "Przyszły czas trwania",
"kill": "Zabij zdarzenie",
"manually": "ręcznie",
"name": "Powtórna rozgrywka",
"past-duration": "Czas przeszły",
"start-error": "Nie można rozpocząć przechwytywania zdarzeń.",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/portuguese.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@
"death": "Evento de morte",
"future-duration": "Duração futura",
"kill": "Matar evento",
"manually": "Manualmente",
"name": "Repetir",
"past-duration": "Duração passada",
"start-error": "A captura de eventos não pôde ser iniciada.",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/russian.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@
"death": "Событие смерти",
"future-duration": "Будущая продолжительность",
"kill": "Убить событие",
"manually": "вручную",
"name": "переигровка",
"past-duration": "Прошлая продолжительность",
"start-error": "Захват событий не может быть начат.",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/simplified-chinese.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@
"death": "死亡事件",
"future-duration": "未来持续时间",
"kill": "杀死事件",
"manually": "手动地",
"name": "重播",
"past-duration": "过去的持续时间",
"start-error": "无法开始事件捕获。",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/spanish.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@
"death": "Evento de muerte",
"future-duration": "Duración futura",
"kill": "Evento de muerte",
"manually": "a mano",
"name": "Repetición",
"past-duration": "Duración pasada",
"start-error": "No se pudo iniciar la captura de eventos.",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/thai.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@
"death": "เหตุการณ์ความตาย",
"future-duration": "อนาคตระยะเวลา",
"kill": "ฆ่าเหตุการณ์",
"manually": "ด้วยมือ",
"name": "เล่นใหม่",
"past-duration": "ระยะเวลาที่ผ่านมา",
"start-error": "ไม่สามารถเริ่มต้นการจับภาพเหตุการณ์",
Expand Down
Loading

0 comments on commit 93870bb

Please sign in to comment.