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
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 {
...
@@ -16,6 +16,8 @@ import {
StepForwardFilled
,
StepForwardFilled
,
MessageFilled
,
MessageFilled
,
CloseCircleFilled
,
CloseCircleFilled
,
ArrowRightOutlined
,
CheckOutlined
,
}
from
"
@ant-design/icons
"
;
}
from
"
@ant-design/icons
"
;
import
{
import
{
sendSelectBattleCmdResponse
,
sendSelectBattleCmdResponse
,
...
@@ -32,16 +34,15 @@ export const Menu = () => {
...
@@ -32,16 +34,15 @@ export const Menu = () => {
const
snapPhase
=
useSnapshot
(
phase
);
const
snapPhase
=
useSnapshot
(
phase
);
const
currentPhase
=
snapPhase
.
currentPhase
;
const
currentPhase
=
snapPhase
.
currentPhase
;
const
[
modalOpen
,
setModalOpen
]
=
useState
(
false
);
const
response
=
[
PhaseType
.
BATTLE_START
,
const
response
=
PhaseType
.
BATTLE_STEP
,
currentPhase
===
PhaseType
.
BATTLE_START
||
PhaseType
.
DAMAGE
,
currentPhase
===
PhaseType
.
BATTLE_STEP
||
PhaseType
.
DAMAGE_GAL
,
currentPhase
===
PhaseType
.
DAMAGE
||
PhaseType
.
BATTLE
,
currentPhase
===
PhaseType
.
DAMAGE_GAL
||
].
includes
(
currentPhase
)
currentPhase
===
PhaseType
.
BATTLE
?
3
?
3
:
7
;
:
7
;
const
clearAllIdleInteractivities
=
()
=>
{
const
clearAllIdleInteractivities
=
()
=>
{
for
(
const
card
of
cardStore
.
inner
)
{
for
(
const
card
of
cardStore
.
inner
)
{
...
@@ -54,24 +55,27 @@ export const Menu = () => {
...
@@ -54,24 +55,27 @@ export const Menu = () => {
[
PhaseType
.
STANDBY
,
"
准备阶段
"
,
-
1
],
[
PhaseType
.
STANDBY
,
"
准备阶段
"
,
-
1
],
[
PhaseType
.
MAIN1
,
"
主要阶段 1
"
,
-
1
],
[
PhaseType
.
MAIN1
,
"
主要阶段 1
"
,
-
1
],
[
PhaseType
.
BATTLE
,
"
战斗阶段
"
,
6
],
[
PhaseType
.
BATTLE
,
"
战斗阶段
"
,
6
],
[
PhaseType
.
BATTLE_START
,
"
战斗开始
"
,
3
],
//
[PhaseType.BATTLE_START, "战斗开始", 3],
[
PhaseType
.
BATTLE_STEP
,
"
战斗步骤
"
,
3
],
//
[PhaseType.BATTLE_STEP, "战斗步骤", 3],
[
PhaseType
.
DAMAGE
,
"
伤害步骤
"
,
3
],
//
[PhaseType.DAMAGE, "伤害步骤", 3],
[
PhaseType
.
DAMAGE_GAL
,
"
伤害步骤(伤害计算)
"
,
3
],
//
[PhaseType.DAMAGE_GAL, "伤害步骤(伤害计算)", 3],
[
PhaseType
.
MAIN2
,
"
主要阶段 2
"
,
2
],
[
PhaseType
.
MAIN2
,
"
主要阶段 2
"
,
2
],
[
PhaseType
.
END
,
"
结束阶段
"
,
response
],
[
PhaseType
.
END
,
"
结束阶段
"
,
response
],
[
PhaseType
.
UNKNOWN
,
"
未知阶段
"
,
response
],
//
[PhaseType.UNKNOWN, "未知阶段", response],
];
];
const
items
:
MenuProps
[
"
items
"
]
=
phaseBind
.
map
(
const
items
:
MenuProps
[
"
items
"
]
=
phaseBind
.
map
(
([
key
,
value
,
response
],
i
)
=>
({
([
phase
,
str
,
response
],
i
)
=>
({
key
:
i
,
key
:
i
,
label
:
value
,
label
:
str
,
disabled
:
currentPhase
>=
Number
(
key
)
,
disabled
:
currentPhase
>=
phase
,
onClick
:
()
=>
{
onClick
:
()
=>
{
sendSelectIdleCmdResponse
(
response
);
if
(
response
===
2
)
sendSelectIdleCmdResponse
(
response
);
else
sendSelectBattleCmdResponse
(
response
);
clearAllIdleInteractivities
();
clearAllIdleInteractivities
();
},
},
icon
:
currentPhase
>=
phase
?
<
CheckOutlined
/>
:
<
ArrowRightOutlined
/>,
danger
:
phase
===
PhaseType
.
END
,
})
})
);
);
...
@@ -86,6 +90,10 @@ export const Menu = () => {
...
@@ -86,6 +90,10 @@ export const Menu = () => {
const
menuStyle
=
{
const
menuStyle
=
{
boxShadow
:
"
none
"
,
boxShadow
:
"
none
"
,
};
};
const
[
showRendererTooltips
,
setShowRendererTooltips
]
=
useState
<
boolean
|
undefined
>
(
undefined
);
return
(
return
(
<>
<>
<
div
className=
"menu-container"
>
<
div
className=
"menu-container"
>
...
@@ -112,7 +120,7 @@ export const Menu = () => {
...
@@ -112,7 +120,7 @@ export const Menu = () => {
<
Tooltip
title=
"聊天室"
>
<
Tooltip
title=
"聊天室"
>
<
Button
icon=
{
<
MessageFilled
/>
}
type=
"text"
></
Button
>
<
Button
icon=
{
<
MessageFilled
/>
}
type=
"text"
></
Button
>
</
Tooltip
>
</
Tooltip
>
<
Tooltip
title=
"投降"
color=
"red"
>
<
Tooltip
title=
"投降"
color=
"red"
open=
{
showRendererTooltips
}
>
<
Popconfirm
<
Popconfirm
title=
"投降"
title=
"投降"
description=
"您确认要投降?"
description=
"您确认要投降?"
...
@@ -121,6 +129,9 @@ export const Menu = () => {
...
@@ -121,6 +129,9 @@ export const Menu = () => {
cancelText=
"取消"
cancelText=
"取消"
placement=
"topRight"
placement=
"topRight"
arrow
arrow
onOpenChange=
{
(
open
)
=>
setShowRendererTooltips
(
!
open
?
undefined
:
!
open
)
}
>
>
<
Button
icon=
{
<
CloseCircleFilled
/>
}
type=
"text"
></
Button
>
<
Button
icon=
{
<
CloseCircleFilled
/>
}
type=
"text"
></
Button
>
</
Popconfirm
>
</
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