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

1. 游戏列表、聊天室可拖拽 (实际上上一版就发了,忘了说,这一版拖拽大小加上了限制)

2. YGOPro 国际化聊天室
3. 窗口拖拽大小限制 (最小默认1024x640)
4. 修复一个导致在游戏详情页面滚动失效的bug
5. 修复英文排位成绩显示为中文的bug
6. 修复竞技负场数据显示为娱乐负场数据的bug
parent 614288d5
:host { :host {
/*background-color: #c3d9ff;*/
flex-grow: 1; flex-grow: 1;
position: relative; position: relative;
}
#background {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
filter: grayscale(50%) opacity(10%);
background-repeat: no-repeat;
background-size: 100% auto;
}
.scroll {
padding: 1rem 1rem 0 1rem; padding: 1rem 1rem 0 1rem;
height: 100%; background-blend-mode: color;
}
.actions {
margin-bottom: 1rem;
} }
.list-group { .list-group {
......
<div *ngIf="currentApp.background" id="background" [style.background-image]="'url(' + currentApp.background + ')'"></div> <div id="main" class="panel">
<div class="scroll">
<div id="main" class="panel">
<img *ngIf="currentApp.cover" id="icon" class="rounded" [src]="currentApp.cover"> <img *ngIf="currentApp.cover" id="icon" class="rounded" [src]="currentApp.cover">
<div id="right"> <div id="right">
<h1>{{currentApp.name}}</h1> <h1>{{currentApp.name}}</h1>
...@@ -27,7 +25,8 @@ ...@@ -27,7 +25,8 @@
<!--应用ready--> <!--应用ready-->
<div *ngIf="currentApp.isReady() && (currentApp.id != 'ygopro')"> <div *ngIf="currentApp.isReady() && (currentApp.id != 'ygopro')">
<button *ngIf="currentApp.runnable()" (click)="runApp(currentApp)" [disabled]="!appsService.allReady(currentApp)" type="button" class="btn btn-primary btn-sm"><i class="fa fa-play" aria-hidden="true"></i> <span i18n>运行</span></button> <button *ngIf="currentApp.runnable()" (click)="runApp(currentApp)" [disabled]="!appsService.allReady(currentApp)" type="button" class="btn btn-primary btn-sm">
<i class="fa fa-play" aria-hidden="true"></i> <span i18n>运行</span></button>
<button i18n *ngIf="currentApp.runnable() && currentApp.actions.get('custom')" [disabled]="!appsService.allReady(currentApp)" (click)="custom(currentApp)" type="button" class="btn btn-secondary btn-sm">设置</button> <button i18n *ngIf="currentApp.runnable() && currentApp.actions.get('custom')" [disabled]="!appsService.allReady(currentApp)" (click)="custom(currentApp)" type="button" class="btn btn-secondary btn-sm">设置</button>
<div id="network" *ngIf="currentApp.network && currentApp.network.protocol == 'maotama'"> <div id="network" *ngIf="currentApp.network && currentApp.network.protocol == 'maotama'">
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
...@@ -49,90 +48,60 @@ ...@@ -49,90 +48,60 @@
<ygopro *ngIf="currentApp.isReady() && (currentApp.id == 'ygopro')" [app]="currentApp" [currentApp]="currentApp" (points)="onPoints($event)"></ygopro> <ygopro *ngIf="currentApp.isReady() && (currentApp.id == 'ygopro')" [app]="currentApp" [currentApp]="currentApp" (points)="onPoints($event)"></ygopro>
</div> </div>
</div> </div>
<!--{"exp":1839,"exp_rank":"9","pt":2207.2901,"arena_rank":"30","win":"703","lose":"568","draw":5,"all":"1276","ratio":"55.09"}--> <!--{"exp":1839,"exp_rank":"9","pt":2207.2901,"arena_rank":"30","win":"703","lose":"568","draw":5,"all":"1276","ratio":"55.09"}-->
<div id="arena" class="panel panel-default" *ngIf="points"> <div id="arena" class="panel panel-default" *ngIf="points">
<h2 i18n>排位成绩</h2> <h2 i18n>排位成绩</h2>
<table class="table table-sm"> <table class="table table-sm">
<tbody> <tbody>
<tr> <tr>
<th>竞技排名</th> <th i18n>竞技排名</th>
<td>{{points.arena_rank}}</td> <td>{{points.arena_rank}}</td>
<th>娱乐排名</th> <th i18n>娱乐排名</th>
<td>{{points.exp_rank}}</td> <td>{{points.exp_rank}}</td>
</tr> </tr>
<tr> <tr>
<th>竞技胜率</th> <th i18n>竞技胜率</th>
<td>{{points.athletic_wl_ratio}}%</td> <td>{{points.athletic_wl_ratio}}%</td>
<th>经验</th> <th i18n>经验</th>
<td>{{points.exp}}</td> <td>{{points.exp}}</td>
</tr> </tr>
<tr> <tr>
<th>胜场</th> <th i18n>胜场</th>
<td>{{points.athletic_win}}</td> <td>{{points.athletic_win}}</td>
<th>胜场</th> <th i18n>胜场</th>
<td>{{points.entertain_win}}</td> <td>{{points.entertain_win}}</td>
</tr> </tr>
<tr> <tr>
<th>负场</th> <th i18n>负场</th>
<td>{{points.entertain_lose}}</td> <td>{{points.athletic_win}}</td>
<th>负场</th> <th i18n>负场</th>
<td>{{points.entertain_lose}}</td> <td>{{points.entertain_lose}}</td>
</tr> </tr>
<tr> <tr>
<th>平局</th> <th i18n>平局</th>
<td>{{points.athletic_draw}}</td> <td>{{points.athletic_draw}}</td>
<th>平局</th> <th i18n>平局</th>
<td>{{points.entertain_draw}}</td> <td>{{points.entertain_draw}}</td>
</tr> </tr>
<tr> <tr>
<th>总场</th> <th i18n>总场</th>
<td>{{points.athletic_all}}</td> <td>{{points.athletic_all}}</td>
<th>总场</th> <th i18n>总场</th>
<td>{{points.entertain_all}}</td> <td>{{points.entertain_all}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<a i18n href="https://mycard.moe/ygopro/arena/" target="_blank" class="moreinfo">更多资料</a> <a i18n href="https://mycard.moe/ygopro/arena/" target="_blank" class="moreinfo">更多资料</a>
</div> </div>
<!--<div *ngIf="points" class="row">--> <!--<div *ngIf="points" class="row">--><!--<dl class="col-4 row">--><!--<dt i18n class="col-8">竞技排名</dt>--><!--<dd class="col-4">{{points.arena_rank}}</dd>--><!--<dt i18n class="col-8">竞技胜率</dt>--><!--<dd class="col-4">{{points.athletic_wl_ratio}}%</dd>--><!--<dt i18n class="col-8">胜场</dt>--><!--<dd class="col-4">{{points.athletic_win}}</dd>--><!--<dt i18n class="col-8">负场</dt>--><!--<dd class="col-4">{{points.athletic_lose}}</dd>--><!--<dt i18n class="col-8">平局</dt>--><!--<dd class="col-4">{{points.athletic_draw}}</dd>--><!--<dt i18n class="col-8">总场</dt>--><!--<dd class="col-4">{{points.athletic_all}}</dd>--><!--</dl>--><!--<dl class="col-4 row">--><!--<dt i18n class="col-8">娱乐排名</dt>--><!--<dd class="col-4">{{points.exp_rank}}</dd>--><!--<dt i18n class="col-8">经验</dt>--><!--<dd class="col-4">{{points.exp}}</dd>--><!--<dt i18n class="col-8">胜场</dt>--><!--<dd class="col-4">{{points.entertain_win}}</dd>--><!--<dt i18n class="col-8">负场</dt>--><!--<dd class="col-4">{{points.entertain_lose}}</dd>--><!--<dt i18n class="col-8">平局</dt>--><!--<dd class="col-4">{{points.entertain_draw}}</dd>--><!--<dt i18n class="col-8">总场</dt>--><!--<dd class="col-4">{{points.entertain_all}}</dd>--><!--</dl>--><!--</div>-->
<!--<dl class="col-4 row">-->
<!--<dt i18n class="col-8">竞技排名</dt>-->
<!--<dd class="col-4">{{points.arena_rank}}</dd>-->
<!--<dt i18n class="col-8">竞技胜率</dt>-->
<!--<dd class="col-4">{{points.athletic_wl_ratio}}%</dd>-->
<!--<dt i18n class="col-8">胜场</dt>-->
<!--<dd class="col-4">{{points.athletic_win}}</dd>-->
<!--<dt i18n class="col-8">负场</dt>-->
<!--<dd class="col-4">{{points.athletic_lose}}</dd>-->
<!--<dt i18n class="col-8">平局</dt>-->
<!--<dd class="col-4">{{points.athletic_draw}}</dd>-->
<!--<dt i18n class="col-8">总场</dt>-->
<!--<dd class="col-4">{{points.athletic_all}}</dd>-->
<!--</dl>-->
<!--<dl class="col-4 row">-->
<!--<dt i18n class="col-8">娱乐排名</dt>-->
<!--<dd class="col-4">{{points.exp_rank}}</dd>-->
<!--<dt i18n class="col-8">经验</dt>-->
<!--<dd class="col-4">{{points.exp}}</dd>-->
<!--<dt i18n class="col-8">胜场</dt>-->
<!--<dd class="col-4">{{points.entertain_win}}</dd>-->
<!--<dt i18n class="col-8">负场</dt>-->
<!--<dd class="col-4">{{points.entertain_lose}}</dd>-->
<!--<dt i18n class="col-8">平局</dt>-->
<!--<dd class="col-4">{{points.entertain_draw}}</dd>-->
<!--<dt i18n class="col-8">总场</dt>-->
<!--<dd class="col-4">{{points.entertain_all}}</dd>-->
<!--</dl>-->
<!--</div>-->
<div class="panel panel-default" *ngIf="news && news.length"> <div class="panel panel-default" *ngIf="news && news.length">
<h2 i18n>新闻</h2> <h2 i18n>新闻</h2>
<div id="news" *ngFor="let item of news"> <div id="news" *ngFor="let item of news">
<h3>{{item.title}}</h3> <h3>{{item.title}}</h3>
...@@ -141,10 +110,10 @@ ...@@ -141,10 +110,10 @@
<a i18n *ngIf="item.url" [href]="item.url" target="_blank">了解更多</a> <a i18n *ngIf="item.url" [href]="item.url" target="_blank">了解更多</a>
</div> </div>
<!--<a href="https://mycard.moe/ygopro/arena/" target="_blank" class="moreinfo">查看所有新闻</a>--> <!--<a href="https://mycard.moe/ygopro/arena/" target="_blank" class="moreinfo">查看所有新闻</a>-->
</div> </div>
<div *ngIf="currentApp.isReady()"> <div *ngIf="currentApp.isReady()">
<div *ngIf="mods && mods.length"> <div *ngIf="mods && mods.length">
<table class="table table-striped"> <table class="table table-striped">
<thead class="thead-inverse"> <thead class="thead-inverse">
...@@ -184,10 +153,10 @@ ...@@ -184,10 +153,10 @@
</div> </div>
</div> </div>
<!--安装modal--> <!--安装modal-->
<div class="modal fade" id="install-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" *ngIf="installOption"> <div class="modal fade" id="install-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" *ngIf="installOption">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<form id="install-form" class="modal-content" (ngSubmit)="install(currentApp,installOption,referencesInstall)" #theForm="ngForm"> <form id="install-form" class="modal-content" (ngSubmit)="install(currentApp,installOption,referencesInstall)" #theForm="ngForm">
<div class="modal-header"> <div class="modal-header">
...@@ -229,9 +198,9 @@ ...@@ -229,9 +198,9 @@
</div> </div>
</form> </form>
</div> </div>
</div> </div>
<div class="modal fade" id="import-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" *ngIf="installOption"> <div class="modal fade" id="import-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" *ngIf="installOption">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<form id="import-form" class="modal-content" (ngSubmit)="importGame(currentApp,installOption,referencesInstall)" #theForm="ngForm"> <form id="import-form" class="modal-content" (ngSubmit)="importGame(currentApp,installOption,referencesInstall)" #theForm="ngForm">
<div class="modal-header"> <div class="modal-header">
...@@ -279,5 +248,4 @@ ...@@ -279,5 +248,4 @@
</div> </div>
</form> </form>
</div> </div>
</div>
</div> </div>
\ No newline at end of file
import {Component, OnInit, Input, ChangeDetectorRef, OnChanges, SimpleChanges} from '@angular/core'; import {Component, OnInit, Input, ChangeDetectorRef, OnChanges, SimpleChanges, ElementRef} from '@angular/core';
import {AppsService} from './apps.service'; import {AppsService} from './apps.service';
import {InstallOption} from './install-option'; import {InstallOption} from './install-option';
import {SettingsService} from './settings.sevices'; import {SettingsService} from './settings.sevices';
...@@ -34,21 +34,19 @@ export class AppDetailComponent implements OnInit, OnChanges { ...@@ -34,21 +34,19 @@ export class AppDetailComponent implements OnInit, OnChanges {
points: Points; points: Points;
constructor(private appsService: AppsService, private settingsService: SettingsService, constructor(private appsService: AppsService, private settingsService: SettingsService,
private downloadService: DownloadService, private ref: ChangeDetectorRef) { private downloadService: DownloadService, private ref: ChangeDetectorRef, private el: ElementRef) {
} }
ngOnChanges(changes: SimpleChanges): void { ngOnChanges(changes: SimpleChanges): void {
if (changes['currentApp']) { if (changes['currentApp']) {
if (this.currentApp.background && this.currentApp.background.length > 0) { if (this.currentApp.background) {
let url = this.currentApp.background[Math.floor(Math.random() * this.currentApp.background.length)]; this.el.nativeElement.style.background = `url("${this.currentApp.background}") rgba(255,255,255,.8)`;
this.background = `url(${url})`;
} else { } else {
this.background = ''; this.el.nativeElement.style.background = 'white';
} }
} }
} }
async ngOnInit(): Promise<void> { async ngOnInit(): Promise<void> {
let volume = 'A'; let volume = 'A';
for (let i = 0; i < 26; i++) { for (let i = 0; i < 26; i++) {
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<div id="right"> <div id="right">
<div id="main"> <div id="main">
<app-detail *ngIf="currentApp" [currentApp]="currentApp"></app-detail> <app-detail class="scroll" *ngIf="currentApp" [currentApp]="currentApp"></app-detail>
<roster class="scroll"></roster> <roster class="scroll"></roster>
</div> </div>
......
...@@ -48,6 +48,10 @@ export class LobbyComponent implements OnInit { ...@@ -48,6 +48,10 @@ export class LobbyComponent implements OnInit {
window.close(); window.close();
} }
} }
// 特化个 YGOPRO 国际服聊天室。其他的暂时没需求。
if (!this.settingsService.getLocale().startsWith('zh')) {
this.apps.get('ygopro')!.conference = 'ygopro-international'
}
this.ref.detectChanges(); this.ref.detectChanges();
// $(this.search.nativeElement).typeahead(<any>{ // $(this.search.nativeElement).typeahead(<any>{
...@@ -75,12 +79,18 @@ export class LobbyComponent implements OnInit { ...@@ -75,12 +79,18 @@ export class LobbyComponent implements OnInit {
if (width < 190) { if (width < 190) {
width = 190; width = 190;
} }
if (width > 400) {
width = 400;
}
this.resizing.style.width = `${width}px`; this.resizing.style.width = `${width}px`;
} else { } else {
let height = this.offset - event.clientY; let height = this.offset - event.clientY;
if (height < 236) { if (height < 236) {
height = 236; height = 236;
} }
if (height > 540) {
height = 540;
}
this.resizing.style.height = `${height}px`; this.resizing.style.height = `${height}px`;
} }
}); });
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
<button i18n [disabled]="!appsService.allReady(app)" (click)="cancel_match()" *ngIf="matching_arena == 'athletic'" type="button" class="btn btn-primary btn-sm">取消等待</button> <button i18n [disabled]="!appsService.allReady(app)" (click)="cancel_match()" *ngIf="matching_arena == 'athletic'" type="button" class="btn btn-primary btn-sm">取消等待</button>
<button i18n [disabled]="matching||!appsService.allReady(app)" (click)="request_match('entertain')" *ngIf="matching_arena != 'entertain'" type="button" class="btn btn-secondary btn-sm">娱乐匹配</button> <button i18n [disabled]="matching||!appsService.allReady(app)" (click)="request_match('entertain')" *ngIf="matching_arena != 'entertain'" type="button" class="btn btn-secondary btn-sm">娱乐匹配</button>
<button i18n [disabled]="!appsService.allReady(app)" (click)="cancel_match()" *ngIf="matching_arena == 'entertain'" type="button" class="btn btn-secondary btn-sm">取消等待</button> <button i18n [disabled]="!appsService.allReady(app)" (click)="cancel_match()" *ngIf="matching_arena == 'entertain'" type="button" class="btn btn-secondary btn-sm">取消等待</button>
<!--<button i18n [disabled]="matching||!appsService.allReady(app)" type="button" class="btn btn-secondary btn-sm" data-toggle="modal" data-target="#game-create-modal">创建房间</button>--> <button i18n [disabled]="matching||!appsService.allReady(app)" type="button" class="btn btn-secondary btn-sm" data-toggle="modal" data-target="#game-list-modal">自定义游戏</button>
<button i18n [disabled]="matching||!appsService.allReady(app)" type="button" class="btn btn-secondary btn-sm" data-toggle="modal" data-target="#game-list-modal">房间列表</button>
<button i18n [disabled]="!appsService.allReady(app)" type="button" class="btn btn-secondary btn-sm" data-toggle="modal" data-target="#game-create-windbot">单人模式</button> <button i18n [disabled]="!appsService.allReady(app)" type="button" class="btn btn-secondary btn-sm" data-toggle="modal" data-target="#game-create-windbot">单人模式</button>
</div> </div>
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
...@@ -13,7 +12,6 @@ ...@@ -13,7 +12,6 @@
<select class="form-control form-control-sm" id="exampleSelect1" name="deck" [(ngModel)]="current_deck"> <select class="form-control form-control-sm" id="exampleSelect1" name="deck" [(ngModel)]="current_deck">
<option *ngFor="let deck of decks" [ngValue]="deck">{{deck}}</option> <option *ngFor="let deck of decks" [ngValue]="deck">{{deck}}</option>
</select> </select>
<!--<input type="text" class="form-control" aria-label="Text input with checkbox">-->
<span class="input-group-btn"> <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> <button id="edit_deck_button" i18n [disabled]="!appsService.allReady(app)" class="btn btn-secondary btn-sm" (click)="edit_deck(current_deck)">编辑</button>
</span> </span>
......
...@@ -140,8 +140,10 @@ function createWindow() { ...@@ -140,8 +140,10 @@ function createWindow() {
mainWindow = new BrowserWindow({ mainWindow = new BrowserWindow({
width: 1024, width: 1024,
height: 640, height: 640,
minWidth: 1024,
minHeight: 640,
frame: process.platform == 'darwin', frame: process.platform == 'darwin',
transparent: true, transparent: process.platform != 'darwin',
titleBarStyle: process.platform == 'darwin' ? 'hidden' : null titleBarStyle: process.platform == 'darwin' ? 'hidden' : null
}); });
......
This diff is collapsed.
...@@ -6,10 +6,12 @@ html, body { ...@@ -6,10 +6,12 @@ html, body {
body { body {
font-family: -apple-system, Arial, 'Source Sans Pro', "Microsoft YaHei", 'Microsoft JhengHei', "WenQuanYi Micro Hei", sans-serif; font-family: -apple-system, Arial, 'Source Sans Pro', "Microsoft YaHei", 'Microsoft JhengHei', "WenQuanYi Micro Hei", sans-serif;
-webkit-user-select: none; -webkit-user-select: none;
}
body.win32 {
background: transparent; background: transparent;
border-radius: 5px; border-radius: 5px;
border: 1px solid #eee; border: 1px solid #eee;
padding-right: 0 !important; padding-right: 0 !important;
} }
...@@ -44,7 +46,7 @@ mycard { ...@@ -44,7 +46,7 @@ mycard {
border-radius: initial; border-radius: initial;
} }
#navbar a, #navbar i, #navbar img { #navbar .nav-link, #navbar .profile, #navbar i, #navbar img {
-webkit-app-region: no-drag; -webkit-app-region: no-drag;
} }
...@@ -54,7 +56,7 @@ mycard { ...@@ -54,7 +56,7 @@ mycard {
} }
/* Turn on custom 8px wide scrollbar */ /* Turn on custom 8px wide scrollbar */
::-webkit-scrollbar { .win32 ::-webkit-scrollbar {
width: 8px; /* 1px wider than Lion. */ width: 8px; /* 1px wider than Lion. */
/* This is more usable for users trying to click it. */ /* This is more usable for users trying to click it. */
background-color: rgba(0, 0, 0, 0); background-color: rgba(0, 0, 0, 0);
...@@ -62,19 +64,19 @@ mycard { ...@@ -62,19 +64,19 @@ mycard {
} }
/* hover effect for both scrollbar area, and scrollbar 'thumb' */ /* hover effect for both scrollbar area, and scrollbar 'thumb' */
::-webkit-scrollbar:active { .win32 ::-webkit-scrollbar:active {
background-color: rgba(0, 0, 0, 0.05); background-color: rgba(0, 0, 0, 0.05);
} }
/* The scrollbar 'thumb' ...that marque oval shape in a scrollbar */ /* The scrollbar 'thumb' ...that marque oval shape in a scrollbar */
::-webkit-scrollbar-thumb:vertical { .win32 ::-webkit-scrollbar-thumb:vertical {
/* This is the EXACT color of Mac OS scrollbars. /* This is the EXACT color of Mac OS scrollbars.
Yes, I pulled out digital color meter */ Yes, I pulled out digital color meter */
background: rgba(0, 0, 0, 0.1); background: rgba(0, 0, 0, 0.1);
-webkit-border-radius: 100px; -webkit-border-radius: 100px;
} }
::-webkit-scrollbar-thumb:vertical:active { .win32 ::-webkit-scrollbar-thumb:vertical:active {
background: rgba(0, 0, 0, 0.2); /* Some darker color when you click it */ background: rgba(0, 0, 0, 0.2); /* Some darker color when you click it */
-webkit-border-radius: 100px; -webkit-border-radius: 100px;
} }
......
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