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
3400fea1
Commit
3400fea1
authored
Apr 29, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix block
parent
ff9bfc96
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
30 deletions
+56
-30
src/ui/Duel/PlayMat2/Block.tsx
src/ui/Duel/PlayMat2/Block.tsx
+48
-0
src/ui/Duel/PlayMat2/Mat.tsx
src/ui/Duel/PlayMat2/Mat.tsx
+8
-30
No files found.
src/ui/Duel/PlayMat2/Block.tsx
View file @
3400fea1
...
...
@@ -3,6 +3,8 @@ import "@/styles/mat.css";
import
classnames
from
"
classnames
"
;
import
React
,
{
MouseEventHandler
}
from
"
react
"
;
import
{
CardState
,
DuelFieldState
}
from
"
@/stores
"
;
export
const
Block
:
React
.
FC
<
{
isExtra
?:
boolean
;
highlight
?:
boolean
;
...
...
@@ -20,3 +22,49 @@ export const Block: React.FC<{
onClick=
{
onClick
}
/>
);
export
function
BlockRow
<
T
extends
DuelFieldState
>
(
props
:
{
states
:
T
})
{
return
(
<
div
className=
"block-row"
>
{
props
.
states
.
map
((
block
,
idx
)
=>
(
<
Block
key=
{
idx
}
highlight=
{
block
.
placeInteractivity
!==
undefined
}
onClick=
{
()
=>
{
// TODO
}
}
/>
))
}
</
div
>
);
}
export
const
ExtraBlockRow
:
React
.
FC
<
{
meLeft
:
CardState
;
meRight
:
CardState
;
opLeft
:
CardState
;
opRight
:
CardState
;
}
>
=
({
meLeft
,
meRight
,
opLeft
,
opRight
})
=>
(
<
div
className=
"block-row"
>
<
Block
highlight=
{
meLeft
.
placeInteractivity
!==
undefined
||
opLeft
.
placeInteractivity
!==
undefined
}
isExtra=
{
true
}
onClick=
{
()
=>
{
// TODO
}
}
/>
<
Block
highlight=
{
meRight
.
placeInteractivity
!==
undefined
||
opRight
.
placeInteractivity
!==
undefined
}
isExtra=
{
true
}
onClick=
{
()
=>
{
// TODO
}
}
/>
</
div
>
);
src/ui/Duel/PlayMat2/Mat.tsx
View file @
3400fea1
...
...
@@ -3,9 +3,9 @@ import "@/styles/mat.css";
import
React
from
"
react
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
DuelFieldState
,
matStore
}
from
"
@/stores
"
;
import
{
CardState
,
DuelFieldState
,
matStore
}
from
"
@/stores
"
;
import
{
Block
}
from
"
./Block
"
;
import
{
Block
Row
,
ExtraBlockRow
}
from
"
./Block
"
;
import
{
Menu
}
from
"
./Menu
"
;
export
const
Mat
=
()
=>
{
...
...
@@ -22,16 +22,14 @@ export const Mat = () => {
</
div
>
<
div
id=
"camera"
>
<
div
id=
"board"
>
<
div
id=
"bo
ra
d-bg"
>
<
div
id=
"bo
ar
d-bg"
>
<
BlockRow
states=
{
magics
.
op
.
slice
(
0
,
5
)
as
DuelFieldState
}
/>
<
BlockRow
states=
{
monsters
.
op
.
slice
(
0
,
5
)
as
DuelFieldState
}
/>
<
BlockRow
states=
{
monsters
.
op
.
slice
(
5
,
7
)
as
DuelFieldState
}
isExtra=
{
true
}
/>
<
BlockRow
states=
{
monsters
.
me
.
slice
(
5
,
7
)
as
DuelFieldState
}
isExtra=
{
true
}
<
ExtraBlockRow
meLeft=
{
monsters
.
me
[
5
]
as
CardState
}
meRight=
{
monsters
.
me
[
6
]
as
CardState
}
opLeft=
{
monsters
.
op
[
5
]
as
CardState
}
opRight=
{
monsters
.
op
[
6
]
as
CardState
}
/>
<
BlockRow
states=
{
monsters
.
me
.
slice
(
0
,
5
)
as
DuelFieldState
}
/>
<
BlockRow
states=
{
magics
.
me
.
slice
(
0
,
5
)
as
DuelFieldState
}
/>
...
...
@@ -41,23 +39,3 @@ export const Mat = () => {
</>
);
};
function
BlockRow
<
T
extends
DuelFieldState
>
(
props
:
{
states
:
T
;
isExtra
?:
boolean
;
})
{
return
(
<
div
className=
"block-row"
>
{
props
.
states
.
map
((
block
,
idx
)
=>
(
<
Block
key=
{
idx
}
isExtra=
{
props
.
isExtra
}
highlight=
{
block
.
placeInteractivity
!==
undefined
}
onClick=
{
()
=>
{
// TODO
}
}
/>
))
}
</
div
>
);
}
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