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
ee27706b
Commit
ee27706b
authored
Jun 21, 2023
by
timel
Committed by
Chunchi Che
Jun 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: rename
parent
b2ac11db
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
8 additions
and
253 deletions
+8
-253
src/service/duel/selectCard.ts
src/service/duel/selectCard.ts
+1
-1
src/service/duel/selectChain.ts
src/service/duel/selectChain.ts
+1
-1
src/service/duel/selectSum.ts
src/service/duel/selectSum.ts
+1
-1
src/service/duel/selectTribute.ts
src/service/duel/selectTribute.ts
+1
-1
src/service/duel/selectUnselectCard.ts
src/service/duel/selectUnselectCard.ts
+1
-1
src/service/utils/fetchCheckCardMeta.ts
src/service/utils/fetchCheckCardMeta.ts
+1
-1
src/ui/Duel/Main.tsx
src/ui/Duel/Main.tsx
+1
-3
src/ui/Duel/Message/SelectActionsModal.tsx
src/ui/Duel/Message/SelectActionsModal.tsx
+0
-243
src/ui/Duel/Message/SelectActionsModal/index.scss
src/ui/Duel/Message/SelectActionsModal/index.scss
+0
-0
src/ui/Duel/Message/SelectActionsModal/index.tsx
src/ui/Duel/Message/SelectActionsModal/index.tsx
+1
-1
No files found.
src/service/duel/selectCard.ts
View file @
ee27706b
...
@@ -2,7 +2,7 @@ import { ygopro } from "@/api";
...
@@ -2,7 +2,7 @@ import { ygopro } from "@/api";
import
MsgSelectCard
=
ygopro
.
StocGameMessage
.
MsgSelectCard
;
import
MsgSelectCard
=
ygopro
.
StocGameMessage
.
MsgSelectCard
;
import
{
fetchCheckCardMeta
,
messageStore
}
from
"
@/stores
"
;
import
{
fetchCheckCardMeta
,
messageStore
}
from
"
@/stores
"
;
import
{
displaySelectActionsModal
}
from
"
@/ui/Duel/Message/
NewSelectAction
Modal
"
;
import
{
displaySelectActionsModal
}
from
"
@/ui/Duel/Message/
SelectActions
Modal
"
;
import
{
fetchCheckCardMeta
as
FIXME_fetchCheckCardMeta
}
from
"
../utils
"
;
import
{
fetchCheckCardMeta
as
FIXME_fetchCheckCardMeta
}
from
"
../utils
"
;
export
default
async
(
selectCard
:
MsgSelectCard
)
=>
{
export
default
async
(
selectCard
:
MsgSelectCard
)
=>
{
...
...
src/service/duel/selectChain.ts
View file @
ee27706b
...
@@ -5,7 +5,7 @@ import {
...
@@ -5,7 +5,7 @@ import {
fetchSelectHintMeta
,
fetchSelectHintMeta
,
messageStore
,
messageStore
,
}
from
"
@/stores
"
;
}
from
"
@/stores
"
;
import
{
displaySelectActionsModal
}
from
"
@/ui/Duel/Message/
NewSelectAction
Modal
"
;
import
{
displaySelectActionsModal
}
from
"
@/ui/Duel/Message/
SelectActions
Modal
"
;
import
{
fetchCheckCardMeta
as
FIXME_fetchCheckCardMeta
}
from
"
../utils
"
;
import
{
fetchCheckCardMeta
as
FIXME_fetchCheckCardMeta
}
from
"
../utils
"
;
const
NeosConfig
=
useConfig
();
const
NeosConfig
=
useConfig
();
...
...
src/service/duel/selectSum.ts
View file @
ee27706b
import
{
ygopro
}
from
"
@/api
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
fetchCheckCardMeta
,
messageStore
}
from
"
@/stores
"
;
import
{
fetchCheckCardMeta
,
messageStore
}
from
"
@/stores
"
;
import
{
displaySelectActionsModal
}
from
"
@/ui/Duel/Message/
NewSelectAction
Modal
"
;
import
{
displaySelectActionsModal
}
from
"
@/ui/Duel/Message/
SelectActions
Modal
"
;
import
{
fetchCheckCardMeta
as
FIXME_fetchCheckCardMeta
}
from
"
../utils
"
;
import
{
fetchCheckCardMeta
as
FIXME_fetchCheckCardMeta
}
from
"
../utils
"
;
type
MsgSelectSum
=
ygopro
.
StocGameMessage
.
MsgSelectSum
;
type
MsgSelectSum
=
ygopro
.
StocGameMessage
.
MsgSelectSum
;
...
...
src/service/duel/selectTribute.ts
View file @
ee27706b
import
{
ygopro
}
from
"
@/api
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
fetchCheckCardMeta
,
messageStore
}
from
"
@/stores
"
;
import
{
fetchCheckCardMeta
,
messageStore
}
from
"
@/stores
"
;
import
{
displaySelectActionsModal
}
from
"
@/ui/Duel/Message/
NewSelectAction
Modal
"
;
import
{
displaySelectActionsModal
}
from
"
@/ui/Duel/Message/
SelectActions
Modal
"
;
import
{
fetchCheckCardMeta
as
FIXME_fetchCheckCardMeta
}
from
"
../utils
"
;
import
{
fetchCheckCardMeta
as
FIXME_fetchCheckCardMeta
}
from
"
../utils
"
;
type
MsgSelectTribute
=
ygopro
.
StocGameMessage
.
MsgSelectTribute
;
type
MsgSelectTribute
=
ygopro
.
StocGameMessage
.
MsgSelectTribute
;
...
...
src/service/duel/selectUnselectCard.ts
View file @
ee27706b
import
{
ygopro
}
from
"
@/api
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
fetchCheckCardMeta
,
messageStore
}
from
"
@/stores
"
;
import
{
fetchCheckCardMeta
,
messageStore
}
from
"
@/stores
"
;
import
{
displaySelectActionsModal
}
from
"
@/ui/Duel/Message/
NewSelectAction
Modal
"
;
import
{
displaySelectActionsModal
}
from
"
@/ui/Duel/Message/
SelectActions
Modal
"
;
import
{
fetchCheckCardMeta
as
FIXME_fetchCheckCardMeta
}
from
"
../utils
"
;
import
{
fetchCheckCardMeta
as
FIXME_fetchCheckCardMeta
}
from
"
../utils
"
;
type
MsgSelectUnselectCard
=
ygopro
.
StocGameMessage
.
MsgSelectUnselectCard
;
type
MsgSelectUnselectCard
=
ygopro
.
StocGameMessage
.
MsgSelectUnselectCard
;
...
...
src/service/utils/fetchCheckCardMeta.ts
View file @
ee27706b
import
type
{
ygopro
}
from
"
@/api
"
;
import
type
{
ygopro
}
from
"
@/api
"
;
import
{
fetchCard
,
getCardStr
}
from
"
@/api/cards
"
;
import
{
fetchCard
,
getCardStr
}
from
"
@/api/cards
"
;
import
{
cardStore
}
from
"
@/stores
"
;
import
{
cardStore
}
from
"
@/stores
"
;
import
type
{
Option
}
from
"
@/ui/Duel/Message/
NewSelectAction
Modal
"
;
import
type
{
Option
}
from
"
@/ui/Duel/Message/
SelectActions
Modal
"
;
const
helper
=
async
(
const
helper
=
async
(
{
{
...
...
src/ui/Duel/Main.tsx
View file @
ee27706b
...
@@ -14,12 +14,11 @@ import {
...
@@ -14,12 +14,11 @@ import {
YesNoModal
,
YesNoModal
,
}
from
"
./Message
"
;
}
from
"
./Message
"
;
import
{
LifeBar
,
Mat
,
Menu
}
from
"
./PlayMat
"
;
import
{
LifeBar
,
Mat
,
Menu
}
from
"
./PlayMat
"
;
import
{
NewSelectActionsModal
}
from
"
./Message/NewSelectActionModal
"
;
const
NeosDuel
=
()
=>
{
const
NeosDuel
=
()
=>
{
return
(
return
(
<>
<>
<
New
SelectActionsModal
/>
<
SelectActionsModal
/>
<
Alert
/>
<
Alert
/>
<
Menu
/>
<
Menu
/>
<
LifeBar
/>
<
LifeBar
/>
...
@@ -27,7 +26,6 @@ const NeosDuel = () => {
...
@@ -27,7 +26,6 @@ const NeosDuel = () => {
<
CardModal
/>
<
CardModal
/>
<
CardListModal
/>
<
CardListModal
/>
<
HintNotification
/>
<
HintNotification
/>
{
/* <SelectActionsModal /> */
}
<
YesNoModal
/>
<
YesNoModal
/>
<
PositionModal
/>
<
PositionModal
/>
<
OptionModal
/>
<
OptionModal
/>
...
...
src/ui/Duel/Message/SelectActionsModal.tsx
deleted
100644 → 0
View file @
b2ac11db
import
"
@/styles/select-modal.scss
"
;
import
{
MinusOutlined
,
ThunderboltOutlined
}
from
"
@ant-design/icons
"
;
import
{
CheckCard
,
CheckCardProps
}
from
"
@ant-design/pro-components
"
;
import
{
Button
,
Card
,
Col
,
Popover
,
Row
,
Tabs
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
fetchStrings
,
sendSelectMultiResponse
,
sendSelectSingleResponse
,
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
clearSelectActions
,
matStore
,
messageStore
}
from
"
@/stores
"
;
import
{
groupBy
}
from
"
../utils
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
const
NeosConfig
=
useConfig
();
const
CANCEL_RESPONSE
=
-
1
;
const
FINISH_RESPONSE
=
-
1
;
const
{
selectCardActions
,
cardModal
}
=
messageStore
;
export
const
SelectActionsModal
=
()
=>
{
const
snap
=
useSnapshot
(
selectCardActions
);
const
isOpen
=
snap
.
isOpen
;
const
isValid
=
snap
.
isValid
;
const
isChain
=
snap
.
isChain
;
const
min
=
snap
.
min
??
0
;
const
max
=
snap
.
max
??
0
;
const
single
=
snap
.
single
??
false
;
const
selecteds
=
snap
.
selecteds
;
const
selectables
=
snap
.
selectables
;
const
mustSelects
=
snap
.
mustSelects
;
const
[
response
,
setResponse
]
=
useState
([]);
const
hint
=
useSnapshot
(
matStore
.
hint
);
const
preHintMsg
=
hint
?.
esHint
||
""
;
const
selectHintMsg
=
hint
?.
esSelectHint
||
"
请选择卡片
"
;
const
cancelable
=
snap
.
cancelAble
;
const
finishable
=
snap
.
finishAble
;
const
totalLevels
=
snap
.
totalLevels
??
0
;
const
overflow
=
snap
.
overflow
||
false
;
const
LevelSum1
=
mustSelects
.
concat
(
response
)
.
map
((
option
)
=>
option
.
level1
||
0
)
.
reduce
((
sum
,
current
)
=>
sum
+
current
,
0
);
const
LevelSum2
=
mustSelects
.
concat
(
response
)
.
map
((
option
)
=>
option
.
level2
||
0
)
.
reduce
((
sum
,
current
)
=>
sum
+
current
,
0
);
const
levelMatched
=
overflow
?
LevelSum1
>=
totalLevels
||
LevelSum2
>=
totalLevels
:
LevelSum1
==
totalLevels
||
LevelSum2
==
totalLevels
;
const
submitable
=
single
?
response
.
length
==
1
:
response
.
length
>=
min
&&
response
.
length
<=
max
&&
levelMatched
;
const
grouped
=
groupBy
(
selectables
,
(
option
)
=>
option
.
location
?.
zone
!
);
return
(
<>
<
DragModal
title=
{
`${preHintMsg} ${selectHintMsg} ${min}-${max} ${
single ? "每次选择一张" : ""
}`
}
open=
{
isOpen
&&
isValid
}
onCancel=
{
()
=>
{
selectCardActions
.
isOpen
=
false
;
}
}
closeIcon=
{
<
MinusOutlined
/>
}
footer=
{
<>
<
Button
disabled=
{
!
submitable
}
onClick=
{
()
=>
{
const
values
=
mustSelects
.
concat
(
response
)
.
map
((
option
)
=>
option
.
response
);
if
(
isChain
)
{
sendSelectSingleResponse
(
values
[
0
]);
}
else
{
sendSelectMultiResponse
(
values
);
}
clearSelectActions
();
}
}
onFocus=
{
()
=>
{}
}
onBlur=
{
()
=>
{}
}
>
{
fetchStrings
(
"
!system
"
,
1211
)
}
</
Button
>
<
Button
disabled=
{
!
finishable
}
onClick=
{
()
=>
{
sendSelectSingleResponse
(
FINISH_RESPONSE
);
clearSelectActions
();
}
}
onFocus=
{
()
=>
{}
}
onBlur=
{
()
=>
{}
}
>
{
fetchStrings
(
"
!system
"
,
1296
)
}
</
Button
>
<
Button
disabled=
{
!
cancelable
}
onClick=
{
()
=>
{
sendSelectSingleResponse
(
CANCEL_RESPONSE
);
clearSelectActions
();
}
}
onFocus=
{
()
=>
{}
}
onBlur=
{
()
=>
{}
}
>
{
fetchStrings
(
"
!system
"
,
1295
)
}
</
Button
>
</>
}
width=
{
800
}
>
<
CheckCard
.
Group
multiple
bordered
size=
"small"
onChange=
{
(
values
:
any
)
=>
{
if
(
values
.
length
>
0
)
{
const
meta
=
values
[
values
.
length
-
1
].
meta
;
cardModal
.
meta
=
meta
;
cardModal
.
counters
=
{};
cardModal
.
interactivies
=
[];
cardModal
.
isOpen
=
true
;
}
setResponse
(
values
);
}
}
>
<
Tabs
type=
"card"
items=
{
grouped
.
map
((
group
,
idx
)
=>
{
return
{
label
:
fetchStrings
(
"
!system
"
,
group
[
0
]
+
1000
),
key
:
idx
.
toString
(),
children
:
(
<
Row
>
{
group
[
1
].
map
((
option
,
idx
)
=>
{
return
(
<
Col
span=
{
4
}
key=
{
idx
}
>
<
HoverCheckCard
hoverContent=
{
option
.
effectDesc
}
style=
{
{
width
:
120
,
backgroundColor
:
option
.
location
?.
controller
===
0
?
"
white
"
:
"
grey
"
,
}
}
cover=
{
<
img
alt=
{
option
.
meta
.
id
.
toString
()
}
src=
{
option
.
meta
.
id
?
`${NeosConfig.cardImgUrl}/${option.meta.id}.jpg`
:
`${NeosConfig.assetsPath}/card_back.jpg`
}
style=
{
{
width
:
100
}
}
/>
}
value=
{
option
}
/>
</
Col
>
);
})
}
</
Row
>
),
};
})
}
/>
<
p
>
{
selecteds
.
length
>
0
?
fetchStrings
(
"
!system
"
,
212
)
:
""
}
</
p
>
<
Row
>
{
selecteds
.
concat
(
mustSelects
).
map
((
option
,
idx
)
=>
{
return
(
<
Col
span=
{
4
}
key=
{
idx
}
>
<
Card
style=
{
{
width
:
120
}
}
cover=
{
<
img
alt=
{
option
.
meta
.
id
.
toString
()
}
src=
{
option
.
meta
.
id
?
`${NeosConfig.cardImgUrl}/${option.meta.id}.jpg`
:
`${NeosConfig.assetsPath}/card_back.jpg`
}
/>
}
/>
</
Col
>
);
})
}
</
Row
>
</
CheckCard
.
Group
>
</
DragModal
>
{
isValid
&&
!
isOpen
?
(
<
div
className=
"select-modal"
>
<
button
className=
"select-modal-button"
onClick=
{
()
=>
{
selectCardActions
.
isOpen
=
true
;
}
}
>
SCROLL UP
</
button
>
</
div
>
)
:
(
<></>
)
}
</>
);
};
const
HoverCheckCard
=
(
props
:
CheckCardProps
&
{
hoverContent
?:
string
})
=>
{
const
[
hover
,
setHover
]
=
useState
(
false
);
const
onMouseEnter
=
()
=>
setHover
(
true
);
const
onMouseLeave
=
()
=>
setHover
(
false
);
return
(
<>
<
CheckCard
{
...
props
}
/>
{
props
.
hoverContent
?
(
<
Popover
content=
{
<
p
>
{
props
.
hoverContent
}
</
p
>
}
open=
{
hover
}
>
<
Button
icon=
{
<
ThunderboltOutlined
/>
}
onMouseEnter=
{
onMouseEnter
}
onMouseLeave=
{
onMouseLeave
}
></
Button
>
</
Popover
>
)
:
(
<></>
)
}
</>
);
};
src/ui/Duel/Message/
NewSelectAction
Modal/index.scss
→
src/ui/Duel/Message/
SelectActions
Modal/index.scss
View file @
ee27706b
File moved
src/ui/Duel/Message/
NewSelectAction
Modal/index.tsx
→
src/ui/Duel/Message/
SelectActions
Modal/index.tsx
View file @
ee27706b
...
@@ -51,7 +51,7 @@ const defaultProps = {
...
@@ -51,7 +51,7 @@ const defaultProps = {
const
localStore
=
proxy
(
defaultProps
);
const
localStore
=
proxy
(
defaultProps
);
export
const
New
SelectActionsModal
:
FC
=
()
=>
{
export
const
SelectActionsModal
:
FC
=
()
=>
{
const
{
const
{
isOpen
,
isOpen
,
isValid
,
isValid
,
...
...
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