Commit 8ad7dc2b authored by wudizhanche1000's avatar wudizhanche1000

Merge remote-tracking branch 'origin/v3' into v3

# Conflicts:
#	app/app-detail.component.html
#	app/install.service.ts
parents e001cc3e 5b048477
......@@ -10,3 +10,5 @@
/.idea/
.DS_Store
Thumbs.db
messages.xlf
messages.xlf.bak
\ No newline at end of file
......@@ -8,7 +8,7 @@ dist: trusty
sudo: required
env:
npm_config_target: 1.4.5
npm_config_target: '$(npm show electron version)'
npm_config_arch: x64
npm_config_target_arch: x64
npm_config_disturl: https://atom.io/download/atom-shell
......@@ -29,11 +29,12 @@ cache:
- $HOME/.cache
before_install:
- env
- openssl aes-256-cbc -K $encrypted_9f35b7f09ebe_key -iv $encrypted_9f35b7f09ebe_iv -in ssh-key.enc -out $HOME/.ssh/id_ecdsa -d
- chmod 600 $HOME/.ssh/id_ecdsa
install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir -p bin; curl -L https://github.com/aria2/aria2/releases/download/release-1.27.1/aria2-1.27.1-osx-darwin.tar.bz2 | tar --strip-components=2 -C bin -jxf - aria2-1.27.1/bin/aria2c; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir -p bin; curl --location --retry 5 https://github.com/aria2/aria2/releases/download/release-1.27.1/aria2-1.27.1-osx-darwin.tar.bz2 | tar --strip-components=2 -C bin -jxf - aria2-1.27.1/bin/aria2c; fi
- npm install
- npm prune
......
......@@ -70,7 +70,23 @@ export class App {
conference: string | undefined;
isInstalled(): boolean {
return !!this.local;
return this.status.status != 'init';
}
isReady(): boolean {
return this.status.status == 'ready';
}
isInstalling(): boolean {
return this.status.status == 'installing';
}
isWaiting(): boolean {
return this.status.status == 'waiting';
}
isDownloading(): boolean {
return this.status.status === "downloading";
}
runable() {
......
......@@ -146,6 +146,7 @@ export class AppsService {
let apps: App[] = [];
let dependencies = app.findDependencies();
apps.push(...dependencies, app);
console.log(apps);
let downloadPath = path.join(option.installLibrary, 'downloading');
let tasks: Promise<any>[] = [];
for (let a of apps) {
......
......@@ -28,6 +28,10 @@ a {
padding: 10px 20px 10px 20px;
}
a:focus, a:hover {
text-decoration: none;
}
.active {
background-color: #428bca;
}
......@@ -42,4 +46,69 @@ span {
.actions {
margin-bottom: 1em;
}
.progress {
height: 1em;
width: 1em;
float: right;
margin: 14px;
position: relative;
}
.pie {
height: 100%;
width: 100%;
clip: rect(0, 1em, 1em, 0.5em);
left: 0;
position: absolute;
top: 0;
}
.half-circle {
height: 100%;
width: 100%;
border: 0.2em solid #3498db;
border-radius: 50%;
clip: rect(0, 0.5em, 1em, 0);
left: 0;
position: absolute;
top: 0;
}
.shadow {
height: 100%;
width: 100%;
border: 0.2em solid #bdc3c7;
border-radius: 50%;
}
.right-side {
display: none;
}
.half-circle {
/*border-color: #e74c3c;*/
border-color: rgb(0, 116, 217);
}
.left-side {
/*transform: rotate(1turn);*/
/*在前台用Angular填写*/
}
.second-half {
clip: rect(auto, auto, auto, auto);
}
.second-half > .right-side {
display: inherit;
transform: rotate(0.5turn);
}
.fa-spin {
margin: 14px;
color: #0275d8;
font-weight: bold;
float: right;
}
\ No newline at end of file
<!-- Begin page content -->
<div id="main">
<div id="apps" *ngIf="apps">
<span *ngIf="grouped_apps.installed">已安装</span>
<ul *ngIf="grouped_apps.installed" class="nav nav-sidebar">
<li *ngFor="let app of grouped_apps.installed" [class.active]="app===currentApp">
<i *ngIf="!app.isReady() && !app.status.total" class="spin fa fa-circle-o-notch fa-spin fa-fw"></i>
<div *ngIf="!app.isReady() && app.status.total" class="progress">
<div class="pie" [class.second-half]="app.status.progress/app.status.total>0.5">
<div class="left-side half-circle" [style.transform]="'rotate('+(app.status.progress/app.status.total).toString()+'turn)'"></div>
<div class="right-side half-circle"></div>
</div>
<div class="shadow"></div>
</div>
<a (click)="chooseApp(app)" href="#">{{app.name}}</a>
</li>
</ul>
<span *ngIf="grouped_apps.recommend">推荐</span>
<ul *ngIf="grouped_apps.recommend" class="nav nav-sidebar">
<li *ngFor="let app of grouped_apps.recommend" [class.active]="app===currentApp">
<a (click)="chooseApp(app)" href="#">{{app.name}}</a>
<progress *ngIf="app.status.status === 'downloading'"
class="progress progress-striped progress-animated"
value="{{app.status.progress}}"
max="{{app.status.total}}"></progress>
</li>
</ul>
<span *ngIf="grouped_apps.yugioh">游戏王</span>
<ul *ngIf="grouped_apps.yugioh" class="nav nav-sidebar">
<li *ngFor="let app of grouped_apps.yugioh" [class.active]="app===currentApp">
<span *ngIf="grouped_apps.mysterious">迷之物体</span>
<ul *ngIf="grouped_apps.mysterious" class="nav nav-sidebar">
<li *ngFor="let app of grouped_apps.mysterious" [class.active]="app===currentApp">
<a (click)="chooseApp(app)" href="#">{{app.name}}</a>
<progress *ngIf="app.status.status === 'downloading'"
class="progress progress-striped progress-animated"
......@@ -47,4 +59,5 @@
<app-detail *ngIf="currentApp" [currentApp]="currentApp"></app-detail>
<roster></roster>
</div>
<webview *ngIf="currentApp" #candy id="candy" [src]="candy_url" nodeintegration></webview>
:host {
height: 100%;
display: flex;
flex-direction: column;
}
nav {
-webkit-app-region: drag;
padding-right: 0;
flex-shrink: 0;
}
nav a, nav i, nav img {
-webkit-app-region: no-drag;
}
nav.darwin {
padding-left: 80px;
}
.navbar-right {
float: right
}
.navbar-right > div, #user > .item {
float: left;
margin: 0 0.5rem;
}
.page {
flex-grow: 1;
/*margin-bottom: 60px;*/
......@@ -50,25 +21,19 @@ nav.darwin {
text-decoration: none;
}
.item:hover {
color: #fff;
}
a {
cursor: default;
}
#window-buttons > i {
color: rgba(255, 255, 255, .75);
margin: .5rem;
#update-status > i {
line-height: 1.5;
color: #eceeef;
padding-top: .425rem;
padding-bottom: .425rem;
}
li > a:hover, #window-buttons > i:hover {
.item:hover, li > a:hover {
color: #fff;
}
.navbar {
border-radius: initial;
a {
cursor: default;
}
/* https://github.com/electron/electron/issues/7661#event-827104990 */
......
<nav class="navbar navbar-dark bg-inverse" [class.darwin]="platform == 'darwin'">
<nav id="navbar" class="navbar navbar-dark bg-inverse">
<a class="navbar-brand" href="#">MyCard</a>
<ul class="nav navbar-nav">
<li *ngIf="!loginService.logged_in" class="nav-item active">
......@@ -17,12 +17,18 @@
</li>
</ul>
<div class="navbar-right">
<div id="update-status">
<i #error [hidden]="update_status != 'error'" (click)="update_retry()" class="fa fa-exclamation-circle" data-toggle="tooltip" title="更新出错,点击重试"></i>
<i #checking_for_update [hidden]="update_status != 'checking-for-update'" class="fa fa-spinner fa-pulse fa-spin" data-toggle="tooltip" title="正在检查更新"></i>
<i #update_available [hidden]="update_status != 'update-available'" class="fa fa-refresh fa-spin" data-toggle="tooltip" title="正在下载更新"></i>
<i #update_downloaded [hidden]="update_status != 'update-downloaded'" (click)="update_install()" class="fa fa-angle-double-up" data-toggle="tooltip" title="下载更新完成,点击安装"></i>
</div>
<div id="user" *ngIf="loginService.logged_in">
<a href="#" class="profile"><img id="avatar" [src]="loginService.user.avatar_url" alt="image"></a>
<a href="#" class="profile item" id="username">{{loginService.user.username}}</a>
<a i18n href="#" (click)="loginService.logout()" class="item">切换账号</a>
</div>
<div id="window-buttons" *ngIf="platform != 'darwin'">
<div id="window-buttons">
<i (click)="currentWindow.minimize()" class="fa fa-minus"></i>
<i *ngIf="!currentWindow.isMaximized()" (click)="currentWindow.maximize()" class="fa fa-expand"></i>
<i *ngIf="currentWindow.isMaximized()" (click)="currentWindow.unmaximize()" class="fa fa-clone"></i>
......@@ -33,4 +39,4 @@
<login class="page" *ngIf="!loginService.logged_in"></login>
<store class="page" *ngIf="loginService.logged_in" [hidden]="currentPage != 'store'"></store>
<lobby class="page" *ngIf="loginService.logged_in" [hidden]="currentPage != 'lobby'"></lobby>
<webview class="page" *ngIf="loginService.logged_in" [hidden]="currentPage != 'community'" src="https://ygobbs.com"></webview>
\ No newline at end of file
<webview class="page" *ngIf="loginService.logged_in" [hidden]="currentPage != 'community'" src="https://ygobbs.com"></webview>
import {Component, Renderer, ChangeDetectorRef, OnInit} from "@angular/core";
import {Component, Renderer, ChangeDetectorRef, OnInit, ElementRef, ViewChild} from "@angular/core";
import {remote} from "electron";
import {LoginService} from "./login.service";
const autoUpdater: Electron.AutoUpdater = remote.getGlobal('autoUpdater');
declare const $: any;
@Component({
moduleId: module.id,
......@@ -11,16 +11,31 @@ const autoUpdater: Electron.AutoUpdater = remote.getGlobal('autoUpdater');
styleUrls: ['mycard.component.css'],
})
export class MyCardComponent implements OnInit {
currentPage: string = "lobby";
platform = process.platform;
update_status: string | undefined;
update_error: string | undefined;
currentWindow = remote.getCurrentWindow();
window = window;
ngOnInit() {
@ViewChild('error')
error: ElementRef;
@ViewChild('checking_for_update')
checking_for_update: ElementRef;
@ViewChild('update_available')
update_available: ElementRef;
@ViewChild('update_downloaded')
update_downloaded: ElementRef;
update_elements: Map<string, ElementRef>;
ngOnInit() {
this.update_elements = new Map(Object.entries({
'error': this.error,
'checking-for-update': this.checking_for_update,
'update-available': this.update_available,
'update-downloaded': this.update_downloaded
}));
}
constructor(private renderer: Renderer, private loginService: LoginService, private ref: ChangeDetectorRef) {
......@@ -29,23 +44,49 @@ export class MyCardComponent implements OnInit {
// // Do something with 'event'
// });
this.currentWindow.on('maximize', () => ref.detectChanges());
this.currentWindow.on('unmaximize', () => ref.detectChanges());
this.currentWindow.on('maximize', () => this.ref.detectChanges());
this.currentWindow.on('unmaximize', () => this.ref.detectChanges());
autoUpdater.on('error', (error) => {
console.log('autoUpdater', 'error', error.message)
this.set_update_status('error');
});
autoUpdater.on('checking-for-update', () => {
console.log('autoUpdater', 'checking-for-update')
this.set_update_status('checking-for-update');
});
autoUpdater.on('update-available', () => {
console.log('autoUpdater', 'update-available')
this.set_update_status('update-available');
});
autoUpdater.on('update-not-available', () => {
console.log('autoUpdater', 'update-not-available')
this.set_update_status('update-not-available');
});
autoUpdater.on('update-downloaded', (event) => {
console.log('autoUpdater', 'update-downloaded')
this.set_update_status('update-downloaded');
});
}
update_retry() {
autoUpdater.checkForUpdates()
}
update_install() {
autoUpdater.quitAndInstall()
}
set_update_status(status: string) {
console.log('autoUpdater', status);
if (this.update_status) {
let element = this.update_elements.get(this.update_status);
if (element) {
$(element.nativeElement).tooltip('dispose')
}
}
this.update_status = status;
this.ref.detectChanges();
let element = this.update_elements.get(this.update_status);
if (element) {
$(element.nativeElement).tooltip({placement: 'bottom', container: 'body'})
}
}
}
<form class="form-inline actions">
<div class="form-group">
<label for="exampleSelect1">卡组</label>
<label i18n for="exampleSelect1">卡组</label>
<select class="form-control" id="exampleSelect1" name="deck" [(ngModel)]="current_deck">
<option *ngFor="let deck of decks" [ngValue]="deck">{{deck}}</option>
</select>
</div>
<button type="submit" class="btn btn-secondary" (click)="edit_deck(current_deck)">编辑</button>
<button type="submit" (click)="delete_deck(current_deck)" class="btn btn-secondary">删除</button>
<button type="submit" (click)="refresh()" class="btn btn-secondary">刷新</button>
<button i18n type="submit" class="btn btn-secondary" (click)="edit_deck(current_deck)">编辑</button>
<button i18n type="submit" (click)="delete_deck(current_deck)" class="btn btn-secondary">删除</button>
<button i18n types="submit" (click)="refresh()" class="btn btn-secondary">刷新</button>
</form>
<div class="actions">
<button (click)="request_match('athletic')" *ngIf="matching_arena != 'athletic'" [disabled]="matching" type="button" class="btn btn-primary">竞技匹配</button>
<button (click)="cancel_match()" *ngIf="matching_arena == 'athletic'" type="button" class="btn btn-primary">取消等待</button>
<button (click)="request_match('entertain')" *ngIf="matching_arena != 'entertain'" [disabled]="matching" type="button" class="btn btn-secondary">娱乐匹配</button>
<button (click)="cancel_match()" *ngIf="matching_arena == 'entertain'" type="button" class="btn btn-secondary">取消等待</button>
<button [disabled]="matching" type="button" class="btn btn-secondary" data-toggle="modal" data-target="#game-create-modal">创建房间</button>
<button [disabled]="matching" type="button" class="btn btn-secondary" data-toggle="modal" data-target="#game-list-modal">房间列表</button>
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#game-create-windbot">单人模式</button>
<button i18n (click)="request_match('athletic')" *ngIf="matching_arena != 'athletic'" [disabled]="matching" type="button" class="btn btn-primary">竞技匹配</button>
<button i18n (click)="cancel_match()" *ngIf="matching_arena == 'athletic'" type="button" class="btn btn-primary">取消等待</button>
<button i18n (click)="request_match('entertain')" *ngIf="matching_arena != 'entertain'" [disabled]="matching" type="button" class="btn btn-secondary">娱乐匹配</button>
<button i18n (click)="cancel_match()" *ngIf="matching_arena == 'entertain'" type="button" class="btn btn-secondary">取消等待</button>
<button i18n [disabled]="matching" type="button" class="btn btn-secondary" data-toggle="modal" data-target="#game-create-modal">创建房间</button>
<button i18n [disabled]="matching" type="button" class="btn btn-secondary" data-toggle="modal" data-target="#game-list-modal">房间列表</button>
<button i18n type="button" class="btn btn-secondary" data-toggle="modal" data-target="#game-create-windbot">单人模式</button>
</div>
<div class="modal fade" id="game-create-windbot" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
......@@ -30,13 +30,13 @@
<h4 class="modal-title" id="myModalLabel1">单人模式</h4>
</div>
<div class="modal-body">
<label>选择对手</label>
<label i18n>选择对手</label>
<div id="windbot" class="list-group">
<a *ngFor="let name of windbot" href="#" class="list-group-item" (click)="join_windbot(name)">{{name}}</a>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button i18n type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
</div>
</div>
</div>
......@@ -49,54 +49,54 @@
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel">创建房间</h4>
<h4 class="modal-title" i18n id="myModalLabel">创建房间</h4>
</div>
<form id="game-create" (submit)="create_room(room)">
<div class="modal-body">
<div class="form-group row">
<label for="game-create-title" class="col-sm-2 form-control-label">游戏标题</label>
<label for="game-create-title" i18n class="col-sm-2 form-control-label">游戏标题</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="game-create-title" name="title" [(ngModel)]="room.title">
</div>
</div>
<div class="form-group row">
<label for="game-create-rule" class="col-sm-2 form-control-label">卡片允许</label>
<label i18n for="game-create-rule" class="col-sm-2 form-control-label">卡片允许</label>
<div class="col-sm-10">
<select class="form-control" id="game-create-rule" name="rule" [(ngModel)]="room.rule">
<option value="0">OCG</option>
<option value="1">TCG</option>
<option value="2">OCG & TCG</option>
<option value="3">专有卡禁止</option>
<option i18n value="0">OCG</option>
<option i18n value="1">TCG</option>
<option i18n value="2">OCG & TCG</option>
<option i18n value="3">专有卡禁止</option>
</select>
</div>
</div>
<div class="form-group row">
<label for="game-create-mode" class="col-sm-2 form-control-label">决斗模式</label>
<label for="game-create-mode" i18n class="col-sm-2 form-control-label">决斗模式</label>
<div class="col-sm-10">
<select class="form-control" id="game-create-mode" name="mode" [(ngModel)]="room.mode">
<option value="0">单局模式</option>
<option value="1">比赛模式</option>
<option value="2">TAG</option>
<option i18n value="0">单局模式</option>
<option i18n value="1">比赛模式</option>
<option i18n value="2">TAG</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 form-control-label">额外选项</label>
<label i18n class="col-sm-2 form-control-label">额外选项</label>
<div class="col-sm-5">
<div class="row">
<label for="game-create-start-lp" class="col-sm-6 form-control-label">初始 LP</label>
<label i18n for="game-create-start-lp" class="col-sm-6 form-control-label">初始 LP</label>
<div class="col-sm-6">
<input name="start_lp" type="number" value="8000" min="1" max="65536" class="form-control form-control-sm game-create-extra" id="game-create-start-lp" [(ngModel)]="room.start_lp">
</div>
</div>
<div class="row">
<label for="game-create-start-hand" class="col-sm-6 form-control-label">初始手牌数</label>
<label i18n for="game-create-start-hand" class="col-sm-6 form-control-label">初始手牌数</label>
<div class="col-sm-6">
<input name="start_hand" type="number" value="5" min="0" max="16" class="form-control form-control-sm game-create-extra" id="game-create-start-hand" [(ngModel)]="room.start_hand">
</div>
</div>
<div class="row">
<label for="game-create-draw-count" class="col-sm-6 form-control-label">每回合抽卡</label>
<label i18n for="game-create-draw-count" class="col-sm-6 form-control-label">每回合抽卡</label>
<div class="col-sm-6">
<input name="draw_count" type="number" value="1" min="0" max="16" class="form-control form-control-sm game-create-extra" id="game-create-draw-count" [(ngModel)]="room.draw_count">
</div>
......@@ -104,18 +104,13 @@
</div>
<div class="col-sm-5">
<div class="checkbox">
<label>
<input name="enable_priority" type="checkbox" [(ngModel)]="room.enable_priority">允许启动效果优先权
</label>
<label i18n>允许启动效果优先权</label><input name="enable_priority" type="checkbox" [(ngModel)]="room.enable_priority">
</div>
<div class="checkbox">
<label> <input name="no_check_deck" type="checkbox" [(ngModel)]="room.no_check_deck">不检查卡组
</label>
<label i18n>不检查卡组</label><input name="no_check_deck" type="checkbox" [(ngModel)]="room.no_check_deck">
</div>
<div class="checkbox">
<label>
<input name="no_shuffle_deck" type="checkbox" [(ngModel)]="room.no_shuffle_deck">开局不洗卡组
</label>
<label i18n>开局不洗卡组</label><input name="no_shuffle_deck" type="checkbox" [(ngModel)]="room.no_shuffle_deck">
</div>
</div>
</div>
......@@ -131,10 +126,9 @@
</div>-->
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary float-left" data-dismiss="modal" data-toggle="modal" data-target="#game-list-modal">查看房间
</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="submit" class="btn btn-primary">创建</button>
<button i18n type="button" class="btn btn-secondary float-left" data-dismiss="modal" data-toggle="modal" data-target="#game-list-modal">查看房间</button>
<button i18n type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button i18n type="submit" class="btn btn-primary">创建</button>
</div>
</form>
</div>
......@@ -146,10 +140,10 @@
<table class="table table-striped table-hover">
<thead class="modal-header">
<tr>
<th class="title">游戏标题</th>
<th class="users">玩家</th>
<th class="mode">决斗模式</th>
<th class="extra">额外选项</th>
<th i18n class="title">游戏标题</th>
<th i18n class="users">玩家</th>
<th i18n class="mode">决斗模式</th>
<th i18n class="extra">额外选项</th>
</tr>
</thead>
<tbody class="modal-body">
......@@ -162,12 +156,12 @@
<td class="mode">{{{'0': '单局模式', '1': '比赛模式', '2': 'TAG'}[room.mode]}}</td>
<td class="extra">
<span *ngIf="room.rule != default_options.rule">{{{'0': 'OCG', '1': 'TCG', '2': 'O/T', '3': '专有卡禁止'}[room.rule]}}</span>
<span *ngIf="room.start_lp != default_options.start_lp">{{room.start_lp}} LP</span>
<span *ngIf="room.start_hand != default_options.start_hand">{{room.start_hand}} 初始</span>
<span *ngIf="room.draw_count != default_options.draw_count">{{room.draw_count}} 抽卡</span>
<span *ngIf="room.enable_priority != default_options.enable_priority">优先权</span>
<span *ngIf="room.no_check_deck != default_options.no_check_deck">不检查</span>
<span *ngIf="room.no_shuffle_deck != default_options.no_shuffle_deck">不洗卡</span>
<span i18n *ngIf="room.start_lp != default_options.start_lp">{{room.start_lp}} LP</span>
<span i18n *ngIf="room.start_hand != default_options.start_hand">{{room.start_hand}} 初始</span>
<span i18n *ngIf="room.draw_count != default_options.draw_count">{{room.draw_count}} 抽卡</span>
<span i18n *ngIf="room.enable_priority != default_options.enable_priority">优先权</span>
<span i18n *ngIf="room.no_check_deck != default_options.no_check_deck">不检查</span>
<span i18n *ngIf="room.no_shuffle_deck != default_options.no_shuffle_deck">不洗卡</span>
</td>
</tbody>
</table>
......@@ -175,9 +169,8 @@
<span aria-hidden="true">&times;</span>
</button>
<div class="modal-footer">
<button type="button" class="btn btn-secondary float-left" data-dismiss="modal" data-toggle="modal" data-target="#game-create-modal">创建房间
</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button i18n type="button" class="btn btn-secondary float-left" data-dismiss="modal" data-toggle="modal" data-target="#game-create-modal">创建房间</button>
<button i18n type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
</div>
</div>
</div>
......
......@@ -2039,7 +2039,7 @@
},
"category": "game",
"tags": [
"yugioh"
"recommend"
],
"dependencies": {
"win32": [],
......@@ -2075,7 +2075,7 @@
},
"news": [
{
"url": "#",
"url": "https://ygobbs.com",
"image": "http://pic.4j4j.cn/upload/pic/20140327/af650cf463.jpg",
"title": "News Title",
"text": "喵喵喵喵"
......@@ -2145,7 +2145,7 @@
},
"category": "game",
"tags": [
"yugioh"
"mysterious"
],
"dependencies": {
"win32": [
......
......@@ -11,7 +11,7 @@ environment:
secure: itZ9Z1dxEpfPJLdTs/PiY98pVZ3GCLNWfid7eAu7SL88Jl9AIrf/3rviKFEbsnoY
CSC_LINK:
secure: e/N0WdbNfjyG8NR62JW2rGtKswMD/IzBxa7NSraefp0yIY/20zYpx99/a9xJLRK1LtzhgnMLmlGsWH8BdaJIli8xCA5wKd/flnIdLmA9jSiFY5gEWesdVWEIi2a8bskYdDrn6APytn4ltRMNInd1mE9grD8oJmadYz+e2J/QoFbaJMN+ixhNcQbXlS0As1lOz2VvbjePXcuGRpBQTMe83cNcmT1wW5Vnk1a7qLJRDyh6B1rgiVrQAvjNyUqyGuL71GRbQlw+o4MkZZs4iM6kjTjbBRjMCULl4WwmJwccqAdV89VpNgLPBfiL35iFIQIHO+M26+l+NcEJ4cyAr2BuwBZpcX2JaehzcXbaQWqX7ygnL8alUgMq5VWifvz78d1PMEMmVlAw9tlMBAIpaaZvXE/h9AzdqXtu+xuDi34O3UZWLb5MtTZXmeRk3wwdH2GlIvhS+FfwgfoYN374c3XpJ2utR44puuCiM85ikfmAKL2lrE7Z6+DO+NrSX0zHyctf1kpwv+L2IksNF13RiU2/EQULaes5X7psKRzggHGrO15oLhfOKDpheOQztvgCBAWgOAiTHDOOpiPm1lIPZZk1UKub0zQJHnbgtrgFFOjHe1UtGAg66nzj3tuSckOLQ0/mrEOICKN/eslUcsKfC7EjOnhmiJVe4tnMO4/baXgkJ+pM1HD1BAO0VDxHGxDfLwypsE/KoqM9DDREqPbLoXFWKe50QtsTC/Yk/bwYcdDt2IEVQQjapgyJSfGplBWrE2odXk1pAR+SMnBFn3RLBtxYcnT1JOOO8ZAqbSs+lAb6sDJ3wNuI0x5VwPIMjzKMGjpowNUUGoC43onmCLxvru6t4vrQUCuE21A584Jmyqzn6/k9ON05Slz9DYzNiySyOWeCzuD+hxK3CrztyGSnnywR8tD+uv4k7krGHeqRCshSQ6OqdfqQ+dpjOz0fS3xSvGb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42gxvRrKJi/eSVRmEjIBenkgqGRvm14KIxQZ+ga+dJc1qXh3nCbQsp2zWsCr513T3JFF2zHRdfKXWF4uYIQA0Z1irM/zeqcqQNjkF1GxA6ASpbD7+0ekDgmknqR0efWbpby/fo7Sr1MLez8Amhtga2EPSxkWHASpBRrGfAQ0q+HcLcfvAME5kcDvgOIG5ZkCFxj7OG5fCuy2AIEuMRdsvWMbjdqw2+qN5e4IgpzBe25iZ/Xqll7BPCDPwlExyVdiqm3WU3hkNC2kRZUKDmpMG6e7ZFaUohNz13Mq6z3oTrTTbefIkNj7Ft9uQIntOR8fVwvRVhQDNu4IgyZk/VW4cKb8QtrZShDQPM0x2XeHk+lUmPGHImVrh4OB3F9TliRuAK+mj2b0xQhb0H7W2+de5AgiwIbwPaKif/gCxJ5H2x1lGSBTq98OnBZ7SDf3E/YwhwviNRYlVfXSlk+HgJdI98Dn4kQ9WWAI8UD1JaVJnm4X2d56Gw8R44ho6eNhxwjUVi300hyvy4RbzXymShNUghCMU6oxtoaZMT8HNmuUHuqem5sgs/9/9hJqVhGzicCw3TNng9yX+Lyf3S+faGkeC9FTlJP12fzX0/P7WYgLsQQoTV4GhZo2qZtpQgsz/byoAoueoS4iy2MQdBApBt1YG4U9e6MsrXvIWHsTzT0+zXUT6obnb4pc2TCMzHN0YQEzppgkLVr+2l1GCylITq35nT5LQIPZOclQ7QN2zfswXZcXgqwzu2ptNKb4WfdmAccdrJH37/W5kxt5rTeyNKQx5mo9qa2XnXXH9NhnfWRxynYh+ggwagy0leNNyLFZTjl5gnphQwXm/bFtEf2cSGddAu9RqqCPxe2Q==
npm_config_target: 1.4.5
# npm_config_target: 1.4.10 # 在下面 install 里动态获取
npm_config_arch: ia32
npm_config_target_arch: ia32
npm_config_disturl: https://atom.io/download/atom-shell
......@@ -19,9 +19,9 @@ environment:
npm_config_build_from_source: true
cache:
- node_modules
- '%APPDATA%\npm-cache'
- '%USERPROFILE%\.electron'
- node_modules -> package.json
- '%APPDATA%\npm-cache -> package.json'
- '%USERPROFILE%\.electron -> package.json'
shallow_clone: true
......@@ -34,14 +34,16 @@ init:
install:
- set PATH=%PATH%;C:\MinGW\msys\1.0\bin # tar xz
- mkdir -p bin
- curl -L -o aria2-1.28.0-win-32bit-build1.zip https://github.com/aria2/aria2/releases/download/release-1.28.0/aria2-1.28.0-win-32bit-build1.zip
- curl --location --retry 5 --output aria2-1.28.0-win-32bit-build1.zip https://github.com/aria2/aria2/releases/download/release-1.28.0/aria2-1.28.0-win-32bit-build1.zip
- unzip -o aria2-1.28.0-win-32bit-build1.zip aria2-1.28.0-win-32bit-build1/aria2c.exe
- mv aria2-1.28.0-win-32bit-build1/aria2c.exe bin
- rm -rf aria2-1.28.0-win-32bit-build1 aria2-1.27.1-win-32bit-build1.zip
- curl -L 'http://downloads.sourceforge.net/project/msys2/REPOS/MSYS2/i686/bsdtar-3.2.1-1-i686.pkg.tar.xz' | tar --strip-components=2 -C bin -Jxf - usr/bin/bsdtar.exe
- curl -L 'http://downloads.sourceforge.net/project/msys2/Base/i686/msys2-base-i686-20161025.tar.xz' | tar --strip-components=3 -C bin -Jxf - msys32/usr/bin/msys-2.0.dll msys32/usr/bin/msys-bz2-1.dll msys32/usr/bin/msys-gcc_s-1.dll msys32/usr/bin/msys-iconv-2.dll msys32/usr/bin/msys-lzma-5.dll msys32/usr/bin/msys-lzo2-2.dll msys32/usr/bin/msys-nettle-6.dll msys32/usr/bin/msys-xml2-2.dll msys32/usr/bin/msys-z.dll msys32/usr/bin/sha256sum.exe msys32/usr/bin/msys-intl-8.dll
- curl --location --retry 5 'http://downloads.sourceforge.net/project/msys2/REPOS/MSYS2/i686/bsdtar-3.2.1-1-i686.pkg.tar.xz' | tar --strip-components=2 -C bin -Jxf - usr/bin/bsdtar.exe
- curl --location --retry 5 'http://downloads.sourceforge.net/project/msys2/Base/i686/msys2-base-i686-20161025.tar.xz' | tar --strip-components=3 -C bin -Jxf - msys32/usr/bin/msys-2.0.dll msys32/usr/bin/msys-bz2-1.dll msys32/usr/bin/msys-gcc_s-1.dll msys32/usr/bin/msys-iconv-2.dll msys32/usr/bin/msys-lzma-5.dll msys32/usr/bin/msys-lzo2-2.dll msys32/usr/bin/msys-nettle-6.dll msys32/usr/bin/msys-xml2-2.dll msys32/usr/bin/msys-z.dll msys32/usr/bin/sha256sum.exe msys32/usr/bin/msys-intl-8.dll
- ps: Install-Product node
- npm show electron version > %temp%\electron-version.txt
- set /p npm_config_target= < %temp%\electron-version.txt
- npm install
- npm prune
......
......@@ -7,6 +7,11 @@
<link rel="shortcut icon" href="res/img/favicon.png" type="image/gif"/>
<link rel="stylesheet" type="text/css" href="libs.min.css"/>
<link rel="stylesheet" type="text/css" href="res/default.css"/>
<style>
body {
font-family: -apple-system, Arial, 'Source Sans Pro', "Microsoft YaHei", 'Microsoft JhengHei', "WenQuanYi Micro Hei", sans-serif;
}
</style>
<script>delete module.exports</script>
<script type="text/javascript" src="../node_modules/jquery/dist/jquery.min.js"></script>
......
......@@ -23,11 +23,32 @@
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script>
System.import('app')
System.import('app').catch((error) => {
$('#loading').hide();
$('#failed').removeAttr('hidden');
$('#error').removeAttr('hidden').text(error);
});
</script>
</head>
<body>
<mycard>Loading...</mycard>
<mycard>
<nav id="navbar" class="navbar navbar-dark bg-inverse">
<a class="navbar-brand" href="#">MyCard</a>
<div class="navbar-right">
<div id="window-buttons">
<i onclick="window.close()" class="fa fa-times"></i>
</div>
</div>
</nav>
<div id="loading">MyCard <span id="version"></span> Loading...</div>
<div id="failed" hidden>发生了错误,请复制以下错误信息并联系 support@mycard.moe</div>
<pre id="error" hidden></pre>
</mycard>
<script>
document.body.classList.add(process.platform);
document.getElementById('version').innerHTML = require('electron').remote.app.getVersion();
</script>
</body>
</html>
'use strict';
const {ipcMain, app, BrowserWindow} = require('electron');
const {ipcMain, app, shell, BrowserWindow} = require('electron');
const {autoUpdater} = require("electron-auto-updater");
const isDev = require('electron-is-dev');
const child_process = require('child_process');
const path = require('path');
if (process.platform == 'darwin') {
try {
autoUpdater.setFeedURL("https://wudizhanche.mycard.moe/update/darwin/" + app.getVersion());
} catch (err) {
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow;
// 单实例
const shouldQuit = app.makeSingleInstance((commandLine, workingDirectory) => {
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {
if (mainWindow.isMinimized()) {
mainWindow.restore()
}
mainWindow.focus()
}
})
if (shouldQuit) {
app.quit()
}
global.autoUpdater = autoUpdater;
// 调试模式
if (!process.env['NODE_ENV']) {
process.env['NODE_ENV'] = isDev ? 'development' : 'production'
}
// 自动更新
let updateWindow;
global.autoUpdater = autoUpdater;
if (process.env['NODE_ENV'] == 'production' && process.platform == 'darwin') {
autoUpdater.setFeedURL("https://wudizhanche.mycard.moe/update/darwin/" + app.getVersion());
}
// else{
// setTimeout(()=>{
// autoUpdater.emit('checking-for-update')
// }, 5000)
// setTimeout(()=>{
// autoUpdater.emit('error', '1')
// }, 6000)
// }
autoUpdater.on('error', (event) => {
console.log('autoUpdater', 'error', event);
});
......@@ -26,27 +55,22 @@ autoUpdater.on('update-available', () => {
autoUpdater.on('update-not-available', () => {
console.log('autoUpdater', 'update-not-available');
});
let updateWindow;
autoUpdater.on('update-downloaded', (event) => {
console.log('autoUpdater', 'update-downloaded', event);
updateWindow = new BrowserWindow({
width: 640,
height: 480,
});
updateWindow.loadURL(`file://${__dirname}/update.html`);
updateWindow.on('closed', function () {
updateWindow = null
});
ipcMain.on('update', (event, arg) => {
autoUpdater.quitAndInstall()
})
});
// 处理提权
function handleElevate() {
// for debug
......@@ -73,32 +97,36 @@ function handleElevate() {
return true;
}
}
if (handleElevate()) {
return;
}
// Aria2c
function createAria2c() {
let aria2c_path;
switch (process.platform) {
case 'win32':
aria2c_path = path.join(process.resourcesPath, 'bin', 'aria2c.exe');
if (process.env['NODE_ENV'] == 'production') {
aria2c_path = path.join(process.resourcesPath, 'bin', 'aria2c.exe');
} else {
aria2c_path = path.join('bin', 'aria2c.exe');
}
break;
case 'darwin':
aria2c_path = path.join(process.resourcesPath, 'bin', 'aria2c');
if (process.env['NODE_ENV'] == 'production') {
aria2c_path = path.join(process.resourcesPath, 'bin', 'aria2c');
} else {
aria2c_path = path.join('bin', 'aria2c');
}
break;
default:
throw 'unsupported platform';
}
return child_process.spawn(aria2c_path, ['--enable-rpc', '--rpc-allow-origin-all', "--continue", "--split=10", "--min-split-size=1M", "--max-connection-per-server=10"], {stdio: 'ignore'});
}
const aria2c = createAria2c();
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow;
// 主窗口
function createWindow() {
// Create the browser window.
mainWindow = new BrowserWindow({
......@@ -111,8 +139,15 @@ function createWindow() {
// and load the index.html of the app.
mainWindow.loadURL(`file://${__dirname}/index.html`);
mainWindow.webContents.on('new-window', function(e, url) {
e.preventDefault();
shell.openExternal(url);
});
// Open the DevTools.
mainWindow.webContents.openDevTools();
if (process.env['NODE_ENV'] == 'development') {
mainWindow.webContents.openDevTools();
}
// Emitted when the window is closed.
mainWindow.on('closed', function () {
......@@ -128,7 +163,9 @@ function createWindow() {
// Some APIs can only be used after this event occurs.
app.on('ready', () => {
createWindow();
setTimeout(autoUpdater.checkForUpdates, 2000);
if (process.env['NODE_ENV'] == 'production') {
setTimeout(autoUpdater.checkForUpdates, 2000);
}
});
// Quit when all windows are closed.
......
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" ?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="zh-CN" datatype="plaintext" original="ng2.template">
<body>
<trans-unit id="fbfb7c4354663a67786aa5aee748d1f38b8fe71c" datatype="html">
<source>游戏</source>
<target>Library</target>
</trans-unit>
<trans-unit id="c4fc2b3584e7581cddb08bb1ebfa41e601195d5b" datatype="html">
<source>社区</source>
<target>Community</target>
</trans-unit>
<trans-unit id="8422ff34db177236e8f54d415b07c972284c36bf" datatype="html">
<source>切换账号</source>
<target>Change Account</target>
</trans-unit>
<trans-unit id="a8cae935472a05e1c8c9be436bb7b1bdea96a54a" datatype="html">
<source>安装</source>
<target>Install</target>
</trans-unit>
<trans-unit id="e6194d8a9c8da57b667847cd80f1da563f2c2b1e" datatype="html">
<source>导入</source>
<target>Import</target>
</trans-unit>
<trans-unit id="2fe99d94b20d6f8aba7814d8657037ec9d69d36c" datatype="html">
<source>正在安装...</source>
<target>Installing...</target>
</trans-unit>
<trans-unit id="e5ee7e692c816893b6fd2f9375e6d8303cd794cd" datatype="html">
<source>等待安装...</source>
<target>Pending...</target>
</trans-unit>
<trans-unit id="d3852e0147360b29d0d6076e95dd1ad0098a60db" datatype="html">
<source>运行</source>
<target>Start</target>
</trans-unit>
<trans-unit id="67adbad4f646bb8e1c440522bafea8fe5f7e6bfd" datatype="html">
<source>设置</source>
<target>Custom</target>
</trans-unit>
<trans-unit id="3d6cad40e26f99e39bc6f5925a890ba83b67ce5b" datatype="html">
<source>联机</source>
<target>Network</target>
</trans-unit>
<trans-unit id="5eadb60473a54773298ee679a4ce6a19d9c2f31c" datatype="html">
<source>复制</source>
<target>Copy</target>
</trans-unit>
<trans-unit id="95d5e106e679433bec012420b1ab9334c294bc7e" datatype="html">
<source>选择服务器</source>
<target>Select Server</target>
</trans-unit>
<trans-unit id="63346eb53d54138db02c1713ae58f73bb1b8786f" datatype="html">
<source>新闻</source>
<target>News</target>
</trans-unit>
<trans-unit id="b1c134df688af90e436e49f6d3e9f6960f9497c6" datatype="html">
<source>了解更多</source>
<target>More Info</target>
</trans-unit>
<trans-unit id="3ebbe3f1c691ec3184ac8c7a5f360706501e6b50" datatype="html">
<source>名称</source>
<target>Name</target>
</trans-unit>
<trans-unit id="d58ff4f339ad18d82b08fb0615ba8c1cf373a4a2" datatype="html">
<source>操作</source>
<target>Action</target>
</trans-unit>
<trans-unit id="e090f6d9d8129a7b8b92387f05f37eb4b44c0b4e" datatype="html">
<source>卸载</source>
<target>Uninstall</target>
</trans-unit>
<trans-unit id="8d0792a89fc399aafb40cc1228cb8c04a2056883" datatype="html">
<source>本地文件</source>
<target>Local Files</target>
</trans-unit>
<trans-unit id="628c76783ac32e6c8b2ea9134397b8cb82a82cd6" datatype="html">
<source>浏览本地文件</source>
<target>Browse</target>
</trans-unit>
<trans-unit id="6d582ed48c57c91fc7cf10f36f3869cd33808d1d" datatype="html">
<source>校验完整性</source>
<target>Verify integrity</target>
</trans-unit>
<trans-unit id="4809edca33b1a07d7d6e8905287d3825e676f2c8" datatype="html">
<source>安装 <x id="INTERPOLATION"/></source>
<target>Install <x id="INTERPOLATION"/></target>
</trans-unit>
<trans-unit id="f8e60167c7a0871ccf40ed2a0750311411dfd665" datatype="html">
<source>即将开始安装 <x id="INTERPOLATION"/></source>
<target>Preparing Install <x id="INTERPOLATION"/></target>
</trans-unit>
<trans-unit id="63a6c9b023e9e9f8ddfba70b0e24931008fa2510" datatype="html">
<source>安装位置</source>
<target>Path</target>
</trans-unit>
<trans-unit id="0b96c54bf810c6deb2c32253bf16b86d3c90da94" datatype="html">
<source>快捷方式</source>
<target>Shortcuts</target>
</trans-unit>
<trans-unit id="8aa0a41ee6809b972d3904d96607ba5e6dc48fd9" datatype="html">
<source>创建 LaunchPad 快捷方式</source>
<target>Create Launchpad Shortcut</target>
</trans-unit>
<trans-unit id="da32e99069864644f0419f67858d93815e029b02" datatype="html">
<source>创建开始菜单快捷方式</source>
<target>Create Start Menu Shortcut</target>
</trans-unit>
<trans-unit id="d8a2d9a9f8854ad118381e6e30a41dc1959a4f0b" datatype="html">
<source>创建桌面快捷方式</source>
<target>Create Desktop Shortcut</target>
</trans-unit>
<trans-unit id="2ba33dd61b1ac70666322680f248e5336b3ee69a" datatype="html">
<source>依赖:</source>
<target>Dependencies</target>
</trans-unit>
</body>
</file>
</xliff>
<file datatype="plaintext" original="ng2.template" source-language="zh-CN" target-language="en-US">
<body>
<trans-unit datatype="html" id="fbfb7c4354663a67786aa5aee748d1f38b8fe71c">
<source>游戏</source>
<target>Library</target>
</trans-unit>
<trans-unit datatype="html" id="c4fc2b3584e7581cddb08bb1ebfa41e601195d5b">
<source>社区</source>
<target>Community</target>
</trans-unit>
<trans-unit datatype="html" id="8422ff34db177236e8f54d415b07c972284c36bf">
<source>切换账号</source>
<target>Change Account</target>
</trans-unit>
<trans-unit datatype="html" id="a8cae935472a05e1c8c9be436bb7b1bdea96a54a">
<source>安装</source>
<target>Install</target>
</trans-unit>
<trans-unit datatype="html" id="e6194d8a9c8da57b667847cd80f1da563f2c2b1e">
<source>导入</source>
<target>Import</target>
</trans-unit>
<trans-unit datatype="html" id="2fe99d94b20d6f8aba7814d8657037ec9d69d36c">
<source>正在安装...</source>
<target>Installing...</target>
</trans-unit>
<trans-unit datatype="html" id="e5ee7e692c816893b6fd2f9375e6d8303cd794cd">
<source>等待安装...</source>
<target>Pending...</target>
</trans-unit>
<trans-unit datatype="html" id="d3852e0147360b29d0d6076e95dd1ad0098a60db">
<source>运行</source>
<target>Start</target>
</trans-unit>
<trans-unit datatype="html" id="67adbad4f646bb8e1c440522bafea8fe5f7e6bfd">
<source>设置</source>
<target>Custom</target>
</trans-unit>
<trans-unit datatype="html" id="3d6cad40e26f99e39bc6f5925a890ba83b67ce5b">
<source>联机</source>
<target>Network</target>
</trans-unit>
<trans-unit datatype="html" id="5eadb60473a54773298ee679a4ce6a19d9c2f31c">
<source>复制</source>
<target>Copy</target>
</trans-unit>
<trans-unit datatype="html" id="95d5e106e679433bec012420b1ab9334c294bc7e">
<source>选择服务器</source>
<target>Select Server</target>
</trans-unit>
<trans-unit datatype="html" id="63346eb53d54138db02c1713ae58f73bb1b8786f">
<source>新闻</source>
<target>News</target>
</trans-unit>
<trans-unit datatype="html" id="b1c134df688af90e436e49f6d3e9f6960f9497c6">
<source>了解更多</source>
<target>More Info</target>
</trans-unit>
<trans-unit datatype="html" id="3ebbe3f1c691ec3184ac8c7a5f360706501e6b50">
<source>名称</source>
<target>Name</target>
</trans-unit>
<trans-unit datatype="html" id="d58ff4f339ad18d82b08fb0615ba8c1cf373a4a2">
<source>操作</source>
<target>Action</target>
</trans-unit>
<trans-unit datatype="html" id="e090f6d9d8129a7b8b92387f05f37eb4b44c0b4e">
<source>卸载</source>
<target>Uninstall</target>
</trans-unit>
<trans-unit datatype="html" id="8d0792a89fc399aafb40cc1228cb8c04a2056883">
<source>本地文件</source>
<target>Local Files</target>
</trans-unit>
<trans-unit datatype="html" id="628c76783ac32e6c8b2ea9134397b8cb82a82cd6">
<source>浏览本地文件</source>
<target>Browse</target>
</trans-unit>
<trans-unit datatype="html" id="6d582ed48c57c91fc7cf10f36f3869cd33808d1d">
<source>校验完整性</source>
<target>Verify integrity</target>
</trans-unit>
<trans-unit datatype="html" id="4809edca33b1a07d7d6e8905287d3825e676f2c8">
<source>安装 <x id="INTERPOLATION"/></source>
<target>Install <x id="INTERPOLATION"/></target>
</trans-unit>
<trans-unit datatype="html" id="f8e60167c7a0871ccf40ed2a0750311411dfd665">
<source>即将开始安装 <x id="INTERPOLATION"/></source>
<target>Preparing Installation
<x id="INTERPOLATION"/>
</target>
</trans-unit>
<trans-unit datatype="html" id="63a6c9b023e9e9f8ddfba70b0e24931008fa2510">
<source>安装位置</source>
<target>Path</target>
</trans-unit>
<trans-unit datatype="html" id="0b96c54bf810c6deb2c32253bf16b86d3c90da94">
<source>快捷方式</source>
<target>Shortcuts</target>
</trans-unit>
<trans-unit datatype="html" id="8aa0a41ee6809b972d3904d96607ba5e6dc48fd9">
<source>创建 LaunchPad 快捷方式</source>
<target>Create Launchpad Shortcut</target>
</trans-unit>
<trans-unit datatype="html" id="da32e99069864644f0419f67858d93815e029b02">
<source>创建开始菜单快捷方式</source>
<target>Create Start Menu Shortcut</target>
</trans-unit>
<trans-unit datatype="html" id="d8a2d9a9f8854ad118381e6e30a41dc1959a4f0b">
<source>创建桌面快捷方式</source>
<target>Create Desktop Shortcut</target>
</trans-unit>
<trans-unit datatype="html" id="2af1068491573803bc4756c4f94a689155370d9c">
<source>扩展内容</source>
<target>Expansion</target>
</trans-unit>
<trans-unit datatype="html" id="2ba33dd61b1ac70666322680f248e5336b3ee69a">
<source>依赖:</source>
<target>Dependencies</target>
</trans-unit>
<trans-unit datatype="html" id="def237147323023c1f5ce0579345da19d4707fdb">
<source>卡组</source>
<target>Deck</target>
</trans-unit>
<trans-unit datatype="html" id="a842d4536fdee499a55c753c50810254347ced32">
<source>编辑</source>
<target>Edit</target>
</trans-unit>
<trans-unit datatype="html" id="08254f4ac965519b9a0befb43fd82bd6fa72a7af">
<source>删除</source>
<target>Delete</target>
</trans-unit>
<trans-unit datatype="html" id="a9f9a37033c904e50f9920798cf02b0f3ccd8270">
<source>刷新</source>
<target>Refresh</target>
</trans-unit>
<trans-unit datatype="html" id="86738bd5d32223ffbb690a7c71360ddf8e7b1b2e">
<source>竞技匹配</source>
<target>Ranked Match</target>
</trans-unit>
<trans-unit datatype="html" id="37869c115276c5df476f1f5aae75c099ffb35b59">
<source>取消等待</source>
<target>Cancel</target>
</trans-unit>
<trans-unit datatype="html" id="0bf938a69dc640aba46428d1cbbd2fef34c88daa">
<source>娱乐匹配</source>
<target>Unranked Match</target>
</trans-unit>
<trans-unit datatype="html" id="19923836b1ae79614782426a7a001d8ccfa27b5c">
<source>创建房间</source>
<target>Custom Game</target>
</trans-unit>
<trans-unit datatype="html" id="c54a3c40a2766446dd03b0af75f64055aa404855">
<source>房间列表</source>
<target>Game List</target>
</trans-unit>
<trans-unit datatype="html" id="3768b60a7e2625bb1fc2db37eb8c6b8e4bd99101">
<source>单人模式</source>
<target>Single Mode</target>
</trans-unit>
<trans-unit datatype="html" id="1e64bb9c96dfc2b9cb03179dd0c9f992e0645e5f">
<source>选择对手</source>
<target>Select Opponent</target>
</trans-unit>
<trans-unit datatype="html" id="f6f3be110e7043e3cfe71a7bd75b8b3be79bff5d">
<source>取消</source>
<target>Cancel</target>
</trans-unit>
<trans-unit datatype="html" id="e35d1bf7c735e8df55a62046cd2d9f820bf5bffd">
<source>游戏标题</source>
<target>Title</target>
</trans-unit>
<trans-unit datatype="html" id="4b911deaa4defd0803635012281f3dd1112aabd1">
<source>卡片允许</source>
<target>Rule</target>
</trans-unit>
<trans-unit datatype="html" id="93d3b6bb4f3a66efd8c49f9063f6c8d6a9e959bf">
<source>OCG</source>
<target>OCG</target>
</trans-unit>
<trans-unit datatype="html" id="150cb34526cf737163beb63ab76e4809ac1367dd">
<source>TCG</source>
<target>TCG</target>
</trans-unit>
<trans-unit datatype="html" id="be6d109c359b1d11b261280915e6b1706ca3ed9b">
<source>OCG &amp; TCG</source>
<target>TCG/OCG</target>
</trans-unit>
<trans-unit datatype="html" id="2a3f48f9ea5e6aae92e249ac2b279dbc07a6127d">
<source>专有卡禁止</source>
<target>Unspecified</target>
</trans-unit>
<trans-unit datatype="html" id="d62a2717a0381d996785271c61177711777ba63c">
<source>决斗模式</source>
<target>Duel mode</target>
</trans-unit>
<trans-unit datatype="html" id="e436a4a0da03320dc61ba35bfab390ab85a23d0c">
<source>单局模式</source>
<target>Single Duel</target>
</trans-unit>
<trans-unit datatype="html" id="2cf71acc936cf244cc5862b28efe461e91cb137d">
<source>比赛模式</source>
<target>Match</target>
</trans-unit>
<trans-unit datatype="html" id="c2ed31e132c305b995382adce0f95ccdabadaa21">
<source>TAG</source>
<target>TAG</target>
</trans-unit>
<trans-unit datatype="html" id="d4038dd5d0e9d5139d425fc7bea40e40d965cc5b">
<source>额外选项</source>
<target>Additional Options</target>
</trans-unit>
<trans-unit datatype="html" id="01cfbee3f1d69f5adae299b7b8c8d75034aef53b">
<source>初始 LP</source>
<target>Starting LP</target>
</trans-unit>
<trans-unit datatype="html" id="0d72e50857f1d2504e08f7886d4c9d35a46e3ed9">
<source>初始手牌数</source>
<target>Starting Hand</target>
</trans-unit>
<trans-unit datatype="html" id="88cc5676c5322fd55c1df94ab487359100e6f9dd">
<source>每回合抽卡</source>
<target>Draw per Turn</target>
</trans-unit>
<trans-unit datatype="html" id="e405d8c7feb2bed82f3f0667657fa4ab668ae015">
<source>允许启动效果优先权</source>
<target>Effect priority during Summon</target>
</trans-unit>
<trans-unit datatype="html" id="6e7470ddf4c35f6fab39b6ebeadb1780701a5469">
<source>不检查卡组</source>
<target>Don't check</target>
</trans-unit>
<trans-unit datatype="html" id="0320acff078b039f2220bb385586cd2e24392bbb">
<source>开局不洗卡组</source>
<target>Don't shuffle</target>
</trans-unit>
<trans-unit datatype="html" id="c17e9385db80e1881f37dda25d109b115a2843b3">
<source>查看房间</source>
<target>View rooms</target>
</trans-unit>
<trans-unit datatype="html" id="f8ae23b4314929573cf0e815ccc12d70486dd74f">
<source>创建</source>
<target>Create</target>
</trans-unit>
<trans-unit datatype="html" id="3872a823a98042e4730861ab6f9344239d9deeb6">
<source>玩家</source>
<target>Player</target>
</trans-unit>
<trans-unit datatype="html" id="4baa1360b4d635000fc5e14a6e7376f46ace0bd9">
<source><x id="INTERPOLATION"/> LP</source>
<target>
<x id="INTERPOLATION"/>
LP
</target>
</trans-unit>
<trans-unit datatype="html" id="1939517ea2b4ff337ce2847302fbcc6f1217d269">
<source><x id="INTERPOLATION"/> 初始</source>
<target>
<x id="INTERPOLATION"/>
Starting
</target>
</trans-unit>
<trans-unit datatype="html" id="a19d6d5a2c74d9df73936a17b5c71b2069051b49">
<source><x id="INTERPOLATION"/> 抽卡</source>
<target>
<x id="INTERPOLATION"/>
Draw
</target>
</trans-unit>
<trans-unit datatype="html" id="be32d8fb22f36c3b2c1530e91f2ca07d108c8abe">
<source>优先权</source>
<target>Priority</target>
</trans-unit>
<trans-unit datatype="html" id="b5be173f96718dfa737f1da31d9ffab5b803561e">
<source>不检查</source>
<target>Don't check</target>
</trans-unit>
<trans-unit datatype="html" id="517c8b6e5361bc32d7458a1e8b2bdbf09abb6f01">
<source>不洗卡</source>
<target>Don't shuffle</target>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
{
"name": "mycard",
"version": "3.0.0-dev.10",
"version": "3.0.0-dev.12",
"description": "mycard",
"keywords": [],
"author": "zh99998 <zh99998@gmail.com>",
......@@ -12,7 +12,7 @@
"pack": "tsc && build --dir",
"dist": "tsc && build",
"tsc": "tsc",
"i18n": "ng-xi18n"
"i18n": "ng-xi18n && sed -i.bak 's/source-language=\"en\"/source-language=\"zh-CN\"/' messages.xlf"
},
"dependencies": {
"@angular/common": "latest",
......@@ -24,22 +24,24 @@
"@angular/platform-browser-dynamic": "latest",
"@angular/router": "latest",
"angular-in-memory-web-api": "latest",
"systemjs": "latest",
"aria2": "latest",
"bootstrap": "next",
"core-js": "latest",
"reflect-metadata": "latest",
"rxjs": "5.0.0-beta.12",
"zone.js": "^0.6.26",
"electron-auto-updater": "latest",
"electron-cookies": "latest",
"electron-is-dev": "latest",
"electron-sudo": "mycard/electron-sudo#mycard",
"jquery": "latest",
"tether": "latest",
"bootstrap": "next",
"font-awesome": "latest",
"aria2": "latest",
"ini": "latest",
"jquery": "latest",
"mkdirp": "latest",
"raw-socket": "latest"
"raw-socket": "latest",
"reflect-metadata": "latest",
"rxjs": "5.0.0-beta.12",
"systemjs": "mycard/systemjs#mycard",
"systemjs-plugin-text": "latest",
"tether": "latest",
"zone.js": "^0.6.26"
},
"devDependencies": {
"@angular/compiler-cli": "latest",
......@@ -75,6 +77,7 @@
]
},
"dmg": {
"format": "ULFO",
"contents": [
{
"x": 448,
......
......@@ -5,3 +5,46 @@ html, body {
body {
font-family: -apple-system, Arial, 'Source Sans Pro', "Microsoft YaHei", 'Microsoft JhengHei', "WenQuanYi Micro Hei", sans-serif;
}
mycard {
height: 100%;
display: flex;
flex-direction: column;
}
.darwin #window-buttons {
display: none;
}
#window-buttons > i {
color: rgba(255, 255, 255, .75);
margin: .5rem;
}
#window-buttons > i:hover {
color: #fff;
}
#navbar {
-webkit-app-region: drag;
padding-right: 0;
flex-shrink: 0;
border-radius: initial;
}
#navbar a, #navbar i, #navbar img {
-webkit-app-region: no-drag;
}
#navbar .navbar-right {
float: right
}
#navbar .navbar-right > div, #user > .item {
float: left;
margin: 0 0.5rem;
}
.darwin #navbar {
padding-left: 80px;
}
\ No newline at end of file
/*
SystemJS Text plugin from
https://github.com/systemjs/plugin-text/blob/master/text.js
*/
exports.translate = function(load) {
if (this.builder && this.transpiler) {
load.metadata.format = 'esm';
return 'exp' + 'ort var __useDefault = true; exp' + 'ort default ' + JSON.stringify(load.source) + ';';
}
load.metadata.format = 'amd';
return 'def' + 'ine(function() {\nreturn ' + JSON.stringify(load.source) + ';\n});';
}
......@@ -13,7 +13,7 @@ System.config({
app: 'app',
// systemjs plugins
'text': 'systemjs-text-plugin.js',
'text': 'npm:systemjs-plugin-text/text.js',
// angular bundles
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
......
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