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
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
Pipeline
#23492
passed with stages
in 21 minutes and 1 second
Changes
2
Pipelines
1
Show 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;
...
@@ -8,8 +8,6 @@ export const DESCRIPTION_LIMIT = 10000;
export
async
function
initStrings
()
{
export
async
function
initStrings
()
{
const
strings
=
await
(
await
fetch
(
stringsUrl
)).
text
();
const
strings
=
await
(
await
fetch
(
stringsUrl
)).
text
();
console
.
log
({
strings
});
const
lineIter
=
strings
.
split
(
"
\n
"
);
const
lineIter
=
strings
.
split
(
"
\n
"
);
for
(
const
line
of
lineIter
)
{
for
(
const
line
of
lineIter
)
{
if
(
!
line
.
startsWith
(
"
#
"
)
&&
line
!==
""
)
{
if
(
!
line
.
startsWith
(
"
#
"
)
&&
line
!==
""
)
{
...
...
src/ui/Duel/PlayMat/Menu/index.tsx
View file @
9a562f46
...
@@ -30,14 +30,10 @@ import { IconFont } from "@/ui/Shared";
...
@@ -30,14 +30,10 @@ import { IconFont } from "@/ui/Shared";
import
styles
from
"
./index.module.scss
"
;
import
styles
from
"
./index.module.scss
"
;
import
PhaseType
=
ygopro
.
StocGameMessage
.
MsgNewPhase
.
PhaseType
;
import
PhaseType
=
ygopro
.
StocGameMessage
.
MsgNewPhase
.
PhaseType
;
const
{
phase
}
=
matStore
;
const
{
phase
:
store
}
=
matStore
;
const
{
useToken
}
=
theme
;
const
{
useToken
}
=
theme
;
export
const
Menu
=
()
=>
{
export
const
Menu
=
()
=>
{
const
snapPhase
=
useSnapshot
(
phase
);
const
{
enableBp
,
enableM2
,
enableEp
,
currentPhase
}
=
useSnapshot
(
store
);
const
currentPhase
=
snapPhase
.
currentPhase
;
const
enableBp
=
snapPhase
.
enableBp
;
const
enableM2
=
snapPhase
.
enableM2
;
const
enableEp
=
snapPhase
.
enableEp
;
const
{
currentPlayer
,
chainSetting
}
=
useSnapshot
(
matStore
);
const
{
currentPlayer
,
chainSetting
}
=
useSnapshot
(
matStore
);
const
clearAllIdleInteractivities
=
()
=>
{
const
clearAllIdleInteractivities
=
()
=>
{
...
@@ -56,52 +52,40 @@ export const Menu = () => {
...
@@ -56,52 +52,40 @@ export const Menu = () => {
?
3
?
3
:
7
;
:
7
;
// PhaseType, 中文, response, 是否显示
// PhaseType, 中文, response, 是否显示
,是否禁用
const
phaseBind
:
[
const
phaseBind
:
[
phase
:
PhaseType
,
phase
:
PhaseType
,
label
:
string
,
label
:
string
,
response
:
number
,
response
:
number
,
show
:
boolean
,
show
:
boolean
,
disabled
:
boolean
,
][]
=
[
][]
=
[
[
PhaseType
.
DRAW
,
"
抽卡阶段
"
,
-
1
,
true
],
[
PhaseType
.
DRAW
,
"
抽卡阶段
"
,
-
1
,
true
,
true
],
[
PhaseType
.
STANDBY
,
"
准备阶段
"
,
-
1
,
true
],
[
PhaseType
.
STANDBY
,
"
准备阶段
"
,
-
1
,
true
,
true
],
[
PhaseType
.
MAIN1
,
"
主要阶段 1
"
,
-
1
,
true
],
[
PhaseType
.
MAIN1
,
"
主要阶段 1
"
,
-
1
,
true
,
true
],
[
PhaseType
.
BATTLE
,
"
战斗阶段
"
,
6
,
true
],
[
PhaseType
.
BATTLE
,
"
战斗阶段
"
,
6
,
true
,
!
enableBp
],
[
PhaseType
.
BATTLE_START
,
"
战斗开始
"
,
3
,
false
],
[
PhaseType
.
BATTLE_START
,
"
战斗开始
"
,
3
,
false
,
true
],
[
PhaseType
.
BATTLE_STEP
,
"
战斗步骤
"
,
3
,
false
],
[
PhaseType
.
BATTLE_STEP
,
"
战斗步骤
"
,
3
,
false
,
true
],
[
PhaseType
.
DAMAGE
,
"
伤害步骤
"
,
3
,
false
],
[
PhaseType
.
DAMAGE
,
"
伤害步骤
"
,
3
,
false
,
true
],
[
PhaseType
.
DAMAGE_GAL
,
"
伤害步骤(伤害计算)
"
,
3
,
false
],
[
PhaseType
.
DAMAGE_GAL
,
"
伤害步骤(伤害计算)
"
,
3
,
false
,
true
],
[
PhaseType
.
MAIN2
,
"
主要阶段 2
"
,
2
,
true
],
[
PhaseType
.
MAIN2
,
"
主要阶段 2
"
,
2
,
true
,
!
enableM2
],
[
PhaseType
.
END
,
"
结束阶段
"
,
endResponse
,
true
],
[
PhaseType
.
END
,
"
结束阶段
"
,
endResponse
,
true
,
!
enableEp
],
[
PhaseType
.
UNKNOWN
,
"
未知阶段
"
,
-
1
,
false
],
[
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
const
phaseSwitchItems
:
MenuProps
[
"
items
"
]
=
phaseBind
.
filter
(([,
,
,
show
])
=>
show
)
.
filter
(([,
,
,
show
])
=>
show
)
.
map
(([
phase
,
label
,
response
,
_
],
key
)
=>
({
.
map
(([
phase
,
label
,
response
,
_
,
disabled
],
key
)
=>
({
key
,
key
,
label
,
label
,
disabled
:
currentPhase
>=
phase
||
!
checkPhaseEnabled
(
phase
)
,
disabled
:
store
.
currentPhase
>=
phase
||
disabled
,
onClick
:
()
=>
{
onClick
:
()
=>
{
if
(
response
===
2
)
sendSelectIdleCmdResponse
(
response
);
if
(
response
===
2
)
sendSelectIdleCmdResponse
(
response
);
else
sendSelectBattleCmdResponse
(
response
);
else
sendSelectBattleCmdResponse
(
response
);
clearAllIdleInteractivities
();
clearAllIdleInteractivities
();
},
},
icon
:
icon
:
currentPhase
>=
phase
||
!
checkPhaseEnabled
(
phase
)
?
(
store
.
currentPhase
>=
phase
||
disabled
?
(
<
CheckOutlined
/>
<
CheckOutlined
/>
)
:
(
)
:
(
<
ArrowRightOutlined
/>
<
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