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
baichixing
Neos
Commits
0a5d3a8e
Commit
0a5d3a8e
authored
Jun 25, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: menu complete
parent
00588b78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
20 deletions
+31
-20
src/ui/Duel/PlayMat/Menu/index.tsx
src/ui/Duel/PlayMat/Menu/index.tsx
+31
-20
No files found.
src/ui/Duel/PlayMat/Menu/index.tsx
View file @
0a5d3a8e
...
...
@@ -16,6 +16,8 @@ import {
StepForwardFilled
,
MessageFilled
,
CloseCircleFilled
,
ArrowRightOutlined
,
CheckOutlined
,
}
from
"
@ant-design/icons
"
;
import
{
sendSelectBattleCmdResponse
,
...
...
@@ -32,16 +34,15 @@ export const Menu = () => {
const
snapPhase
=
useSnapshot
(
phase
);
const
currentPhase
=
snapPhase
.
currentPhase
;
const
[
modalOpen
,
setModalOpen
]
=
useState
(
false
);
const
response
=
currentPhase
===
PhaseType
.
BATTLE_START
||
currentPhase
===
PhaseType
.
BATTLE_STEP
||
currentPhase
===
PhaseType
.
DAMAGE
||
currentPhase
===
PhaseType
.
DAMAGE_GAL
||
currentPhase
===
PhaseType
.
BATTLE
?
3
:
7
;
const
response
=
[
PhaseType
.
BATTLE_START
,
PhaseType
.
BATTLE_STEP
,
PhaseType
.
DAMAGE
,
PhaseType
.
DAMAGE_GAL
,
PhaseType
.
BATTLE
,
].
includes
(
currentPhase
)
?
3
:
7
;
const
clearAllIdleInteractivities
=
()
=>
{
for
(
const
card
of
cardStore
.
inner
)
{
...
...
@@ -54,24 +55,27 @@ export const Menu = () => {
[
PhaseType
.
STANDBY
,
"
准备阶段
"
,
-
1
],
[
PhaseType
.
MAIN1
,
"
主要阶段 1
"
,
-
1
],
[
PhaseType
.
BATTLE
,
"
战斗阶段
"
,
6
],
[
PhaseType
.
BATTLE_START
,
"
战斗开始
"
,
3
],
[
PhaseType
.
BATTLE_STEP
,
"
战斗步骤
"
,
3
],
[
PhaseType
.
DAMAGE
,
"
伤害步骤
"
,
3
],
[
PhaseType
.
DAMAGE_GAL
,
"
伤害步骤(伤害计算)
"
,
3
],
//
[PhaseType.BATTLE_START, "战斗开始", 3],
//
[PhaseType.BATTLE_STEP, "战斗步骤", 3],
//
[PhaseType.DAMAGE, "伤害步骤", 3],
//
[PhaseType.DAMAGE_GAL, "伤害步骤(伤害计算)", 3],
[
PhaseType
.
MAIN2
,
"
主要阶段 2
"
,
2
],
[
PhaseType
.
END
,
"
结束阶段
"
,
response
],
[
PhaseType
.
UNKNOWN
,
"
未知阶段
"
,
response
],
//
[PhaseType.UNKNOWN, "未知阶段", response],
];
const
items
:
MenuProps
[
"
items
"
]
=
phaseBind
.
map
(
([
key
,
value
,
response
],
i
)
=>
({
([
phase
,
str
,
response
],
i
)
=>
({
key
:
i
,
label
:
value
,
disabled
:
currentPhase
>=
Number
(
key
)
,
label
:
str
,
disabled
:
currentPhase
>=
phase
,
onClick
:
()
=>
{
sendSelectIdleCmdResponse
(
response
);
if
(
response
===
2
)
sendSelectIdleCmdResponse
(
response
);
else
sendSelectBattleCmdResponse
(
response
);
clearAllIdleInteractivities
();
},
icon
:
currentPhase
>=
phase
?
<
CheckOutlined
/>
:
<
ArrowRightOutlined
/>,
danger
:
phase
===
PhaseType
.
END
,
})
);
...
...
@@ -86,6 +90,10 @@ export const Menu = () => {
const
menuStyle
=
{
boxShadow
:
"
none
"
,
};
const
[
showRendererTooltips
,
setShowRendererTooltips
]
=
useState
<
boolean
|
undefined
>
(
undefined
);
return
(
<>
<
div
className=
"menu-container"
>
...
...
@@ -112,7 +120,7 @@ export const Menu = () => {
<
Tooltip
title=
"聊天室"
>
<
Button
icon=
{
<
MessageFilled
/>
}
type=
"text"
></
Button
>
</
Tooltip
>
<
Tooltip
title=
"投降"
color=
"red"
>
<
Tooltip
title=
"投降"
color=
"red"
open=
{
showRendererTooltips
}
>
<
Popconfirm
title=
"投降"
description=
"您确认要投降?"
...
...
@@ -121,6 +129,9 @@ export const Menu = () => {
cancelText=
"取消"
placement=
"topRight"
arrow
onOpenChange=
{
(
open
)
=>
setShowRendererTooltips
(
!
open
?
undefined
:
!
open
)
}
>
<
Button
icon=
{
<
CloseCircleFilled
/>
}
type=
"text"
></
Button
>
</
Popconfirm
>
...
...
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