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
a199e5f5
Commit
a199e5f5
authored
Jan 01, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add modal list slice
parent
f5fb9b2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
src/reducers/duel/mod.ts
src/reducers/duel/mod.ts
+7
-0
src/reducers/duel/modalSlice.ts
src/reducers/duel/modalSlice.ts
+31
-0
No files found.
src/reducers/duel/mod.ts
View file @
a199e5f5
...
...
@@ -23,6 +23,8 @@ import {
setCardModalTextImpl
,
setCardModalImgUrlImpl
,
setCardModalInteractiviesImpl
,
setCardListModalIsOpenImpl
,
setCardListModalInfoImpl
,
}
from
"
./modalSlice
"
;
import
{
MonsterState
,
...
...
@@ -73,6 +75,7 @@ export interface DuelState {
const
initialState
:
DuelState
=
{
modalState
:
{
cardModal
:
{
isOpen
:
false
,
interactivies
:
[]
},
cardListModal
:
{
isOpen
:
false
,
list
:
[]
},
},
};
...
...
@@ -111,6 +114,8 @@ const duelSlice = createSlice({
setCardModalText
:
setCardModalTextImpl
,
setCardModalImgUrl
:
setCardModalImgUrlImpl
,
setCardModalInteractivies
:
setCardModalInteractiviesImpl
,
setCardListModalIsOpen
:
setCardListModalIsOpenImpl
,
setCardListModalInfo
:
setCardListModalInfoImpl
,
},
extraReducers
(
builder
)
{
handsCase
(
builder
);
...
...
@@ -141,6 +146,8 @@ export const {
clearMagicSelectInfo
,
removeHand
,
initCemetery
,
setCardListModalIsOpen
,
setCardListModalInfo
,
}
=
duelSlice
.
actions
;
export
const
selectDuelHsStart
=
(
state
:
RootState
)
=>
{
return
state
.
duel
.
meInitInfo
!=
null
;
...
...
src/reducers/duel/modalSlice.ts
View file @
a199e5f5
...
...
@@ -11,6 +11,15 @@ export interface ModalState {
imgUrl
?:
string
;
interactivies
:
{
desc
:
string
;
response
:
number
}[];
};
// 卡牌列表弹窗
cardListModal
:
{
isOpen
:
boolean
;
list
:
{
name
?:
string
;
desc
?:
string
;
imgUrl
?:
string
;
}[];
};
}
// 更新卡牌弹窗打开状态
...
...
@@ -49,6 +58,24 @@ export const setCardModalInteractiviesImpl: CaseReducer<
state
.
modalState
.
cardModal
.
interactivies
=
action
.
payload
;
};
// 更新卡牌列表弹窗打开状态
export
const
setCardListModalIsOpenImpl
:
CaseReducer
<
DuelState
,
PayloadAction
<
boolean
>
>
=
(
state
,
action
)
=>
{
state
.
modalState
.
cardListModal
.
isOpen
=
action
.
payload
;
};
// 更新卡牌列表文本
export
const
setCardListModalInfoImpl
:
CaseReducer
<
DuelState
,
PayloadAction
<
{
name
?:
string
;
desc
?:
string
;
imgUrl
?:
string
}[]
>
>
=
(
state
,
action
)
=>
{
const
list
=
action
.
payload
;
state
.
modalState
.
cardListModal
.
list
=
list
;
};
export
const
selectCardModalIsOpen
=
(
state
:
RootState
)
=>
state
.
duel
.
modalState
.
cardModal
.
isOpen
;
export
const
selectCardModalName
=
(
state
:
RootState
)
=>
...
...
@@ -59,3 +86,7 @@ export const selectCardModalImgUrl = (state: RootState) =>
state
.
duel
.
modalState
.
cardModal
.
imgUrl
;
export
const
selectCardModalInteractivies
=
(
state
:
RootState
)
=>
state
.
duel
.
modalState
.
cardModal
.
interactivies
;
export
const
selectCardListModalIsOpen
=
(
state
:
RootState
)
=>
state
.
duel
.
modalState
.
cardListModal
.
isOpen
;
export
const
selectCardListModalInfo
=
(
state
:
RootState
)
=>
state
.
duel
.
modalState
.
cardListModal
.
list
;
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