Skip to content

Commit

Permalink
<feature> greatly improve unpack game function which can unpack all f…
Browse files Browse the repository at this point in the history
…iles at once no matter whether the rpa file is loaded

update version to v2.2.8
  • Loading branch information
anonymousException committed May 7, 2024
1 parent 154fd9a commit 50bf1fb
Show file tree
Hide file tree
Showing 30 changed files with 46 additions and 48 deletions.
36 changes: 17 additions & 19 deletions src/hook_unrpa.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ init python early hide:
import renpy.loader
import threading
import io
from renpy.loader import file_open_callbacks,load_from_archive
from renpy.loader import file_open_callbacks,load_from_archive,archives

def my_load_from_archive(name):
rv = load_from_archive(name)
try:
rv = load_from_archive(name)
except:
print('load_from_archive : ' + name +' error!')
return None
if rv is None:
return rv
if hasattr(renpy.loader,"SubFile") and isinstance(rv,renpy.loader.SubFile):
Expand All @@ -16,7 +20,7 @@ init python early hide:
_read = rv.readall()
else:
return rv
file_open_callbacks.remove(my_load_from_archive)
#file_open_callbacks.remove(my_load_from_archive)
current_file_path = os.path.abspath(sys.argv[0])
current_dir_path = os.path.dirname(current_file_path)
path = current_dir_path + '/game/' + name
Expand All @@ -34,24 +38,18 @@ init python early hide:
print(path)

rv = load_from_archive(name)
file_open_callbacks.append(my_load_from_archive)
#file_open_callbacks.append(my_load_from_archive)
return rv

file_open_callbacks.remove(load_from_archive)

file_open_callbacks.append(my_load_from_archive)


#file_open_callbacks.remove(load_from_archive)

init python:
import os
my_old_show_screen = renpy.show_screen
#file_open_callbacks.append(my_load_from_archive)

def my_show_screen(_screen_name, *_args, **kwargs):
finish_flag = 'unpack.finish'
if os.path.isfile(finish_flag):
os.remove(finish_flag)
renpy.show_screen = my_old_show_screen
return my_old_show_screen(_screen_name, *_args, **kwargs)
for prefix, index in archives:
for name in index.keys():
print(name)
my_load_from_archive(name)

renpy.show_screen = my_show_screen
finish_flag = 'unpack.finish'
if os.path.isfile(finish_flag):
os.remove(finish_flag)
Binary file modified src/qm/arabic.qm
Binary file not shown.
Binary file modified src/qm/bengali.qm
Binary file not shown.
Binary file modified src/qm/chinese.qm
Binary file not shown.
Binary file modified src/qm/french.qm
Binary file not shown.
Binary file modified src/qm/german.qm
Binary file not shown.
Binary file modified src/qm/hindi.qm
Binary file not shown.
Binary file modified src/qm/japanese.qm
Binary file not shown.
Binary file modified src/qm/korean.qm
Binary file not shown.
Binary file modified src/qm/portuguese.qm
Binary file not shown.
Binary file modified src/qm/russian.qm
Binary file not shown.
Binary file modified src/qm/spanish.qm
Binary file not shown.
Binary file modified src/qm/turkish.qm
Binary file not shown.
Binary file modified src/qm/urdu.qm
Binary file not shown.
4 changes: 2 additions & 2 deletions src/ts/arabic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.7</source>
<translation>الإصدار2.2.7</translation>
<source>Version 2.2.8</source>
<translation>الإصدار2.2.8</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/bengali.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.7</source>
<translation>সংস্করণ 2.2.7</translation>
<source>Version 2.2.8</source>
<translation>সংস্করণ 2.2.8</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/chinese.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1178,8 +1178,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.7</source>
<translation>版本 2.2.7</translation>
<source>Version 2.2.8</source>
<translation>版本 2.2.8</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
2 changes: 1 addition & 1 deletion src/ts/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.7</source>
<source>Version 2.2.8</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/french.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.7</source>
<translation>Version 2.2.7</translation>
<source>Version 2.2.8</source>
<translation>Version 2.2.8</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/german.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1288,8 +1288,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.7</source>
<translation>Version 2.2.7</translation>
<source>Version 2.2.8</source>
<translation>Version 2.2.8</translation>
</message>
<message>
<location filename="../ui.ui" line="391"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/hindi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.7</source>
<translation>संस्करण 2.2.7</translation>
<source>Version 2.2.8</source>
<translation>संस्करण 2.2.8</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/japanese.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1174,8 +1174,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.7</source>
<translation>バージョン2.2.7</translation>
<source>Version 2.2.8</source>
<translation>バージョン2.2.8</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/korean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1288,8 +1288,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.7</source>
<translation>버전 2.2.7</translation>
<source>Version 2.2.8</source>
<translation>버전 2.2.8</translation>
</message>
<message>
<location filename="../ui.ui" line="391"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/portuguese.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.7</source>
<translation>Versão 2.2.7</translation>
<source>Version 2.2.8</source>
<translation>Versão 2.2.8</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/russian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.7</source>
<translation>Версия 2.2.7</translation>
<source>Version 2.2.8</source>
<translation>Версия 2.2.8</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/spanish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.7</source>
<translation>Versión 2.2.7</translation>
<source>Version 2.2.8</source>
<translation>Versión 2.2.8</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/turkish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1265,8 +1265,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.7</source>
<translation>Sürüm 2.2.7</translation>
<source>Version 2.2.8</source>
<translation>Sürüm 2.2.8</translation>
</message>
<message>
<location filename="../ui.ui" line="391"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/urdu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.7</source>
<translation>ورژن 2.2.7</translation>
<source>Version 2.2.8</source>
<translation>ورژن 2.2.8</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
2 changes: 1 addition & 1 deletion src/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def retranslateUi(self, MainWindow):
self.actionpack_game_files.setText(QCoreApplication.translate("MainWindow", u"pack game files", None))
self.clearLogBtn.setText(QCoreApplication.translate("MainWindow", u"clear log", None))
self.copyrightLabel.setText(QCoreApplication.translate("MainWindow", u"\u00a92024 Last moment,All rights reserved.", None))
self.versionLabel.setText(QCoreApplication.translate("MainWindow", u"Version 2.2.7", None))
self.versionLabel.setText(QCoreApplication.translate("MainWindow", u"Version 2.2.8", None))
self.translateBtn.setText(QCoreApplication.translate("MainWindow", u"translate", None))
self.selectFilesBtn.setText(QCoreApplication.translate("MainWindow", u"...", None))
self.label_2.setText(QCoreApplication.translate("MainWindow", u"directory", None))
Expand Down
2 changes: 1 addition & 1 deletion src/ui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</size>
</property>
<property name="text">
<string>Version 2.2.7</string>
<string>Version 2.2.8</string>
</property>
</widget>
</item>
Expand Down

0 comments on commit 50bf1fb

Please sign in to comment.