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
60488335
Commit
60488335
authored
Oct 09, 2024
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup 408 lflist
parent
d58778dc
Pipeline
#30304
passed with stages
in 7 minutes and 31 seconds
Changes
12
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
91 additions
and
55 deletions
+91
-55
neos.config.json
neos.config.json
+3
-0
neos.config.prod.json
neos.config.prod.json
+3
-0
src/api/forbiddens.ts
src/api/forbiddens.ts
+2
-6
src/ui/BuildDeck/index.tsx
src/ui/BuildDeck/index.tsx
+23
-0
src/ui/I18N/Source/Chinese/translation.json
src/ui/I18N/Source/Chinese/translation.json
+1
-0
src/ui/I18N/Source/English/translation.json
src/ui/I18N/Source/English/translation.json
+1
-0
src/ui/I18N/Source/Japanese/translation.json
src/ui/I18N/Source/Japanese/translation.json
+1
-0
src/ui/Layout/utils.ts
src/ui/Layout/utils.ts
+4
-2
src/ui/Shared/DeckCard/index.tsx
src/ui/Shared/DeckCard/index.tsx
+47
-44
src/ui/Shared/DeckZone/index.tsx
src/ui/Shared/DeckZone/index.tsx
+3
-0
src/ui/Shared/Select/index.module.scss
src/ui/Shared/Select/index.module.scss
+2
-2
src/ui/Shared/Select/index.tsx
src/ui/Shared/Select/index.tsx
+1
-1
No files found.
neos.config.json
View file @
60488335
...
...
@@ -39,6 +39,9 @@
"lflist"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf"
,
"config"
:
"https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release-v2.json"
},
"env408Resource"
:
{
"lflist"
:
"https://cdn02.moecube.com:444/cn-database/env408-zh-CN/expansions/lflist.conf"
},
"stringsUrl"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf"
,
"replayUrl"
:
"replay.neos.moe"
,
"loginUrl"
:
"https://accounts.moecube.com/signin"
,
...
...
neos.config.prod.json
View file @
60488335
...
...
@@ -39,6 +39,9 @@
"lflist"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf"
,
"config"
:
"https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release-v2.json"
},
"env408Resource"
:
{
"lflist"
:
"https://cdn02.moecube.com:444/cn-database/env408-zh-CN/expansions/lflist.conf"
},
"stringsUrl"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf"
,
"replayUrl"
:
"replay.neos.moe"
,
"loginUrl"
:
"https://accounts.moecube.com/signin"
,
...
...
src/api/forbiddens.ts
View file @
60488335
import
{
isNil
}
from
"
lodash-es
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
CardMeta
}
from
"
./cards
"
;
const
{
releaseResource
:
{
lflist
},
}
=
useConfig
();
class
Forbidden
{
private
data
:
Map
<
number
,
number
>
=
new
Map
<
number
,
number
>
();
public
time
:
string
=
"
?
"
;
public
async
init
():
Promise
<
void
>
{
public
async
init
(
lflist
:
string
):
Promise
<
void
>
{
const
text
=
await
(
await
fetch
(
lflist
)).
text
();
const
{
time
,
forbiddens
}
=
this
.
extractForbiddensFromText
(
text
);
this
.
time
=
time
;
...
...
@@ -87,3 +82,4 @@ class Forbidden {
}
export
const
forbidden
=
new
Forbidden
();
export
const
forbidden_408
=
new
Forbidden
();
src/ui/BuildDeck/index.tsx
View file @
60488335
...
...
@@ -26,6 +26,7 @@ import {
DeckZone
,
Loading
,
ScrollableArea
,
Select
,
}
from
"
@/ui/Shared
"
;
import
{
Type
}
from
"
@/ui/Shared/DeckZone
"
;
...
...
@@ -41,6 +42,9 @@ import {
iDeckToEditingDeck
,
}
from
"
./utils
"
;
const
ENV_OCG
=
0
;
const
ENV_408
=
1
;
export
const
loader
:
LoaderFunction
=
async
()
=>
{
// 必须先加载卡组,不然页面会崩溃
if
(
!
initStore
.
decks
)
{
...
...
@@ -182,6 +186,9 @@ export const DeckEditor: React.FC<{
}
>
=
({
deck
,
onClear
,
onReset
,
onSave
,
onShuffle
,
onSort
})
=>
{
const
snapEditDeck
=
useSnapshot
(
editDeckStore
);
const
[
deckName
,
setDeckName
]
=
useState
(
editDeckStore
.
deckName
);
const
[
env
,
setEnv
]
=
useState
(
ENV_OCG
);
const
handleEnvChange
=
(
value
:
any
)
=>
setEnv
(
value
);
useEffect
(()
=>
{
iDeckToEditingDeck
(
deck
).
then
(
editDeckStore
.
set
);
...
...
@@ -249,6 +256,21 @@ export const DeckEditor: React.FC<{
value=
{
deckName
}
/>
<
Space
style=
{
{
marginRight
:
"
0.4rem
"
}
}
size=
{
5
}
>
<
Select
title=
{
i18n
(
"
Environment
"
)
}
value=
{
env
}
options=
{
[
{
value
:
ENV_OCG
,
label
:
"
OCG
"
,
},
{
value
:
ENV_408
,
label
:
"
408
"
,
},
]
}
onChange=
{
handleEnvChange
}
/>
<
Button
type=
"text"
size=
"small"
...
...
@@ -313,6 +335,7 @@ export const DeckEditor: React.FC<{
editDeckStore
.
add
(
type
,
card
);
}
}
}
is408=
{
env
===
ENV_408
}
/>
))
}
</
ScrollableArea
>
...
...
src/ui/I18N/Source/Chinese/translation.json
View file @
60488335
...
...
@@ -42,6 +42,7 @@
},
"BuildDeck"
:
{
"EnterTheDeckName"
:
"请输入卡组名字"
,
"Environment"
:
"环境"
,
"Shuffle"
:
"打乱"
,
"Sort"
:
"排序"
,
"Clear"
:
"清空"
,
...
...
src/ui/I18N/Source/English/translation.json
View file @
60488335
...
...
@@ -42,6 +42,7 @@
},
"BuildDeck"
:
{
"EnterTheDeckName"
:
"Deck name"
,
"Environment"
:
"Environment"
,
"Shuffle"
:
"Shuffle"
,
"Sort"
:
"Sort"
,
"Clear"
:
"Clear"
,
...
...
src/ui/I18N/Source/Japanese/translation.json
View file @
60488335
...
...
@@ -40,6 +40,7 @@
},
"BuildDeck"
:
{
"EnterTheDeckName"
:
"デッキ名を入力"
,
"Environment"
:
"環境"
,
"Shuffle"
:
"シャッフル"
,
"Sort"
:
"ソート"
,
"Clear"
:
"クリア"
,
...
...
src/ui/Layout/utils.ts
View file @
60488335
...
...
@@ -3,6 +3,7 @@ import rustInit from "rust-src";
import
{
CookieKeys
,
forbidden
,
forbidden_408
,
getCookie
,
initStrings
,
initSuperPrerelease
,
...
...
@@ -12,7 +13,7 @@ import { useConfig } from "@/config";
import
{
useEnv
}
from
"
@/hook
"
;
import
sqliteMiddleWare
,
{
sqliteCmd
}
from
"
@/middleware/sqlite
"
;
import
{
accountStore
,
deckStore
,
initStore
,
type
User
}
from
"
@/stores
"
;
const
{
releaseResource
,
preReleaseResource
}
=
useConfig
();
const
{
releaseResource
,
preReleaseResource
,
env408Resource
}
=
useConfig
();
const
{
BASE_URL
}
=
useEnv
();
/** 加载ygodb */
...
...
@@ -55,7 +56,8 @@ export const initWASM = async () => {
/** 加载禁限卡表 */
export
const
initForbidden
=
async
()
=>
{
if
(
!
initStore
.
forbidden
)
{
await
forbidden
.
init
();
await
forbidden
.
init
(
releaseResource
.
lflist
);
await
forbidden_408
.
init
(
env408Resource
.
lflist
);
initStore
.
forbidden
=
true
;
}
};
...
...
src/ui/Shared/DeckCard/index.tsx
View file @
60488335
import
React
,
{
memo
,
useRef
,
useState
}
from
"
react
"
;
import
{
useDrag
}
from
"
react-dnd
"
;
import
{
CardMeta
,
forbidden
}
from
"
@/api
"
;
import
{
CardMeta
,
forbidden
,
forbidden_408
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
Type
}
from
"
../DeckZone
"
;
...
...
@@ -22,48 +22,51 @@ export const DeckCard: React.FC<{
onMouseUp
?:
(
event
:
DeckCardMouseUpEvent
)
=>
void
;
onMouseEnter
?:
()
=>
void
;
onDoubleClick
?:
(
card
:
CardMeta
)
=>
void
;
}
>
=
memo
(({
value
,
source
,
onMouseUp
,
onMouseEnter
,
onDoubleClick
})
=>
{
const
ref
=
useRef
<
HTMLDivElement
>
(
null
);
const
[{
isDragging
},
drag
]
=
useDrag
({
type
:
"
Card
"
,
item
:
{
value
,
source
},
collect
:
(
monitor
)
=>
({
isDragging
:
monitor
.
isDragging
(),
}),
});
drag
(
ref
);
const
[
showText
,
setShowText
]
=
useState
(
true
);
const
limitCnt
=
forbidden
.
get
(
value
);
is408
?:
boolean
;
}
>
=
memo
(
({
value
,
source
,
onMouseUp
,
onMouseEnter
,
onDoubleClick
,
is408
})
=>
{
const
ref
=
useRef
<
HTMLDivElement
>
(
null
);
const
[{
isDragging
},
drag
]
=
useDrag
({
type
:
"
Card
"
,
item
:
{
value
,
source
},
collect
:
(
monitor
)
=>
({
isDragging
:
monitor
.
isDragging
(),
}),
});
drag
(
ref
);
const
[
showText
,
setShowText
]
=
useState
(
true
);
const
limitCnt
=
is408
?
forbidden_408
.
get
(
value
)
:
forbidden
.
get
(
value
);
return
(
<
div
className=
{
styles
.
card
}
ref=
{
ref
}
style=
{
{
opacity
:
isDragging
&&
source
!==
"
search
"
?
0
:
1
}
}
onMouseUp=
{
(
event
)
=>
onMouseUp
?.({
event
,
card
:
value
,
})
}
onMouseEnter=
{
onMouseEnter
}
onDoubleClick=
{
()
=>
onDoubleClick
?.(
value
)
}
onContextMenu=
{
(
e
)
=>
{
e
.
preventDefault
();
}
}
>
{
showText
&&
<
div
className=
{
styles
.
cardname
}
>
{
value
.
text
.
name
}
</
div
>
}
<
YgoCard
className=
{
styles
.
cardcover
}
code=
{
value
.
id
}
onLoad=
{
()
=>
setShowText
(
false
)
}
/>
{
limitCnt
!==
undefined
&&
(
<
img
className=
{
styles
.
cardlimit
}
src=
{
`${assetsPath}/Limit0${limitCnt}.png`
}
return
(
<
div
className=
{
styles
.
card
}
ref=
{
ref
}
style=
{
{
opacity
:
isDragging
&&
source
!==
"
search
"
?
0
:
1
}
}
onMouseUp=
{
(
event
)
=>
onMouseUp
?.({
event
,
card
:
value
,
})
}
onMouseEnter=
{
onMouseEnter
}
onDoubleClick=
{
()
=>
onDoubleClick
?.(
value
)
}
onContextMenu=
{
(
e
)
=>
{
e
.
preventDefault
();
}
}
>
{
showText
&&
<
div
className=
{
styles
.
cardname
}
>
{
value
.
text
.
name
}
</
div
>
}
<
YgoCard
className=
{
styles
.
cardcover
}
code=
{
value
.
id
}
onLoad=
{
()
=>
setShowText
(
false
)
}
/>
)
}
</
div
>
);
});
{
limitCnt
!==
undefined
&&
(
<
img
className=
{
styles
.
cardlimit
}
src=
{
`${assetsPath}/Limit0${limitCnt}.png`
}
/>
)
}
</
div
>
);
},
);
src/ui/Shared/DeckZone/index.tsx
View file @
60488335
...
...
@@ -26,6 +26,7 @@ export const DeckZone: React.FC<{
)
=>
void
;
onElementMouseUp
:
(
event
:
DeckCardMouseUpEvent
)
=>
void
;
onDoubleClick
?:
(
card
:
CardMeta
)
=>
void
;
is408
?:
boolean
;
}
>
=
({
type
,
cards
,
...
...
@@ -33,6 +34,7 @@ export const DeckZone: React.FC<{
onChange
,
onElementMouseUp
:
onElementMouseUp
,
onDoubleClick
,
is408
,
})
=>
{
const
{
message
}
=
App
.
useApp
();
const
[
allowToDrop
,
setAllowToDrop
]
=
useState
(
false
);
...
...
@@ -74,6 +76,7 @@ export const DeckZone: React.FC<{
source=
{
type
}
onMouseUp=
{
onElementMouseUp
}
onDoubleClick=
{
onDoubleClick
}
is408=
{
is408
}
/>
))
}
<
div
className=
{
styles
[
"
editing-zone-name
"
]
}
>
...
...
src/ui/Shared/Select/index.module.scss
View file @
60488335
...
...
@@ -2,8 +2,8 @@
display
:
flex
;
align-items
:
center
;
.prefix
{
height
:
40px
;
line-height
:
40px
;
height
:
2rem
;
line-height
:
2rem
;
padding
:
0
1rem
;
border-radius
:
6px
;
border-right
:
none
;
...
...
src/ui/Shared/Select/index.tsx
View file @
60488335
...
...
@@ -10,7 +10,7 @@ export const Select: React.FC<
{
title
&&
<
span
className=
{
styles
.
prefix
}
>
{
title
}
</
span
>
}
<
AntdSelect
className=
{
classNames
(
styles
.
select
,
className
)
}
size=
"
larg
e"
size=
"
middl
e"
dropdownStyle=
{
{
backdropFilter
:
"
blur(20px)
"
,
...
dropdownStyle
,
...
...
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