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
fcb1fe34
Commit
fcb1fe34
authored
Mar 12, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
e2e42df3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
5 deletions
+44
-5
src/common.ts
src/common.ts
+32
-0
src/ui/Duel/cardModal.tsx
src/ui/Duel/cardModal.tsx
+12
-5
No files found.
src/common.ts
View file @
fcb1fe34
...
...
@@ -126,3 +126,35 @@ export const Meta2StringCodeMap: Map<number, number> = new Map([
[
RACE_WYRM
,
1043
],
[
RACE_CYBERSE
,
1044
],
]);
/*
* ygopro将卡牌类型按位运算进行了编码,这里将编码信息提出出来*/
export
function
extraCardTypes
(
typeCode
:
number
):
number
[]
{
return
[
TYPE_MONSTER
,
TYPE_SPELL
,
TYPE_TRAP
,
TYPE_NORMAL
,
TYPE_EFFECT
,
TYPE_FUSION
,
TYPE_RITUAL
,
TYPE_TRAPMONSTER
,
TYPE_SPIRIT
,
TYPE_UNION
,
TYPE_DUAL
,
TYPE_TUNER
,
TYPE_SYNCHRO
,
TYPE_TOKEN
,
TYPE_QUICKPLAY
,
TYPE_CONTINUOUS
,
TYPE_EQUIP
,
TYPE_FIELD
,
TYPE_COUNTER
,
TYPE_FLIP
,
TYPE_TOON
,
TYPE_XYZ
,
TYPE_PENDULUM
,
TYPE_SPSUMMON
,
TYPE_LINK
,
].
filter
((
target
)
=>
(
target
&
typeCode
)
>
0
);
}
src/ui/Duel/cardModal.tsx
View file @
fcb1fe34
...
...
@@ -16,7 +16,7 @@ import Icon, { StarOutlined } from "@ant-design/icons";
import
NeosConfig
from
"
../../../neos.config.json
"
;
import
{
ReactComponent
as
BattleSvg
}
from
"
../../../neos-assets/battle-axe.svg
"
;
import
{
ReactComponent
as
DefenceSvg
}
from
"
../../../neos-assets/checked-shield.svg
"
;
import
{
Meta2StringCodeMap
}
from
"
../../common
"
;
import
{
extraCardTypes
,
Meta2StringCodeMap
}
from
"
../../common
"
;
import
{
fetchStrings
}
from
"
../../api/strings
"
;
const
{
Meta
}
=
Card
;
...
...
@@ -27,7 +27,7 @@ const CardModal = () => {
const
isOpen
=
useAppSelector
(
selectCardModalIsOpen
);
const
meta
=
useAppSelector
(
selectCardModalMeta
);
const
name
=
meta
?.
text
.
name
;
const
types
=
meta
?.
text
.
types
;
const
types
=
meta
?.
data
.
type
;
const
race
=
meta
?.
data
.
race
;
const
attribute
=
meta
?.
data
.
attribute
;
const
level
=
meta
?.
data
.
level
;
...
...
@@ -52,7 +52,11 @@ const CardModal = () => {
>
<
Meta
title=
{
name
}
/>
<
p
>
<
AttLine
types=
{
types
}
race=
{
race
}
attribute=
{
attribute
}
/>
<
AttLine
types=
{
extraCardTypes
(
types
||
0
)
}
race=
{
race
}
attribute=
{
attribute
}
/>
</
p
>
<
p
>
<
AtkLine
level=
{
level
}
atk=
{
atk
}
def=
{
def
}
/>
...
...
@@ -109,7 +113,7 @@ const AtkLine = (props: { level?: number; atk?: number; def?: number }) => (
);
const
AttLine
=
(
props
:
{
types
?:
string
;
types
:
number
[]
;
race
?:
number
;
attribute
?:
number
;
})
=>
{
...
...
@@ -119,9 +123,12 @@ const AttLine = (props: {
const
attribute
=
props
.
attribute
?
fetchStrings
(
"
!system
"
,
Meta2StringCodeMap
.
get
(
props
.
attribute
)
||
0
)
:
undefined
;
const
types
=
props
.
types
.
map
((
t
)
=>
fetchStrings
(
"
!system
"
,
Meta2StringCodeMap
.
get
(
t
)
||
0
))
.
join
(
"
|
"
);
return
(
<
Row
gutter=
{
8
}
>
{
props
.
types
?
<
Col
>
{
`[${props.types}]`
}
</
Col
>
:
<></>
}
<
Col
>
{
`[${types}]`
}
</
Col
>
{
race
?
<
Col
>
{
race
}
</
Col
>
:
<></>
}
<
Col
>
/
</
Col
>
{
attribute
?
<
Col
>
{
attribute
}
</
Col
>
:
<></>
}
...
...
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