30
30
}
31
31
32
32
class BuildVariant :
33
- def __init__ (self ,chapter , unity , system , target_crc32 = None ):
33
+ def __init__ (self , short_description , chapter , unity , system , target_crc32 = None , translation_default = False ):
34
34
self .chapter = chapter
35
35
self .unity = unity
36
36
self .system = system
37
37
self .target_crc32 = target_crc32
38
38
self .chapter_number = chapter_to_chapter_number [chapter ]
39
- self .data_dir = f"HigurashiEp{ self .chapter_number } _Data"
39
+ self .data_dir = f"HigurashiEp{ self .chapter_number :02} _Data"
40
+ self .translation_default = translation_default
41
+ self .short_description = short_description
40
42
41
43
def get_build_command (self ) -> str :
42
44
args = [self .chapter , self .unity , self .system ]
@@ -46,63 +48,83 @@ def get_build_command(self) -> str:
46
48
47
49
return " " .join (args )
48
50
51
+ def get_translation_sharedassets_name (self ) -> str :
52
+ operatingSystem = None
53
+ if self .system == "win" :
54
+ operatingSystem = "Windows"
55
+ elif self .system == "unix" :
56
+ operatingSystem = "LinuxMac"
57
+ elif self .system == "mac" :
58
+ operatingSystem = "Mac"
59
+ else :
60
+ raise Exception (f"Unknown system { self .system } " )
61
+
62
+ args = [operatingSystem , self .short_description , self .unity ]
63
+
64
+ if self .target_crc32 is not None :
65
+ args .append (self .target_crc32 )
66
+
67
+ name_no_ext = "-" .join (args )
68
+
69
+ return f"{ name_no_ext } .languagespecificassets"
70
+
49
71
# List of build variants for any given chapter
50
72
#
51
73
# There must be a corresponding vanilla sharedassets0.assets file located at:
52
74
# assets\vanilla\{CHAPTER_NAME}[-{CRC32}]\{OS}-{UNITY_VERSION}\sharedassets0.assets
53
75
# for each entry.
54
76
chapter_to_build_variants = {
55
77
"onikakushi" : [
56
- BuildVariant ("onikakushi" , "5.2.2f1" , "win" ),
57
- BuildVariant ("onikakushi" , "5.2.2f1" , "unix" ),
78
+ BuildVariant ("GOG-MG-Steam" , " onikakushi" , "5.2.2f1" , "win" , translation_default = True ),
79
+ BuildVariant ("GOG-MG-Steam" , " onikakushi" , "5.2.2f1" , "unix" ),
58
80
],
59
81
"watanagashi" : [
60
- BuildVariant ("watanagashi" , "5.2.2f1" , "win" ),
61
- BuildVariant ("watanagashi" , "5.2.2f1" , "unix" ),
82
+ BuildVariant ("GOG-MG-Steam" , " watanagashi" , "5.2.2f1" , "win" , translation_default = True ),
83
+ BuildVariant ("GOG-MG-Steam" , " watanagashi" , "5.2.2f1" , "unix" ),
62
84
],
63
85
"tatarigoroshi" : [
64
- BuildVariant ("tatarigoroshi" , "5.4.0f1" , "win" ),
65
- BuildVariant ("tatarigoroshi" , "5.4.0f1" , "unix" ),
66
- BuildVariant ("tatarigoroshi" , "5.3.5f1" , "win" ),
67
- BuildVariant ("tatarigoroshi" , "5.3.4p1" , "win" ),
68
- BuildVariant ("tatarigoroshi" , "5.3.4p1" , "unix" ),
86
+ BuildVariant ("GOG-Steam" , " tatarigoroshi" , "5.4.0f1" , "win" , translation_default = True ),
87
+ BuildVariant ("GOG-Steam" , " tatarigoroshi" , "5.4.0f1" , "unix" ),
88
+ BuildVariant ("MG" , " tatarigoroshi" , "5.3.5f1" , "win" ),
89
+ BuildVariant ("Legacy" , " tatarigoroshi" , "5.3.4p1" , "win" ),
90
+ BuildVariant ("MG" , " tatarigoroshi" , "5.3.4p1" , "unix" ),
69
91
],
70
92
"himatsubushi" : [
71
- BuildVariant ("himatsubushi" , "5.4.1f1" , "win" ),
72
- BuildVariant ("himatsubushi" , "5.4.1f1" , "unix" ),
93
+ BuildVariant ("GOG-MG-Steam" , " himatsubushi" , "5.4.1f1" , "win" , translation_default = True ),
94
+ BuildVariant ("GOG-MG-Steam" , " himatsubushi" , "5.4.1f1" , "unix" ),
73
95
],
74
96
"meakashi" : [
75
- BuildVariant ("meakashi" , "5.5.3p3" , "win" ),
76
- BuildVariant ("meakashi" , "5.5.3p3" , "unix" ),
77
- BuildVariant ("meakashi" , "5.5.3p1" , "win" ),
78
- BuildVariant ("meakashi" , "5.5.3p1" , "unix" ),
97
+ BuildVariant ("MG-Steam-GOG_old" , " meakashi" , "5.5.3p3" , "win" , translation_default = True ), #also used by GOG old?
98
+ BuildVariant ("MG-Steam-GOG_old" , " meakashi" , "5.5.3p3" , "unix" ), #also used by GOG old?
99
+ BuildVariant ("GOG" , " meakashi" , "5.5.3p1" , "win" ),
100
+ BuildVariant ("GOG" , " meakashi" , "5.5.3p1" , "unix" ),
79
101
],
80
102
"tsumihoroboshi" : [
81
- BuildVariant ("tsumihoroboshi" , "5.5.3p3" , "win" ),
82
- BuildVariant ("tsumihoroboshi" , "5.5.3p3" , "unix" ),
103
+ BuildVariant ("GOG-MG-Steam" , " tsumihoroboshi" , "5.5.3p3" , "win" , translation_default = True ),
104
+ BuildVariant ("GOG-MG-Steam" , " tsumihoroboshi" , "5.5.3p3" , "unix" ),
83
105
# While GOG Windows is ver 5.6.7f1, we actually downgrade back to 5.5.3p3 in the installer, so we don't need this version.
84
106
#'tsumihoroboshi 5.6.7f1 win'
85
107
],
86
108
"minagoroshi" : [
87
- BuildVariant ("minagoroshi" , "5.6.7f1" , "win" ),
88
- BuildVariant ("minagoroshi" , "5.6.7f1" , "unix" ),
109
+ BuildVariant ("GOG-MG-Steam" , " minagoroshi" , "5.6.7f1" , "win" , translation_default = True ),
110
+ BuildVariant ("GOG-MG-Steam" , " minagoroshi" , "5.6.7f1" , "unix" ),
89
111
# While GOG Windows is ver 5.6.7f1, we actually downgrade back to 5.5.3p3 in the installer, so we don't need this version.
90
112
# 'matsuribayashi 5.6.7f1 win'
91
113
# 'matsuribayashi 5.6.7f1 unix'
92
114
],
93
115
"matsuribayashi" : [
94
- BuildVariant ("matsuribayashi" , "2017.2.5" , "unix" ),
116
+ BuildVariant ("M_GOG-M_MG-Steam" , " matsuribayashi" , "2017.2.5" , "unix" ),
95
117
# Special version for GOG/Mangagamer Linux with SHA256:
96
118
# A200EC2A85349BC03B59C8E2F106B99ED0CBAAA25FC50928BB8BA2E2AA90FCE9
97
119
# CRC32L 51100D6D
98
- BuildVariant ("matsuribayashi" , "2017.2.5" , "unix" , "51100D6D" ),
99
- BuildVariant ("matsuribayashi" , "2017.2.5" , "win" ),
120
+ BuildVariant ("L_GOG-L_MG" , " matsuribayashi" , "2017.2.5" , "unix" , "51100D6D" ),
121
+ BuildVariant ("GOG-MG-Steam" , " matsuribayashi" , "2017.2.5" , "win" , translation_default = True ),
100
122
],
101
123
'rei' : [
102
- BuildVariant ("rei" , "2019.4.3" , "win" ),
103
- BuildVariant ("rei" , "2019.4.4" , "win" ),
104
- BuildVariant ("rei" , "2019.4.3" , "unix" ),
105
- BuildVariant ("rei" , "2019.4.4" , "unix" ),
124
+ BuildVariant ("GOG-Steam-MG_old" , " rei" , "2019.4.3" , "win" , translation_default = True ),
125
+ BuildVariant ("MG" , " rei" , "2019.4.4" , "win" ),
126
+ BuildVariant ("GOG-Steam-MG_old" , " rei" , "2019.4.3" , "unix" ),
127
+ BuildVariant ("MG" , " rei" , "2019.4.4" , "unix" ),
106
128
],
107
129
}
108
130
@@ -218,9 +240,11 @@ def save(self):
218
240
choices = ["all" , "github_actions" ] + list (chapter_to_build_variants .keys ()),
219
241
)
220
242
parser .add_argument ("--force-download" , default = False , action = 'store_true' )
243
+ parser .add_argument ("--translation" , default = False , action = 'store_true' )
221
244
args = parser .parse_args ()
222
245
223
246
force_download = args .force_download
247
+ translation = args .translation
224
248
225
249
# Get chapter name from git tag if "github_actions" specified as the chapter
226
250
chapter_name = args .chapter
@@ -234,7 +258,8 @@ def save(self):
234
258
235
259
# Get a list of build variants (like 'onikakushi 5.2.2f1 win') depending on commmand line arguments
236
260
build_variants = get_build_variants (chapter_name )
237
- print (f"For chapter '{ chapter_name } ' building: { build_variants } " )
261
+ build_variants_list = "\n - " .join ([b .get_build_command () for b in build_variants ])
262
+ print (f"For chapter '{ chapter_name } ' building:\n - { build_variants_list } " )
238
263
239
264
# Install python dependencies
240
265
print ("Installing python dependencies" )
@@ -310,3 +335,15 @@ def save(self):
310
335
call (f"cargo run { build_variant .get_build_command ()} " )
311
336
else :
312
337
call (f"ui-compiler.exe { build_variant .get_build_command ()} " )
338
+
339
+ if translation :
340
+ source_sharedassets = os .path .join ("output" , build_variant .data_dir , "sharedassets0.assets" )
341
+ translation_data_dir = os .path .join ("output/translation" , build_variant .data_dir )
342
+ destination_sharedassets = os .path .join (translation_data_dir , build_variant .get_translation_sharedassets_name ())
343
+
344
+ os .makedirs (translation_data_dir , exist_ok = True )
345
+ shutil .copyfile (source_sharedassets , destination_sharedassets )
346
+
347
+ if build_variant .translation_default :
348
+ destination_default_sharedassets = os .path .join (translation_data_dir , "sharedassets0.assets" )
349
+ shutil .copyfile (source_sharedassets , destination_default_sharedassets )
0 commit comments