From 3642aa63a543924ce60b4e2427218794f6d0e772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Thu, 7 Mar 2024 11:01:34 +0900 Subject: [PATCH 1/2] fix #126 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- .../DMMGamePlayerFastLauncher.py | 16 ++++---------- .../models/setting_data.py | 8 ++----- DMMGamePlayerFastLauncher/tab/setting.py | 11 ++++------ assets/i18n/app.en_US.yml | 22 +++++++++++++------ assets/i18n/app.ja_JP.yml | 22 +++++++++++++------ assets/i18n/app.zh_CN.yml | 22 +++++++++++++------ assets/i18n/app.zh_TW.yml | 22 +++++++++++++------ 7 files changed, 70 insertions(+), 53 deletions(-) diff --git a/DMMGamePlayerFastLauncher/DMMGamePlayerFastLauncher.py b/DMMGamePlayerFastLauncher/DMMGamePlayerFastLauncher.py index a28b1ee..0449945 100644 --- a/DMMGamePlayerFastLauncher/DMMGamePlayerFastLauncher.py +++ b/DMMGamePlayerFastLauncher/DMMGamePlayerFastLauncher.py @@ -65,18 +65,10 @@ def loder(master: LanchLauncher): config_migrate() - if AppConfig.DATA.proxy_http.get() != "": - os.environ["HTTP_PROXY"] = AppConfig.DATA.proxy_http.get() - if AppConfig.DATA.proxy_https.get() != "": - os.environ["HTTPS_PROXY"] = AppConfig.DATA.proxy_https.get() - if AppConfig.DATA.proxy_socks.get() != "": - os.environ["SOCKS_PROXY"] = AppConfig.DATA.proxy_socks.get() - if AppConfig.DATA.dmm_proxy_http.get() != "": - DgpSessionV2.PROXY["http"] = AppConfig.DATA.dmm_proxy_http.get() - if AppConfig.DATA.dmm_proxy_https.get() != "": - DgpSessionV2.PROXY["https"] = AppConfig.DATA.dmm_proxy_https.get() - if AppConfig.DATA.dmm_proxy_socks.get() != "": - DgpSessionV2.PROXY["socks"] = AppConfig.DATA.dmm_proxy_socks.get() + if AppConfig.DATA.proxy_all.get() != "": + os.environ["ALL_PROXY"] = AppConfig.DATA.proxy_all.get() + if AppConfig.DATA.dmm_proxy_all.get() != "": + DgpSessionV2.PROXY["all"] = AppConfig.DATA.dmm_proxy_all.get() ctk.set_default_color_theme(str(AssetsPathConfig.THEMES.joinpath(AppConfig.DATA.theme.get()).with_suffix(".json"))) ctk.set_appearance_mode(AppConfig.DATA.appearance_mode.get()) diff --git a/DMMGamePlayerFastLauncher/models/setting_data.py b/DMMGamePlayerFastLauncher/models/setting_data.py index 89f72f1..b3cec67 100644 --- a/DMMGamePlayerFastLauncher/models/setting_data.py +++ b/DMMGamePlayerFastLauncher/models/setting_data.py @@ -13,12 +13,8 @@ class SettingData(VariableBase): last_version: StringVar = field(default_factory=lambda: StringVar(value="v0.0.0")) # field(default_factory=lambda: StringVar(value=Env.VERSION)) dmm_game_player_program_folder: PathVar = field(default_factory=lambda: PathVar(value=Env.DEFAULT_DMM_GAME_PLAYER_PROGURAM_FOLDER)) dmm_game_player_data_folder: PathVar = field(default_factory=lambda: PathVar(value=Env.DEFAULT_DMM_GAME_PLAYER_DATA_FOLDER)) - proxy_http: StringVar = field(default_factory=StringVar) - proxy_https: StringVar = field(default_factory=StringVar) - proxy_socks: StringVar = field(default_factory=StringVar) - dmm_proxy_http: StringVar = field(default_factory=StringVar) - dmm_proxy_https: StringVar = field(default_factory=StringVar) - dmm_proxy_socks: StringVar = field(default_factory=StringVar) + proxy_all: StringVar = field(default_factory=StringVar) + dmm_proxy_all: StringVar = field(default_factory=StringVar) lang: StringVar = field(default_factory=lambda: StringVar(value=get_default_locale()[0])) theme: StringVar = field(default_factory=lambda: StringVar(value="blue")) appearance_mode: StringVar = field(default_factory=lambda: StringVar(value="dark")) diff --git a/DMMGamePlayerFastLauncher/tab/setting.py b/DMMGamePlayerFastLauncher/tab/setting.py index bca37b1..4fce435 100644 --- a/DMMGamePlayerFastLauncher/tab/setting.py +++ b/DMMGamePlayerFastLauncher/tab/setting.py @@ -58,13 +58,10 @@ def create(self): OptionMenuComponent(self, text=i18n.t("app.setting.theme"), values=self.theme, variable=self.data.theme).create() OptionMenuComponent(self, text=i18n.t("app.setting.appearance"), values=["light", "dark", "system"], variable=self.data.appearance_mode).create() - EntryComponent(self, text=i18n.t("app.setting.proxy_http"), variable=self.data.proxy_http).create() - EntryComponent(self, text=i18n.t("app.setting.proxy_https"), variable=self.data.proxy_https).create() - EntryComponent(self, text=i18n.t("app.setting.proxy_socks"), variable=self.data.proxy_socks).create() - - EntryComponent(self, text=i18n.t("app.setting.dmm_proxy_http"), variable=self.data.dmm_proxy_http).create() - EntryComponent(self, text=i18n.t("app.setting.dmm_proxy_https"), variable=self.data.dmm_proxy_https).create() - EntryComponent(self, text=i18n.t("app.setting.dmm_proxy_socks"), variable=self.data.dmm_proxy_socks).create() + text = i18n.t("app.setting.proxy_all") + EntryComponent(self, text=text, tooltip=i18n.t("app.setting.proxy_all_tooltip"), variable=self.data.proxy_all).create() + text = i18n.t("app.setting.dmm_proxy_all") + EntryComponent(self, text=text, tooltip=i18n.t("app.setting.dmm_proxy_all_tooltip"), variable=self.data.dmm_proxy_all).create() PaddingComponent(self, height=5).create() CTkLabel(self, text=i18n.t("app.setting.window_scaling")).pack(anchor=ctk.W) diff --git a/assets/i18n/app.en_US.yml b/assets/i18n/app.en_US.yml index 8d6feba..edd50cd 100644 --- a/assets/i18n/app.en_US.yml +++ b/assets/i18n/app.en_US.yml @@ -144,13 +144,21 @@ en_US: theme: Theme appearance: Appearance - proxy_http: HTTP Proxy - proxy_https: HTTPS Proxy - proxy_socks: SOCKS Proxy - - dmm_proxy_http: DMM HTTP Proxy - dmm_proxy_https: DMM HTTPS Proxy - dmm_proxy_socks: DMM SOCKS Proxy + proxy_all: Proxy + proxy_all_tooltip: |- + Set up the game's proxy. + Example: http://127.0.0.1:80 + https://127.0.0.1:443 + socks5://127.0.0.1:1080 + socks5://user:pass@127.0.0.1:1080 + + dmm_proxy_all: DMM Proxy + dmm_proxy_all_tooltip: |- + Set up DMM's proxy. + Example: http://127.0.0.1:80 + https://127.0.0.1:443 + socks5://127.0.0.1:1080 + socks5://user:pass@127.0.0.1:1080 window_scaling: Window Scaling debug_window: Show Debug Window diff --git a/assets/i18n/app.ja_JP.yml b/assets/i18n/app.ja_JP.yml index 5407c2f..4071f80 100644 --- a/assets/i18n/app.ja_JP.yml +++ b/assets/i18n/app.ja_JP.yml @@ -141,13 +141,21 @@ ja_JP: theme: テーマ appearance: 外観 - proxy_http: HTTPプロキシ - proxy_https: HTTPSプロキシ - proxy_socks: SOCKSプロキシ - - dmm_proxy_http: DMM HTTPプロキシ - dmm_proxy_https: DMM HTTPSプロキシ - dmm_proxy_socks: DMM SOCKSプロキシ + proxy_all: プロキシ + proxy_all_tooltip: |- + ゲームのプロキシを設定します。 + 例: http://127.0.0.1:80 + https://127.0.0.1:443 + socks5://127.0.0.1:1080 + socks5://user:pass@127.0.0.1:1080 + + dmm_proxy_all: DMM プロキシ + dmm_proxy_all_tooltip: |- + DMMのプロキシを設定します。 + 例: http://127.0.0.1:80 + https://127.0.0.1:443 + socks5://127.0.0.1:1080 + socks5://user:pass@127.0.0.1:1080 window_scaling: ウィンドウの拡大率 debug_window: デバッグウィンドウを表示する diff --git a/assets/i18n/app.zh_CN.yml b/assets/i18n/app.zh_CN.yml index 30d11cf..58f40a6 100644 --- a/assets/i18n/app.zh_CN.yml +++ b/assets/i18n/app.zh_CN.yml @@ -143,13 +143,21 @@ zh_CN: theme: 主题 appearance: 外观 - proxy_http: HTTP 代理 - proxy_https: HTTPS 代理 - proxy_socks: SOCKS 代理 - - dmm_proxy_http: DMM HTTP 代理 - dmm_proxy_https: DMM HTTPS 代理 - dmm_proxy_socks: DMM SOCKS 代理 + proxy_all: 代理 + proxy_all_tooltip: |- + 设置游戏的代理。 + 例子:http://127.0.0.1:80 + https://127.0.0.1:443 + socks5://127.0.0.1:1080 + socks5://user:pass@127.0.0.1:1080 + + dmm_proxy_all: DMM 代理 + dmm_proxy_all_tooltip: |- + 设置 DMM 的代理。 + 例子:http://127.0.0.1:80 + https://127.0.0.1:443 + socks5://127.0.0.1:1080 + socks5://user:pass@127.0.0.1:1080 window_scaling: 窐口缩放比例 debug_window: 显示调试窗口 diff --git a/assets/i18n/app.zh_TW.yml b/assets/i18n/app.zh_TW.yml index c1705e3..f409c3e 100644 --- a/assets/i18n/app.zh_TW.yml +++ b/assets/i18n/app.zh_TW.yml @@ -142,13 +142,21 @@ zh_TW: theme: 主題 appearance: 外貌 - proxy_http: HTTP 代理 - proxy_https: HTTPS 代理 - proxy_socks: SOCKS 代理 - - dmm_proxy_http: DMM HTTP 代理 - dmm_proxy_https: DMM HTTPS 代理 - dmm_proxy_socks: DMM SOCKS 代理 + proxy_all: 代理 + proxy_all_tooltip: |- + 設定遊戲的代理。 + 例子:http://127.0.0.1:80 + https://127.0.0.1:443 + socks5://127.0.0.1:1080 + socks5://user:pass@127.0.0.1:1080 + + dmm_proxy_all: DMM 代理 + dmm_proxy_all_tooltip: |- + 設定 DMM 的代理。 + 例子:http://127.0.0.1:80 + https://127.0.0.1:443 + socks5://127.0.0.1:1080 + socks5://user:pass@127.0.0.1:1080 window_scaling: 窐口縮放比例 debug_window: 顯示除錯窗口 From ec5e7486bf8d1c66fac1df137a4e6517ebafe1f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Thu, 7 Mar 2024 11:15:18 +0900 Subject: [PATCH 2/2] fix all args is not working MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- DMMGamePlayerFastLauncher/DMMGamePlayerFastLauncher.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DMMGamePlayerFastLauncher/DMMGamePlayerFastLauncher.py b/DMMGamePlayerFastLauncher/DMMGamePlayerFastLauncher.py index 0449945..e5a68b6 100644 --- a/DMMGamePlayerFastLauncher/DMMGamePlayerFastLauncher.py +++ b/DMMGamePlayerFastLauncher/DMMGamePlayerFastLauncher.py @@ -68,7 +68,8 @@ def loder(master: LanchLauncher): if AppConfig.DATA.proxy_all.get() != "": os.environ["ALL_PROXY"] = AppConfig.DATA.proxy_all.get() if AppConfig.DATA.dmm_proxy_all.get() != "": - DgpSessionV2.PROXY["all"] = AppConfig.DATA.dmm_proxy_all.get() + DgpSessionV2.PROXY["http"] = AppConfig.DATA.dmm_proxy_all.get() + DgpSessionV2.PROXY["https"] = AppConfig.DATA.dmm_proxy_all.get() ctk.set_default_color_theme(str(AssetsPathConfig.THEMES.joinpath(AppConfig.DATA.theme.get()).with_suffix(".json"))) ctk.set_appearance_mode(AppConfig.DATA.appearance_mode.get())