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
9a562f46
Commit
9a562f46
authored
Sep 17, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/menu' into 'main'
修复偶现的进入不了战阶的问题 See merge request
!318
parents
08c20a9b
c434241e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
36 deletions
+18
-36
src/api/strings.ts
src/api/strings.ts
+0
-2
src/ui/Duel/PlayMat/Menu/index.tsx
src/ui/Duel/PlayMat/Menu/index.tsx
+18
-34
No files found.
src/api/strings.ts
View file @
9a562f46
...
...
@@ -8,8 +8,6 @@ export const DESCRIPTION_LIMIT = 10000;
export
async
function
initStrings
()
{
const
strings
=
await
(
await
fetch
(
stringsUrl
)).
text
();
console
.
log
({
strings
});
const
lineIter
=
strings
.
split
(
"
\n
"
);
for
(
const
line
of
lineIter
)
{
if
(
!
line
.
startsWith
(
"
#
"
)
&&
line
!==
""
)
{
...
...
src/ui/Duel/PlayMat/Menu/index.tsx
View file @
9a562f46
...
...
@@ -30,14 +30,10 @@ import { IconFont } from "@/ui/Shared";
import
styles
from
"
./index.module.scss
"
;
import
PhaseType
=
ygopro
.
StocGameMessage
.
MsgNewPhase
.
PhaseType
;
const
{
phase
}
=
matStore
;
const
{
phase
:
store
}
=
matStore
;
const
{
useToken
}
=
theme
;
export
const
Menu
=
()
=>
{
const
snapPhase
=
useSnapshot
(
phase
);
const
currentPhase
=
snapPhase
.
currentPhase
;
const
enableBp
=
snapPhase
.
enableBp
;
const
enableM2
=
snapPhase
.
enableM2
;
const
enableEp
=
snapPhase
.
enableEp
;
const
{
enableBp
,
enableM2
,
enableEp
,
currentPhase
}
=
useSnapshot
(
store
);
const
{
currentPlayer
,
chainSetting
}
=
useSnapshot
(
matStore
);
const
clearAllIdleInteractivities
=
()
=>
{
...
...
@@ -56,52 +52,40 @@ export const Menu = () => {
?
3
:
7
;
// PhaseType, 中文, response, 是否显示
// PhaseType, 中文, response, 是否显示
,是否禁用
const
phaseBind
:
[
phase
:
PhaseType
,
label
:
string
,
response
:
number
,
show
:
boolean
,
disabled
:
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
],
[
PhaseType
.
DRAW
,
"
抽卡阶段
"
,
-
1
,
true
,
true
],
[
PhaseType
.
STANDBY
,
"
准备阶段
"
,
-
1
,
true
,
true
],
[
PhaseType
.
MAIN1
,
"
主要阶段 1
"
,
-
1
,
true
,
true
],
[
PhaseType
.
BATTLE
,
"
战斗阶段
"
,
6
,
true
,
!
enableBp
],
[
PhaseType
.
BATTLE_START
,
"
战斗开始
"
,
3
,
false
,
true
],
[
PhaseType
.
BATTLE_STEP
,
"
战斗步骤
"
,
3
,
false
,
true
],
[
PhaseType
.
DAMAGE
,
"
伤害步骤
"
,
3
,
false
,
true
],
[
PhaseType
.
DAMAGE_GAL
,
"
伤害步骤(伤害计算)
"
,
3
,
false
,
true
],
[
PhaseType
.
MAIN2
,
"
主要阶段 2
"
,
2
,
true
,
!
enableM2
],
[
PhaseType
.
END
,
"
结束阶段
"
,
endResponse
,
true
,
!
enableEp
],
[
PhaseType
.
UNKNOWN
,
"
未知阶段
"
,
-
1
,
false
,
true
],
];
const
checkPhaseEnabled
=
(
phase
:
PhaseType
)
=>
{
switch
(
phase
)
{
case
PhaseType
.
BATTLE
:
return
enableBp
;
case
PhaseType
.
MAIN2
:
return
enableM2
;
case
PhaseType
.
END
:
return
enableEp
;
default
:
return
true
;
}
};
const
phaseSwitchItems
:
MenuProps
[
"
items
"
]
=
phaseBind
.
filter
(([,
,
,
show
])
=>
show
)
.
map
(([
phase
,
label
,
response
,
_
],
key
)
=>
({
.
map
(([
phase
,
label
,
response
,
_
,
disabled
],
key
)
=>
({
key
,
label
,
disabled
:
currentPhase
>=
phase
||
!
checkPhaseEnabled
(
phase
)
,
disabled
:
store
.
currentPhase
>=
phase
||
disabled
,
onClick
:
()
=>
{
if
(
response
===
2
)
sendSelectIdleCmdResponse
(
response
);
else
sendSelectBattleCmdResponse
(
response
);
clearAllIdleInteractivities
();
},
icon
:
currentPhase
>=
phase
||
!
checkPhaseEnabled
(
phase
)
?
(
store
.
currentPhase
>=
phase
||
disabled
?
(
<
CheckOutlined
/>
)
:
(
<
ArrowRightOutlined
/>
...
...
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