From 1beb2abdc0792de297b420cac4e029e42b8b2e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Fri, 23 Aug 2024 15:53:32 +0800 Subject: [PATCH] fix --- LunaTranslator/LunaTranslator/gui/translatorUI.py | 3 ++- LunaTranslator/LunaTranslator/metadata/bangumi.py | 10 ++++++++++ LunaTranslator/LunaTranslator/myutils/config.py | 2 +- LunaTranslator/files/defaultconfig/config.json | 2 +- docs/zh/alltoolbuttons.md | 6 ++++-- plugins/CMakeLists.txt | 2 +- 6 files changed, 19 insertions(+), 6 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/translatorUI.py b/LunaTranslator/LunaTranslator/gui/translatorUI.py index ab2848eb..6eaeb6fe 100644 --- a/LunaTranslator/LunaTranslator/gui/translatorUI.py +++ b/LunaTranslator/LunaTranslator/gui/translatorUI.py @@ -1066,7 +1066,8 @@ class TranslatorWindow(resizableframeless): topr, str2rgba( globalconfig["backcolor"], - globalconfig["transparent"] * (not globalconfig["backtransparent"]), + max(100 / 255, globalconfig["transparent"]) + * (not globalconfig["backtransparent"]), ), ) ) diff --git a/LunaTranslator/LunaTranslator/metadata/bangumi.py b/LunaTranslator/LunaTranslator/metadata/bangumi.py index d9c2e897..78385e99 100644 --- a/LunaTranslator/LunaTranslator/metadata/bangumi.py +++ b/LunaTranslator/LunaTranslator/metadata/bangumi.py @@ -209,7 +209,17 @@ class searcher(common): developers.append(__) elif isinstance(__, dict): developers.append(__["v"]) + namemaps = {} + try: + charas = self.proxysession.get( + f"https://api.bgm.tv/v0/subjects/{sid}/characters", headers=headers + ).json() + for _ in charas: + namemaps[_["name"]] = _["name"] + except: + pass return { + "namemap": namemaps, "title": response["name"], "imagepath_all": [imagepath], "webtags": vndbtags, diff --git a/LunaTranslator/LunaTranslator/myutils/config.py b/LunaTranslator/LunaTranslator/myutils/config.py index 9fc0b872..82a45ac5 100644 --- a/LunaTranslator/LunaTranslator/myutils/config.py +++ b/LunaTranslator/LunaTranslator/myutils/config.py @@ -9,7 +9,7 @@ def namemapcast(namemap): for k, v in namemap.items(): for sp in ["・", " "]: spja = k.split(sp) - spen = v.split(" ") + spen = v.split(sp if k == v else " ") if len(spja) == len(spen) and len(spen) > 1: for i in range(len(spja)): if len(spja[i]) >= 2: diff --git a/LunaTranslator/files/defaultconfig/config.json b/LunaTranslator/files/defaultconfig/config.json index 64618bd7..3b37fa64 100644 --- a/LunaTranslator/files/defaultconfig/config.json +++ b/LunaTranslator/files/defaultconfig/config.json @@ -621,7 +621,7 @@ }, "backtransbutton": { "use": true, - "tip": "背景窗口透明", + "tip": "背景窗口透明_EX", "icon": "fa.lightbulb-o", "align": 2 }, diff --git a/docs/zh/alltoolbuttons.md b/docs/zh/alltoolbuttons.md index 86c522f0..5f0cfd95 100644 --- a/docs/zh/alltoolbuttons.md +++ b/docs/zh/alltoolbuttons.md @@ -44,8 +44,10 @@ 当把翻译窗口置于游戏窗口的文本框之上时,激活这个按钮可以直接点击游戏的文本框而不是点击到翻译窗口上。
当把鼠标移动到**鼠标穿透窗口按钮及其左右一个按钮的区域**时,会自动退出穿透以使用工具按钮;移出区域时自动恢复穿透。 -1. #### 背景窗口透明 - 该按钮作用仅是一键使得翻译窗口的不透明度切换到0。这个切换不会使得原版的不透明度设置被遗忘。 +1. #### 背景窗口透明_EX + 将不透明度降低到0后,将无法在拖动主窗口中的全透明区域。因此,使用设置中的透明度设置最低只允许将不透明度降低到0.39%,以防止误操作导致找不到窗口。 + 而该按钮可以无视该限制,使得翻译窗口的不透明度切换到0。这个切换不会使得不透明度设置的值被遗忘。 + 1. #### 锁定工具栏 未锁定工具栏时,当鼠标移出时,工具栏会自动隐藏;激活后工具栏将始终显示。
未锁定工具栏时,如果激活了`鼠标穿透窗口`,则仅当鼠标移动到**鼠标穿透窗口按钮及其左右一个按钮的区域**时,工具栏才显示;否则只要鼠标进入到翻译窗口,工具就会显示。
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index cbe83d31..a975e618 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -29,7 +29,7 @@ include(generate_product_version) set(VERSION_MAJOR 5) set(VERSION_MINOR 30) -set(VERSION_PATCH 2) +set(VERSION_PATCH 1) add_library(pch pch.cpp) target_precompile_headers(pch PUBLIC pch.h)