Commit 0ed4dbd6 authored by 神楽坂玲奈's avatar 神楽坂玲奈

achievements

parent 56940564
...@@ -13,10 +13,8 @@ import { CubesService } from './cubes.service'; ...@@ -13,10 +13,8 @@ import { CubesService } from './cubes.service';
import { SettingsService } from './settings.sevices'; import { SettingsService } from './settings.sevices';
import { LoginService } from './login.service'; import { LoginService } from './login.service';
import { DownloadService } from './download.service'; import { DownloadService } from './download.service';
import { AuthGuard } from './auth.guard';
import { ProgressSpinnerComponent } from './progress-spinner/progress-spinner.component'; import { ProgressSpinnerComponent } from './progress-spinner/progress-spinner.component';
import { CommunityComponent } from './community/community.component'; import { CommunityComponent } from './community/community.component';
import { LoadingGuard } from './loading.guard';
import { UpdateComponent } from './update/update.component'; import { UpdateComponent } from './update/update.component';
import { WindowControlComponent } from './window-control/window-control.component'; import { WindowControlComponent } from './window-control/window-control.component';
import { CubeActionsComponent } from './cube-actions/cube-actions.component'; import { CubeActionsComponent } from './cube-actions/cube-actions.component';
...@@ -29,6 +27,7 @@ import { ELECTRON_SCHEMA } from 'electron-schema'; ...@@ -29,6 +27,7 @@ import { ELECTRON_SCHEMA } from 'electron-schema';
import { MaotamaComponent } from './maotama/maotama.component'; import { MaotamaComponent } from './maotama/maotama.component';
import { ProfileComponent } from './profile/profile.component'; import { ProfileComponent } from './profile/profile.component';
import { RoutingService } from './routing.sevices'; import { RoutingService } from './routing.sevices';
import { CubeAchievementsComponent } from './cube-achievements/cube-achievements.component';
@NgModule({ @NgModule({
imports: [BrowserModule, FormsModule, ReactiveFormsModule, HttpModule], imports: [BrowserModule, FormsModule, ReactiveFormsModule, HttpModule],
...@@ -37,7 +36,7 @@ import { RoutingService } from './routing.sevices'; ...@@ -37,7 +36,7 @@ import { RoutingService } from './routing.sevices';
CubeDetailComponent, RosterComponent, YGOProComponent, CandyComponent, CubeDetailComponent, RosterComponent, YGOProComponent, CandyComponent,
ProgressSpinnerComponent, CommunityComponent, UpdateComponent, WindowControlComponent, ProgressSpinnerComponent, CommunityComponent, UpdateComponent, WindowControlComponent,
CubeActionsComponent, CubeArenaComponent, CubeDescriptionComponent, CubeNewsComponent, CubeExpansionsComponent, CubeActionsComponent, CubeArenaComponent, CubeDescriptionComponent, CubeNewsComponent, CubeExpansionsComponent,
ProgressBarComponent, MaotamaComponent, ProfileComponent ProgressBarComponent, MaotamaComponent, ProfileComponent, CubeAchievementsComponent
], ],
bootstrap: [MoeCubeComponent], bootstrap: [MoeCubeComponent],
providers: [ providers: [
......
/**
* Created by zh99998 on 16/9/2.
*/
import { Component, Input } from '@angular/core';
import { Cube } from '../cube';
@Component({
selector: 'cube-achievements',
templateUrl: './cube-achievements.component.html',
styleUrls: ['./cube-achievements.component.css'],
})
export class CubeAchievementsComponent {
@Input()
currentCube: Cube;
}
<ng-container *ngIf="currentCube"> <ng-container *ngIf="currentCube">
<cube-actions [currentCube]="currentCube" class="panel"></cube-actions> <cube-actions [currentCube]="currentCube" class="panel"></cube-actions>
<cube-achievements *ngIf="currentCube.useAchievements()" [currentCube]="currentCube" class="panel"></cube-achievements>
<cube-arena *ngIf="currentCube.useArena()" [currentCube]="currentCube" class="panel"></cube-arena> <cube-arena *ngIf="currentCube.useArena()" [currentCube]="currentCube" class="panel"></cube-arena>
<cube-description *ngIf="currentCube.useDescription()" [currentCube]="currentCube"></cube-description> <cube-description *ngIf="currentCube.useDescription()" [currentCube]="currentCube"></cube-description>
<cube-news *ngIf="currentCube.useNews()" [currentCube]="currentCube" class="panel"></cube-news> <cube-news *ngIf="currentCube.useNews()" [currentCube]="currentCube" class="panel"></cube-news>
......
...@@ -35,6 +35,7 @@ export class Cube { ...@@ -35,6 +35,7 @@ export class Cube {
// 宣传片 // 宣传片
trailer: { url: string, type: 'video' | 'image', url2?: string }[]; trailer: { url: string, type: 'video' | 'image', url2?: string }[];
achievements: { name: string, description: string, unlocked: boolean, unlocked_at: Date }[];
static downloadUrl(app: Cube, platform: string, locale: string): string { static downloadUrl(app: Cube, platform: string, locale: string): string {
if (app.id === 'ygopro') { if (app.id === 'ygopro') {
...@@ -144,6 +145,10 @@ export class Cube { ...@@ -144,6 +145,10 @@ export class Cube {
return this.useRun() && !!this.actions.get('custom'); return this.useRun() && !!this.actions.get('custom');
} }
useAchievements(): boolean {
return this.achievements.length > 0;
}
progressMessage(): string | undefined { progressMessage(): string | undefined {
return this.status.progressMessage; return this.status.progressMessage;
} }
...@@ -178,6 +183,7 @@ export class Cube { ...@@ -178,6 +183,7 @@ export class Cube {
this.key = app.key; this.key = app.key;
this.trailer = app.trailer || []; this.trailer = app.trailer || [];
this.achievements = app.achievements || [];
// { url: 'http://cdn.edgecast.steamstatic.com/steam/apps/2036126/movie480.webm', type: 'video', url2:''}, // { url: 'http://cdn.edgecast.steamstatic.com/steam/apps/2036126/movie480.webm', type: 'video', url2:''},
// { // {
// url: 'http://cdn.edgecast.steamstatic.com/steam/apps/264710/ss_e41e71c05f3fcf08e54140bd9f1ffc9008706843.600x338.jpg', // url: 'http://cdn.edgecast.steamstatic.com/steam/apps/264710/ss_e41e71c05f3fcf08e54140bd9f1ffc9008706843.600x338.jpg',
...@@ -272,7 +278,7 @@ export class CubeLocal { ...@@ -272,7 +278,7 @@ export class CubeLocal {
for (let [k, v] of Object.entries(this.files)) { for (let [k, v] of Object.entries(this.files)) {
t[k] = v; t[k] = v;
} }
return {path: this.path, version: this.version, files: t}; return { path: this.path, version: this.version, files: t };
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment