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
d21e74cc
Commit
d21e74cc
authored
Mar 12, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
364ae7c0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
22 deletions
+25
-22
src/api/strings.ts
src/api/strings.ts
+1
-4
src/reducers/duel/hintSlice.ts
src/reducers/duel/hintSlice.ts
+1
-1
src/reducers/duel/modal/yesNoModalSlice.ts
src/reducers/duel/modal/yesNoModalSlice.ts
+1
-1
src/ui/Duel/cardModal.tsx
src/ui/Duel/cardModal.tsx
+22
-16
No files found.
src/api/strings.ts
View file @
d21e74cc
...
@@ -13,9 +13,6 @@ export async function initStrings() {
...
@@ -13,9 +13,6 @@ export async function initStrings() {
}
}
}
}
export
async
function
fetchStrings
(
export
function
fetchStrings
(
region
:
string
,
id
:
number
):
string
{
region
:
string
,
id
:
number
):
Promise
<
string
>
{
return
localStorage
.
getItem
(
`
${
region
}
_
${
id
}
`
)
||
""
;
return
localStorage
.
getItem
(
`
${
region
}
_
${
id
}
`
)
||
""
;
}
}
src/reducers/duel/hintSlice.ts
View file @
d21e74cc
...
@@ -16,7 +16,7 @@ export const fetchCommonHintMeta = createAsyncThunk(
...
@@ -16,7 +16,7 @@ export const fetchCommonHintMeta = createAsyncThunk(
const
player
=
param
[
0
];
const
player
=
param
[
0
];
const
hintData
=
param
[
1
];
const
hintData
=
param
[
1
];
const
hintMeta
=
await
fetchStrings
(
"
!system
"
,
hintData
);
const
hintMeta
=
fetchStrings
(
"
!system
"
,
hintData
);
const
response
:
[
number
,
string
]
=
[
player
,
hintMeta
];
const
response
:
[
number
,
string
]
=
[
player
,
hintMeta
];
return
response
;
return
response
;
...
...
src/reducers/duel/modal/yesNoModalSlice.ts
View file @
d21e74cc
...
@@ -31,7 +31,7 @@ export const fetchYesNoMeta = createAsyncThunk(
...
@@ -31,7 +31,7 @@ export const fetchYesNoMeta = createAsyncThunk(
cardLocation
:
ygopro
.
CardLocation
cardLocation
:
ygopro
.
CardLocation
)
=>
string
;
)
=>
string
;
})
=>
{
})
=>
{
const
desc
=
await
fetchStrings
(
"
!system
"
,
param
.
descCode
);
const
desc
=
fetchStrings
(
"
!system
"
,
param
.
descCode
);
const
meta
=
await
fetchCard
(
param
.
code
,
true
);
const
meta
=
await
fetchCard
(
param
.
code
,
true
);
// TODO: 国际化文案
// TODO: 国际化文案
...
...
src/ui/Duel/cardModal.tsx
View file @
d21e74cc
...
@@ -17,6 +17,7 @@ import NeosConfig from "../../../neos.config.json";
...
@@ -17,6 +17,7 @@ import NeosConfig from "../../../neos.config.json";
import
{
ReactComponent
as
BattleSvg
}
from
"
../../../neos-assets/battle-axe.svg
"
;
import
{
ReactComponent
as
BattleSvg
}
from
"
../../../neos-assets/battle-axe.svg
"
;
import
{
ReactComponent
as
DefenceSvg
}
from
"
../../../neos-assets/checked-shield.svg
"
;
import
{
ReactComponent
as
DefenceSvg
}
from
"
../../../neos-assets/checked-shield.svg
"
;
import
{
Meta2StringCodeMap
}
from
"
../../common
"
;
import
{
Meta2StringCodeMap
}
from
"
../../common
"
;
import
{
fetchStrings
}
from
"
../../api/strings
"
;
const
{
Meta
}
=
Card
;
const
{
Meta
}
=
Card
;
const
CARD_WIDTH
=
240
;
const
CARD_WIDTH
=
240
;
...
@@ -51,10 +52,10 @@ const CardModal = () => {
...
@@ -51,10 +52,10 @@ const CardModal = () => {
>
>
<
Meta
title=
{
name
}
/>
<
Meta
title=
{
name
}
/>
<
p
>
<
p
>
<
At
kLine
level=
{
level
}
atk=
{
atk
}
def=
{
def
}
/>
<
At
tLine
types=
{
types
}
race=
{
race
}
attribute=
{
attribute
}
/>
</
p
>
</
p
>
<
p
>
<
p
>
<
At
tLine
types=
{
types
}
race=
{
race
}
attribute=
{
attribute
}
/>
<
At
kLine
level=
{
level
}
atk=
{
atk
}
def=
{
def
}
/>
</
p
>
</
p
>
<
p
>
{
desc
}
</
p
>
<
p
>
{
desc
}
</
p
>
</
Card
>
</
Card
>
...
@@ -113,18 +114,23 @@ const AttLine = (props: {
...
@@ -113,18 +114,23 @@ const AttLine = (props: {
types
?:
string
;
types
?:
string
;
race
?:
number
;
race
?:
number
;
attribute
?:
number
;
attribute
?:
number
;
})
=>
(
})
=>
{
const
race
=
props
.
race
?
fetchStrings
(
"
!system
"
,
Meta2StringCodeMap
.
get
(
props
.
race
)
||
0
)
:
undefined
;
const
attribute
=
props
.
attribute
?
fetchStrings
(
"
!system
"
,
Meta2StringCodeMap
.
get
(
props
.
attribute
)
||
0
)
:
undefined
;
return
(
<
Row
gutter=
{
8
}
>
<
Row
gutter=
{
8
}
>
{
props
.
types
?
<
Col
>
{
`[${props.types}]`
}
</
Col
>
:
<></>
}
{
props
.
types
?
<
Col
>
{
`[${props.types}]`
}
</
Col
>
:
<></>
}
{
props
.
race
?
<
Col
>
{
Meta2StringCodeMap
.
get
(
props
.
race
)
}
</
Col
>
:
<></>
}
{
race
?
<
Col
>
{
race
}
</
Col
>
:
<></>
}
<
Col
>
<
Col
>
<
div
>
/
</
div
>
<
div
>
/
</
div
>
</
Col
>
</
Col
>
{
props
.
attribute
?
(
{
attribute
?
<
Col
>
{
attribute
}
</
Col
>
:
<></>
}
<
Col
>
{
Meta2StringCodeMap
.
get
(
props
.
attribute
)
}
</
Col
>
)
:
(
<></>
)
}
</
Row
>
</
Row
>
);
);
};
export
default
CardModal
;
export
default
CardModal
;
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