Skip to content

Commit

Permalink
- added replays location as tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyusung4698 committed Sep 17, 2020
1 parent 6c7c2d6 commit 9c4582c
Show file tree
Hide file tree
Showing 18 changed files with 110 additions and 5 deletions.
53 changes: 53 additions & 0 deletions overlay.babel
Original file line number Diff line number Diff line change
Expand Up @@ -12010,6 +12010,59 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>help</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>kill</name>
<definition_loaded>false</definition_loaded>
Expand Down
13 changes: 13 additions & 0 deletions src/app/core/odk/ow-replay.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
import { from, Observable } from 'rxjs';

export class OWReplay {
public static path(): Observable<string> {
const promise = new Promise<string>((resolve, reject) => {
overwolf.settings.getOverwolfVideosFolder(result => {
if (result.success && result.path?.Value) {
resolve(result.path.Value);
} else {
reject(result.error);
}
});
});
return from(promise);
}

public static turnOn(settings: any): Observable<void> {
const promise = new Promise<void>((resolve, reject) => {
overwolf.media.replays.turnOn(settings, result => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<app-card [title]="'replay.manually' | translate" appAnnotation="replay">
<app-card [title]="'replay.manually' | translate" [help]="'replay.help' | translate:{path: path$ | async}" appAnnotation="replay">
<div class="row">
<div class="col">
<mat-slide-toggle [checked]="settings.replayCaptureManually"
Expand Down Expand Up @@ -46,7 +46,7 @@
</div>
</app-card>

<app-card [title]="'replay.death' | translate" appAnnotation="replay">
<app-card [title]="'replay.death' | translate" [help]="'replay.help' | translate:{path: path$ | async}" appAnnotation="replay">
<div class="row">
<div class="col">
<mat-slide-toggle [checked]="settings.replayCaptureDeath"
Expand Down Expand Up @@ -82,7 +82,7 @@
</div>
</div>
</app-card>
<app-card [title]="'replay.kill' | translate" appAnnotation="replay">
<app-card [title]="'replay.kill' | translate" [help]="'replay.help' | translate:{path: path$ | async}" appAnnotation="replay">
<div class="row">
<div class="col">
<mat-slide-toggle [checked]="settings.replayCaptureKill"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { FeatureSettingsComponent } from '@app/feature';
import { OWReplay } from '@app/odk';
import { ReplayFeatureSettings } from '@modules/replay/replay-feature-settings';
import { Observable } from 'rxjs';

@Component({
selector: 'app-replay-settings',
templateUrl: './replay-settings.component.html',
styleUrls: ['./replay-settings.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ReplaySettingsComponent extends FeatureSettingsComponent<ReplayFeatureSettings> {
export class ReplaySettingsComponent extends FeatureSettingsComponent<ReplayFeatureSettings> implements OnInit {
public path$: Observable<string>;

public displayDuration = (value: number) => `${value}s`;

public ngOnInit(): void {
this.path$ = OWReplay.path();
}

public load(): void { }

public onCaptureChange(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<div class="col">
<div class="title">
<mat-label>{{title | translate}}</mat-label>
<mat-icon *ngIf="help" [matTooltip]="help">help</mat-icon>
</div>
</div>
</div>
Expand Down
16 changes: 16 additions & 0 deletions src/app/shared/module/material/component/card/card.component.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
$help-size: 18px;

::ng-deep {
app-card {
> .mat-card {
padding: 14px 10px;
}

mat-label,
mat-icon {
display: inline-block;
}

.mat-icon {
height: $help-size;
width: $help-size;
font-size: $help-size;
line-height: $help-size;
margin-left: 8px;
vertical-align: text-top;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
export class CardComponent {
@Input()
public title: string;

@Input()
public help: string;
}
1 change: 1 addition & 0 deletions src/assets/i18n/english.json
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@
"capture-error": "The event could not be captured.",
"death": "Death event",
"future-duration": "Future duration",
"help": "Replays are saved at: '{{path}}'\nOld videos are deleted after reaching a size threshold.",
"kill": "Kill event",
"manually": "Manually",
"name": "Replay",
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 @@ -369,6 +369,7 @@
"capture-error": "L'événement n'a pas pu être capturé.",
"death": "Événement de décès",
"future-duration": "Durée future",
"help": "Les rediffusions sont enregistrées à l'adresse: \"{{path}}\"\nLes anciennes vidéos sont supprimées après avoir atteint un seuil de taille.",
"kill": "Tuer l'événement",
"manually": "Manuellement",
"name": "Rejouer",
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 @@ -369,6 +369,7 @@
"capture-error": "Das Ereignis konnte nicht erfasst werden.",
"death": "Todesereignis",
"future-duration": "Zukünftige Dauer",
"help": "Wiederholungen werden gespeichert unter: '{{path}}'\nAlte Videos werden nach Erreichen eines Größenschwellenwerts gelöscht.",
"kill": "Tötungsereignis",
"manually": "Manuell",
"name": "Wiederholung",
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 @@ -369,6 +369,7 @@
"capture-error": "이벤트를 캡처 할 수 없습니다.",
"death": "죽음의 사건",
"future-duration": "향후 기간",
"help": "리플레이는 '{{path}}'에 저장됩니다.\n크기 임계 값에 도달하면 오래된 비디오가 삭제됩니다.",
"kill": "킬 이벤트",
"manually": "수동으로",
"name": "다시 하다",
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 @@ -369,6 +369,7 @@
"capture-error": "Nie można zarejestrować zdarzenia.",
"death": "Zdarzenie śmierci",
"future-duration": "Przyszły czas trwania",
"help": "Powtórki są zapisywane w: „{{path}}”\nStare filmy są usuwane po osiągnięciu progu rozmiaru.",
"kill": "Zabij zdarzenie",
"manually": "ręcznie",
"name": "Powtórna rozgrywka",
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 @@ -369,6 +369,7 @@
"capture-error": "O evento não pôde ser capturado.",
"death": "Evento de morte",
"future-duration": "Duração futura",
"help": "As repetições são salvas em: '{{path}}'\nVídeos antigos são excluídos após atingir um limite de tamanho.",
"kill": "Matar evento",
"manually": "Manualmente",
"name": "Repetir",
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 @@ -369,6 +369,7 @@
"capture-error": "Событие не может быть захвачено.",
"death": "Событие смерти",
"future-duration": "Будущая продолжительность",
"help": "Повторы сохраняются в: '{{path}}'\nСтарые видео удаляются по достижении порогового размера.",
"kill": "Убить событие",
"manually": "вручную",
"name": "переигровка",
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 @@ -369,6 +369,7 @@
"capture-error": "无法捕获该事件。",
"death": "死亡事件",
"future-duration": "未来持续时间",
"help": "重放保存在:'{{path}}'\n达到大小阈值后,旧视频将被删除。",
"kill": "杀死事件",
"manually": "手动地",
"name": "重播",
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 @@ -369,6 +369,7 @@
"capture-error": "El evento no pudo ser capturado.",
"death": "Evento de muerte",
"future-duration": "Duración futura",
"help": "Las repeticiones se guardan en: '{{path}}'\nLos videos antiguos se eliminan después de alcanzar un umbral de tamaño.",
"kill": "Evento de muerte",
"manually": "a mano",
"name": "Repetición",
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 @@ -369,6 +369,7 @@
"capture-error": "ไม่สามารถจับกิจกรรม",
"death": "เหตุการณ์ความตาย",
"future-duration": "อนาคตระยะเวลา",
"help": "การเล่นซ้ำจะถูกบันทึกไว้ที่: \"{{path}}\"\nวิดีโอเก่าจะถูกลบหลังจากถึงเกณฑ์ขนาด",
"kill": "ฆ่าเหตุการณ์",
"manually": "ด้วยมือ",
"name": "เล่นใหม่",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/traditional-chinese.json
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@
"capture-error": "無法獲取該事件。",
"death": "死亡事件",
"future-duration": "未來幾秒內",
"help": "重放保存在:'{{path}}'\n達到大小閾值後,舊視頻將被刪除。",
"kill": "擊殺事件",
"manually": "手動地",
"name": "重播",
Expand Down

0 comments on commit 9c4582c

Please sign in to comment.