diff --git a/build_rs.ps1 b/build_rs.ps1 index 07b8c6c..b77858a 100644 --- a/build_rs.ps1 +++ b/build_rs.ps1 @@ -1,4 +1,4 @@ -Set-Location .\libs\Difficult_Rocket_rs\src +Set-Location .\mods\dr_game\Difficult_Rocket_rs\src Write-Output $args[0] @@ -25,4 +25,4 @@ if ($do -or "311" -in $args) { python3.8 post_build.py -Set-Location ..\..\..\ +Set-Location ..\..\..\..\ diff --git a/docs/src/update_logs.md b/docs/src/update_logs.md index c0b2d30..e16da34 100644 --- a/docs/src/update_logs.md +++ b/docs/src/update_logs.md @@ -35,7 +35,7 @@ - `game.config` - 已删除 - Removed -- `DR_option` & `DR_runtime` +- `DR_option` & `DR_runtime`(`long_version` `15`) - 完全移除 `DR_rust` 部分 - Completely removed the `DR_rust` part diff --git a/libs/Difficult_Rocket_rs/lib/Difficult_Rocket_rs.cp38-win_amd64.pyd b/libs/Difficult_Rocket_rs/lib/Difficult_Rocket_rs.cp38-win_amd64.pyd deleted file mode 100644 index 92a505e..0000000 --- a/libs/Difficult_Rocket_rs/lib/Difficult_Rocket_rs.cp38-win_amd64.pyd +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b87767f49fc2670e55497ca14925e0f100947d882d791f16d067669ac77ab5eb -size 1427968 diff --git a/libs/Difficult_Rocket_rs/__init__.py b/mods/dr_game/Difficult_Rocket_rs/__init__.py similarity index 100% rename from libs/Difficult_Rocket_rs/__init__.py rename to mods/dr_game/Difficult_Rocket_rs/__init__.py diff --git a/libs/Difficult_Rocket_rs/src/.gitignore b/mods/dr_game/Difficult_Rocket_rs/src/.gitignore similarity index 100% rename from libs/Difficult_Rocket_rs/src/.gitignore rename to mods/dr_game/Difficult_Rocket_rs/src/.gitignore diff --git a/libs/Difficult_Rocket_rs/src/Cargo.lock b/mods/dr_game/Difficult_Rocket_rs/src/Cargo.lock similarity index 100% rename from libs/Difficult_Rocket_rs/src/Cargo.lock rename to mods/dr_game/Difficult_Rocket_rs/src/Cargo.lock diff --git a/libs/Difficult_Rocket_rs/src/Cargo.toml b/mods/dr_game/Difficult_Rocket_rs/src/Cargo.toml similarity index 100% rename from libs/Difficult_Rocket_rs/src/Cargo.toml rename to mods/dr_game/Difficult_Rocket_rs/src/Cargo.toml diff --git a/libs/Difficult_Rocket_rs/src/mac-build.ps1 b/mods/dr_game/Difficult_Rocket_rs/src/mac-build.ps1 similarity index 100% rename from libs/Difficult_Rocket_rs/src/mac-build.ps1 rename to mods/dr_game/Difficult_Rocket_rs/src/mac-build.ps1 diff --git a/libs/Difficult_Rocket_rs/src/post_build.py b/mods/dr_game/Difficult_Rocket_rs/src/post_build.py similarity index 100% rename from libs/Difficult_Rocket_rs/src/post_build.py rename to mods/dr_game/Difficult_Rocket_rs/src/post_build.py diff --git a/libs/Difficult_Rocket_rs/src/pyproject.toml b/mods/dr_game/Difficult_Rocket_rs/src/pyproject.toml similarity index 100% rename from libs/Difficult_Rocket_rs/src/pyproject.toml rename to mods/dr_game/Difficult_Rocket_rs/src/pyproject.toml diff --git a/libs/Difficult_Rocket_rs/src/readme.md b/mods/dr_game/Difficult_Rocket_rs/src/readme.md similarity index 100% rename from libs/Difficult_Rocket_rs/src/readme.md rename to mods/dr_game/Difficult_Rocket_rs/src/readme.md diff --git a/libs/Difficult_Rocket_rs/src/setup.py b/mods/dr_game/Difficult_Rocket_rs/src/setup.py similarity index 80% rename from libs/Difficult_Rocket_rs/src/setup.py rename to mods/dr_game/Difficult_Rocket_rs/src/setup.py index b3c4657..bd0fa18 100644 --- a/libs/Difficult_Rocket_rs/src/setup.py +++ b/mods/dr_game/Difficult_Rocket_rs/src/setup.py @@ -3,22 +3,16 @@ # Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com # All rights reserved # ------------------------------- -import os import sys import shutil from setuptools import setup from setuptools_rust import Binding, RustExtension -sys.path.append('../../../') -sys.path.append(os.curdir) -if '../../../' in sys.path: - from Difficult_Rocket import DR_runtime - package_path = 'Difficult_Rocket_rs' setup( name='Difficult_Rocket_rs', - version=DR_runtime.DR_Rust_version.__str__(), + version="0.2.6.2", author='shenjackyuanjie', author_email='3695888@qq.com', rust_extensions=[RustExtension(target="Difficult_Rocket_rs.Difficult_Rocket_rs", diff --git a/libs/Difficult_Rocket_rs/src/src/__init__.py b/mods/dr_game/Difficult_Rocket_rs/src/src/__init__.py similarity index 100% rename from libs/Difficult_Rocket_rs/src/src/__init__.py rename to mods/dr_game/Difficult_Rocket_rs/src/src/__init__.py diff --git a/libs/Difficult_Rocket_rs/src/src/lib.rs b/mods/dr_game/Difficult_Rocket_rs/src/src/lib.rs similarity index 100% rename from libs/Difficult_Rocket_rs/src/src/lib.rs rename to mods/dr_game/Difficult_Rocket_rs/src/src/lib.rs diff --git a/libs/Difficult_Rocket_rs/src/src/logger.rs b/mods/dr_game/Difficult_Rocket_rs/src/src/logger.rs similarity index 100% rename from libs/Difficult_Rocket_rs/src/src/logger.rs rename to mods/dr_game/Difficult_Rocket_rs/src/src/logger.rs diff --git a/libs/Difficult_Rocket_rs/src/src/plugin.rs b/mods/dr_game/Difficult_Rocket_rs/src/src/plugin.rs similarity index 100% rename from libs/Difficult_Rocket_rs/src/src/plugin.rs rename to mods/dr_game/Difficult_Rocket_rs/src/src/plugin.rs diff --git a/libs/Difficult_Rocket_rs/src/src/python.rs b/mods/dr_game/Difficult_Rocket_rs/src/src/python.rs similarity index 100% rename from libs/Difficult_Rocket_rs/src/src/python.rs rename to mods/dr_game/Difficult_Rocket_rs/src/src/python.rs diff --git a/libs/Difficult_Rocket_rs/src/src/render.rs b/mods/dr_game/Difficult_Rocket_rs/src/src/render.rs similarity index 100% rename from libs/Difficult_Rocket_rs/src/src/render.rs rename to mods/dr_game/Difficult_Rocket_rs/src/src/render.rs diff --git a/libs/Difficult_Rocket_rs/src/src/rustfmt.toml b/mods/dr_game/Difficult_Rocket_rs/src/src/rustfmt.toml similarity index 100% rename from libs/Difficult_Rocket_rs/src/src/rustfmt.toml rename to mods/dr_game/Difficult_Rocket_rs/src/src/rustfmt.toml diff --git a/libs/Difficult_Rocket_rs/src/src/simulator.rs b/mods/dr_game/Difficult_Rocket_rs/src/src/simulator.rs similarity index 100% rename from libs/Difficult_Rocket_rs/src/src/simulator.rs rename to mods/dr_game/Difficult_Rocket_rs/src/src/simulator.rs diff --git a/libs/Difficult_Rocket_rs/src/src/sr1_data.rs b/mods/dr_game/Difficult_Rocket_rs/src/src/sr1_data.rs similarity index 100% rename from libs/Difficult_Rocket_rs/src/src/sr1_data.rs rename to mods/dr_game/Difficult_Rocket_rs/src/src/sr1_data.rs diff --git a/libs/Difficult_Rocket_rs/src/src/types.rs b/mods/dr_game/Difficult_Rocket_rs/src/src/types.rs similarity index 100% rename from libs/Difficult_Rocket_rs/src/src/types.rs rename to mods/dr_game/Difficult_Rocket_rs/src/src/types.rs diff --git a/mods/dr_game/__init__.py b/mods/dr_game/__init__.py index c24dc9d..09beac7 100644 --- a/mods/dr_game/__init__.py +++ b/mods/dr_game/__init__.py @@ -28,7 +28,7 @@ class _DR_mod_runtime(Options): def init(self, **kwargs) -> None: try: - from libs.Difficult_Rocket_rs import get_version_str + from .Difficult_Rocket_rs import get_version_str self.DR_rust_get_version = Version(get_version_str()) self.DR_rust_available = True if self.DR_rust_get_version != self.DR_rust_version: @@ -36,7 +36,12 @@ class _DR_mod_runtime(Options): warnings.warn(f'DR_rust builtin version is {self.DR_rust_version} but true version is {get_version_str()}.\n' f'Builtin version {relationship} than true version') self.use_DR_rust = self.use_DR_rust and self.DR_rust_available - except ImportError as e: + except Exception as e: + try: + from .Difficult_Rocket_rs import get_version_str + print(type(get_version_str)) + except: + ... traceback.print_exc() self.DR_rust_available = False self.use_DR_rust = False diff --git a/mods/dr_game/sr1_ship.py b/mods/dr_game/sr1_ship.py index 767475c..ae53a58 100644 --- a/mods/dr_game/sr1_ship.py +++ b/mods/dr_game/sr1_ship.py @@ -35,7 +35,7 @@ if TYPE_CHECKING: from Difficult_Rocket.client import ClientWindow if DR_mod_runtime.use_DR_rust: - from libs.Difficult_Rocket_rs import CenterCamera_rs, SR1PartList_rs + from .Difficult_Rocket_rs import CenterCamera_rs, SR1PartList_rs logger = logging.getLogger('client')