Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
ef805f26
Commit
ef805f26
authored
Aug 09, 2022
by
AnimeGitB
Committed by
Luke H-W
Aug 09, 2022
Browse files
Remove vestigial references to gacha_mappings
parent
0091fb87
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/Grasscutter.java
View file @
ef805f26
...
@@ -95,17 +95,10 @@ public final class Grasscutter {
...
@@ -95,17 +95,10 @@ public final class Grasscutter {
boolean
exitEarly
=
false
;
boolean
exitEarly
=
false
;
for
(
String
arg
:
args
)
{
for
(
String
arg
:
args
)
{
switch
(
arg
.
toLowerCase
())
{
switch
(
arg
.
toLowerCase
())
{
case
"-handbook"
,
"-handbooks"
->
{
exitEarly
=
true
;
}
case
"-dumppacketids"
->
{
case
"-dumppacketids"
->
{
PacketOpcodesUtils
.
dumpPacketIds
();
PacketOpcodesUtils
.
dumpPacketIds
();
exitEarly
=
true
;
exitEarly
=
true
;
}
}
case
"-gachamap"
->
{
Tools
.
createGachaMapping
(
DATA
(
"gacha_mappings.js"
));
exitEarly
=
true
;
}
case
"-version"
->
{
case
"-version"
->
{
System
.
out
.
println
(
"Grasscutter version: "
+
BuildConfig
.
VERSION
+
"-"
+
BuildConfig
.
GIT_HASH
);
System
.
out
.
println
(
"Grasscutter version: "
+
BuildConfig
.
VERSION
+
"-"
+
BuildConfig
.
GIT_HASH
);
exitEarly
=
true
;
exitEarly
=
true
;
...
...
src/main/java/emu/grasscutter/tools/Tools.java
View file @
ef805f26
...
@@ -180,22 +180,16 @@ final class ToolsWithLanguageOption {
...
@@ -180,22 +180,16 @@ final class ToolsWithLanguageOption {
// if the user made choices for language, I assume it's okay to assign his/her selected language to "en-us"
// if the user made choices for language, I assume it's okay to assign his/her selected language to "en-us"
// since it's the fallback language and there will be no difference in the gacha record page.
// since it's the fallback language and there will be no difference in the gacha record page.
// The enduser can still modify the `gacha
_
mappings.js` directly to enable multilingual for the gacha record system.
// The enduser can still modify the `gacha
/
mappings.js` directly to enable multilingual for the gacha record system.
writer
.
println
(
"mappings = {\"en-us\": {"
);
writer
.
println
(
"mappings = {\"en-us\": {"
);
// Avatars
// Avatars
boolean
first
=
true
;
for
(
Integer
id
:
list
)
{
for
(
Integer
id
:
list
)
{
AvatarData
data
=
GameData
.
getAvatarDataMap
().
get
(
id
);
AvatarData
data
=
GameData
.
getAvatarDataMap
().
get
(
id
);
int
avatarID
=
data
.
getId
();
int
avatarID
=
data
.
getId
();
if
(
avatarID
>=
11000000
)
{
// skip test avatar
if
(
avatarID
>=
11000000
)
{
// skip test avatar
continue
;
continue
;
}
}
if
(
first
)
{
// skip adding comma for the first element
first
=
false
;
}
else
{
writer
.
print
(
","
);
}
String
color
=
switch
(
data
.
getQualityType
())
{
String
color
=
switch
(
data
.
getQualityType
())
{
case
"QUALITY_PURPLE"
->
"purple"
;
case
"QUALITY_PURPLE"
->
"purple"
;
case
"QUALITY_ORANGE"
->
"yellow"
;
case
"QUALITY_ORANGE"
->
"yellow"
;
...
@@ -205,7 +199,7 @@ final class ToolsWithLanguageOption {
...
@@ -205,7 +199,7 @@ final class ToolsWithLanguageOption {
writer
.
println
(
writer
.
println
(
"\""
+
(
avatarID
%
1000
+
1000
)
+
"\" : [\""
"\""
+
(
avatarID
%
1000
+
1000
)
+
"\" : [\""
+
map
.
get
(
data
.
getNameTextMapHash
())
+
"("
+
map
.
get
(
4233146695L
)+
")\", \""
+
map
.
get
(
data
.
getNameTextMapHash
())
+
"("
+
map
.
get
(
4233146695L
)+
")\", \""
+
color
+
"\"]"
);
+
color
+
"\"]
,
"
);
}
}
writer
.
println
();
writer
.
println
();
...
@@ -219,29 +213,22 @@ final class ToolsWithLanguageOption {
...
@@ -219,29 +213,22 @@ final class ToolsWithLanguageOption {
if
(
data
.
getId
()
<=
11101
||
data
.
getId
()
>=
20000
)
{
if
(
data
.
getId
()
<=
11101
||
data
.
getId
()
>=
20000
)
{
continue
;
//skip non weapon items
continue
;
//skip non weapon items
}
}
String
color
;
String
color
=
switch
(
data
.
getRankLevel
())
{
case
3
->
"blue"
;
switch
(
data
.
getRankLevel
())
{
case
4
->
"purple"
;
case
3
:
case
5
->
"yellow"
;
color
=
"blue"
;
default
->
null
;
break
;
};
case
4
:
if
(
color
==
null
)
color
=
"purple"
;
continue
;
// skip unnecessary entries
break
;
case
5
:
color
=
"yellow"
;
break
;
default
:
continue
;
// skip unnecessary entries
}
// Got the magic number 4231343903 from manually search in the json file
// Got the magic number 4231343903 from manually search in the json file
writer
.
println
(
"
,
\""
+
data
.
getId
()
+
writer
.
println
(
"\""
+
data
.
getId
()
+
"\" : [\""
+
map
.
get
(
data
.
getNameTextMapHash
()).
replaceAll
(
"\""
,
""
)
"\" : [\""
+
map
.
get
OrDefault
(
data
.
getNameTextMapHash
()
,
id
.
toString
()
).
replaceAll
(
"\""
,
""
)
+
"("
+
map
.
get
(
4231343903L
)+
")\",\""
+
color
+
"\"]"
);
+
"("
+
map
.
get
(
4231343903L
)+
")\",\""
+
color
+
"\"]
,
"
);
}
}
writer
.
println
(
"
,
\"200\": \""
+
map
.
get
(
332935371L
)+
"\", \"301\": \""
+
map
.
get
(
2272170627L
)
+
"\", \"302\": \""
+
map
.
get
(
2864268523L
)+
"\""
);
writer
.
println
(
"\"200\": \""
+
map
.
get
(
332935371L
)+
"\", \"301\": \""
+
map
.
get
(
2272170627L
)
+
"\", \"302\": \""
+
map
.
get
(
2864268523L
)+
"\""
);
writer
.
println
(
"}\n}"
);
writer
.
println
(
"}\n}"
);
}
}
...
...
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