replace runtime import [build skip] [build rs skip]

This commit is contained in:
shenjack 2023-06-17 00:51:05 +08:00
parent 645e7ae80d
commit 893912fae3
4 changed files with 8 additions and 6 deletions

View File

@ -30,10 +30,10 @@ from pyglet.window import key, mouse
if TYPE_CHECKING: if TYPE_CHECKING:
from Difficult_Rocket.main import Game from Difficult_Rocket.main import Game
from Difficult_Rocket.utils import tools from Difficult_Rocket.utils import tools
from Difficult_Rocket.api.types import Options
from Difficult_Rocket.command import line from Difficult_Rocket.command import line
from Difficult_Rocket.api.types import Options
from Difficult_Rocket.utils.translate import tr from Difficult_Rocket.utils.translate import tr
from Difficult_Rocket import DR_runtime from Difficult_Rocket.runtime import DR_runtime
from Difficult_Rocket.api.screen import BaseScreen from Difficult_Rocket.api.screen import BaseScreen
from Difficult_Rocket.utils.thread import new_thread from Difficult_Rocket.utils.thread import new_thread
from Difficult_Rocket.client.fps.fps_log import FpsLogger from Difficult_Rocket.client.fps.fps_log import FpsLogger
@ -51,7 +51,7 @@ class ClientOption(Options):
resizeable: bool = True resizeable: bool = True
visible: bool = True visible: bool = True
gui_scale: float = 1.0 gui_scale: float = 1.0
caption: str = "Difficult Rocket v{DR_version}|DR_rs v{DR_Rust_get_version}" caption: str = "Difficult Rocket v{DR_version}"
def load_file(self) -> None: def load_file(self) -> None:
file: dict = tools.load_file('./configs/main.toml') file: dict = tools.load_file('./configs/main.toml')

View File

@ -99,7 +99,8 @@ def write_cache(cache_stream, crash_info):
def write_info_to_cache(cache_stream): def write_info_to_cache(cache_stream):
# 运行状态信息 # 运行状态信息
from Difficult_Rocket import DR_status, DR_runtime from Difficult_Rocket import DR_status
from Difficult_Rocket.runtime import DR_runtime
cache_stream.write(Run_message) cache_stream.write(Run_message)
cache_stream.write(markdown_line_handler(f'DR Version: {Difficult_Rocket.game_version}', level=1)) cache_stream.write(markdown_line_handler(f'DR Version: {Difficult_Rocket.game_version}', level=1))
cache_stream.write(markdown_line_handler(f'DR language: {DR_runtime.language}', level=1)) cache_stream.write(markdown_line_handler(f'DR language: {DR_runtime.language}', level=1))

View File

@ -17,8 +17,9 @@ import inspect
from dataclasses import dataclass from dataclasses import dataclass
from typing import Union, Tuple, Any, List, Dict, Hashable, Optional from typing import Union, Tuple, Any, List, Dict, Hashable, Optional
from Difficult_Rocket import DR_runtime, DR_status from Difficult_Rocket import DR_status
from Difficult_Rocket.utils import tools from Difficult_Rocket.utils import tools
from Difficult_Rocket.runtime import DR_runtime
from Difficult_Rocket.exception.language import (LanguageNotFound, from Difficult_Rocket.exception.language import (LanguageNotFound,
TranslateKeyNotFound) TranslateKeyNotFound)

View File

@ -12,8 +12,8 @@ from typing import Optional
from Difficult_Rocket import DR_status from Difficult_Rocket import DR_status
from Difficult_Rocket.main import Game from Difficult_Rocket.main import Game
from Difficult_Rocket.api.mod import ModInfo from Difficult_Rocket.api.mod import ModInfo
from Difficult_Rocket.api.types import Options, Version
from Difficult_Rocket.client import ClientWindow from Difficult_Rocket.client import ClientWindow
from Difficult_Rocket.api.types import Options, Version
DR_rust_version = Version("0.2.10.1") # DR_mod 的 Rust 编写部分的兼容版本 DR_rust_version = Version("0.2.10.1") # DR_mod 的 Rust 编写部分的兼容版本