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
37415155
Commit
37415155
authored
Jun 25, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: small
parent
3acc1431
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
29 deletions
+38
-29
src/stores/matStore/store.ts
src/stores/matStore/store.ts
+1
-1
src/ui/Duel/PlayMat/LifeBar/index.scss
src/ui/Duel/PlayMat/LifeBar/index.scss
+1
-1
src/ui/Duel/PlayMat/LifeBar/index.tsx
src/ui/Duel/PlayMat/LifeBar/index.tsx
+12
-2
src/ui/Duel/PlayMat/Menu/index.tsx
src/ui/Duel/PlayMat/Menu/index.tsx
+24
-25
No files found.
src/stores/matStore/store.ts
View file @
37415155
...
...
@@ -75,7 +75,7 @@ export const matStore: MatState = proxy<MatState>({
hint
:
{
code
:
-
1
},
currentPlayer
:
-
1
,
phase
:
{
currentPhase
:
ygopro
.
StocGameMessage
.
MsgNewPhase
.
PhaseType
.
UNKNOWN
,
// TODO 当前的阶段 应该改成enum
currentPhase
:
ygopro
.
StocGameMessage
.
MsgNewPhase
.
PhaseType
.
UNKNOWN
,
enableBp
:
false
,
// 允许进入战斗阶段
enableM2
:
false
,
// 允许进入M2阶段
enableEp
:
false
,
// 允许回合结束
...
...
src/ui/Duel/PlayMat/LifeBar/index.scss
View file @
37415155
...
...
@@ -30,6 +30,6 @@
font-weight
:
bold
;
}
.life
{
font-size
:
2
rem
;
font-size
:
1
.8
rem
;
}
}
src/ui/Duel/PlayMat/LifeBar/index.tsx
View file @
37415155
...
...
@@ -4,18 +4,28 @@ import React from "react";
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
matStore
,
playerStore
}
from
"
@/stores
"
;
import
classNames
from
"
classnames
"
;
export
const
LifeBar
:
React
.
FC
=
()
=>
{
const
snap
=
useSnapshot
(
matStore
.
initInfo
);
const
snapPlayer
=
useSnapshot
(
playerStore
);
const
{
currentPlayer
}
=
useSnapshot
(
matStore
);
return
(
<
div
id=
"life-bar-container"
>
<
div
className=
"life-bar"
>
<
div
className=
{
classNames
(
"
life-bar
"
,
{
"
life-bar-activated
"
:
matStore
.
isMe
(
currentPlayer
),
})
}
>
<
div
className=
"name"
>
{
snapPlayer
.
getOpPlayer
().
name
}
</
div
>
<
div
className=
"life"
>
{
snap
.
op
.
life
}
</
div
>
</
div
>
<
div
className=
"life-bar"
>
<
div
className=
{
classNames
(
"
life-bar
"
,
{
"
life-bar-activated
"
:
matStore
.
isMe
(
currentPlayer
),
})
}
>
<
div
className=
"name"
>
{
snapPlayer
.
getMePlayer
().
name
}
</
div
>
<
div
className=
"life"
>
{
snap
.
me
.
life
}
</
div
>
</
div
>
...
...
src/ui/Duel/PlayMat/Menu/index.tsx
View file @
37415155
...
...
@@ -36,6 +36,12 @@ export const Menu = () => {
const
{
currentPlayer
}
=
useSnapshot
(
matStore
);
const
currentPhase
=
snapPhase
.
currentPhase
;
const
clearAllIdleInteractivities
=
()
=>
{
for
(
const
card
of
cardStore
.
inner
)
{
card
.
idleInteractivities
=
[];
}
};
const
endResponse
=
[
PhaseType
.
BATTLE_START
,
PhaseType
.
BATTLE_STEP
,
...
...
@@ -46,28 +52,24 @@ export const Menu = () => {
?
3
:
7
;
const
clearAllIdleInteractivities
=
()
=>
{
for
(
const
card
of
cardStore
.
inner
)
{
card
.
idleInteractivities
=
[];
}
};
const
phaseBind
:
[
PhaseType
,
string
,
number
][]
=
[
[
PhaseType
.
DRAW
,
"
抽卡阶段
"
,
-
1
],
[
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
.
MAIN2
,
"
主要阶段 2
"
,
2
],
[
PhaseType
.
END
,
"
结束阶段
"
,
endResponse
],
// [PhaseType.UNKNOWN, "未知阶段", response],
// PhaseType, 中文, response, 是否显示
const
phaseBind
:
[
PhaseType
,
string
,
number
,
boolean
][]
=
[
[
PhaseType
.
DRAW
,
"
抽卡阶段
"
,
-
1
,
true
],
[
PhaseType
.
STANDBY
,
"
准备阶段
"
,
-
1
,
true
],
[
PhaseType
.
MAIN1
,
"
主要阶段 1
"
,
-
1
,
true
],
[
PhaseType
.
BATTLE
,
"
战斗阶段
"
,
6
,
true
],
[
PhaseType
.
BATTLE_START
,
"
战斗开始
"
,
3
,
false
],
[
PhaseType
.
BATTLE_STEP
,
"
战斗步骤
"
,
3
,
false
],
[
PhaseType
.
DAMAGE
,
"
伤害步骤
"
,
3
,
false
],
[
PhaseType
.
DAMAGE_GAL
,
"
伤害步骤(伤害计算)
"
,
3
,
false
],
[
PhaseType
.
MAIN2
,
"
主要阶段 2
"
,
2
,
true
],
[
PhaseType
.
END
,
"
结束阶段
"
,
endResponse
,
true
],
[
PhaseType
.
UNKNOWN
,
"
未知阶段
"
,
-
1
,
false
],
];
const
phaseSwitchItems
:
MenuProps
[
"
items
"
]
=
phaseBind
.
map
(
([
phase
,
str
,
response
],
i
)
=>
({
const
phaseSwitchItems
:
MenuProps
[
"
items
"
]
=
phaseBind
.
filter
(([,
,
,
show
])
=>
show
)
.
map
(([
phase
,
str
,
response
],
i
)
=>
({
key
:
i
,
label
:
str
,
disabled
:
currentPhase
>=
phase
,
...
...
@@ -78,21 +80,18 @@ export const Menu = () => {
},
icon
:
currentPhase
>=
phase
?
<
CheckOutlined
/>
:
<
ArrowRightOutlined
/>,
danger
:
phase
===
PhaseType
.
END
,
})
);
}));
const
surrenderMenuItems
:
MenuProps
[
"
items
"
]
=
[
{
key
:
0
,
label
:
"
取消
"
,
},
{
key
:
1
,
label
:
"
确定
"
,
danger
:
true
,
onClick
:
sendSurrender
,
},
];
]
.
map
((
item
,
i
)
=>
({
key
:
i
,
...
item
}))
;
const
globalDisable
=
!
matStore
.
isMe
(
currentPlayer
);
return
(
...
...
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