Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
fallenstardust
YGOMobile
Commits
508f48b0
Commit
508f48b0
authored
Apr 01, 2022
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化setname导入
parent
ec342d31
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
20 deletions
+29
-20
mobile/assets/data/conf/strings.conf
mobile/assets/data/conf/strings.conf
+3
-3
mobile/src/main/java/ocgcore/StringManager.java
mobile/src/main/java/ocgcore/StringManager.java
+26
-17
No files found.
mobile/assets/data/conf/strings.conf
View file @
508f48b0
...
@@ -712,7 +712,7 @@
...
@@ -712,7 +712,7 @@
!
setname
0
x31
命运女郎 フォーチュンレディ
!
setname
0
x31
命运女郎 フォーチュンレディ
!
setname
0
x32
火山 ヴォルカニック
!
setname
0
x32
火山 ヴォルカニック
!
setname
0
x33
黑羽
BF
(ブラックフェザー)
!
setname
0
x33
黑羽
BF
(ブラックフェザー)
!
setname
0
x1033
强袭黑羽
A
_
BF
(アサルト ブラックフェザー)
!
setname
0
x1033
强袭黑羽
A
BF
(アサルト ブラックフェザー)
!
setname
0
x34
宝玉 宝玉
!
setname
0
x34
宝玉 宝玉
!
setname
0
x1034
宝玉兽 宝玉獣
!
setname
0
x1034
宝玉兽 宝玉獣
!
setname
0
x2034
究极宝玉神 究極宝玉神
!
setname
0
x2034
究极宝玉神 究極宝玉神
...
@@ -963,8 +963,8 @@
...
@@ -963,8 +963,8 @@
!
setname
0
xed
地中族 サブテラー
!
setname
0
xed
地中族 サブテラー
!
setname
0
x10ed
地中族邪界 サブテラーマリス
!
setname
0
x10ed
地中族邪界 サブテラーマリス
!
setname
0
xee
秘旋谍
SPYRAL
!
setname
0
xee
秘旋谍
SPYRAL
!
setname
0
x10ee
秘旋谍装备
SPYRAL
_
GEAR
!
setname
0
x10ee
秘旋谍装备
SPYRAL
GEAR
!
setname
0
x20ee
秘旋谍任务
SPYRAL
_
MISSION
!
setname
0
x20ee
秘旋谍任务
SPYRAL
MISSION
!
setname
0
xef
堕天使
!
setname
0
xef
堕天使
!
setname
0
xf0
风魔女
WW
(ウィンド・ウィッチ)
!
setname
0
xf0
风魔女
WW
(ウィンド・ウィッチ)
!
setname
0
xf1
十二兽 十二獣
!
setname
0
xf1
十二兽 十二獣
...
...
mobile/src/main/java/ocgcore/StringManager.java
View file @
508f48b0
...
@@ -3,6 +3,9 @@ package ocgcore;
...
@@ -3,6 +3,9 @@ package ocgcore;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.util.Log
;
import
android.util.SparseArray
;
import
android.util.SparseArray
;
import
android.widget.Toast
;
import
androidx.core.content.res.TypedArrayUtils
;
import
java.io.BufferedReader
;
import
java.io.BufferedReader
;
import
java.io.Closeable
;
import
java.io.Closeable
;
...
@@ -13,6 +16,7 @@ import java.io.InputStream;
...
@@ -13,6 +16,7 @@ import java.io.InputStream;
import
java.io.InputStreamReader
;
import
java.io.InputStreamReader
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipEntry
;
...
@@ -145,12 +149,17 @@ public class StringManager implements Closeable {
...
@@ -145,12 +149,17 @@ public class StringManager implements Closeable {
// System.out.println(Arrays.toString(words));
// System.out.println(Arrays.toString(words));
//setcode
//setcode
long
id
=
toNumber
(
words
[
1
]);
long
id
=
toNumber
(
words
[
1
]);
CardSet
cardSet
;
//setname
if
(
words
.
length
>=
5
)
{
String
setname
;
cardSet
=
new
CardSet
(
id
,
words
[
2
]
+
" "
+
words
[
3
]);
int
beforeTab
=
line
.
lastIndexOf
(
"\t"
);
int
afterSetCode
=
line
.
indexOf
(
words
[
1
])
+
words
[
1
].
length
()
+
1
;
if
(
beforeTab
!=
-
1
)
{
setname
=
line
.
substring
(
afterSetCode
,
beforeTab
);
}
else
{
}
else
{
cardSet
=
new
CardSet
(
id
,
words
[
2
]
);
setname
=
line
.
substring
(
afterSetCode
);
}
}
CardSet
cardSet
;
cardSet
=
new
CardSet
(
id
,
setname
);
int
i
=
mCardSets
.
indexOf
(
cardSet
);
int
i
=
mCardSets
.
indexOf
(
cardSet
);
if
(
i
>=
0
)
{
if
(
i
>=
0
)
{
CardSet
cardSet1
=
mCardSets
.
get
(
i
);
CardSet
cardSet1
=
mCardSets
.
get
(
i
);
...
@@ -203,10 +212,10 @@ public class StringManager implements Closeable {
...
@@ -203,10 +212,10 @@ public class StringManager implements Closeable {
/**
/**
* @param index 索引
* @param index 索引
* @param def 默认值
* @param def
默认值
*/
*/
public
String
getSystemString
(
Integer
index
,
String
def
){
public
String
getSystemString
(
Integer
index
,
String
def
)
{
if
(
index
<=
0
)
{
if
(
index
<=
0
)
{
return
def
;
return
def
;
}
}
try
{
try
{
...
@@ -222,7 +231,7 @@ public class StringManager implements Closeable {
...
@@ -222,7 +231,7 @@ public class StringManager implements Closeable {
public
String
getLimitString
(
long
id
)
{
public
String
getLimitString
(
long
id
)
{
LimitType
value
=
LimitType
.
valueOf
(
id
);
LimitType
value
=
LimitType
.
valueOf
(
id
);
if
(
value
==
null
)
{
if
(
value
==
null
)
{
return
String
.
valueOf
(
id
);
return
String
.
valueOf
(
id
);
}
}
return
getSystemString
(
value
.
getLanguageIndex
(),
value
.
name
());
return
getSystemString
(
value
.
getLanguageIndex
(),
value
.
name
());
...
@@ -230,7 +239,7 @@ public class StringManager implements Closeable {
...
@@ -230,7 +239,7 @@ public class StringManager implements Closeable {
public
String
getTypeString
(
long
id
)
{
public
String
getTypeString
(
long
id
)
{
CardType
value
=
CardType
.
valueOf
(
id
);
CardType
value
=
CardType
.
valueOf
(
id
);
if
(
value
==
null
)
{
if
(
value
==
null
)
{
return
String
.
valueOf
(
id
);
return
String
.
valueOf
(
id
);
}
}
return
getSystemString
(
value
.
getLanguageIndex
(),
value
.
name
());
return
getSystemString
(
value
.
getLanguageIndex
(),
value
.
name
());
...
@@ -238,7 +247,7 @@ public class StringManager implements Closeable {
...
@@ -238,7 +247,7 @@ public class StringManager implements Closeable {
public
String
getAttributeString
(
long
id
)
{
public
String
getAttributeString
(
long
id
)
{
CardAttribute
value
=
CardAttribute
.
valueOf
(
id
);
CardAttribute
value
=
CardAttribute
.
valueOf
(
id
);
if
(
value
==
null
)
{
if
(
value
==
null
)
{
return
String
.
valueOf
(
id
);
return
String
.
valueOf
(
id
);
}
}
return
getSystemString
(
value
.
getLanguageIndex
(),
value
.
name
());
return
getSystemString
(
value
.
getLanguageIndex
(),
value
.
name
());
...
@@ -246,27 +255,27 @@ public class StringManager implements Closeable {
...
@@ -246,27 +255,27 @@ public class StringManager implements Closeable {
public
String
getRaceString
(
long
id
)
{
public
String
getRaceString
(
long
id
)
{
CardRace
value
=
CardRace
.
valueOf
(
id
);
CardRace
value
=
CardRace
.
valueOf
(
id
);
if
(
value
==
null
)
{
if
(
value
==
null
)
{
return
String
.
format
(
"0x%x"
,
id
);
return
String
.
format
(
"0x%x"
,
id
);
}
}
return
getSystemString
(
value
.
getLanguageIndex
(),
value
.
name
());
return
getSystemString
(
value
.
getLanguageIndex
(),
value
.
name
());
}
}
public
String
getOtString
(
int
ot
,
boolean
full
)
{
public
String
getOtString
(
int
ot
,
boolean
full
)
{
if
(!
full
||
ot
==
0
)
{
if
(!
full
||
ot
==
0
)
{
CardOt
value
=
CardOt
.
valueOf
(
ot
);
CardOt
value
=
CardOt
.
valueOf
(
ot
);
if
(
value
==
null
)
{
if
(
value
==
null
)
{
return
String
.
valueOf
(
ot
);
return
String
.
valueOf
(
ot
);
}
}
return
getSystemString
(
value
.
getLanguageIndex
(),
value
.
name
());
return
getSystemString
(
value
.
getLanguageIndex
(),
value
.
name
());
}
}
StringBuilder
stringBuilder
=
new
StringBuilder
();
StringBuilder
stringBuilder
=
new
StringBuilder
();
boolean
first
=
true
;
boolean
first
=
true
;
for
(
CardOt
_ot
:
CardOt
.
values
())
{
for
(
CardOt
_ot
:
CardOt
.
values
())
{
if
(
_ot
.
getId
()
==
CardOt
.
NO_EXCLUSIVE
.
getId
())
if
(
_ot
.
getId
()
==
CardOt
.
NO_EXCLUSIVE
.
getId
())
continue
;
continue
;
if
((
_ot
.
getId
()
&
ot
)
!=
0
)
{
if
((
_ot
.
getId
()
&
ot
)
!=
0
)
{
if
(
first
)
{
if
(
first
)
{
first
=
false
;
first
=
false
;
}
else
{
}
else
{
stringBuilder
.
append
(
"|"
);
stringBuilder
.
append
(
"|"
);
...
@@ -279,7 +288,7 @@ public class StringManager implements Closeable {
...
@@ -279,7 +288,7 @@ public class StringManager implements Closeable {
public
String
getCategoryString
(
long
id
)
{
public
String
getCategoryString
(
long
id
)
{
CardCategory
value
=
CardCategory
.
valueOf
(
id
);
CardCategory
value
=
CardCategory
.
valueOf
(
id
);
if
(
value
==
null
)
{
if
(
value
==
null
)
{
return
String
.
valueOf
(
id
);
return
String
.
valueOf
(
id
);
}
}
return
getSystemString
(
value
.
getLanguageIndex
(),
value
.
name
());
return
getSystemString
(
value
.
getLanguageIndex
(),
value
.
name
());
...
...
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