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
b93e1471
Commit
b93e1471
authored
Aug 06, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 按需加载预设卡组
parent
4e1a921f
Pipeline
#22924
failed with stages
in 11 minutes and 49 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
src/stores/deckStore.ts
src/stores/deckStore.ts
+5
-6
No files found.
src/stores/deckStore.ts
View file @
b93e1471
...
...
@@ -3,12 +3,6 @@ import { proxy } from "valtio";
import
{
type
NeosStore
}
from
"
./shared
"
;
// 给玩家预设了几套卡组,一旦idb为空,就会给玩家添加这几套卡组
const
PRESET_DECKS
:
Record
<
string
,
{
default
:
Omit
<
IDeck
,
"
deckName
"
>
}
>
=
import
.
meta
.
glob
(
"
/neos-assets/structure-decks/*.ydk
"
,
{
eager
:
true
,
});
const
IDB_NAME
=
"
decks
"
;
const
deckIdb
=
createStore
(
IDB_NAME
,
IDB_NAME
);
...
...
@@ -57,6 +51,11 @@ export const deckStore = proxy({
async
initialize
()
{
deckStore
.
decks
=
await
values
<
IDeck
>
(
deckIdb
);
if
(
!
deckStore
.
decks
.
length
)
{
// 给玩家预设了几套卡组,一旦idb为空,就会给玩家添加这几套卡组
const
PRESET_DECKS
:
Record
<
string
,
{
default
:
Omit
<
IDeck
,
"
deckName
"
>
}
>
=
import
.
meta
.
glob
(
"
/neos-assets/structure-decks/*.ydk
"
,
{
eager
:
true
,
});
for
(
const
key
in
PRESET_DECKS
)
{
const
deck
=
PRESET_DECKS
[
key
].
default
;
const
deckName
=
...
...
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