Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
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
love_飞影
Neos
Commits
dd5386d5
Commit
dd5386d5
authored
May 10, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'optimize/select_action/card_modal' into 'main'
Optimize/select action/card modal See merge request
!187
parents
892fb37f
e03b628e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
14 deletions
+18
-14
src/service/duel/move.ts
src/service/duel/move.ts
+1
-1
src/stores/matStore/methods/fetchCheckCardMeta.ts
src/stores/matStore/methods/fetchCheckCardMeta.ts
+2
-2
src/stores/messageStore/types.ts
src/stores/messageStore/types.ts
+1
-1
src/ui/Duel/Message/SelectActionsModal.tsx
src/ui/Duel/Message/SelectActionsModal.tsx
+14
-10
No files found.
src/service/duel/move.ts
View file @
dd5386d5
...
@@ -114,7 +114,7 @@ export default (move: MsgMove) => {
...
@@ -114,7 +114,7 @@ export default (move: MsgMove) => {
for
(
const
hand
of
matStore
.
in
(
to
.
location
).
of
(
to
.
controler
))
{
for
(
const
hand
of
matStore
.
in
(
to
.
location
).
of
(
to
.
controler
))
{
hand
.
focus
=
false
;
hand
.
focus
=
false
;
}
}
},
2
00
);
},
5
00
);
}
}
break
;
break
;
}
}
...
...
src/stores/matStore/methods/fetchCheckCardMeta.ts
View file @
dd5386d5
...
@@ -27,13 +27,13 @@ export const fetchCheckCardMeta = async (
...
@@ -27,13 +27,13 @@ export const fetchCheckCardMeta = async (
?
code
?
code
:
matStore
.
in
(
location
.
location
).
of
(
controller
)[
location
.
sequence
]
:
matStore
.
in
(
location
.
location
).
of
(
controller
)[
location
.
sequence
]
?.
occupant
?.
id
||
0
;
?.
occupant
?.
id
||
0
;
const
meta
=
await
fetchCard
(
code
);
const
meta
=
await
fetchCard
(
newID
);
const
effectDesc
=
effectDescCode
const
effectDesc
=
effectDescCode
?
getCardStr
(
meta
,
effectDescCode
&
0xf
)
?
getCardStr
(
meta
,
effectDescCode
&
0xf
)
:
undefined
;
:
undefined
;
const
newOption
=
{
const
newOption
=
{
code
:
newID
,
meta
,
location
:
location
.
toObject
(),
location
:
location
.
toObject
(),
level1
,
level1
,
level2
,
level2
,
...
...
src/stores/messageStore/types.ts
View file @
dd5386d5
...
@@ -3,7 +3,7 @@ type CardLocation = ReturnType<typeof ygopro.CardLocation.prototype.toObject>;
...
@@ -3,7 +3,7 @@ type CardLocation = ReturnType<typeof ygopro.CardLocation.prototype.toObject>;
interface
Option
{
interface
Option
{
// card id
// card id
code
:
number
;
meta
:
CardMeta
;
location
?:
CardLocation
;
location
?:
CardLocation
;
// 效果
// 效果
effectDesc
?:
string
;
effectDesc
?:
string
;
...
...
src/ui/Duel/Message/SelectActionsModal.tsx
View file @
dd5386d5
...
@@ -20,7 +20,7 @@ const NeosConfig = useConfig();
...
@@ -20,7 +20,7 @@ const NeosConfig = useConfig();
const
CANCEL_RESPONSE
=
-
1
;
const
CANCEL_RESPONSE
=
-
1
;
const
FINISH_RESPONSE
=
-
1
;
const
FINISH_RESPONSE
=
-
1
;
const
{
selectCardActions
}
=
messageStore
;
const
{
selectCardActions
,
cardModal
}
=
messageStore
;
export
const
SelectActionsModal
=
()
=>
{
export
const
SelectActionsModal
=
()
=>
{
const
snap
=
useSnapshot
(
selectCardActions
);
const
snap
=
useSnapshot
(
selectCardActions
);
...
@@ -121,9 +121,13 @@ export const SelectActionsModal = () => {
...
@@ -121,9 +121,13 @@ export const SelectActionsModal = () => {
multiple
multiple
bordered
bordered
size=
"small"
size=
"small"
onChange=
{
(
value
)
=>
{
onChange=
{
(
values
:
any
)
=>
{
// @ts-ignore
if
(
values
.
length
>
0
)
{
setResponse
(
value
);
const
meta
=
values
[
values
.
length
-
1
].
meta
;
cardModal
.
meta
=
meta
;
cardModal
.
isOpen
=
true
;
}
setResponse
(
values
);
}
}
}
}
>
>
<
Row
>
<
Row
>
...
@@ -135,10 +139,10 @@ export const SelectActionsModal = () => {
...
@@ -135,10 +139,10 @@ export const SelectActionsModal = () => {
style=
{
{
width
:
120
}
}
style=
{
{
width
:
120
}
}
cover=
{
cover=
{
<
img
<
img
alt=
{
option
.
code
.
toString
()
}
alt=
{
option
.
meta
.
id
.
toString
()
}
src=
{
src=
{
option
.
code
option
.
meta
.
id
?
`${NeosConfig.cardImgUrl}/${option.
code
}.jpg`
?
`${NeosConfig.cardImgUrl}/${option.
meta.id
}.jpg`
:
`${NeosConfig.assetsPath}/card_back.jpg`
:
`${NeosConfig.assetsPath}/card_back.jpg`
}
}
style=
{
{
width
:
100
}
}
style=
{
{
width
:
100
}
}
...
@@ -159,10 +163,10 @@ export const SelectActionsModal = () => {
...
@@ -159,10 +163,10 @@ export const SelectActionsModal = () => {
style=
{
{
width
:
120
}
}
style=
{
{
width
:
120
}
}
cover=
{
cover=
{
<
img
<
img
alt=
{
option
.
code
.
toString
()
}
alt=
{
option
.
meta
.
id
.
toString
()
}
src=
{
src=
{
option
.
code
option
.
meta
.
id
?
`${NeosConfig.cardImgUrl}/${option.
code
}.jpg`
?
`${NeosConfig.cardImgUrl}/${option.
meta.id
}.jpg`
:
`${NeosConfig.assetsPath}/card_back.jpg`
:
`${NeosConfig.assetsPath}/card_back.jpg`
}
}
/>
/>
...
...
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