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
8e69b403
Commit
8e69b403
authored
Sep 15, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/select_coutner' into 'main'
修复一些指示器相关的问题 See merge request
mycard/Neos!316
parents
3d7dd366
e503eea3
Pipeline
#23477
passed with stages
in 17 minutes and 18 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
25 deletions
+33
-25
src/ui/Duel/Message/CardModal/index.module.scss
src/ui/Duel/Message/CardModal/index.module.scss
+4
-2
src/ui/Duel/Message/CardModal/index.tsx
src/ui/Duel/Message/CardModal/index.tsx
+19
-18
src/ui/Duel/Message/CheckCounterModal.tsx
src/ui/Duel/Message/CheckCounterModal.tsx
+10
-5
No files found.
src/ui/Duel/Message/CardModal/index.module.scss
View file @
8e69b403
...
...
@@ -26,7 +26,9 @@
height
:
100%
;
}
.atkLine
{
.atkLine
,
.counterLine
{
.title
,
.number
{
font-family
:
var
(
--
theme-font
);
...
...
@@ -46,5 +48,5 @@
.info
{
justify-content
:
space-between
;
position
:
relative
;
height
:
2
04
px
;
// TODO - fix this
height
:
2
30
px
;
// TODO - fix this
}
src/ui/Duel/Message/CardModal/index.tsx
View file @
8e69b403
...
...
@@ -41,7 +41,7 @@ const store = proxy(defaultStore);
export
const
CardModal
=
()
=>
{
const
snap
=
useSnapshot
(
store
);
const
{
isOpen
,
meta
,
counters
:
_counters
}
=
snap
;
const
{
isOpen
,
meta
,
counters
}
=
snap
;
const
name
=
meta
?.
text
.
name
;
const
types
=
extraCardTypes
(
meta
?.
data
.
type
??
0
);
...
...
@@ -80,10 +80,10 @@ export const CardModal = () => {
atk=
{
atk
}
def=
{
types
.
includes
(
TYPE_LINK
)
?
undefined
:
def
}
/>
<
CounterLine
counters=
{
counters
}
/>
<
AttLine
types=
{
types
}
race=
{
race
}
attribute=
{
attribute
}
/>
{
/* TODO: 只有怪兽卡需要展示攻击防御 */
}
{
/* TODO: 展示星级/LINK数 */
}
{
/* <CounterLine counters={counters} /> */
}
</
Space
>
</
Space
>
<
Divider
style=
{
{
margin
:
"
14px 0
"
}
}
></
Divider
>
...
...
@@ -132,23 +132,24 @@ const AtkLine = (props: { atk?: number; def?: number }) => (
</
Space
>
);
// TODO: 未完成,研究一下怎么展示这个信息
const
_CounterLine
=
(
props
:
{
counters
:
{
[
type
:
number
]:
number
}
})
=>
{
const
counters
=
[];
for
(
const
counterType
in
props
.
counters
)
{
const
count
=
props
.
counters
[
counterType
];
if
(
count
>
0
)
{
const
counterStr
=
fetchStrings
(
Region
.
Counter
,
`0x
${
counterType
}
`
);
counters
.
push
(
`
${
counterStr
}
:
${
count
}
`
);
}
}
const
CounterLine
=
(
props
:
{
counters
:
{
[
type
:
number
]:
number
}
})
=>
{
return
(
<>
{
counters
.
map
((
counter
)
=>
(
<
div
>
{
counter
}
</
div
>
))
}
</>
<
Space
size=
{
10
}
className=
{
styles
.
counterLine
}
direction=
"vertical"
>
{
Object
.
entries
(
props
.
counters
).
map
(
([
counterType
,
count
],
idx
)
=>
count
>
0
&&
(
<
div
key=
{
idx
}
>
<
div
className=
{
styles
.
title
}
>
{
fetchStrings
(
Region
.
Counter
,
`0x${Number(counterType).toString(16)}`
,
)
}
</
div
>
<
div
className=
{
styles
.
number
}
>
{
count
}
</
div
>
</
div
>
),
)
}
</
Space
>
);
};
...
...
src/ui/Duel/Message/CheckCounterModal.tsx
View file @
8e69b403
// 指示器选择弹窗
import
{
Omit
}
from
"
@react-spring/web
"
;
import
{
Button
,
Card
,
Col
,
InputNumber
,
Row
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
React
,
{
use
Effect
,
use
State
}
from
"
react
"
;
import
{
proxy
,
useSnapshot
}
from
"
valtio
"
;
import
{
fetchStrings
,
Region
,
sendSelectCounterResponse
}
from
"
@/api
"
;
...
...
@@ -41,6 +41,10 @@ export const CheckCounterModal = () => {
const
sum
=
selected
.
reduce
((
sum
,
current
)
=>
sum
+
current
,
0
);
const
finishable
=
sum
===
min
;
useEffect
(()
=>
{
setSelected
(
new
Array
(
options
.
length
));
},
[
options
]);
const
onFinish
=
()
=>
{
sendSelectCounterResponse
(
selected
);
rs
();
...
...
@@ -75,10 +79,11 @@ export const CheckCounterModal = () => {
max=
{
option
.
max
}
defaultValue=
{
0
}
onChange=
{
(
value
)
=>
{
let
newSelected
=
[...
selected
];
newSelected
[
idx
]
=
value
||
0
;
setSelected
(
newSelected
);
setSelected
((
prevSelected
)
=>
{
let
newSelected
=
[...
prevSelected
];
newSelected
[
idx
]
=
value
??
0
;
return
newSelected
;
});
}
}
/>
</
Card
>
...
...
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