Skip to content

Commit 85fe36a

Browse files
Add separate handling for the title screen and scene files
1 parent d6f202d commit 85fe36a

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[
2+
{
3+
"from": "game/game_sequence.cmpres",
4+
"to": "files/game/langDE/game_sequence.cmpres"
5+
},
6+
{
7+
"from": "game/game_sequence.cmpres",
8+
"to": "files/game/langEN/game_sequence.cmpres"
9+
},
10+
{
11+
"from": "game/game_sequence.cmpres",
12+
"to": "files/game/langES/game_sequence.cmpres"
13+
},
14+
{
15+
"from": "game/game_sequence.cmpres",
16+
"to": "files/game/langFR/game_sequence.cmpres"
17+
},
18+
{
19+
"from": "game/game_sequence.cmpres",
20+
"to": "files/game/langIT/game_sequence.cmpres"
21+
},
22+
{
23+
"from": "game/game_sequence.cmpres",
24+
"to": "files/game/game_sequence.cmpres"
25+
},
26+
{
27+
"from": "scene/bg801.scene",
28+
"to": "files/scene/bg801.scene"
29+
},
30+
{
31+
"from": "scene/op001.scene",
32+
"to": "files/scene/op001.scene"
33+
}
34+
]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import pycsmm
2+
import os
3+
import json
4+
import shutil
5+
6+
MODID = __name__
7+
8+
class Mod(pycsmm.CSMMMod, pycsmm.GeneralInterface):
9+
def __init__(self):
10+
pycsmm.CSMMMod.__init__(self)
11+
pycsmm.GeneralInterface.__init__(self)
12+
def modId(self):
13+
return MODID
14+
def saveFiles(self, root, gameInstance, modList):
15+
modpack_dir = self.modpackDir()
16+
with open(os.path.join(modpack_dir, f'{MODID}.json'), 'rb') as config_file:
17+
config = json.load(config_file)
18+
for command in config:
19+
copy_from = os.path.join(modpack_dir, command["from"])
20+
copy_to = os.path.join(root, command["to"])
21+
if os.path.isdir(copy_from):
22+
shutil.copytree(copy_from, copy_to, dirs_exist_ok=True)
23+
else:
24+
shutil.copy(copy_from, copy_to)
25+
26+
mod = Mod()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
+cswtpycsmm
22
+ChangeCurtain
3+
+NewTitleScreen

0 commit comments

Comments
 (0)