Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
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
syntax_j
mycard
Commits
5e48de4d
Commit
5e48de4d
authored
Sep 21, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v3-refactor3' into v3.1-refresh-ygopro
parents
4966752b
5b96a05c
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
122 additions
and
64 deletions
+122
-64
src/app/shared/app.ts
src/app/shared/app.ts
+10
-7
src/app/ygopro/ygopro.component.html
src/app/ygopro/ygopro.component.html
+8
-11
src/app/ygopro/ygopro.component.ts
src/app/ygopro/ygopro.component.ts
+104
-46
No files found.
src/app/shared/app.ts
View file @
5e48de4d
...
@@ -4,6 +4,7 @@ import ini from 'ini';
...
@@ -4,6 +4,7 @@ import ini from 'ini';
import
fs
from
'
fs
'
;
import
fs
from
'
fs
'
;
import
child_process
from
'
child_process
'
;
import
child_process
from
'
child_process
'
;
import
Mustache
from
'
mustache
'
;
import
Mustache
from
'
mustache
'
;
import
_
from
'
lodash-es
'
;
export
enum
Category
{
export
enum
Category
{
game
,
game
,
...
@@ -68,7 +69,9 @@ export class AppStatus {
...
@@ -68,7 +69,9 @@ export class AppStatus {
export
interface
YGOProDistroData
{
export
interface
YGOProDistroData
{
deckPath
:
string
;
deckPath
:
string
;
replayPath
:
string
;
replayPath
:
string
;
systemConf
:
string
;
systemConf
?:
string
;
lastDeckFormat
?:
string
;
lastCategoryFormat
?:
string
;
}
}
export
class
App
{
export
class
App
{
...
@@ -366,24 +369,24 @@ export class App {
...
@@ -366,24 +369,24 @@ export class App {
return
this
.
data
.
ygopro
||
undefined
;
return
this
.
data
.
ygopro
||
undefined
;
}
}
get
ygoproDeckPath
(
):
string
|
undefined
{
ygoproDeckPath
(
_distroData
:
YGOProDistroData
):
string
|
undefined
{
const
distroData
=
this
.
ygoproDistroData
;
const
distroData
=
_distroData
||
this
.
ygoproDistroData
;
if
(
!
distroData
)
{
if
(
!
distroData
)
{
return
;
return
;
}
}
return
path
.
join
(
this
.
local
!
.
path
,
distroData
.
deckPath
);
return
path
.
join
(
this
.
local
!
.
path
,
distroData
.
deckPath
);
}
}
get
ygoproReplayPath
(
):
string
|
undefined
{
ygoproReplayPath
(
_distroData
:
YGOProDistroData
):
string
|
undefined
{
const
distroData
=
this
.
ygoproDistroData
;
const
distroData
=
_distroData
||
this
.
ygoproDistroData
;
if
(
!
distroData
||
!
distroData
.
replayPath
)
{
if
(
!
distroData
||
!
distroData
.
replayPath
)
{
return
;
return
;
}
}
return
path
.
join
(
this
.
local
!
.
path
,
distroData
.
replayPath
);
return
path
.
join
(
this
.
local
!
.
path
,
distroData
.
replayPath
);
}
}
get
systemConfPath
(
):
string
|
undefined
{
systemConfPath
(
_distroData
:
YGOProDistroData
):
string
|
undefined
{
const
distroData
=
this
.
ygoproDistroData
;
const
distroData
=
_distroData
||
this
.
ygoproDistroData
;
if
(
!
distroData
||
!
distroData
.
systemConf
)
{
if
(
!
distroData
||
!
distroData
.
systemConf
)
{
return
;
return
;
}
}
...
...
src/app/ygopro/ygopro.component.html
View file @
5e48de4d
...
@@ -26,17 +26,14 @@
...
@@ -26,17 +26,14 @@
</div>
</div>
<div
class=
"col-sm-8 input-group input-group-sm"
>
<div
class=
"col-sm-8 input-group input-group-sm"
>
<label
i18n
class=
"input-group-text"
id=
"basic-addon1"
>
卡组
</label>
<label
i18n
class=
"input-group-text"
id=
"basic-addon1"
>
卡组
</label>
<select
class=
"form-select form-select-sm"
id=
"exampleSelect1"
name=
"deck"
[(ngModel)]=
"current_deck"
>
<select
class=
"form-select form-select-sm"
id=
"exampleSelect1"
name=
"deck"
[(ngModel)]=
"currentDeckSymbol"
(change)=
"onDeckChange()"
>
<option
*ngFor=
"let deck of decks_grouped['.']"
[value]=
"deck"
>
{{deck}}
</option>
<optgroup
*ngFor=
"let group of decks_grouped"
[label]=
"group[0] === '.' ? '未分类卡组' : group[0]"
>
<ng-container
*ngFor=
"let group of decks_grouped | keyvalue"
>
<option
*ngFor=
"let deck of group[1]"
[value]=
"deck.symbol"
>
{{deck.deck}}
</option>
<optgroup
*ngIf=
"group.key !== '.'"
[label]=
'group.key'
>
</optgroup>
<option
*ngFor=
"let deck of group.value"
[value]=
"group.key + '/' + deck"
>
{{deck}}
</option>
</optgroup>
</ng-container>
</select>
</select>
<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(
)"
>
编辑
</button>
</span>
</span>
</div>
</div>
</div>
</div>
...
@@ -124,10 +121,10 @@
...
@@ -124,10 +121,10 @@
<small
i18n
class=
"form-text text-muted"
>
最多 12 个字
</small>
<small
i18n
class=
"form-text text-muted"
>
最多 12 个字
</small>
</ng-container>
</ng-container>
<ng-template
#private
>
<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>
<span
i18n
>
房间密码
</span></label>
<div
class=
"input-group input-group-sm"
>
<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=
"房间密码已复制到剪贴板"
>
<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>
<button
i18n-title
class=
"btn btn-secondary fa fa-clipboard"
type=
"button"
title=
"复制"
(click)=
"copy(host_password, $event)"
></button>
</span>
</span>
...
...
src/app/ygopro/ygopro.component.ts
View file @
5e48de4d
This diff is collapsed.
Click to expand it.
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