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
679c2d85
Commit
679c2d85
authored
Jul 29, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: small
parent
bfe20ce5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
20 deletions
+53
-20
neos-assets/neos-logo.svg
neos-assets/neos-logo.svg
+1
-1
src/ui/Duel/PlayMat/Menu/index.module.scss
src/ui/Duel/PlayMat/Menu/index.module.scss
+4
-0
src/ui/Duel/PlayMat/Menu/index.tsx
src/ui/Duel/PlayMat/Menu/index.tsx
+47
-18
src/ui/Start/index.module.scss
src/ui/Start/index.module.scss
+1
-1
No files found.
neos-assets/neos-logo.svg
View file @
679c2d85
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/ui/Duel/PlayMat/Menu/index.module.scss
View file @
679c2d85
...
...
@@ -11,3 +11,7 @@
border-radius
:
6px
;
overflow
:
hidden
;
}
:global
(
.ant-dropdown-menu-item
)
{
gap
:
8px
;
}
src/ui/Duel/PlayMat/Menu/index.tsx
View file @
679c2d85
...
...
@@ -2,8 +2,8 @@ import {
ArrowRightOutlined
,
CheckOutlined
,
CloseCircleFilled
,
createFromIconfontCN
,
MessageFilled
,
SettingOutlined
,
StepForwardFilled
,
}
from
"
@ant-design/icons
"
;
import
{
...
...
@@ -25,11 +25,15 @@ import {
sendSurrender
,
ygopro
,
}
from
"
@/api
"
;
import
{
cardStore
,
matStore
}
from
"
@/stores
"
;
import
{
cardStore
,
ChainSetting
,
matStore
}
from
"
@/stores
"
;
import
styles
from
"
./index.module.scss
"
;
import
PhaseType
=
ygopro
.
StocGameMessage
.
MsgNewPhase
.
PhaseType
;
const
IconFont
=
createFromIconfontCN
({
scriptUrl
:
[
"
//at.alicdn.com/t/c/font_4188978_z6f9ellbtoc.js
"
],
});
const
{
phase
}
=
matStore
;
const
{
useToken
}
=
theme
;
export
const
Menu
=
()
=>
{
...
...
@@ -38,8 +42,7 @@ export const Menu = () => {
const
enableBp
=
snapPhase
.
enableBp
;
const
enableM2
=
snapPhase
.
enableM2
;
const
enableEp
=
snapPhase
.
enableEp
;
const
{
currentPlayer
}
=
useSnapshot
(
matStore
);
const
{
chainSetting
}
=
useSnapshot
(
matStore
);
const
{
currentPlayer
,
chainSetting
}
=
useSnapshot
(
matStore
);
const
clearAllIdleInteractivities
=
()
=>
{
for
(
const
card
of
cardStore
.
inner
)
{
...
...
@@ -110,15 +113,21 @@ export const Menu = () => {
danger
:
phase
===
PhaseType
.
END
,
}));
const
chainSettingTexts
=
[
"
全部连锁
"
,
"
忽略连锁
"
,
"
智能连锁
"
];
const
chainSettingItems
:
MenuProps
[
"
items
"
]
=
chainSettingTexts
.
map
((
text
,
i
)
=>
({
const
chainSettingTexts
=
[
[
ChainSetting
.
CHAIN_ALL
,
"
全部连锁
"
],
[
ChainSetting
.
CHAIN_IGNORE
,
"
忽略连锁
"
],
[
ChainSetting
.
CHAIN_SMART
,
"
智能连锁
"
],
]
as
const
;
const
chainSettingItems
:
MenuProps
[
"
items
"
]
=
chainSettingTexts
.
map
(
([
key
,
text
])
=>
({
label
:
text
,
icon
:
<
ChainIcon
chainSetting=
{
key
}
/>,
key
,
onClick
:
()
=>
{
matStore
.
chainSetting
=
i
;
matStore
.
chainSetting
=
key
;
},
})
)
.
map
((
item
,
i
)
=>
({
key
:
i
,
...
item
})
);
})
);
const
surrenderMenuItems
:
MenuProps
[
"
items
"
]
=
[
{
...
...
@@ -148,14 +157,14 @@ export const Menu = () => {
</
Button
>
</
DropdownWithTitle
>
<
DropdownWithTitle
title=
{
chainSettingTexts
[
chainSetting
]
}
menu=
{
{
items
:
chainSettingItems
,
selectable
:
true
,
defaultSelectedKeys
:
[
"
3
"
],
}
}
>
<
Button
icon=
{
<
SettingOutlined
/>
}
type=
"text"
></
Button
>
<
Button
icon=
{
<
ChainIcon
chainSetting=
{
chainSetting
}
/>
}
type=
"text"
></
Button
>
</
DropdownWithTitle
>
<
Tooltip
title=
"聊天室"
>
<
Button
icon=
{
<
MessageFilled
/>
}
type=
"text"
></
Button
>
...
...
@@ -170,7 +179,7 @@ export const Menu = () => {
);
};
const
DropdownWithTitle
:
React
.
FC
<
DropdownProps
&
{
title
:
string
}
>
=
(
const
DropdownWithTitle
:
React
.
FC
<
DropdownProps
&
{
title
?
:
string
}
>
=
(
props
)
=>
{
const
{
token
}
=
useToken
();
...
...
@@ -187,17 +196,37 @@ const DropdownWithTitle: React.FC<DropdownProps & { title: string }> = (
{
...
props
}
dropdownRender=
{
(
menu
)
=>
(
<
div
style=
{
contentStyle
}
>
<
Space
style=
{
{
padding
:
"
12px 16px
"
}
}
>
{
props
.
title
}
</
Space
>
<
Divider
style=
{
{
margin
:
0
}
}
/>
{
props
.
title
&&
(
<>
<
Space
style=
{
{
padding
:
"
12px 16px
"
,
fontSize
:
12
}
}
>
{
props
.
title
}
</
Space
>
<
Divider
style=
{
{
margin
:
0
}
}
/>
</>
)
}
{
cloneElement
(
menu
as
React
.
ReactElement
,
{
style
:
menuStyle
,
})
}
</
div
>
)
}
arrow
trigger=
{
[
"
click
"
,
"
hover
"
]
}
trigger=
{
[
"
click
"
]
}
>
{
props
.
children
}
</
Dropdown
>
);
};
const
ChainIcon
:
React
.
FC
<
{
chainSetting
:
ChainSetting
}
>
=
({
chainSetting
,
})
=>
{
switch
(
chainSetting
)
{
case
ChainSetting
.
CHAIN_ALL
:
return
<
IconFont
type=
"icon-chain-all"
/>;
case
ChainSetting
.
CHAIN_SMART
:
return
<
IconFont
type=
"icon-chain"
/>;
case
ChainSetting
.
CHAIN_IGNORE
:
default
:
return
<
IconFont
type=
"icon-chain-broken"
/>;
}
};
src/ui/Start/index.module.scss
View file @
679c2d85
body
{
background
:
#0f131e
;
text-align
:
center
;
position
:
relative
;
margin
:
0
;
padding
:
0
;
...
...
@@ -13,6 +12,7 @@ body * {
.wrapper
{
position
:
relative
;
text-align
:
center
;
}
.wrapper
>
*
{
...
...
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