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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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
Neos
Commits
3fd5151f
Commit
3fd5151f
authored
May 14, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrap EffectButton
parent
c60754fd
Pipeline
#21657
passed with stages
in 12 minutes and 12 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
42 deletions
+64
-42
src/ui/Duel/Message/CardModal.tsx
src/ui/Duel/Message/CardModal.tsx
+3
-42
src/ui/Duel/Message/EffectButton.tsx
src/ui/Duel/Message/EffectButton.tsx
+61
-0
No files found.
src/ui/Duel/Message/CardModal.tsx
View file @
3fd5151f
...
...
@@ -4,7 +4,7 @@ import classnames from "classnames";
import
React
from
"
react
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
fetchStrings
,
getCardStr
,
sendSelectIdleCmdResponse
}
from
"
@/api
"
;
import
{
fetchStrings
,
sendSelectIdleCmdResponse
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
clearAllIdleInteractivities
as
clearAllIdleInteractivities
,
...
...
@@ -17,6 +17,7 @@ import {
Race2StringCodeMap
,
Type2StringCodeMap
,
}
from
"
../../../common
"
;
import
{
EffectButton
}
from
"
./EffectButton
"
;
const
{
cardModal
}
=
messageStore
;
const
NeosConfig
=
useConfig
();
...
...
@@ -84,47 +85,7 @@ export const CardModal = () => {
</
button
>
);
})
}
{
effectInteractivies
.
length
>
0
?
(
effectInteractivies
.
length
==
1
?
(
// 如果只有一个效果,点击直接触发
<
button
className=
"card-modal-btn"
onClick=
{
()
=>
{
sendSelectIdleCmdResponse
(
effectInteractivies
[
0
].
response
);
cardModal
.
isOpen
=
false
;
clearAllIdleInteractivities
(
0
);
clearAllIdleInteractivities
(
1
);
}
}
>
{
effectInteractivies
[
0
].
desc
}
</
button
>
)
:
(
// 如果有多个效果,点击后进入`OptionModal`选择
<
button
className=
"card-modal-btn"
onClick=
{
()
=>
{
for
(
const
effect
of
effectInteractivies
)
{
const
effectMsg
=
meta
&&
effect
.
effectCode
?
getCardStr
(
meta
,
effect
.
effectCode
&
0xf
)
??
"
[:?]
"
:
"
[:?]
"
;
messageStore
.
optionModal
.
options
.
push
({
msg
:
effectMsg
,
response
:
effect
.
response
,
});
}
cardModal
.
isOpen
=
false
;
clearAllIdleInteractivities
(
0
);
clearAllIdleInteractivities
(
1
);
messageStore
.
optionModal
.
isOpen
=
true
;
}
}
>
发动效果
</
button
>
)
)
:
(
<></>
)
}
<
EffectButton
meta=
{
meta
}
effectInteractivies=
{
effectInteractivies
}
/>
</
div
>
</
div
>
);
...
...
src/ui/Duel/Message/EffectButton.tsx
0 → 100644
View file @
3fd5151f
import
React
from
"
react
"
;
import
"
@/styles/card-modal.scss
"
;
import
{
CardMeta
,
getCardStr
,
sendSelectIdleCmdResponse
}
from
"
@/api
"
;
import
{
clearAllIdleInteractivities
as
clearAllIdleInteractivities
,
messageStore
,
}
from
"
@/stores
"
;
const
{
cardModal
}
=
messageStore
;
export
const
EffectButton
=
(
props
:
{
meta
?:
CardMeta
;
effectInteractivies
:
{
desc
:
string
;
response
:
number
;
effectCode
?:
number
;
}[];
})
=>
(
<>
{
props
.
effectInteractivies
.
length
>
0
?
(
props
.
effectInteractivies
.
length
==
1
?
(
// 如果只有一个效果,点击直接触发
<
button
className=
"card-modal-btn"
onClick=
{
()
=>
{
sendSelectIdleCmdResponse
(
props
.
effectInteractivies
[
0
].
response
);
cardModal
.
isOpen
=
false
;
clearAllIdleInteractivities
(
0
);
clearAllIdleInteractivities
(
1
);
}
}
>
{
props
.
effectInteractivies
[
0
].
desc
}
</
button
>
)
:
(
// 如果有多个效果,点击后进入`OptionModal`选择
<
button
className=
"card-modal-btn"
onClick=
{
()
=>
{
for
(
const
effect
of
props
.
effectInteractivies
)
{
const
effectMsg
=
props
.
meta
&&
effect
.
effectCode
?
getCardStr
(
props
.
meta
,
effect
.
effectCode
&
0xf
)
??
"
[:?]
"
:
"
[:?]
"
;
messageStore
.
optionModal
.
options
.
push
({
msg
:
effectMsg
,
response
:
effect
.
response
,
});
}
cardModal
.
isOpen
=
false
;
clearAllIdleInteractivities
(
0
);
clearAllIdleInteractivities
(
1
);
messageStore
.
optionModal
.
isOpen
=
true
;
}
}
>
发动效果
</
button
>
)
)
:
(
<></>
)
}
</>
);
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