From 845d2aa68e9a7d6728c0656347444f55379ba037 Mon Sep 17 00:00:00 2001 From: esphas Date: Wed, 17 Jul 2024 02:00:25 +0800 Subject: [PATCH] Add proxy support and cache options (#157) * Add proxy support and cache options; Refine chinese locales. * Better proxy supporting --- scenes/Catapult.tscn | 70 ++++++++++++++++++++++++++++++++---- scripts/ChangelogDialod.gd | 12 +++++++ scripts/ModManager.gd | 11 +++--- scripts/ReleaseInstaller.gd | 11 +++--- scripts/ReleaseManager.gd | 36 +++++++++---------- scripts/SettingsUI.gd | 32 +++++++++++++++++ scripts/SoundpackManager.gd | 9 ++--- scripts/download_manager.gd | 20 +++++++++++ scripts/path_helper.gd | 6 ++++ scripts/settings_manager.gd | 5 +++ text/en/download_manager.csv | 1 + text/en/settings_tab.csv | 11 ++++++ text/zh/download_manager.csv | 1 + text/zh/game_tab.csv | 28 +++++++-------- text/zh/release_manager.csv | 2 +- text/zh/settings_tab.csv | 11 ++++++ 16 files changed, 212 insertions(+), 54 deletions(-) diff --git a/scenes/Catapult.tscn b/scenes/Catapult.tscn index 156a3312..8ce1414b 100644 --- a/scenes/Catapult.tscn +++ b/scenes/Catapult.tscn @@ -1113,17 +1113,31 @@ margin_bottom = 290.0 hint_tooltip = "tooltip_install_archived_mods" text = "cbtn_install_archived_mods" -[node name="ShowDebug" type="CheckButton" parent="Main/Tabs/Settings"] +[node name="KeepCache" type="CheckButton" parent="Main/Tabs/Settings"] margin_top = 292.0 margin_right = 577.0 margin_bottom = 320.0 +hint_tooltip = "tooltip_keep_cache" +text = "cbtn_keep_cache" + +[node name="IgnoreCache" type="CheckButton" parent="Main/Tabs/Settings"] +margin_top = 322.0 +margin_right = 577.0 +margin_bottom = 350.0 +hint_tooltip = "tooltip_ignore_cache" +text = "cbtn_ignore_cache" + +[node name="ShowDebug" type="CheckButton" parent="Main/Tabs/Settings"] +margin_top = 352.0 +margin_right = 577.0 +margin_bottom = 380.0 hint_tooltip = "tooltip_debug_mode" text = "cbtn_debug_mode" [node name="NumReleases" type="HBoxContainer" parent="Main/Tabs/Settings"] -margin_top = 322.0 +margin_top = 382.0 margin_right = 577.0 -margin_bottom = 346.0 +margin_bottom = 406.0 hint_tooltip = "tooltip_num_releases_to_request" [node name="Label" type="Label" parent="Main/Tabs/Settings/NumReleases"] @@ -1141,9 +1155,9 @@ value = 30.0 rounded = true [node name="NumPrs" type="HBoxContainer" parent="Main/Tabs/Settings"] -margin_top = 348.0 +margin_top = 408.0 margin_right = 577.0 -margin_bottom = 372.0 +margin_bottom = 432.0 hint_tooltip = "tooltip_num_prs_to_request" [node name="Label" type="Label" parent="Main/Tabs/Settings/NumPrs"] @@ -1161,10 +1175,47 @@ step = 10.0 value = 100.0 rounded = true +[node name="ProxySettings" type="HBoxContainer" parent="Main/Tabs/Settings"] +margin_top = 434.0 +margin_right = 577.0 +margin_bottom = 458.0 +hint_tooltip = "tooltip_proxy_settings" + +[node name="Label" type="Label" parent="Main/Tabs/Settings/ProxySettings"] +margin_right = 120.0 +margin_bottom = 24.0 +text = "lbl_proxy_settings" + +[node name="obtnProxyOption" type="OptionButton" parent="Main/Tabs/Settings/ProxySettings"] +margin_left = 127.0 +margin_right = 295.0 +margin_bottom = 24.0 +hint_tooltip = "tooltip_proxy_options" +size_flags_horizontal = 10 +size_flags_stretch_ratio = 20.0 +text = "obtn_proxy_option_off" +items = [ "obtn_proxy_option_off", null, false, 0, null, "obtn_proxy_option_on", null, false, 1, null, "obtn_proxy_option_download", null, false, 2, null ] +selected = 0 + +[node name="leProxyHost" type="LineEdit" parent="Main/Tabs/Settings/ProxySettings"] +margin_left = 301.0 +margin_right = 471.0 +margin_bottom = 24.0 +rect_min_size = Vector2( 170, 0 ) +size_flags_horizontal = 10 +placeholder_text = "localhost" + +[node name="sbProxyPort" type="SpinBox" parent="Main/Tabs/Settings/ProxySettings"] +margin_left = 477.0 +margin_right = 577.0 +margin_bottom = 24.0 +size_flags_horizontal = 10 +max_value = 65535.0 + [node name="ScaleOverride" type="HBoxContainer" parent="Main/Tabs/Settings"] -margin_top = 374.0 +margin_top = 460.0 margin_right = 577.0 -margin_bottom = 402.0 +margin_bottom = 488.0 hint_tooltip = "tooltip_ui_scale_override" __meta__ = { "_edit_use_anchors_": false @@ -1401,9 +1452,14 @@ __meta__ = { [connection signal="toggled" from="Main/Tabs/Settings/AlwaysShowInstalls" to="Main/Tabs/Settings" method="_on_AlwaysShowInstalls_toggled"] [connection signal="toggled" from="Main/Tabs/Settings/ShowObsoleteMods" to="Main/Tabs/Settings" method="_on_ShowObsoleteMods_toggled"] [connection signal="toggled" from="Main/Tabs/Settings/InstallArchivedMods" to="Main/Tabs/Settings" method="_on_InstallArchivedMods_toggled"] +[connection signal="toggled" from="Main/Tabs/Settings/KeepCache" to="Main/Tabs/Settings" method="_on_KeepCache_toggled"] +[connection signal="toggled" from="Main/Tabs/Settings/IgnoreCache" to="Main/Tabs/Settings" method="_on_IgnoreCache_toggled"] [connection signal="toggled" from="Main/Tabs/Settings/ShowDebug" to="Main/Tabs/Settings" method="_on_ShowDebug_toggled"] [connection signal="value_changed" from="Main/Tabs/Settings/NumReleases/sbNumReleases" to="Main/Tabs/Settings" method="_on_sbNumReleases_value_changed"] [connection signal="value_changed" from="Main/Tabs/Settings/NumPrs/sbNumPRs" to="Main/Tabs/Settings" method="_on_sbNumPRs_value_changed"] +[connection signal="item_selected" from="Main/Tabs/Settings/ProxySettings/obtnProxyOption" to="Main/Tabs/Settings" method="_on_obtnProxyOption_item_selected"] +[connection signal="text_changed" from="Main/Tabs/Settings/ProxySettings/leProxyHost" to="Main/Tabs/Settings" method="_on_leProxyHost_text_changed"] +[connection signal="value_changed" from="Main/Tabs/Settings/ProxySettings/sbProxyPort" to="Main/Tabs/Settings" method="_on_sbProxyPort_value_changed"] [connection signal="toggled" from="Main/Tabs/Settings/ScaleOverride/cbScaleOverrideEnable" to="Main/Tabs/Settings" method="_on_cbScaleOverrideEnable_toggled"] [connection signal="value_changed" from="Main/Tabs/Settings/ScaleOverride/sbScaleOverride" to="Main/Tabs/Settings" method="_on_sbScaleOverride_value_changed"] [connection signal="pressed" from="Main/Tabs/Debug/Button" to="Main/Tabs/Debug" method="_on_Button_pressed"] diff --git a/scripts/ChangelogDialod.gd b/scripts/ChangelogDialod.gd index 10faa95b..55c3f684 100644 --- a/scripts/ChangelogDialod.gd +++ b/scripts/ChangelogDialod.gd @@ -20,6 +20,17 @@ func open() -> void: popup_centered_ratio(0.9) +func _update_proxy(http: HTTPRequest) -> void: + if Settings.read("proxy_option") == "on": + var host = Settings.read("proxy_host") + var port = Settings.read("proxy_port") as int + http.set_http_proxy(host, port) + http.set_https_proxy(host, port) + else: + http.set_http_proxy("", -1) + http.set_https_proxy("", -1) + + func download_pull_requests(): var game_selected = Settings.read("game") var prs = Settings.read("num_prs_to_request") @@ -27,6 +38,7 @@ func download_pull_requests(): url += "+is%3Apr+is%3Amerged&per_page=" + prs var headers = ["user-agent: CatapultGodotApp"] _pr_data = tr("str_fetching_changes") + _update_proxy(_pullRequests) _pullRequests.request(url, headers) _changelogTextBox.clear() _changelogTextBox.append_bbcode(_pr_data) diff --git a/scripts/ModManager.gd b/scripts/ModManager.gd index 2f138c6e..8af3ce7b 100644 --- a/scripts/ModManager.gd +++ b/scripts/ModManager.gd @@ -264,14 +264,17 @@ func retrieve_kenan_pack() -> void: emit_signal("modpack_retrieval_started") Status.post(tr("msg_getting_kenan_pack") % game.to_upper()) - Downloader.download_file(pack["url"], Paths.own_dir, pack["filename"]) - yield(Downloader, "download_finished") + var archive = Paths.cache_dir.plus_file(pack["filename"]) + + if Settings.read("ignore_cache") or not Directory.new().file_exists(archive): + Downloader.download_file(pack["url"], Paths.cache_dir, pack["filename"]) + yield(Downloader, "download_finished") - var archive = Paths.own_dir.plus_file(pack["filename"]) if Directory.new().file_exists(archive): FS.extract(archive, Paths.tmp_dir) yield(FS, "extract_done") - Directory.new().remove(archive) + if not Settings.read("keep_cache"): + Directory.new().remove(archive) Status.post(tr("msg_wiping_mod_repo")) if (Directory.new().dir_exists(Paths.mod_repo)): diff --git a/scripts/ReleaseInstaller.gd b/scripts/ReleaseInstaller.gd index 174ec0d4..e1b0f16f 100644 --- a/scripts/ReleaseInstaller.gd +++ b/scripts/ReleaseInstaller.gd @@ -14,15 +14,18 @@ func install_release(release_info: Dictionary, game: String, update_in: String = else: Status.post(tr("msg_installing_game") % release_info["name"]) - Downloader.download_file(release_info["url"], Paths.own_dir, release_info["filename"]) - yield(Downloader, "download_finished") + var archive: String = Paths.cache_dir.plus_file(release_info["filename"]) + + if Settings.read("ignore_cache") or not Directory.new().file_exists(archive): + Downloader.download_file(release_info["url"], Paths.cache_dir, release_info["filename"]) + yield(Downloader, "download_finished") - var archive: String = Paths.own_dir.plus_file(release_info["filename"]) if Directory.new().file_exists(archive): FS.extract(archive, Paths.tmp_dir) yield(FS, "extract_done") - Directory.new().remove(archive) + if not Settings.read("keep_cache"): + Directory.new().remove(archive) if FS.last_extract_result == 0: diff --git a/scripts/ReleaseManager.gd b/scripts/ReleaseManager.gd index 311aa9bd..f4a6b3c2 100644 --- a/scripts/ReleaseManager.gd +++ b/scripts/ReleaseManager.gd @@ -270,24 +270,20 @@ func _get_query_string() -> String: return "?per_page=%s" % num_per_page -func _request_dda() -> void: - emit_signal("started_fetching_releases") - $HTTPRequest_DDA.request(_RELEASE_URLS["dda-experimental"] + _get_query_string()) - - -func _request_bn() -> void: - emit_signal("started_fetching_releases") - $HTTPRequest_BN.request(_RELEASE_URLS["bn-experimental"] + _get_query_string()) - - -func _request_eod() -> void: - emit_signal("started_fetching_releases") - $HTTPRequest_EOD.request(_RELEASE_URLS["eod-experimental"] + _get_query_string()) - +func _update_proxy(http: HTTPRequest) -> void: + if Settings.read("proxy_option") == "on": + var host = Settings.read("proxy_host") + var port = Settings.read("proxy_port") as int + http.set_http_proxy(host, port) + http.set_https_proxy(host, port) + else: + http.set_http_proxy("", -1) + http.set_https_proxy("", -1) -func _request_tish() -> void: +func _request_releases(http: HTTPRequest, release: String) -> void: emit_signal("started_fetching_releases") - $HTTPRequest_TISH.request(_RELEASE_URLS["tish-experimental"] + _get_query_string()) + _update_proxy(http) + http.request(_RELEASE_URLS[release] + _get_query_string()) func _on_request_completed_dda(result: int, response_code: int, @@ -387,7 +383,7 @@ func fetch(release_key: String) -> void: emit_signal("done_fetching_releases") "dda-experimental": Status.post(tr("msg_fetching_releases_dda")) - _request_dda() + _request_releases($HTTPRequest_DDA, "dda-experimental") "bn-stable": match _platform: "linux": @@ -397,13 +393,13 @@ func fetch(release_key: String) -> void: emit_signal("done_fetching_releases") "bn-experimental": Status.post(tr("msg_fetching_releases_bn")) - _request_bn() + _request_releases($HTTPRequest_BN, "bn-experimental") "eod-experimental": Status.post(tr("msg_fetching_releases_eod")) - _request_eod() + _request_releases($HTTPRequest_EOD, "eod-experimental") "tish-experimental": Status.post(tr("msg_fetching_releases_tish")) - _request_tish() + _request_releases($HTTPRequest_TISH, "tish-experimental") _: Status.post(tr("msg_invalid_fetch_func_param") % release_key, Enums.MSG_ERROR) diff --git a/scripts/SettingsUI.gd b/scripts/SettingsUI.gd index 553da082..ea7e3837 100644 --- a/scripts/SettingsUI.gd +++ b/scripts/SettingsUI.gd @@ -11,6 +11,8 @@ var _themes := [ "Solarized_Light.res", ] +var _proxy_options := ["off", "on", "download"] + onready var _root = $"/root/Catapult" onready var _tabs = $"/root/Catapult/Main/Tabs" onready var _debug_ui = $"/root/Catapult/Main/Tabs/Debug" @@ -41,10 +43,20 @@ func _ready() -> void: $AlwaysShowInstalls.pressed = Settings.read("always_show_installs") $ShowObsoleteMods.pressed = Settings.read("show_obsolete_mods") $InstallArchivedMods.pressed = Settings.read("install_archived_mods") + $KeepCache.pressed = Settings.read("keep_cache") + $IgnoreCache.pressed = Settings.read("ignore_cache") $ShowDebug.pressed = Settings.read("debug_mode") $NumReleases/sbNumReleases.value = Settings.read("num_releases_to_request") as int $NumPrs/sbNumPRs.value = Settings.read("num_prs_to_request") as int + var proxy_option_idx := _proxy_options.find(Settings.read("proxy_option")) + if proxy_option_idx >= 0: + $ProxySettings/obtnProxyOption.selected = proxy_option_idx + else: + $ProxySettings/obtnProxyOption.selected = 0 + $ProxySettings/leProxyHost.text = Settings.read("proxy_host") + $ProxySettings/sbProxyPort.value = Settings.read("proxy_port") as int + $ScaleOverride/cbScaleOverrideEnable.pressed = Settings.read("ui_scale_override_enabled") $ScaleOverride/sbScaleOverride.editable = Settings.read("ui_scale_override_enabled") $ScaleOverride/sbScaleOverride.value = (Settings.read("ui_scale_override") as float) * 100.0 @@ -103,6 +115,14 @@ func _on_InstallArchivedMods_toggled(button_pressed: bool) -> void: Settings.store("install_archived_mods", button_pressed) +func _on_KeepCache_toggled(button_pressed: bool) -> void: + + Settings.store("keep_cache", button_pressed) + +func _on_IgnoreCache_toggled(button_pressed: bool) -> void: + + Settings.store("ignore_cache", button_pressed) + func _on_ShowDebug_toggled(button_pressed: bool) -> void: Settings.store("debug_mode", button_pressed) @@ -123,6 +143,16 @@ func _on_sbNumPRs_value_changed(value: float) -> void: Settings.store("num_prs_to_request", str(value)) +func _on_obtnProxyOption_item_selected(index): + Settings.store("proxy_option", _proxy_options[index]) + +func _on_leProxyHost_text_changed(new_text): + Settings.store("proxy_host", new_text) + +func _on_sbProxyPort_value_changed(value): + Settings.store("proxy_port", value) + + func _on_cbScaleOverrideEnable_toggled(button_pressed: bool) -> void: Settings.store("ui_scale_override_enabled", button_pressed) @@ -142,3 +172,5 @@ func _on_sbScaleOverride_value_changed(value: float) -> void: Settings.store("ui_scale_override", value / 100.0) Geom.scale = value / 100.0 _root.theme.apply_scale(Geom.scale) + + diff --git a/scripts/SoundpackManager.gd b/scripts/SoundpackManager.gd index d2459852..6ea6fe0c 100644 --- a/scripts/SoundpackManager.gd +++ b/scripts/SoundpackManager.gd @@ -159,9 +159,10 @@ func install_pack(soundpack_index: int, from_file = null, reinstall = false, kee if from_file: archive = from_file else: - Downloader.download_file(pack["url"], Paths.own_dir, pack["filename"]) - yield(Downloader, "download_finished") - archive = Paths.own_dir.plus_file(pack["filename"]) + archive = Paths.cache_dir.plus_file(pack["filename"]) + if Settings.read("ignore_cache") or not Directory.new().file_exists(archive): + Downloader.download_file(pack["url"], Paths.cache_dir, pack["filename"]) + yield(Downloader, "download_finished") if not Directory.new().file_exists(archive): Status.post(tr("msg_sound_download_failed"), Enums.MSG_ERROR) emit_signal("soundpack_installation_finished") @@ -173,7 +174,7 @@ func install_pack(soundpack_index: int, from_file = null, reinstall = false, kee FS.extract(archive, tmp_dir) yield(FS, "extract_done") - if not keep_archive: + if not keep_archive and not Settings.read("keep_cache"): Directory.new().remove(archive) FS.move_dir(tmp_dir + "/" + pack["internal_path"], sound_dir + "/" + pack["name"]) yield(FS, "move_dir_done") diff --git a/scripts/download_manager.gd b/scripts/download_manager.gd index 1c65cd4f..d864fbc9 100644 --- a/scripts/download_manager.gd +++ b/scripts/download_manager.gd @@ -23,9 +23,29 @@ func _enter_tree() -> void: self.add_child(_http) _http.connect("request_completed", self, "_on_HTTPRequest_request_completed") +func set_proxy(host: String, port: int) -> void: + + _http.set_http_proxy(host, port) + _http.set_https_proxy(host, port) func download_file(url: String, target_dir: String, target_filename: String) -> void: + if Settings.read("proxy_option") == "on" or Settings.read("proxy_option") == "download": + var host = Settings.read("proxy_host") + var port = Settings.read("proxy_port") as int + Status.post(tr("msg_using_proxy") % [host, port]) + set_proxy(host, port) + else: + set_proxy("", -1) + + var d = Directory.new() + if not d.dir_exists(target_dir): + var err = d.make_dir_recursive(target_dir) + if err: + Status.post(tr("msg_download_failed") % target_filename, Enums.MSG_ERROR) + emit_signal("download_finished") + return + Status.post(tr("msg_downloading_file") % target_filename) emit_signal("download_started") _current_filename = target_filename diff --git a/scripts/path_helper.gd b/scripts/path_helper.gd index 4b33a954..3b1e9a66 100644 --- a/scripts/path_helper.gd +++ b/scripts/path_helper.gd @@ -6,6 +6,7 @@ signal status_message var own_dir: String setget , _get_own_dir var installs_summary: Dictionary setget , _get_installs_summary +var cache_dir: String setget , _get_cache_dir var game_dir: String setget , _get_game_dir var next_install_dir: String setget , _get_next_install_dir var userdata: String setget , _get_userdata_dir @@ -61,6 +62,11 @@ func _get_installs_summary() -> Dictionary: return result +func _get_cache_dir() -> String: + + return _get_own_dir().plus_file("cache") + + func _get_game_dir() -> String: var active_name = Settings.read("active_install_" + Settings.read("game")) diff --git a/scripts/settings_manager.gd b/scripts/settings_manager.gd index f0e435d0..e1bba8be 100644 --- a/scripts/settings_manager.gd +++ b/scripts/settings_manager.gd @@ -30,6 +30,11 @@ const _HARDCODED_DEFAULTS = { "font_preview_cyrillic": false, "show_game_desc": true, "keep_open_after_starting_game": true, + "keep_cache": false, + "ignore_cache": false, + "proxy_option": "off", + "proxy_host": "", + "proxy_port": 0, "debug_mode": false, } diff --git a/text/en/download_manager.csv b/text/en/download_manager.csv index 394823e7..53524463 100644 --- a/text/en/download_manager.csv +++ b/text/en/download_manager.csv @@ -11,3 +11,4 @@ "msg_download_finished","Finished downloading %s." "msg_download_failed","Failed to download %s." "msg_http_request_info","[b]HTTPRequest info:[/b]\n[u]Result:[/u] %s\n[u]Response code:[/u] %s\n[u]Headers:[/u] %s" +"msg_using_proxy","Using proxy: %s:%s" diff --git a/text/en/settings_tab.csv b/text/en/settings_tab.csv index ec35d7fe..6bdd3103 100644 --- a/text/en/settings_tab.csv +++ b/text/en/settings_tab.csv @@ -10,12 +10,19 @@ "cbtn_show_game_desc","Show game description" "cbtn_show_obsolete_mods","List obsolete mods in installed" "cbtn_updating_to_same_build","Allow ""updating"" to the same build as installed" +"cbtn_keep_cache","Keep download cache" +"cbtn_ignore_cache","Ignore download cache" +"cbtn_enable_proxy","Enable " +"obtn_proxy_option_off", "Disabled" +"obtn_proxy_option_on", "Enabled" +"obtn_proxy_option_download", "For Downloading Only" "keys","en" "lbl_launcher_language","Launcher language" "lbl_launcher_theme","Launcher theme" "lbl_num_prs_to_request","Number of results to download for the changelog:" "lbl_num_releases_to_request","Number of releases to request:" "lbl_ui_scale_override","Custom UI scaling:" +"lbl_proxy_settings","Proxy server:" "tooltip_debug_mode","Shows the Debug tab with some testing functions\nand enables debug messages in the status\npane (useful for troubleshooting)." "tooltip_install_archived_mods","When installing Kenan Modpack, also include *archived* mods.\nThese mods are no longer maintained by Kenan and may be outdated." "tooltip_keep_launcher_open","If turned off, the launcher will close after clicking Play or Resume.\nNote that if the game fails to start for any reason, the launcher\nwill still close." @@ -28,3 +35,7 @@ "tooltip_show_obsolete_mods","Show mods that come with the game but are marked as ""obsolete"".\nNormally, such mods are not considered as installed." "tooltip_ui_scale_override","Use this if the automatically inferred UI scale looks too large\nor too small on your system. (Automatic scale relies on\nsystem-reported display DPI, which may not work on all systems,\nor give inadequate results when the resolution is too low.)" "tooltip_updating_to_same_build","Allow starting the update procedure even when the selected\nrelease is the same as currently installed." +"tooltip_keep_cache","Keep downloaded contents (game releases, modpacks, soundpacks) in cache folder\nwhen install completes, instead of having it deleted." +"tooltip_ignore_cache","Always download contents from the web,\neven if it's already inside cache folder." +"tooltip_proxy_settings","Configure a proxy server for downloading." +"tooltip_proxy_options","Disabled - Do not use proxy\nEnabled - Use proxy on all occasions (e.g. requesting releases)\nFor Downloading Only - Use proxy only when downloading" diff --git a/text/zh/download_manager.csv b/text/zh/download_manager.csv index 4523a2f1..ce99d315 100644 --- a/text/zh/download_manager.csv +++ b/text/zh/download_manager.csv @@ -11,3 +11,4 @@ "msg_download_finished","已完成下载%s。" "msg_download_failed","下载%s失败。" "msg_http_request_info","[b]HTTPRequest信息:[/b]\n[u]结果:[/u] %s\n[u]响应代码:[/u] %s\n[u]头:[/u] %s" +"msg_using_proxy","使用代理:%s:%s" diff --git a/text/zh/game_tab.csv b/text/zh/game_tab.csv index b7985f75..828a2959 100644 --- a/text/zh/game_tab.csv +++ b/text/zh/game_tab.csv @@ -1,18 +1,18 @@ "keys","zh" , -"lbl_channel","版本:" +"lbl_channel","渠道:" "rbtn_stable","稳定版" "rbtn_experimental","测试版" "lbl_changelog","[right][color=#3b93f7][url]查看测试版更新日志[/url][/color][/right]" -"lbl_builds","可用构建:" +"lbl_builds","可用版本:" "btn_refresh","刷新" "btn_install","安装" "btn_update","更新" -"cb_update_active","更新当前活动安装" -"lbl_active_install","主动安装:" +"cb_update_active","更新当前实例(覆盖安装)" +"lbl_active_install","当前实例:" "btn_play","开始" -"btn_resume","加载最后一个世界" -"lbl_installs","已安装版本:" +"btn_resume","加载上次游玩的世界" +"lbl_installs","已安装的实例:" "lbl_currently_installed","已安装:" "lbl_none","无" "btn_activate","激活" @@ -22,16 +22,16 @@ "tooltip_changelog","点击从Github加载最近的更新日志。" "tooltip_stable","稳定版(仅DDA)。" "tooltip_experimental","测试版。" -"tooltip_builds","选择游戏要安装或更新到具体哪个构建。" -"tooltip_refresh","从Github重新检索可用 游戏列表(仅测试版)。" -"tooltip_install","安装所选发布(DDA和BN 分别管理,可同时存在)。" -"tooltip_update","如果选中,当前设置为活动的游戏安装\n将替换为上面选择的版本。\n否则,选择的构建将是新的,单独安装游戏。" +"tooltip_builds","选择游戏要安装或更新到具体哪个版本。" +"tooltip_refresh","从Github重新检索可用游戏版本列表(仅测试版)。" +"tooltip_install","安装所选版本(DDA和BN分别管理,可同时存在)。" +"tooltip_update","如果选中,所选择的版本将替换掉当前实例的内容。\n否则,所选择的版本将作为全新实例安装。" "tooltip_game_dir","打开游戏安装目录(包含游戏可执行文件和内置游戏内容)。" "tooltip_user_dir","打开用户数据目录(包含存档、游戏配置、用户模组、声音等)" "tooltip_play","启动游戏。" -"tooltip_resume","跳过主菜单并快速加载上次播放的世界。\n(如果有多个,将始终加载第一个字符。)" -"tooltip_activate","将选定的游戏安装设置为活动(即正在使用)。\n""活动"" 安装是在您单击播放/继续时启动\n或在单击安装时更新的安装。" -"tooltip_delete","删除选中的游戏副本。\n(游戏存档、设置等用户数据单独存储,不会丢失。)" +"tooltip_resume","跳过主菜单并快速加载上次游玩的世界。\n(如果有多个角色,将始终加载第一个。)" +"tooltip_activate","将选定的实例设置为当前实例(即正在使用)。\n这就是在您单击开始/加载上次游玩的世界时启动的、\n或在覆盖安装时更新的实例。" +"tooltip_delete","删除选中的游戏实例。\n(游戏存档、设置等用户数据是单独存储的,不会丢失。)" "tooltip_installs_item","位置:\n%s\n(双击打开文件夹)" , -"msg_set_active","将活动安装设置为 %s。" +"msg_set_active","将当前实例设置为 %s。" diff --git a/text/zh/release_manager.csv b/text/zh/release_manager.csv index efa7b548..ae75dcd1 100644 --- a/text/zh/release_manager.csv +++ b/text/zh/release_manager.csv @@ -2,7 +2,7 @@ , "msg_unsupported_platform","不支持的平台:\""%s\""" "msg_releases_request_failed","请求失败。你的网络正常连接吗?" -"msg_releases_api_failure","无法获取构建列表。GitHub说:%s" +"msg_releases_api_failure","无法获取版本列表。GitHub说:%s" "msg_got_n_releases","获取了%s个发布。" "msg_fetching_releases_dda","正在为DDA测试版获取发布... " "msg_fetching_releases_bn","正在为BN测试版获取发布..." diff --git a/text/zh/settings_tab.csv b/text/zh/settings_tab.csv index afc56c93..abdb2163 100644 --- a/text/zh/settings_tab.csv +++ b/text/zh/settings_tab.csv @@ -15,6 +15,13 @@ "lbl_num_prs_to_request","下载更新日志的数量" "lbl_ui_scale_override","自定义UI比例:" "cbtn_enable_scale","启用" +"cbtn_keep_cache","保留缓存" +"cbtn_ignore_cache","忽略缓存" +"lbl_proxy_settings","代理服务器" +"cbtn_enable_proxy","启用" +"obtn_proxy_option_off", "关" +"obtn_proxy_option_on", "开" +"obtn_proxy_option_download", "仅用于下载" , "tooltip_show_game_desc","为所选游戏展示描述" "tooltip_keep_launcher_open","如果关闭,点击播放或继续后启动器将关闭。\n请注意,如果游戏因任何原因无法启动,启动器仍会关闭。" @@ -29,3 +36,7 @@ "tooltip_num_prs_to_request","启动器会从Github拉取多少条PR来组成更新日志, 过高的数字会导致获取变慢或失败。" "tooltip_ui_scale_override","如果自动指定的UI比例在您的系统上看起来 太大或太小,请使用此选项。(自动缩放依赖于 系统报告的显示 DPI,这可能不适用于所有系统, 或者在分辨率太低时给出不充分的结果。) " "tooltip_data_to_migrate","选择哪些游戏数据要在 更新游戏版本时迁移。" +"tooltip_keep_cache","当从网络上下载的内容(游戏版本、模组包、音乐等)安装完成时,\n不将下载的包删除, 而是留在缓存文件夹中。" +"tooltip_ignore_cache","即使缓存文件夹中已有所需的包,也仍然从网络上进行下载。" +"tooltip_proxy_settings","配置一个用于下载的代理服务器。" +"tooltip_proxy_options","关 - 不启用代理\n开 - 在所有场合均使用代理(例如获取发布列表时)\n仅用于下载 - 仅在下载时使用代理"