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
12102999
Commit
12102999
authored
Mar 12, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/ui/overlay' into 'main'
Feat/ui/overlay See merge request
!129
parents
fff94394
aa85d993
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
70 additions
and
20 deletions
+70
-20
src/common.ts
src/common.ts
+29
-0
src/reducers/duel/modal/cardListModalSlice.ts
src/reducers/duel/modal/cardListModalSlice.ts
+2
-3
src/reducers/duel/modal/mod.ts
src/reducers/duel/modal/mod.ts
+1
-3
src/service/duel/move.ts
src/service/duel/move.ts
+4
-3
src/ui/Duel/cardListModal.tsx
src/ui/Duel/cardListModal.tsx
+10
-6
src/ui/Duel/fixedSlot.tsx
src/ui/Duel/fixedSlot.tsx
+21
-0
src/ui/Duel/main.tsx
src/ui/Duel/main.tsx
+2
-2
src/ui/Duel/singleSlot.tsx
src/ui/Duel/singleSlot.tsx
+1
-3
No files found.
src/common.ts
View file @
12102999
...
@@ -167,3 +167,32 @@ export const Race2StringCodeMap: Map<number, number> = new Map([
...
@@ -167,3 +167,32 @@ export const Race2StringCodeMap: Map<number, number> = new Map([
[
RACE_WYRM
,
1043
],
[
RACE_WYRM
,
1043
],
[
RACE_CYBERSE
,
1044
],
[
RACE_CYBERSE
,
1044
],
]);
]);
// const REASON_DESTROY = 0x1; //
// const REASON_RELEASE = 0x2; //
// const REASON_TEMPORARY = 0x4; //
export
const
REASON_MATERIAL
=
0x8
;
//
// const REASON_SUMMON = 0x10; //
// const REASON_BATTLE = 0x20; //
// const REASON_EFFECT = 0x40; //
// const REASON_COST = 0x80; //
// const REASON_ADJUST = 0x100; //
// const REASON_LOST_TARGET = 0x200; //
// const REASON_RULE = 0x400; //
// const REASON_SPSUMMON = 0x800; //
// const REASON_DISSUMMON = 0x1000; //
// const REASON_FLIP = 0x2000; //
// const REASON_DISCARD = 0x4000; //
// const REASON_RDAMAGE = 0x8000; //
// const REASON_RRECOVER = 0x10000; //
// const REASON_RETURN = 0x20000; //
// const REASON_FUSION = 0x40000; //
// const REASON_SYNCHRO = 0x80000; //
// const REASON_RITUAL = 0x100000; //
// const REASON_XYZ = 0x200000; //
// const REASON_REPLACE = 0x1000000; //
// const REASON_DRAW = 0x2000000; //
// const REASON_REDIRECT = 0x4000000; //
// const REASON_REVEAL = 0x8000000; //
// const REASON_LINK = 0x10000000; //
// const REASON_LOST_OVERLAY = 0x20000000; //
src/reducers/duel/modal/cardListModalSlice.ts
View file @
12102999
import
{
PayloadAction
,
CaseReducer
}
from
"
@reduxjs/toolkit
"
;
import
{
PayloadAction
,
CaseReducer
}
from
"
@reduxjs/toolkit
"
;
import
{
DuelState
}
from
"
../mod
"
;
import
{
DuelState
}
from
"
../mod
"
;
import
{
RootState
}
from
"
../../../store
"
;
import
{
RootState
}
from
"
../../../store
"
;
import
{
CardMeta
}
from
"
../../../api/cards
"
;
// 更新卡牌列表弹窗打开状态
// 更新卡牌列表弹窗打开状态
export
const
setCardListModalIsOpenImpl
:
CaseReducer
<
export
const
setCardListModalIsOpenImpl
:
CaseReducer
<
...
@@ -15,9 +16,7 @@ export const setCardListModalInfoImpl: CaseReducer<
...
@@ -15,9 +16,7 @@ export const setCardListModalInfoImpl: CaseReducer<
DuelState
,
DuelState
,
PayloadAction
<
PayloadAction
<
{
{
name
?:
string
;
meta
?:
CardMeta
;
desc
?:
string
;
imgUrl
?:
string
;
interactivies
:
{
desc
:
string
;
response
:
number
}[];
interactivies
:
{
desc
:
string
;
response
:
number
}[];
}[]
}[]
>
>
...
...
src/reducers/duel/modal/mod.ts
View file @
12102999
...
@@ -12,9 +12,7 @@ export interface ModalState {
...
@@ -12,9 +12,7 @@ export interface ModalState {
cardListModal
:
{
cardListModal
:
{
isOpen
:
boolean
;
isOpen
:
boolean
;
list
:
{
list
:
{
name
?:
string
;
meta
?:
CardMeta
;
desc
?:
string
;
imgUrl
?:
string
;
interactivies
:
{
desc
:
string
;
response
:
number
}[];
interactivies
:
{
desc
:
string
;
response
:
number
}[];
}[];
}[];
};
};
...
...
src/service/duel/move.ts
View file @
12102999
...
@@ -19,6 +19,7 @@ import { fetchCemeteryMeta } from "../../reducers/duel/cemeretySlice";
...
@@ -19,6 +19,7 @@ import { fetchCemeteryMeta } from "../../reducers/duel/cemeretySlice";
import
{
insertHandMeta
}
from
"
../../reducers/duel/handsSlice
"
;
import
{
insertHandMeta
}
from
"
../../reducers/duel/handsSlice
"
;
import
{
fetchExclusionMeta
}
from
"
../../reducers/duel/exclusionSlice
"
;
import
{
fetchExclusionMeta
}
from
"
../../reducers/duel/exclusionSlice
"
;
import
{
fetchExtraDeckMeta
}
from
"
../../reducers/duel/extraDeckSlice
"
;
import
{
fetchExtraDeckMeta
}
from
"
../../reducers/duel/extraDeckSlice
"
;
import
{
REASON_MATERIAL
}
from
"
../../common
"
;
const
OVERLAY_STACK
:
{
code
:
number
;
sequence
:
number
}[]
=
[];
const
OVERLAY_STACK
:
{
code
:
number
;
sequence
:
number
}[]
=
[];
...
@@ -26,7 +27,7 @@ export default (move: MsgMove, dispatch: AppDispatch) => {
...
@@ -26,7 +27,7 @@ export default (move: MsgMove, dispatch: AppDispatch) => {
const
code
=
move
.
code
;
const
code
=
move
.
code
;
const
from
=
move
.
from
;
const
from
=
move
.
from
;
const
to
=
move
.
to
;
const
to
=
move
.
to
;
// TODO: reason
const
reason
=
move
.
reason
;
switch
(
from
.
location
)
{
switch
(
from
.
location
)
{
case
ygopro
.
CardZone
.
HAND
:
{
case
ygopro
.
CardZone
.
HAND
:
{
...
@@ -165,8 +166,8 @@ export default (move: MsgMove, dispatch: AppDispatch) => {
...
@@ -165,8 +166,8 @@ export default (move: MsgMove, dispatch: AppDispatch) => {
break
;
break
;
}
}
case
ygopro
.
CardZone
.
OVERLAY
:
{
case
ygopro
.
CardZone
.
OVERLAY
:
{
if
(
to
.
sequence
>
6
)
{
if
(
reason
==
REASON_MATERIAL
)
{
// 超量素材在进行超量召唤时,若玩家未选择超量怪兽的位置,会“沉到决斗盘下面”,
这时候素材们的sequence会暂时大于6
// 超量素材在进行超量召唤时,若玩家未选择超量怪兽的位置,会“沉到决斗盘下面”,
`reason`字段值是`REASON_MATERIAL`
// 这时候将它们放到一个栈中,待超量怪兽的Move消息到来时从栈中获取超量素材补充到状态中
// 这时候将它们放到一个栈中,待超量怪兽的Move消息到来时从栈中获取超量素材补充到状态中
OVERLAY_STACK
.
push
({
code
,
sequence
:
to
.
overlay_sequence
});
OVERLAY_STACK
.
push
({
code
,
sequence
:
to
.
overlay_sequence
});
}
else
{
}
else
{
...
...
src/ui/Duel/cardListModal.tsx
View file @
12102999
...
@@ -9,8 +9,9 @@ import {
...
@@ -9,8 +9,9 @@ import {
clearAllIdleInteractivities
,
clearAllIdleInteractivities
,
setCardListModalIsOpen
,
setCardListModalIsOpen
,
}
from
"
../../reducers/duel/mod
"
;
}
from
"
../../reducers/duel/mod
"
;
import
{
Modal
,
List
,
Button
}
from
"
antd
"
;
import
{
Drawer
,
List
,
Button
}
from
"
antd
"
;
import
{
sendSelectIdleCmdResponse
}
from
"
../../api/ocgcore/ocgHelper
"
;
import
{
sendSelectIdleCmdResponse
}
from
"
../../api/ocgcore/ocgHelper
"
;
import
NeosConfig
from
"
../../../neos.config.json
"
;
const
CARD_WIDTH
=
100
;
const
CARD_WIDTH
=
100
;
...
@@ -24,7 +25,7 @@ const CardListModal = () => {
...
@@ -24,7 +25,7 @@ const CardListModal = () => {
};
};
return
(
return
(
<
Modal
open=
{
isOpen
}
onOk=
{
handleOkOrCancel
}
onCancel
=
{
handleOkOrCancel
}
>
<
Drawer
open=
{
isOpen
}
onClose
=
{
handleOkOrCancel
}
>
<
List
<
List
itemLayout=
"horizontal"
itemLayout=
"horizontal"
dataSource=
{
list
}
dataSource=
{
list
}
...
@@ -45,17 +46,20 @@ const CardListModal = () => {
...
@@ -45,17 +46,20 @@ const CardListModal = () => {
))
}
))
}
extra=
{
extra=
{
<
img
<
img
alt=
{
item
.
name
}
alt=
{
item
.
meta
?.
text
.
name
}
src=
{
item
.
imgUrl
}
src=
{
`${NeosConfig.cardImgUrl}/${item.meta?.id}.jpg`
}
style=
{
{
width
:
CARD_WIDTH
}
}
style=
{
{
width
:
CARD_WIDTH
}
}
/>
/>
}
}
>
>
<
List
.
Item
.
Meta
title=
{
item
.
name
}
description=
{
item
.
desc
}
/>
<
List
.
Item
.
Meta
title=
{
item
.
meta
?.
text
.
name
}
description=
{
item
.
meta
?.
text
.
desc
}
/>
</
List
.
Item
>
</
List
.
Item
>
)
}
)
}
></
List
>
></
List
>
</
Modal
>
</
Drawer
>
);
);
};
};
...
...
src/ui/Duel/fixedSlot.tsx
View file @
12102999
...
@@ -6,6 +6,8 @@ import { useClick } from "./hook";
...
@@ -6,6 +6,8 @@ import { useClick } from "./hook";
import
{
sendSelectPlaceResponse
}
from
"
../../api/ocgcore/ocgHelper
"
;
import
{
sendSelectPlaceResponse
}
from
"
../../api/ocgcore/ocgHelper
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
import
{
setCardListModalInfo
,
setCardListModalIsOpen
,
setCardModalInteractivies
,
setCardModalInteractivies
,
setCardModalIsOpen
,
setCardModalIsOpen
,
setCardModalMeta
,
setCardModalMeta
,
...
@@ -54,6 +56,7 @@ const FixedSlot = (props: {
...
@@ -54,6 +56,7 @@ const FixedSlot = (props: {
dispatch
(
props
.
clearPlaceInteractivitiesAction
(
0
));
dispatch
(
props
.
clearPlaceInteractivitiesAction
(
0
));
dispatch
(
props
.
clearPlaceInteractivitiesAction
(
1
));
dispatch
(
props
.
clearPlaceInteractivitiesAction
(
1
));
}
else
if
(
props
.
state
.
occupant
)
{
}
else
if
(
props
.
state
.
occupant
)
{
// 中央弹窗展示选中卡牌信息
dispatch
(
setCardModalMeta
(
props
.
state
.
occupant
));
dispatch
(
setCardModalMeta
(
props
.
state
.
occupant
));
dispatch
(
dispatch
(
setCardModalInteractivies
(
setCardModalInteractivies
(
...
@@ -66,6 +69,24 @@ const FixedSlot = (props: {
...
@@ -66,6 +69,24 @@ const FixedSlot = (props: {
)
)
);
);
dispatch
(
setCardModalIsOpen
(
true
));
dispatch
(
setCardModalIsOpen
(
true
));
// 侧边栏展示超量素材信息
if
(
props
.
state
.
overlay_materials
&&
props
.
state
.
overlay_materials
.
length
>
0
)
{
dispatch
(
setCardListModalInfo
(
props
.
state
.
overlay_materials
?.
map
((
overlay
)
=>
{
return
{
meta
:
overlay
,
interactivies
:
[],
};
})
||
[]
)
);
dispatch
(
setCardListModalIsOpen
(
true
));
}
}
}
},
},
planeRef
,
planeRef
,
...
...
src/ui/Duel/main.tsx
View file @
12102999
...
@@ -73,14 +73,14 @@ const NeosDuel = () => {
...
@@ -73,14 +73,14 @@ const NeosDuel = () => {
};
};
const
NeosSider
=
()
=>
(
const
NeosSider
=
()
=>
(
<
div
>
<>
<
Row
>
<
Row
>
<
DuelTimeLine
/>
<
DuelTimeLine
/>
</
Row
>
</
Row
>
<
Row
>
<
Row
>
<
SendBox
/>
<
SendBox
/>
</
Row
>
</
Row
>
</
div
>
</>
);
);
const
NeosCanvas
=
()
=>
(
const
NeosCanvas
=
()
=>
(
...
...
src/ui/Duel/singleSlot.tsx
View file @
12102999
...
@@ -38,9 +38,7 @@ const SingleSlot = (props: {
...
@@ -38,9 +38,7 @@ const SingleSlot = (props: {
)
)
.
map
((
item
)
=>
{
.
map
((
item
)
=>
{
return
{
return
{
name
:
item
.
occupant
?.
text
.
name
,
meta
:
item
.
occupant
,
desc
:
item
.
occupant
?.
text
.
desc
,
imgUrl
:
`
${
NeosConfig
.
cardImgUrl
}
/
${
item
.
occupant
?.
id
}.
jpg
`,
interactivies
:
item
.
idleInteractivities
.
map
((
interactivy
)
=>
{
interactivies
:
item
.
idleInteractivities
.
map
((
interactivy
)
=>
{
return
{
return
{
desc
:
interactTypeToString
(
interactivy
.
interactType
),
desc
:
interactTypeToString
(
interactivy
.
interactType
),
...
...
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