Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mycard Mobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mycard Mobile
Commits
ca10bacf
Commit
ca10bacf
authored
Aug 24, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complete most
parent
b66f1ff2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
18 deletions
+34
-18
src/app/app.module.ts
src/app/app.module.ts
+1
-1
src/app/lobby/lobby.component.html
src/app/lobby/lobby.component.html
+6
-6
src/app/lobby/lobby.component.ts
src/app/lobby/lobby.component.ts
+6
-1
src/app/ygopro.service.ts
src/app/ygopro.service.ts
+14
-3
src/assets/Spinner-1s-200px.svg
src/assets/Spinner-1s-200px.svg
+3
-2
src/polyfills.ts
src/polyfills.ts
+4
-5
No files found.
src/app/app.module.ts
View file @
ca10bacf
import
{
ErrorHandler
,
isDevMode
,
NgModule
,
Provider
}
from
'
@angular/core
'
;
import
{
ErrorHandler
,
NgModule
,
Provider
}
from
'
@angular/core
'
;
import
{
FormsModule
,
ReactiveFormsModule
}
from
'
@angular/forms
'
;
import
{
FormsModule
,
ReactiveFormsModule
}
from
'
@angular/forms
'
;
import
{
import
{
MatAutocompleteModule
,
MatAutocompleteModule
,
...
...
src/app/lobby/lobby.component.html
View file @
ca10bacf
...
@@ -35,27 +35,27 @@
...
@@ -35,27 +35,27 @@
<!--<a href="https://accounts.moecube.com/profiles" id="avatar" mat-raised-button [style.background-image]="'url(' + login.user.avatar_url + ')'">{{login.user.username}}</a>-->
<!--<a href="https://accounts.moecube.com/profiles" id="avatar" mat-raised-button [style.background-image]="'url(' + login.user.avatar_url + ')'">{{login.user.username}}</a>-->
<!--</mat-grid-tile>-->
<!--</mat-grid-tile>-->
<mat-grid-tile>
<mat-grid-tile>
<button
mat-raised-button
color=
"primary"
[disabled]=
'ygopro.currentServer && ygopro.currentServer.id !== "tiramisu"'
(click)=
"ygopro.request_match('athletic')"
>
<button
mat-raised-button
color=
"primary"
(click)=
"ygopro.request_match('athletic')"
>
<mat-icon
fontSet=
"fa"
fontIcon=
"fa-futbol-o"
></mat-icon>
<mat-icon
fontSet=
"fa"
fontIcon=
"fa-futbol-o"
></mat-icon>
<br>
竞技匹配
<br>
竞技匹配
</button>
</button>
</mat-grid-tile>
</mat-grid-tile>
<mat-grid-tile>
<mat-grid-tile>
<button
mat-raised-button
color=
"primary"
[disabled]=
'ygopro.currentServer && ygopro.currentServer.id !== "tiramisu"'
(click)=
"ygopro.request_match('entertain')"
>
<button
mat-raised-button
color=
"primary"
(click)=
"ygopro.request_match('entertain')"
>
<mat-icon>
toys
</mat-icon>
<mat-icon>
toys
</mat-icon>
<br>
娱乐匹配
<br>
娱乐匹配
</button>
</button>
</mat-grid-tile>
</mat-grid-tile>
<mat-grid-tile><a
mat-raised-button
color=
"primary"
[disabled]=
'ygopro.currentServer && !ygopro.currentServer.custom
'
routerLink=
"/ygopro/rooms"
>
<mat-grid-tile><a
mat-raised-button
color=
"primary"
(click)=
'reloadServers(["custom"])
'
routerLink=
"/ygopro/rooms"
>
<mat-icon>
games
</mat-icon>
<mat-icon>
games
</mat-icon>
<br>
房间列表
</a></mat-grid-tile>
<br>
房间列表
</a></mat-grid-tile>
<mat-grid-tile><a
mat-raised-button
color=
"primary"
[disabled]=
'ygopro.currentServer && !ygopro.currentServer.custom
'
routerLink=
"/ygopro/rooms/new"
>
<mat-grid-tile><a
mat-raised-button
color=
"primary"
(click)=
'reloadServers(["custom"])
'
routerLink=
"/ygopro/rooms/new"
>
<mat-icon>

</mat-icon>
<!--add_box-->
<mat-icon>

</mat-icon>
<!--add_box-->
<br>
创建房间
</a></mat-grid-tile>
<br>
创建房间
</a></mat-grid-tile>
<mat-grid-tile><a
mat-raised-button
[disabled]=
'ygopro.currentServer && !ygopro.currentServer.windbot
'
routerLink=
"/ygopro/windbot"
>
<mat-grid-tile><a
mat-raised-button
(click)=
'reloadServers(["windbot"])
'
routerLink=
"/ygopro/windbot"
>
<mat-icon>

</mat-icon>
<!-- airplanemode_active -->
<mat-icon>

</mat-icon>
<!-- airplanemode_active -->
<br>
单人模式
</a></mat-grid-tile>
<br>
单人模式
</a></mat-grid-tile>
<mat-grid-tile><a
mat-raised-button
[disabled]=
'ygopro.currentServer && !ygopro.currentServer.replay
'
routerLink=
"/ygopro/watch"
>
<mat-grid-tile><a
mat-raised-button
(click)=
'reloadServers(["replay"])
'
routerLink=
"/ygopro/watch"
>
<mat-icon>

</mat-icon>
<!--remove_red_eye-->
<mat-icon>

</mat-icon>
<!--remove_red_eye-->
<br>
观战
</a></mat-grid-tile>
<br>
观战
</a></mat-grid-tile>
<!--<mat-grid-tile>-->
<!--<mat-grid-tile>-->
...
...
src/app/lobby/lobby.component.ts
View file @
ca10bacf
...
@@ -4,13 +4,14 @@ import { environment } from '../../environments/environment';
...
@@ -4,13 +4,14 @@ import { environment } from '../../environments/environment';
import
{
LoginService
}
from
'
../login.service
'
;
import
{
LoginService
}
from
'
../login.service
'
;
import
{
routerTransition
}
from
'
../router.animations
'
;
import
{
routerTransition
}
from
'
../router.animations
'
;
import
{
StorageService
}
from
'
../storage.service
'
;
import
{
StorageService
}
from
'
../storage.service
'
;
import
{
YGOProService
}
from
'
../ygopro.service
'
;
import
{
YGOProService
,
Server
}
from
'
../ygopro.service
'
;
import
{
HttpClient
}
from
'
@angular/common/http
'
;
import
{
HttpClient
}
from
'
@angular/common/http
'
;
import
{
distinctUntilChanged
,
filter
,
map
,
switchMap
}
from
'
rxjs/internal/operators
'
;
import
{
distinctUntilChanged
,
filter
,
map
,
switchMap
}
from
'
rxjs/internal/operators
'
;
import
{
MatDialog
}
from
'
@angular/material
'
;
import
{
MatDialog
}
from
'
@angular/material
'
;
import
{
LogoutDialogComponent
}
from
'
../logout-dialog/logout-dialog.component
'
;
import
{
LogoutDialogComponent
}
from
'
../logout-dialog/logout-dialog.component
'
;
@
Component
({
@
Component
({
selector
:
'
app-lobby
'
,
selector
:
'
app-lobby
'
,
templateUrl
:
'
lobby.component.html
'
,
templateUrl
:
'
lobby.component.html
'
,
...
@@ -57,6 +58,10 @@ export class LobbyComponent {
...
@@ -57,6 +58,10 @@ export class LobbyComponent {
}
}
}
}
reloadServers
(
fields
:
(
keyof
Server
)[])
{
this
.
ygopro
.
reloadSelectableServers
(
s
=>
fields
.
some
((
field
)
=>
!!
s
[
field
]));
}
search
(
key
:
string
)
{
search
(
key
:
string
)
{
const
url
=
new
URL
(
'
http://www.ourocg.cn/S.aspx
'
);
const
url
=
new
URL
(
'
http://www.ourocg.cn/S.aspx
'
);
url
.
searchParams
.
set
(
'
key
'
,
key
);
url
.
searchParams
.
set
(
'
key
'
,
key
);
...
...
src/app/ygopro.service.ts
View file @
ca10bacf
...
@@ -140,6 +140,18 @@ export class YGOProService {
...
@@ -140,6 +140,18 @@ export class YGOProService {
selectableServers
:
Server
[]
=
[];
selectableServers
:
Server
[]
=
[];
currentServer
:
Server
;
currentServer
:
Server
;
reloadSelectableServers
(
condition
:
(
server
:
Server
)
=>
boolean
=
()
=>
true
)
{
this
.
selectableServers
=
this
.
servers
.
filter
(
s
=>
{
if
(
s
.
hidden
)
{
return
false
;
}
return
condition
(
s
);
});
if
(
!
this
.
currentServer
||
!
this
.
selectableServers
.
includes
(
this
.
currentServer
))
{
this
.
currentServer
=
this
.
selectableServers
[
0
];
}
}
constructor
(
private
login
:
LoginService
,
private
http
:
HttpClient
,
private
dialog
:
MatDialog
,
private
storage
:
StorageService
)
{
constructor
(
private
login
:
LoginService
,
private
http
:
HttpClient
,
private
dialog
:
MatDialog
,
private
storage
:
StorageService
)
{
const
app
=
this
.
http
.
get
<
App
[]
>
(
'
https://sapi.moecube.com:444/apps.json
'
).
pipe
(
map
(
apps
=>
apps
.
find
(
_app
=>
_app
.
id
===
'
ygopro
'
)
!
),
publishLast
(),
refCount
());
const
app
=
this
.
http
.
get
<
App
[]
>
(
'
https://sapi.moecube.com:444/apps.json
'
).
pipe
(
map
(
apps
=>
apps
.
find
(
_app
=>
_app
.
id
===
'
ygopro
'
)
!
),
publishLast
(),
refCount
());
...
@@ -153,8 +165,7 @@ export class YGOProService {
...
@@ -153,8 +165,7 @@ export class YGOProService {
this
.
serversPromise
.
then
((
servers
)
=>
{
this
.
serversPromise
.
then
((
servers
)
=>
{
this
.
servers
=
servers
;
this
.
servers
=
servers
;
this
.
selectableServers
=
servers
.
filter
(
s
=>
!
s
.
hidden
);
this
.
reloadSelectableServers
();
this
.
currentServer
=
this
.
selectableServers
[
0
];
})
})
this
.
news
=
app
this
.
news
=
app
...
@@ -461,7 +472,7 @@ export class RoomListDataSource extends DataSource<Room> {
...
@@ -461,7 +472,7 @@ export class RoomListDataSource extends DataSource<Room> {
// 筛选一下房间,只扔进去当前房间或者竞技匹配的
// 筛选一下房间,只扔进去当前房间或者竞技匹配的
// 房间排序
// 房间排序
map
(
rooms
=>
map
(
rooms
=>
sortBy
(
rooms
.
filter
(
r
=>
r
.
arena
||
r
.
server
===
this
.
ygopro
.
currentServer
),
room
=>
{
sortBy
(
rooms
.
filter
(
r
=>
(
r
.
arena
&&
this
.
ygopro
.
currentServer
&&
this
.
ygopro
.
currentServer
.
id
===
'
tiramisu
'
)
||
r
.
server
===
this
.
ygopro
.
currentServer
),
room
=>
{
if
(
room
.
arena
===
'
athletic
'
)
{
if
(
room
.
arena
===
'
athletic
'
)
{
return
0
;
return
0
;
}
else
if
(
room
.
arena
===
'
entertain
'
)
{
}
else
if
(
room
.
arena
===
'
entertain
'
)
{
...
...
src/assets/Spinner-1s-200px.svg
View file @
ca10bacf
<svg
class=
"lds-spinner"
width=
"200px"
height=
"200px"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
viewBox=
"0 0 100 100"
preserveAspectRatio=
"xMidYMid"
style=
"background: none;"
><g
transform=
"rotate(0 50 50)"
>
<svg
class=
'lds-spinner'
width=
'200px'
height=
'200px'
xmlns=
'http://www.w3.org/2000/svg'
viewBox=
'0 0 100 100'
preserveAspectRatio=
'xMidYMid'
style=
'background: none;'
><g
transform=
"rotate(0 50 50)"
>
<rect
x=
"47"
y=
"24"
rx=
"9.4"
ry=
"4.8"
width=
"6"
height=
"12"
fill=
"#4b99ea"
>
<rect
x=
"47"
y=
"24"
rx=
"9.4"
ry=
"4.8"
width=
"6"
height=
"12"
fill=
"#4b99ea"
>
<animate
attributeName=
"opacity"
values=
"1;0"
keyTimes=
"0;1"
dur=
"1s"
begin=
"-0.9166666666666666s"
repeatCount=
"indefinite"
></animate>
<animate
attributeName=
"opacity"
values=
"1;0"
keyTimes=
"0;1"
dur=
"1s"
begin=
"-0.9166666666666666s"
repeatCount=
"indefinite"
></animate>
</rect>
</rect>
...
@@ -46,4 +47,4 @@
...
@@ -46,4 +47,4 @@
<rect
x=
"47"
y=
"24"
rx=
"9.4"
ry=
"4.8"
width=
"6"
height=
"12"
fill=
"#4b99ea"
>
<rect
x=
"47"
y=
"24"
rx=
"9.4"
ry=
"4.8"
width=
"6"
height=
"12"
fill=
"#4b99ea"
>
<animate
attributeName=
"opacity"
values=
"1;0"
keyTimes=
"0;1"
dur=
"1s"
begin=
"0s"
repeatCount=
"indefinite"
></animate>
<animate
attributeName=
"opacity"
values=
"1;0"
keyTimes=
"0;1"
dur=
"1s"
begin=
"0s"
repeatCount=
"indefinite"
></animate>
</rect>
</rect>
</g></svg>
</g></svg>
\ No newline at end of file
src/polyfills.ts
View file @
ca10bacf
...
@@ -44,6 +44,10 @@
...
@@ -44,6 +44,10 @@
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
// import 'core-js/es7/reflect';
// import 'core-js/es7/reflect';
import
'
core-js/fn/symbol/async-iterator
'
;
import
'
core-js/fn/symbol/async-iterator
'
;
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import
'
zone.js/dist/zone
'
;
// Included with Angular CLI.
/**
/**
* Required to support Web Animations `@angular/platform-browser/animations`.
* Required to support Web Animations `@angular/platform-browser/animations`.
...
@@ -66,11 +70,6 @@ import 'core-js/fn/symbol/async-iterator';
...
@@ -66,11 +70,6 @@ import 'core-js/fn/symbol/async-iterator';
*/
*/
// (window as any).__Zone_enable_cross_context_check = true;
// (window as any).__Zone_enable_cross_context_check = true;
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import
'
zone.js/dist/zone
'
;
// Included with Angular CLI.
/***************************************************************************************************
/***************************************************************************************************
* APPLICATION IMPORTS
* APPLICATION IMPORTS
*/
*/
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment