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
deft
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 {
...
@@ -8,13 +8,13 @@ import {
import
{
DuelState
}
from
"
./mod
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
RootState
}
from
"
../../store
"
;
import
{
RootState
}
from
"
../../store
"
;
import
{
CardMeta
,
fetchCard
}
from
"
../../api/cards
"
;
import
{
fetchCard
}
from
"
../../api/cards
"
;
export
interface
MonsterState
{
export
interface
MonsterState
{
monsters
:
Monster
[];
monsters
:
Monster
[];
}
}
// 初始化
自己的
怪兽区状态
// 初始化怪兽区状态
export
const
initMonstersImpl
:
CaseReducer
<
DuelState
,
PayloadAction
<
number
>>
=
(
export
const
initMonstersImpl
:
CaseReducer
<
DuelState
,
PayloadAction
<
number
>>
=
(
state
,
state
,
action
action
...
@@ -168,3 +168,5 @@ export const monsterCase = (builder: ActionReducerMapBuilder<DuelState>) => {
...
@@ -168,3 +168,5 @@ export const monsterCase = (builder: ActionReducerMapBuilder<DuelState>) => {
export
const
selectMeMonsters
=
(
state
:
RootState
)
=>
export
const
selectMeMonsters
=
(
state
:
RootState
)
=>
state
.
duel
.
meMonsters
||
{
monsters
:
[]
};
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 {
...
@@ -14,7 +14,10 @@ import {
setCardModalText
,
setCardModalText
,
}
from
"
../../reducers/duel/mod
"
;
}
from
"
../../reducers/duel/mod
"
;
import
{
useAppSelector
}
from
"
../../hook
"
;
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
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
zip
}
from
"
./util
"
;
import
{
zip
}
from
"
./util
"
;
...
@@ -25,6 +28,8 @@ const gap = 1.05;
...
@@ -25,6 +28,8 @@ const gap = 1.05;
const
Monsters
=
()
=>
{
const
Monsters
=
()
=>
{
const
meMonsters
=
useAppSelector
(
selectMeMonsters
).
monsters
;
const
meMonsters
=
useAppSelector
(
selectMeMonsters
).
monsters
;
const
meMonsterPositions
=
monsterPositions
(
0
,
meMonsters
);
const
meMonsterPositions
=
monsterPositions
(
0
,
meMonsters
);
const
opMonsters
=
useAppSelector
(
selectOpMonsters
).
monsters
;
const
opMonsterPositions
=
monsterPositions
(
1
,
opMonsters
);
return
(
return
(
<>
<>
...
@@ -39,6 +44,18 @@ const Monsters = () => {
...
@@ -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
/>
<
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