Commit 5e48de4d authored by nanahira's avatar nanahira

Merge branch 'v3-refactor3' into v3.1-refresh-ygopro

parents 4966752b 5b96a05c
......@@ -4,6 +4,7 @@ import ini from 'ini';
import fs from 'fs';
import child_process from 'child_process';
import Mustache from 'mustache';
import _ from 'lodash-es';
export enum Category {
game,
......@@ -68,7 +69,9 @@ export class AppStatus {
export interface YGOProDistroData {
deckPath: string;
replayPath: string;
systemConf: string;
systemConf?: string;
lastDeckFormat?: string;
lastCategoryFormat?: string;
}
export class App {
......@@ -366,24 +369,24 @@ export class App {
return this.data.ygopro || undefined;
}
get ygoproDeckPath(): string | undefined {
const distroData = this.ygoproDistroData;
ygoproDeckPath(_distroData: YGOProDistroData): string | undefined {
const distroData = _distroData || this.ygoproDistroData;
if (!distroData) {
return;
}
return path.join(this.local!.path, distroData.deckPath);
}
get ygoproReplayPath(): string | undefined {
const distroData = this.ygoproDistroData;
ygoproReplayPath(_distroData: YGOProDistroData): string | undefined {
const distroData = _distroData || this.ygoproDistroData;
if (!distroData || !distroData.replayPath) {
return;
}
return path.join(this.local!.path, distroData.replayPath);
}
get systemConfPath(): string | undefined {
const distroData = this.ygoproDistroData;
systemConfPath(_distroData: YGOProDistroData): string | undefined {
const distroData = _distroData || this.ygoproDistroData;
if (!distroData || !distroData.systemConf) {
return;
}
......
......@@ -26,17 +26,14 @@
</div>
<div class="col-sm-8 input-group input-group-sm">
<label i18n class="input-group-text" id="basic-addon1">卡组</label>
<select class="form-select form-select-sm" id="exampleSelect1" name="deck" [(ngModel)]="current_deck">
<option *ngFor="let deck of decks_grouped['.']" [value]="deck">{{deck}}</option>
<ng-container *ngFor="let group of decks_grouped | keyvalue">
<optgroup *ngIf="group.key !== '.'" [label]='group.key'>
<option *ngFor="let deck of group.value" [value]="group.key + '/' + deck">{{deck}}</option>
</optgroup>
</ng-container>
<select class="form-select form-select-sm" id="exampleSelect1" name="deck" [(ngModel)]="currentDeckSymbol" (change)="onDeckChange()">
<optgroup *ngFor="let group of decks_grouped" [label]="group[0] === '.' ? '未分类卡组' : group[0]">
<option *ngFor="let deck of group[1]" [value]="deck.symbol">{{deck.deck}}</option>
</optgroup>
</select>
<span class="input-group-btn">
<button id="edit_deck_button" i18n [disabled]="!appsService.allReady(app)" class="btn btn-secondary btn-sm" (click)="edit_deck(current_deck)">编辑</button>
</span>
<button id="edit_deck_button" i18n [disabled]="!appsService.allReady(app)" class="btn btn-secondary btn-sm" (click)="edit_deck()">编辑</button>
</span>
</div>
</div>
......@@ -124,10 +121,10 @@
<small i18n class="form-text text-muted">最多 12 个字</small>
</ng-container>
<ng-template #private>
<label *ngIf="room.private" for="game-create-title"><i class="fa fa-key" aria-hidden="true"></i>
<label *ngIf="room.private" for="game-create-password"><i class="fa fa-key" aria-hidden="true"></i>
<span i18n>房间密码</span></label>
<div class="input-group input-group-sm">
<input type="text" maxlength="12" class="form-control" id="game-create-title" name="title" [(ngModel)]="host_password" readonly>
<input type="text" maxlength="12" class="form-control" id="game-create-password" name="title" [(ngModel)]="host_password" readonly>
<span i18n-title id="copy-wrapper" class="input-group-btn" data-bs-toggle="tooltip" title="房间密码已复制到剪贴板">
<button i18n-title class="btn btn-secondary fa fa-clipboard" type="button" title="复制" (click)="copy(host_password, $event)"></button>
</span>
......
This diff is collapsed.
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