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
79f8700c
Commit
79f8700c
authored
Jul 30, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: dropdown menu icon
parent
bc8d435b
Pipeline
#22855
failed with stages
in 12 minutes
Changes
7
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
91 additions
and
8 deletions
+91
-8
src/ui/Duel/PlayMat/Card/index.tsx
src/ui/Duel/PlayMat/Card/index.tsx
+4
-1
src/ui/Duel/PlayMat/Mat/index.module.scss
src/ui/Duel/PlayMat/Mat/index.module.scss
+1
-1
src/ui/Duel/PlayMat/Menu/index.tsx
src/ui/Duel/PlayMat/Menu/index.tsx
+1
-5
src/ui/Duel/utils/index.ts
src/ui/Duel/utils/index.ts
+1
-1
src/ui/Duel/utils/interactTypeToStringIcon.tsx
src/ui/Duel/utils/interactTypeToStringIcon.tsx
+70
-0
src/ui/Shared/IconFont.tsx
src/ui/Shared/IconFont.tsx
+13
-0
src/ui/Shared/index.ts
src/ui/Shared/index.ts
+1
-0
No files found.
src/ui/Duel/PlayMat/Card/index.tsx
View file @
79f8700c
...
...
@@ -21,7 +21,7 @@ import {
displayOptionModal
,
displaySimpleSelectCardsModal
,
}
from
"
../../Message
"
;
import
{
interactTypeToString
}
from
"
../../utils
"
;
import
{
interactTypeTo
Icon
,
interactTypeTo
String
}
from
"
../../utils
"
;
import
styles
from
"
./index.module.scss
"
;
import
{
attack
,
...
...
@@ -31,6 +31,7 @@ import {
type
MoveOptions
,
}
from
"
./springs
"
;
import
type
{
SpringApiProps
}
from
"
./springs/types
"
;
import
{
IconFont
}
from
"
@/ui/Shared
"
;
const
{
HAND
,
GRAVE
,
REMOVED
,
EXTRA
,
MZONE
,
SZONE
,
TZONE
}
=
ygopro
.
CardZone
;
...
...
@@ -152,6 +153,7 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
([
action
,
cards
],
key
)
=>
({
key
,
label
:
interactTypeToString
(
action
),
icon
:
interactTypeToIcon
(
action
),
onClick
:
async
()
=>
{
if
(
!
isField
)
{
// 单卡: 直接召唤/特殊召唤/...
...
...
@@ -185,6 +187,7 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
const
effectItem
:
DropdownItem
=
{
key
:
nonEffectItem
.
length
,
label
:
interactTypeToString
(
InteractType
.
ACTIVATE
),
icon
:
interactTypeToIcon
(
InteractType
.
ACTIVATE
),
onClick
:
async
()
=>
{
let
tmpCard
:
CardType
;
if
(
!
isField
)
{
...
...
src/ui/Duel/PlayMat/Mat/index.module.scss
View file @
79f8700c
body
{
background-image
:
url(/neos-assets/play-mat.png)
;
//
background-image: url(/neos-assets/play-mat.png);
background-repeat
:
no-repeat
;
background-size
:
cover
;
}
...
...
src/ui/Duel/PlayMat/Menu/index.tsx
View file @
79f8700c
...
...
@@ -2,7 +2,6 @@ import {
ArrowRightOutlined
,
CheckOutlined
,
CloseCircleFilled
,
createFromIconfontCN
,
MessageFilled
,
StepForwardFilled
,
}
from
"
@ant-design/icons
"
;
...
...
@@ -26,14 +25,11 @@ import {
ygopro
,
}
from
"
@/api
"
;
import
{
cardStore
,
ChainSetting
,
matStore
}
from
"
@/stores
"
;
import
{
IconFont
}
from
"
@/ui/Shared
"
;
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
=
()
=>
{
...
...
src/ui/Duel/utils/index.ts
View file @
79f8700c
export
*
from
"
./groupBy
"
;
export
*
from
"
./interactTypeToString
"
;
export
*
from
"
./interactTypeToString
Icon
"
;
export
*
from
"
./zip
"
;
src/ui/Duel/utils/interactTypeToString
.ts
→
src/ui/Duel/utils/interactTypeToString
Icon.tsx
View file @
79f8700c
import
{
ygopro
}
from
"
@/api
"
;
import
{
InteractType
}
from
"
@/stores
"
;
import
{
IconFont
}
from
"
@/ui/Shared
"
;
import
CardPosition
=
ygopro
.
CardPosition
;
export
function
interactTypeToString
(
t
:
InteractType
):
string
{
switch
(
t
)
{
...
...
@@ -20,3 +24,47 @@ export function interactTypeToString(t: InteractType): string {
return
"
未知选项
"
;
}
}
const
Icon
:
React
.
FC
<
{
type
:
string
;
size
?:
number
}
>
=
({
type
,
size
=
24
,
})
=>
(
<
IconFont
type=
{
type
}
size=
{
size
}
style=
{
{
width
:
24
,
height
:
30
,
marginRight
:
6
,
justifyContent
:
"
center
"
,
}
}
/>
);
export
function
interactTypeToIcon
(
t
:
InteractType
,
position
?:
CardPosition
):
JSX
.
Element
{
switch
(
t
)
{
case
InteractType
.
POS_CHANGE
:
if
(
position
===
CardPosition
.
FACEDOWN_ATTACK
)
return
<
IconFont
type=
"icon-back-defence"
/>;
else
if
(
position
===
CardPosition
.
FACEDOWN_DEFENSE
)
return
<
IconFont
type=
"icon-back"
size=
{
22
}
/>;
else
if
(
position
===
CardPosition
.
FACEUP_DEFENSE
)
return
<
IconFont
type=
"icon-front"
size=
{
22
}
/>;
return
<
Icon
type=
"icon-front-defence"
/>;
case
InteractType
.
MSET
:
return
<
Icon
type=
"icon-back-defence"
/>;
case
InteractType
.
SSET
:
return
<
Icon
type=
"icon-back"
size=
{
22
}
/>;
case
InteractType
.
ACTIVATE
:
return
<
Icon
type=
"icon-activate"
/>;
case
InteractType
.
ATTACK
:
return
<
Icon
type=
"icon-attack"
size=
{
20
}
/>;
case
InteractType
.
SUMMON
:
case
InteractType
.
SP_SUMMON
:
default
:
return
<
Icon
type=
"icon-summon"
size=
{
20
}
/>;
}
}
src/ui/Shared/IconFont.tsx
0 → 100644
View file @
79f8700c
import
{
createFromIconfontCN
}
from
"
@ant-design/icons
"
;
const
_IconFont
=
createFromIconfontCN
({
scriptUrl
:
[
"
//at.alicdn.com/t/c/font_4188978_14gvq0ry2bk.js
"
],
});
export
const
IconFont
:
React
.
FC
<
{
type
:
string
;
size
?:
number
;
style
?:
React
.
CSSProperties
;
}
>
=
({
type
,
size
=
14
,
style
})
=>
(
<
_IconFont
type=
{
type
}
style=
{
{
...
style
,
fontSize
:
size
}
}
/>
);
src/ui/Shared/index.ts
View file @
79f8700c
export
*
from
"
./css
"
;
export
*
from
"
./YgoCard
"
;
export
*
from
"
./IconFont
"
;
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