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
4815f5be
Commit
4815f5be
authored
Jun 21, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: rename
parent
cdd8ab84
Pipeline
#22352
failed with stages
in 14 minutes and 47 seconds
Changes
10
Pipelines
1
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 @
4815f5be
...
...
@@ -2,7 +2,7 @@ import { ygopro } from "@/api";
import
MsgSelectCard
=
ygopro
.
StocGameMessage
.
MsgSelectCard
;
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
"
;
export
default
async
(
selectCard
:
MsgSelectCard
)
=>
{
...
...
src/service/duel/selectChain.ts
View file @
4815f5be
...
...
@@ -5,7 +5,7 @@ import {
fetchSelectHintMeta
,
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
"
;
const
NeosConfig
=
useConfig
();
...
...
src/service/duel/selectSum.ts
View file @
4815f5be
import
{
ygopro
}
from
"
@/api
"
;
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
"
;
type
MsgSelectSum
=
ygopro
.
StocGameMessage
.
MsgSelectSum
;
...
...
src/service/duel/selectTribute.ts
View file @
4815f5be
import
{
ygopro
}
from
"
@/api
"
;
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
"
;
type
MsgSelectTribute
=
ygopro
.
StocGameMessage
.
MsgSelectTribute
;
...
...
src/service/duel/selectUnselectCard.ts
View file @
4815f5be
import
{
ygopro
}
from
"
@/api
"
;
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
"
;
type
MsgSelectUnselectCard
=
ygopro
.
StocGameMessage
.
MsgSelectUnselectCard
;
...
...
src/service/utils/fetchCheckCardMeta.ts
View file @
4815f5be
import
type
{
ygopro
}
from
"
@/api
"
;
import
{
fetchCard
,
getCardStr
}
from
"
@/api/cards
"
;
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
(
{
...
...
src/ui/Duel/Main.tsx
View file @
4815f5be
...
...
@@ -14,12 +14,11 @@ import {
YesNoModal
,
}
from
"
./Message
"
;
import
{
LifeBar
,
Mat
,
Menu
}
from
"
./PlayMat
"
;
import
{
NewSelectActionsModal
}
from
"
./Message/NewSelectActionModal
"
;
const
NeosDuel
=
()
=>
{
return
(
<>
<
New
SelectActionsModal
/>
<
SelectActionsModal
/>
<
Alert
/>
<
Menu
/>
<
LifeBar
/>
...
...
@@ -27,7 +26,6 @@ const NeosDuel = () => {
<
CardModal
/>
<
CardListModal
/>
<
HintNotification
/>
{
/* <SelectActionsModal /> */
}
<
YesNoModal
/>
<
PositionModal
/>
<
OptionModal
/>
...
...
src/ui/Duel/Message/SelectActionsModal.tsx
deleted
100644 → 0
View file @
cdd8ab84
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 @
4815f5be
File moved
src/ui/Duel/Message/
NewSelectAction
Modal/index.tsx
→
src/ui/Duel/Message/
SelectActions
Modal/index.tsx
View file @
4815f5be
...
...
@@ -51,7 +51,7 @@ const defaultProps = {
const
localStore
=
proxy
(
defaultProps
);
export
const
New
SelectActionsModal
:
FC
=
()
=>
{
export
const
SelectActionsModal
:
FC
=
()
=>
{
const
{
isOpen
,
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