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
0b322a0a
Commit
0b322a0a
authored
Jan 01, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
render op monsters
parent
b2a44904
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
src/reducers/duel/monstersSlice.ts
src/reducers/duel/monstersSlice.ts
+4
-2
src/ui/Duel/monsters.tsx
src/ui/Duel/monsters.tsx
+18
-1
No files found.
src/reducers/duel/monstersSlice.ts
View file @
0b322a0a
...
...
@@ -8,13 +8,13 @@ import {
import
{
DuelState
}
from
"
./mod
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
RootState
}
from
"
../../store
"
;
import
{
CardMeta
,
fetchCard
}
from
"
../../api/cards
"
;
import
{
fetchCard
}
from
"
../../api/cards
"
;
export
interface
MonsterState
{
monsters
:
Monster
[];
}
// 初始化
自己的
怪兽区状态
// 初始化怪兽区状态
export
const
initMonstersImpl
:
CaseReducer
<
DuelState
,
PayloadAction
<
number
>>
=
(
state
,
action
...
...
@@ -168,3 +168,5 @@ export const monsterCase = (builder: ActionReducerMapBuilder<DuelState>) => {
export
const
selectMeMonsters
=
(
state
:
RootState
)
=>
state
.
duel
.
meMonsters
||
{
monsters
:
[]
};
export
const
selectOpMonsters
=
(
state
:
RootState
)
=>
state
.
duel
.
opMonsters
||
{
monsters
:
[]
};
src/ui/Duel/monsters.tsx
View file @
0b322a0a
...
...
@@ -14,7 +14,10 @@ import {
setCardModalText
,
}
from
"
../../reducers/duel/mod
"
;
import
{
useAppSelector
}
from
"
../../hook
"
;
import
{
selectMeMonsters
}
from
"
../../reducers/duel/monstersSlice
"
;
import
{
selectMeMonsters
,
selectOpMonsters
,
}
from
"
../../reducers/duel/monstersSlice
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
zip
}
from
"
./util
"
;
...
...
@@ -25,6 +28,8 @@ const gap = 1.05;
const
Monsters
=
()
=>
{
const
meMonsters
=
useAppSelector
(
selectMeMonsters
).
monsters
;
const
meMonsterPositions
=
monsterPositions
(
0
,
meMonsters
);
const
opMonsters
=
useAppSelector
(
selectOpMonsters
).
monsters
;
const
opMonsterPositions
=
monsterPositions
(
1
,
opMonsters
);
return
(
<>
...
...
@@ -39,6 +44,18 @@ const Monsters = () => {
/>
);
})
}
{
zip
(
opMonsters
,
opMonsterPositions
).
map
(([
monster
,
position
],
idx
)
=>
{
return
(
<
CommonMonster
state=
{
monster
}
key=
{
idx
}
position=
{
position
}
rotation=
{
CONFIG
.
CardSlotRotation
()
}
deffenseRotation=
{
CONFIG
.
CardSlotDefenceRotation
()
}
/>
);
})
}
<
ExtraMonsters
/>
<
ExtraMonsters
/>
</>
);
...
...
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