Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-cn-database-generator
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
MyCard
ygopro-cn-database-generator
Commits
26f8222a
Commit
26f8222a
authored
Sep 24, 2024
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
override text
parent
5e856f04
Pipeline
#29948
passed with stages
in 1 minute and 57 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
13 deletions
+11
-13
.gitlab-ci.yml
.gitlab-ci.yml
+1
-1
src/config.ts
src/config.ts
+2
-2
src/dbreader.ts
src/dbreader.ts
+8
-10
No files found.
.gitlab-ci.yml
View file @
26f8222a
...
@@ -48,7 +48,7 @@ env408:
...
@@ -48,7 +48,7 @@ env408:
DATE
:
'
2006-05-15'
DATE
:
'
2006-05-15'
CARD_SYMBOL
:
'
408环境'
CARD_SYMBOL
:
'
408环境'
FILE_SYMBOL
:
'
env408'
FILE_SYMBOL
:
'
env408'
O
LD
_TEXT_DB_PATH
:
./extras/2012.cdb
O
VERRIDE
_TEXT_DB_PATH
:
./extras/2012.cdb
upload_to_minio
:
upload_to_minio
:
stage
:
deploy
stage
:
deploy
...
...
src/config.ts
View file @
26f8222a
...
@@ -5,7 +5,7 @@ export interface Config {
...
@@ -5,7 +5,7 @@ export interface Config {
postDepth
:
number
;
postDepth
:
number
;
jpDatabasePath
:
string
;
jpDatabasePath
:
string
;
cnDatabasePath
:
string
;
cnDatabasePath
:
string
;
o
ld
TextDbPath
:
string
;
o
verride
TextDbPath
:
string
;
cardListDatabasePath
:
string
;
cardListDatabasePath
:
string
;
outputPath
:
string
;
outputPath
:
string
;
descSymbol
:
string
;
descSymbol
:
string
;
...
@@ -19,7 +19,7 @@ export async function loadConfig(): Promise<Config> {
...
@@ -19,7 +19,7 @@ export async function loadConfig(): Promise<Config> {
postDepth
:
process
.
env
.
POST_DEPTH
?
parseInt
(
process
.
env
.
POST_DEPTH
)
:
5
,
postDepth
:
process
.
env
.
POST_DEPTH
?
parseInt
(
process
.
env
.
POST_DEPTH
)
:
5
,
jpDatabasePath
:
process
.
env
.
JP_DATABASE_PATH
||
"
./ygopro-database/locales/ja-JP/cards.cdb
"
,
jpDatabasePath
:
process
.
env
.
JP_DATABASE_PATH
||
"
./ygopro-database/locales/ja-JP/cards.cdb
"
,
cnDatabasePath
:
process
.
env
.
SOURCE_TARGET_PATH
||
"
./ygopro-database/locales/zh-CN/cards.cdb
"
,
cnDatabasePath
:
process
.
env
.
SOURCE_TARGET_PATH
||
"
./ygopro-database/locales/zh-CN/cards.cdb
"
,
o
ldTextDbPath
:
process
.
env
.
OLD
_TEXT_DB_PATH
||
""
,
o
verrideTextDbPath
:
process
.
env
.
OVERRIDE
_TEXT_DB_PATH
||
""
,
cardListDatabasePath
:
process
.
env
.
CARD_LIST_DATABASE_PATH
||
"
./pack.db
"
,
cardListDatabasePath
:
process
.
env
.
CARD_LIST_DATABASE_PATH
||
"
./pack.db
"
,
outputPath
:
process
.
env
.
OUTPUT_PATH
||
"
./output
"
,
outputPath
:
process
.
env
.
OUTPUT_PATH
||
"
./output
"
,
descSymbol
:
process
.
env
.
CARD_SYMBOL
||
"
简体中文卡
"
,
descSymbol
:
process
.
env
.
CARD_SYMBOL
||
"
简体中文卡
"
,
...
...
src/dbreader.ts
View file @
26f8222a
...
@@ -114,7 +114,7 @@ export class DBReader extends Base {
...
@@ -114,7 +114,7 @@ export class DBReader extends Base {
jpdb
:
Database
;
jpdb
:
Database
;
cndb
:
Database
;
cndb
:
Database
;
outputdb
:
Database
;
outputdb
:
Database
;
o
ld
TextDb
:
Database
;
o
verride
TextDb
:
Database
;
async
openDatabase
(
path
:
string
)
{
async
openDatabase
(
path
:
string
)
{
return
await
open
({
return
await
open
({
filename
:
path
,
filename
:
path
,
...
@@ -126,7 +126,7 @@ export class DBReader extends Base {
...
@@ -126,7 +126,7 @@ export class DBReader extends Base {
this
.
log
.
debug
(
`Opening databases...`
);
this
.
log
.
debug
(
`Opening databases...`
);
this
.
cndb
=
await
this
.
openDatabase
(
this
.
config
.
cnDatabasePath
);
this
.
cndb
=
await
this
.
openDatabase
(
this
.
config
.
cnDatabasePath
);
this
.
jpdb
=
await
this
.
openDatabase
(
this
.
config
.
jpDatabasePath
);
this
.
jpdb
=
await
this
.
openDatabase
(
this
.
config
.
jpDatabasePath
);
this
.
o
ldTextDb
=
this
.
config
.
oldTextDbPath
?
await
this
.
openDatabase
(
this
.
config
.
old
TextDbPath
)
:
null
;
this
.
o
verrideTextDb
=
this
.
config
.
overrideTextDbPath
?
await
this
.
openDatabase
(
this
.
config
.
override
TextDbPath
)
:
null
;
}
}
async
finalize
()
{
async
finalize
()
{
await
this
.
cndb
.
close
();
await
this
.
cndb
.
close
();
...
@@ -134,8 +134,8 @@ export class DBReader extends Base {
...
@@ -134,8 +134,8 @@ export class DBReader extends Base {
if
(
this
.
outputdb
)
{
if
(
this
.
outputdb
)
{
await
this
.
outputdb
.
close
();
await
this
.
outputdb
.
close
();
}
}
if
(
this
.
o
ld
TextDb
)
{
if
(
this
.
o
verride
TextDb
)
{
await
this
.
o
ld
TextDb
.
close
();
await
this
.
o
verride
TextDb
.
close
();
}
}
}
}
private
async
openOutputDatabase
()
{
private
async
openOutputDatabase
()
{
...
@@ -239,12 +239,10 @@ export class DBReader extends Base {
...
@@ -239,12 +239,10 @@ export class DBReader extends Base {
if
(
this
.
config
.
fileSymbol
===
'
cn
'
)
{
if
(
this
.
config
.
fileSymbol
===
'
cn
'
)
{
card
.
datas
.
ot
|=
0x8
;
card
.
datas
.
ot
|=
0x8
;
}
}
if
(
this
.
oldTextDb
)
{
if
(
this
.
overrideTextDb
)
{
const
oldTextEntry
=
await
this
.
oldTextDb
.
get
(
'
SELECT desc FROM texts WHERE id = ?
'
,
[
card
.
code
]);
const
overrideTextEntry
=
await
this
.
overrideTextDb
.
get
(
'
SELECT desc FROM texts WHERE id = ?
'
,
[
card
.
code
]);
if
(
oldTextEntry
)
{
if
(
overrideTextEntry
)
{
const
oldText
=
oldTextEntry
.
desc
;
card
.
texts
.
desc
=
overrideTextEntry
.
desc
;
const
newText
=
card
.
texts
.
desc
;
card
.
texts
.
desc
=
`旧效果:\r\n
${
oldText
}
\r\n\r\n新效果:\r\n
${
newText
}
`
;
}
}
}
}
card
.
texts
.
desc
+=
'
\r\n\r\n\
u2605
'
+
this
.
config
.
descSymbol
;
card
.
texts
.
desc
+=
'
\r\n\r\n\
u2605
'
+
this
.
config
.
descSymbol
;
...
...
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