From f95716ac6602402eeff715c89967b2e00285fa85 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Mon, 29 Aug 2022 00:26:14 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=9B=B4=E6=96=B0=E7=82=B9=E5=B0=8F?= =?UTF-8?q?=E4=B8=9C=E8=A5=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Difficult_Rocket/client/__init__.py | 2 +- .../{ => client}/guis/__init__.py | 0 .../client/guis/format/__init__.py | 5 ++++ .../{ => client}/guis/format/html.py | 4 +-- Difficult_Rocket/{ => client}/guis/label.py | 0 Difficult_Rocket/{ => client}/guis/widgets.py | 4 +-- Difficult_Rocket/client/screen.py | 2 +- Difficult_Rocket/client/window.py | 5 ++++ Difficult_Rocket/guis/format/html.jl | 19 ------------- configs/main.toml | 4 +-- configs/textures.toml | 27 +++++++++++++++++++ test/gui/format/html_format.py | 3 +-- 12 files changed, 46 insertions(+), 29 deletions(-) rename Difficult_Rocket/{ => client}/guis/__init__.py (100%) create mode 100644 Difficult_Rocket/client/guis/format/__init__.py rename Difficult_Rocket/{ => client}/guis/format/html.py (98%) rename Difficult_Rocket/{ => client}/guis/label.py (100%) rename Difficult_Rocket/{ => client}/guis/widgets.py (99%) create mode 100644 Difficult_Rocket/client/window.py delete mode 100644 Difficult_Rocket/guis/format/html.jl create mode 100644 configs/textures.toml diff --git a/Difficult_Rocket/client/__init__.py b/Difficult_Rocket/client/__init__.py index 4327c26..f8c19ce 100644 --- a/Difficult_Rocket/client/__init__.py +++ b/Difficult_Rocket/client/__init__.py @@ -24,7 +24,7 @@ from Difficult_Rocket import Options from Difficult_Rocket.command import line, tree from Difficult_Rocket.utils import new_thread from Difficult_Rocket.utils.translate import tr -from Difficult_Rocket.guis.widgets import InputBox +from Difficult_Rocket.client.guis.widgets import InputBox # from Difficult_Rocket.client.screen import DRScreen from Difficult_Rocket.utils import tools, translate from Difficult_Rocket.client.fps.fps_log import FpsLogger diff --git a/Difficult_Rocket/guis/__init__.py b/Difficult_Rocket/client/guis/__init__.py similarity index 100% rename from Difficult_Rocket/guis/__init__.py rename to Difficult_Rocket/client/guis/__init__.py diff --git a/Difficult_Rocket/client/guis/format/__init__.py b/Difficult_Rocket/client/guis/format/__init__.py new file mode 100644 index 0000000..0a68a6a --- /dev/null +++ b/Difficult_Rocket/client/guis/format/__init__.py @@ -0,0 +1,5 @@ +# ------------------------------- +# Difficult Rocket +# Copyright © 2021-2022 by shenjackyuanjie 3695888@qq.com +# All rights reserved +# ------------------------------- diff --git a/Difficult_Rocket/guis/format/html.py b/Difficult_Rocket/client/guis/format/html.py similarity index 98% rename from Difficult_Rocket/guis/format/html.py rename to Difficult_Rocket/client/guis/format/html.py index e5d6987..79fc3dc 100644 --- a/Difficult_Rocket/guis/format/html.py +++ b/Difficult_Rocket/client/guis/format/html.py @@ -208,8 +208,8 @@ class SingleTextStyle: # [\u4e00-\u9fa5] 中文字符 default_fonts_config = [ { - 'match': re.compile(r'.'), # 匹配的字符 匹配选项是re.compile() - 'shown': re.compile(r'.'), # 匹配到的字符中显示的部分 匹配选项是re.compile() + 'match': re.compile(r''), # 匹配的字符 匹配选项是re.compile() + 'shown': re.compile(r''), # 匹配到的字符中显示的部分 匹配选项是re.compile() 'style': SingleTextStyle(font_name=translate.鸿蒙简体, font_size=15, bold=False, italic=False, show=True, color='white'), }, { diff --git a/Difficult_Rocket/guis/label.py b/Difficult_Rocket/client/guis/label.py similarity index 100% rename from Difficult_Rocket/guis/label.py rename to Difficult_Rocket/client/guis/label.py diff --git a/Difficult_Rocket/guis/widgets.py b/Difficult_Rocket/client/guis/widgets.py similarity index 99% rename from Difficult_Rocket/guis/widgets.py rename to Difficult_Rocket/client/guis/widgets.py index 39a2076..dbcf296 100644 --- a/Difficult_Rocket/guis/widgets.py +++ b/Difficult_Rocket/client/guis/widgets.py @@ -11,8 +11,8 @@ github: @shenjackyuanjie gitee: @shenjackyuanjie """ -from utils import translate -from Difficult_Rocket.guis.format import html +from Difficult_Rocket.utils import translate +from Difficult_Rocket.client.guis.format import html from Difficult_Rocket import DR_option # from libs import pyglet diff --git a/Difficult_Rocket/client/screen.py b/Difficult_Rocket/client/screen.py index 2738e98..0cec024 100644 --- a/Difficult_Rocket/client/screen.py +++ b/Difficult_Rocket/client/screen.py @@ -4,7 +4,7 @@ # All rights reserved # ------------------------------- -import ctypes +# import ctypes from Difficult_Rocket.client import ClientWindow from Difficult_Rocket.command.tree import CommandTree diff --git a/Difficult_Rocket/client/window.py b/Difficult_Rocket/client/window.py new file mode 100644 index 0000000..0a68a6a --- /dev/null +++ b/Difficult_Rocket/client/window.py @@ -0,0 +1,5 @@ +# ------------------------------- +# Difficult Rocket +# Copyright © 2021-2022 by shenjackyuanjie 3695888@qq.com +# All rights reserved +# ------------------------------- diff --git a/Difficult_Rocket/guis/format/html.jl b/Difficult_Rocket/guis/format/html.jl deleted file mode 100644 index f5ad509..0000000 --- a/Difficult_Rocket/guis/format/html.jl +++ /dev/null @@ -1,19 +0,0 @@ -#= -html: -- Julia version: 1.7.2 -- Author: shenjack -- Date: 2022-04-26 -=# - -using PyCall - -include("../../utils/translate.jl") - -struct default_style - font_name::String - font_size::UInt8 - bold::Bool - italic::Bool -end - -default_style = default_style(fonts.HOS) \ No newline at end of file diff --git a/configs/main.toml b/configs/main.toml index ef83817..2374ab4 100644 --- a/configs/main.toml +++ b/configs/main.toml @@ -8,8 +8,8 @@ fonts_folder = "libs/fonts" [window] style = "None" -width = 956 -height = 569 +width = 763 +height = 448 visible = true caption = "Difficult Rocket {version}" resizable = true diff --git a/configs/textures.toml b/configs/textures.toml new file mode 100644 index 0000000..07370af --- /dev/null +++ b/configs/textures.toml @@ -0,0 +1,27 @@ +[Runtime] + +[Parts] +battery = "Battery.png" +beam = "Beam.png" +cover_bottom = "CoverBottom.png" +nose_cone = "NoseCone.png" + +[Editor] +[[runtime]] +"toolbar.dark" = "ToolbarDark.png" +"toolbar.light" = "ToolbarLight.png" +"button_side.dark" = "ButtonDarkSide.png" +"button_side.light" = "ButtonLightSide.png" + +[[toggle_button]] +stage = "ToolbarIconStaging.png" +add_part = "ToolbarIconAddPart.png" +menu = "ToolbarIconMenu.png" + +[[push_button]] +zoom = "ToolbarIconZoom.png" +"zoom.in" = "ToolbarIconZoomIn.png" +"zoom.out" = "ToolbarIconZoomOut.png" +play = "ToolbarIconPlay.png" +rotate = "RotateButton.png" +trash_can = "TrashCan.png" diff --git a/test/gui/format/html_format.py b/test/gui/format/html_format.py index dcf540a..60743e4 100644 --- a/test/gui/format/html_format.py +++ b/test/gui/format/html_format.py @@ -18,8 +18,7 @@ os.chdir('..') os.chdir('..') os.chdir('..') - -from Difficult_Rocket.guis.format import html +from client.guis.format import html try_texts = [ '明天天气很好',