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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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
MyCard
Neos
Commits
bb640b14
Commit
bb640b14
authored
Jun 04, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable unused code
parent
b7d038b3
Pipeline
#22110
passed with stages
in 16 minutes and 25 seconds
Changes
18
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
34 additions
and
75 deletions
+34
-75
.eslintrc.json
.eslintrc.json
+7
-2
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/start.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/start.ts
+1
-1
src/env.d.ts
src/env.d.ts
+1
-0
src/service/duel/reloadField.ts
src/service/duel/reloadField.ts
+1
-1
src/service/duel/selectChain.ts
src/service/duel/selectChain.ts
+2
-2
src/service/duel/selectPosition.ts
src/service/duel/selectPosition.ts
+1
-1
src/service/duel/selectYesNo.ts
src/service/duel/selectYesNo.ts
+1
-1
src/service/room/hsPlayerChange.ts
src/service/room/hsPlayerChange.ts
+3
-3
src/service/room/joinGame.ts
src/service/room/joinGame.ts
+2
-2
src/ui/Duel/PlayMat/Card/index.tsx
src/ui/Duel/PlayMat/Card/index.tsx
+1
-1
src/ui/Duel/PlayMat/Card/springs/focus.ts
src/ui/Duel/PlayMat/Card/springs/focus.ts
+1
-4
src/ui/Duel/PlayMat/Card/springs/moveToDeck.ts
src/ui/Duel/PlayMat/Card/springs/moveToDeck.ts
+2
-11
src/ui/Duel/PlayMat/Card/springs/moveToGround.ts
src/ui/Duel/PlayMat/Card/springs/moveToGround.ts
+1
-9
src/ui/Duel/PlayMat/Card/springs/moveToHand.ts
src/ui/Duel/PlayMat/Card/springs/moveToHand.ts
+2
-12
src/ui/Duel/PlayMat/Card/springs/moveToOutside.ts
src/ui/Duel/PlayMat/Card/springs/moveToOutside.ts
+4
-21
src/ui/Duel/PlayMat/Card/springs/types.ts
src/ui/Duel/PlayMat/Card/springs/types.ts
+1
-1
src/ui/Duel/PlayMat/Mat/index.tsx
src/ui/Duel/PlayMat/Mat/index.tsx
+2
-2
src/ui/Duel/PlayMat/utils/cssConfig.ts
src/ui/Duel/PlayMat/utils/cssConfig.ts
+1
-1
No files found.
.eslintrc.json
View file @
bb640b14
...
...
@@ -18,12 +18,17 @@
"interface"
],
"simple-import-sort/imports"
:
"warn"
,
"simple-import-sort/exports"
:
"warn"
"simple-import-sort/exports"
:
"warn"
,
"no-unused-vars"
:
"off"
,
"@typescript-eslint/no-unused-vars"
:
[
"error"
,
{
"argsIgnorePattern"
:
"^_"
,
"varsIgnorePattern"
:
"^_"
}
]
},
"settings"
:
{
"import/resolver"
:
{
"node"
:
true
,
"typescript"
:
true
}
}
},
"ignorePatterns"
:
[
"src/api/ocgcore/idl/ocgcore.ts"
]
}
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/start.ts
View file @
bb640b14
...
...
@@ -26,7 +26,7 @@ export default (data: Uint8Array) => {
let
offset
=
1
;
if
(
dataView
.
byteLength
>
17
)
{
// data长度大于17,会多传一个大师规则字段
const
masterRule
=
dataView
.
getUint8
(
offset
);
// TODO
const
_
masterRule
=
dataView
.
getUint8
(
offset
);
// TODO
offset
+=
1
;
}
...
...
src/env.d.ts
View file @
bb640b14
...
...
@@ -12,6 +12,7 @@ interface ImportMeta {
readonly
env
:
ImportMetaEnv
;
}
/* eslint @typescript-eslint/no-unused-vars: 0 */
import
{
EventEmitter
}
from
"
eventemitter3
"
;
/* eslint no-var: 0 */
...
...
src/service/duel/reloadField.ts
View file @
bb640b14
import
{
ygopro
}
from
"
@/api
"
;
type
MsgReloadField
=
ygopro
.
StocGameMessage
.
MsgReloadField
;
export
default
(
field
:
MsgReloadField
)
=>
{
export
default
(
_
field
:
MsgReloadField
)
=>
{
// TODO: 断线重连比较复杂,先留着后面时实现
};
src/service/duel/selectChain.ts
View file @
bb640b14
...
...
@@ -12,8 +12,8 @@ type MsgSelectChain = ygopro.StocGameMessage.MsgSelectChain;
export
default
(
selectChain
:
MsgSelectChain
)
=>
{
const
spCount
=
selectChain
.
special_count
;
const
forced
=
selectChain
.
forced
;
const
hint0
=
selectChain
.
hint0
;
const
hint1
=
selectChain
.
hint1
;
const
_
hint0
=
selectChain
.
hint0
;
const
_
hint1
=
selectChain
.
hint1
;
const
chains
=
selectChain
.
chains
;
let
handle_flag
=
0
;
...
...
src/service/duel/selectPosition.ts
View file @
bb640b14
...
...
@@ -4,7 +4,7 @@ import { messageStore } from "@/stores";
type
MsgSelectPosition
=
ygopro
.
StocGameMessage
.
MsgSelectPosition
;
export
default
(
selectPosition
:
MsgSelectPosition
)
=>
{
const
player
=
selectPosition
.
player
;
const
_
player
=
selectPosition
.
player
;
const
positions
=
selectPosition
.
positions
;
messageStore
.
positionModal
.
positions
=
positions
.
map
(
...
...
src/service/duel/selectYesNo.ts
View file @
bb640b14
...
...
@@ -4,7 +4,7 @@ import { messageStore } from "@/stores";
type
MsgSelectYesNo
=
ygopro
.
StocGameMessage
.
MsgSelectYesNo
;
export
default
async
(
selectYesNo
:
MsgSelectYesNo
)
=>
{
const
player
=
selectYesNo
.
player
;
const
_
player
=
selectYesNo
.
player
;
const
effect_description
=
selectYesNo
.
effect_description
;
messageStore
.
yesNoModal
.
msg
=
await
getStrings
(
effect_description
);
...
...
src/service/room/hsPlayerChange.ts
View file @
bb640b14
...
...
@@ -19,12 +19,12 @@ export default function handleHsPlayerChange(pb: ygopro.YgoStocMsg) {
case
ygopro
.
StocHsPlayerChange
.
State
.
MOVE
:
{
console
.
log
(
"
Player
"
+
change
.
pos
+
"
moved to
"
+
change
.
moved_pos
);
let
src
=
change
.
pos
;
let
dst
=
change
.
moved_pos
;
let
_
src
=
change
.
pos
;
let
_
dst
=
change
.
moved_pos
;
console
.
log
(
"
Currently unsupport Move type of StocHsPlayerChange.
"
);
//
todo
//
TODO
break
;
}
...
...
src/service/room/joinGame.ts
View file @
bb640b14
...
...
@@ -2,7 +2,7 @@ import { ygopro } from "@/api";
import
{
joinStore
}
from
"
@/stores
"
;
export
default
function
handleJoinGame
(
pb
:
ygopro
.
YgoStocMsg
)
{
const
msg
=
pb
.
stoc_join_game
;
//
todo
const
_
msg
=
pb
.
stoc_join_game
;
//
TODO
joinStore
.
value
=
true
;
}
src/ui/Duel/PlayMat/Card/index.tsx
View file @
bb640b14
...
...
@@ -67,7 +67,7 @@ export const Card: FC<{ idx: number }> = React.memo(({ idx }) => {
},
[]);
const
[
highlight
,
setHighlight
]
=
useState
(
false
);
const
[
shadowOpacity
,
setShadowOpacity
]
=
useState
(
0
);
// TODO
透明度
// const [shadowOpacity, setShadowOpacity] = useState(0); // TODO:
透明度
// >>> 动画 >>>
/** 动画序列的promise */
...
...
src/ui/Duel/PlayMat/Card/springs/focus.ts
View file @
bb640b14
import
{
easings
}
from
"
@react-spring/web
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
type
CardType
,
isMe
,
matStore
}
from
"
@/stores
"
;
import
{
type
CardType
,
matStore
}
from
"
@/stores
"
;
import
{
matConfig
}
from
"
../../utils
"
;
import
{
SpringApi
}
from
"
./types
"
;
import
{
asyncStart
}
from
"
./utils
"
;
...
...
src/ui/Duel/PlayMat/Card/springs/moveToDeck.ts
View file @
bb640b14
import
{
easings
}
from
"
@react-spring/web
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
type
CardType
,
isMe
}
from
"
@/stores
"
;
import
{
matConfig
}
from
"
../../utils
"
;
import
{
SpringApi
}
from
"
./types
"
;
import
{
asyncStart
}
from
"
./utils
"
;
const
{
PLANE_ROTATE_X
,
BLOCK_WIDTH
,
BLOCK_HEIGHT_M
,
BLOCK_HEIGHT_S
,
CARD_RATIO
,
COL_GAP
,
ROW_GAP
,
HAND_MARGIN_TOP
,
HAND_CARD_HEIGHT
,
HAND_CIRCLE_CENTER_OFFSET_Y
,
DECK_OFFSET_X
,
DECK_OFFSET_Y
,
DECK_ROTATE_Z
,
DECK_CARD_HEIGHT
,
}
=
matConfig
;
const
{
HAND
,
GRAVE
,
REMOVED
,
DECK
,
EXTRA
,
MZONE
,
SZONE
,
TZONE
}
=
ygopro
.
CardZone
;
const
{
DECK
,
EXTRA
}
=
ygopro
.
CardZone
;
export
const
moveToDeck
=
async
(
props
:
{
card
:
CardType
;
api
:
SpringApi
})
=>
{
const
{
card
,
api
}
=
props
;
// report
const
{
location
}
=
card
;
const
{
controller
,
zone
,
sequence
,
position
}
=
location
;
const
{
controller
,
zone
,
sequence
}
=
location
;
const
rightX
=
DECK_OFFSET_X
.
value
+
2
*
(
BLOCK_WIDTH
.
value
+
COL_GAP
.
value
);
const
leftX
=
-
rightX
;
...
...
src/ui/Duel/PlayMat/Card/springs/moveToGround.ts
View file @
bb640b14
...
...
@@ -8,23 +8,15 @@ import { SpringApi } from "./types";
import
{
asyncStart
}
from
"
./utils
"
;
const
{
PLANE_ROTATE_X
,
BLOCK_WIDTH
,
BLOCK_HEIGHT_M
,
BLOCK_HEIGHT_S
,
CARD_RATIO
,
COL_GAP
,
ROW_GAP
,
HAND_MARGIN_TOP
,
HAND_CARD_HEIGHT
,
HAND_CIRCLE_CENTER_OFFSET_Y
,
DECK_OFFSET_X
,
DECK_OFFSET_Y
,
DECK_ROTATE_Z
,
}
=
matConfig
;
const
{
HAND
,
GRAVE
,
REMOVED
,
DECK
,
EXTRA
,
MZONE
,
SZONE
,
TZONE
}
=
ygopro
.
CardZone
;
const
{
MZONE
,
SZONE
}
=
ygopro
.
CardZone
;
export
const
moveToGround
=
async
(
props
:
{
card
:
CardType
;
...
...
src/ui/Duel/PlayMat/Card/springs/moveToHand.ts
View file @
bb640b14
import
{
easings
}
from
"
@react-spring/web
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
cardStore
,
type
CardType
,
isMe
}
from
"
@/stores
"
;
import
{
matConfig
}
from
"
../../utils
"
;
import
{
SpringApi
}
from
"
./types
"
;
import
{
asyncStart
}
from
"
./utils
"
;
const
{
PLANE_ROTATE_X
,
BLOCK_WIDTH
,
BLOCK_HEIGHT_M
,
BLOCK_HEIGHT_S
,
CARD_RATIO
,
COL_GAP
,
ROW_GAP
,
HAND_MARGIN_TOP
,
HAND_CARD_HEIGHT
,
HAND_CIRCLE_CENTER_OFFSET_Y
,
DECK_OFFSET_X
,
DECK_OFFSET_Y
,
DECK_ROTATE_Z
,
}
=
matConfig
;
const
{
HAND
,
GRAVE
,
REMOVED
,
DECK
,
EXTRA
,
MZONE
,
SZONE
,
TZONE
}
=
ygopro
.
CardZone
;
const
{
HAND
}
=
ygopro
.
CardZone
;
export
const
moveToHand
=
async
(
props
:
{
card
:
CardType
;
api
:
SpringApi
})
=>
{
const
{
card
,
api
}
=
props
;
const
{
zone
,
sequence
,
controller
}
=
card
.
location
;
const
{
sequence
,
controller
}
=
card
.
location
;
// 手卡会有很复杂的计算...
const
hand_circle_center_x
=
0
;
const
hand_circle_center_y
=
...
...
src/ui/Duel/PlayMat/Card/springs/moveToOutside.ts
View file @
bb640b14
import
{
easings
}
from
"
@react-spring/web
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
type
CardType
,
isMe
}
from
"
@/stores
"
;
import
{
matConfig
}
from
"
../../utils
"
;
import
{
SpringApi
}
from
"
./types
"
;
import
{
asyncStart
}
from
"
./utils
"
;
const
{
PLANE_ROTATE_X
,
BLOCK_WIDTH
,
BLOCK_HEIGHT_M
,
BLOCK_HEIGHT_S
,
CARD_RATIO
,
COL_GAP
,
ROW_GAP
,
HAND_MARGIN_TOP
,
HAND_CARD_HEIGHT
,
HAND_CIRCLE_CENTER_OFFSET_Y
,
DECK_OFFSET_X
,
DECK_OFFSET_Y
,
DECK_ROTATE_Z
,
}
=
matConfig
;
const
{
BLOCK_WIDTH
,
BLOCK_HEIGHT_M
,
BLOCK_HEIGHT_S
,
COL_GAP
,
ROW_GAP
}
=
matConfig
;
const
{
HAND
,
GRAVE
,
REMOVED
,
DECK
,
EXTRA
,
MZONE
,
SZONE
,
TZONE
}
=
ygopro
.
CardZone
;
const
{
GRAVE
}
=
ygopro
.
CardZone
;
export
const
moveToOutside
=
async
(
props
:
{
card
:
CardType
;
...
...
@@ -32,7 +15,7 @@ export const moveToOutside = async (props: {
})
=>
{
const
{
card
,
api
}
=
props
;
// report
const
{
zone
,
sequence
,
controller
,
position
}
=
card
.
location
;
const
{
zone
,
controller
,
position
}
=
card
.
location
;
let
x
=
(
BLOCK_WIDTH
.
value
+
COL_GAP
.
value
)
*
3
,
y
=
zone
===
GRAVE
?
BLOCK_HEIGHT_M
.
value
+
ROW_GAP
.
value
:
0
;
...
...
src/ui/Duel/PlayMat/Card/springs/types.ts
View file @
bb640b14
import
{
type
SpringRef
,
type
SpringValue
}
from
"
@react-spring/web
"
;
import
{
type
SpringRef
}
from
"
@react-spring/web
"
;
export
type
SpringApi
=
SpringRef
<
{
x
:
number
;
...
...
src/ui/Duel/PlayMat/Mat/index.tsx
View file @
bb640b14
...
...
@@ -7,7 +7,7 @@ import { cardStore } from "@/stores";
import
{
Bg
}
from
"
../Bg
"
;
import
{
Card
}
from
"
../Card
"
;
import
{
type
CSSConfig
,
matConfig
,
toCssProperties
}
from
"
../utils
"
;
import
{
matConfig
,
toCssProperties
}
from
"
../utils
"
;
// 后面再改名
export
const
Mat
:
FC
=
()
=>
{
...
...
@@ -23,7 +23,7 @@ export const Mat: FC = () => {
<
Plane
>
<
Bg
/>
<
CardContainer
>
{
snap
.
map
((
cardSnap
,
i
)
=>
(
{
snap
.
map
((
_
cardSnap
,
i
)
=>
(
<
Card
key=
{
i
}
idx=
{
i
}
/>
))
}
</
CardContainer
>
...
...
src/ui/Duel/PlayMat/utils/cssConfig.ts
View file @
bb640b14
type
CSSValue
=
[
number
,
string
]
|
number
;
//
type CSSValue = [number, string] | number;
export
type
CSSConfig
=
Record
<
string
,
{
value
:
number
;
unit
:
UNIT
}
>
;
...
...
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