Compare commits

..

No commits in common. "12a69f907633553926a7cebea9b24f7757d6aa98" and "ea6bc528b1c38e539d0db0c6631fddfa59c3031c" have entirely different histories.

223 changed files with 51 additions and 73 deletions

View File

@ -19,10 +19,10 @@ if sys.argv == [__file__]: # 没有输入参数,直接输出默认信息并
print(sys.version) print(sys.version)
from Difficult_Rocket.utils import tools from Difficult_Rocket.utils import tools
# 重置窗口信息 # 重置窗口信息
config_file = tools.load_file('./config/main.toml') config_file = tools.load_file('./configs/main.toml')
config_file['window']['width'] = 1024 config_file['window']['width'] = 1024
config_file['window']['height'] = 768 config_file['window']['height'] = 768
rtoml.dump(config_file, open('./config/main.toml', 'w')) rtoml.dump(config_file, open('./configs/main.toml', 'w'))
elif os.path.abspath(os.curdir) in sys.path and '-env' in sys.argv: elif os.path.abspath(os.curdir) in sys.path and '-env' in sys.argv:
with open('./.github/workflows/env.ps1', encoding='utf-8', mode='w') as env_file: with open('./.github/workflows/env.ps1', encoding='utf-8', mode='w') as env_file:

View File

@ -7,6 +7,7 @@ on:
push: push:
paths: paths:
- "Difficult_Rocket/**" # 本体修改 - "Difficult_Rocket/**" # 本体修改
- "configs/**" # 配置修改
- "libs/pyglet/**" # pyglet 修改 - "libs/pyglet/**" # pyglet 修改
- ".github/workflows/**" # workflow 修改 - ".github/workflows/**" # workflow 修改
- "nuitka_build.py" # 构建脚本修改 - "nuitka_build.py" # 构建脚本修改
@ -14,6 +15,7 @@ on:
pull_request: pull_request:
paths: paths:
- "Difficult_Rocket/**" # 本体修改 - "Difficult_Rocket/**" # 本体修改
- "configs/**" # 配置修改
- "libs/pyglet/**" # pyglet 修改 - "libs/pyglet/**" # pyglet 修改
- ".github/workflows/**" # workflow 修改 - ".github/workflows/**" # workflow 修改
- "nuitka_build.py" # 构建脚本修改 - "nuitka_build.py" # 构建脚本修改

View File

@ -10,7 +10,7 @@ from pathlib import Path
from Difficult_Rocket.api.types import Options, Version from Difficult_Rocket.api.types import Options, Version
sdk_version = Version("0.8.6.0") # SDK 版本 sdk_version = Version("0.8.5.2") # SDK 版本
build_version = Version("2.1.3.0") # 编译文件版本(与游戏本体无关) build_version = Version("2.1.3.0") # 编译文件版本(与游戏本体无关)
Api_version = Version("0.1.1.0") # API 版本 Api_version = Version("0.1.1.0") # API 版本
__version__ = sdk_version __version__ = sdk_version
@ -76,7 +76,7 @@ DR_status = _DR_status()
def load_logging(): def load_logging():
with open('./config/logger.toml') as f: with open('./configs/logger.toml') as f:
import rtoml import rtoml
logger_config = rtoml.load(f) logger_config = rtoml.load(f)
log_path = logger_config['handlers']['file']['filename'] log_path = logger_config['handlers']['file']['filename']

View File

@ -59,7 +59,7 @@ class ClientOption(Options):
caption: str = "Difficult Rocket v{DR_version}" caption: str = "Difficult Rocket v{DR_version}"
def load_file(self) -> None: def load_file(self) -> None:
file: dict = tools.load_file('./config/main.toml') file: dict = tools.load_file('./configs/main.toml')
self.fps = int(file['runtime']['fps']) self.fps = int(file['runtime']['fps'])
self.width = int(file['window']['width']) self.width = int(file['window']['width'])
self.height = int(file['window']['height']) self.height = int(file['window']['height'])
@ -215,9 +215,9 @@ class ClientWindow(Window):
self.net_mode = net_mode self.net_mode = net_mode
self.run_input = False self.run_input = False
self.command_list: List[str] = [] self.command_list: List[str] = []
# config # configs
self.main_config = tools.load_file('./config/main.toml') self.main_config = tools.load_file('./configs/main.toml')
self.game_config = tools.load_file('./config/game.config') self.game_config = tools.load_file('./configs/game.config')
# FPS # FPS
self.FPS = Decimal(int(self.main_config['runtime']['fps'])) self.FPS = Decimal(int(self.main_config['runtime']['fps']))
self.SPF = Decimal('1') / self.FPS self.SPF = Decimal('1') / self.FPS
@ -250,7 +250,7 @@ class ClientWindow(Window):
self.count = 0 self.count = 0
def setup(self): def setup(self):
self.set_icon(pyglet.image.load('assets/textures/icon.png')) self.set_icon(pyglet.image.load('./textures/icon.png'))
self.load_fonts() self.load_fonts()
self.screen_list['DR_debug'] = DRDEBUGScreen(self) self.screen_list['DR_debug'] = DRDEBUGScreen(self)
self.game.dispatch_mod_event('on_client_start', game=self.game, client=self) self.game.dispatch_mod_event('on_client_start', game=self.game, client=self)
@ -262,7 +262,7 @@ class ClientWindow(Window):
pyglet_load_fonts_folder(fonts_folder_path) pyglet_load_fonts_folder(fonts_folder_path)
def start_game(self) -> None: def start_game(self) -> None:
self.set_icon(pyglet.image.load('assets/textures/icon.png')) self.set_icon(pyglet.image.load('./textures/icon.png'))
try: try:
pyglet.app.event_loop.run(1 / self.main_config['runtime']['fps']) pyglet.app.event_loop.run(1 / self.main_config['runtime']['fps'])
except KeyboardInterrupt: except KeyboardInterrupt:
@ -275,11 +275,11 @@ class ClientWindow(Window):
@new_thread('window save_info') @new_thread('window save_info')
def save_info(self): def save_info(self):
self.logger.info(tr().client.config.save.start()) self.logger.info(tr().client.config.save.start())
config_file: dict = tools.load_file('./config/main.toml') config_file: dict = tools.load_file('./configs/main.toml')
config_file['window']['width'] = self.width config_file['window']['width'] = self.width
config_file['window']['height'] = self.height config_file['window']['height'] = self.height
config_file['runtime']['language'] = DR_runtime.language config_file['runtime']['language'] = DR_runtime.language
rtoml.dump(config_file, open('./config/main.toml', 'w')) rtoml.dump(config_file, open('./configs/main.toml', 'w'))
self.logger.info(tr().client.config.save.done()) self.logger.info(tr().client.config.save.done())
""" """
@ -373,7 +373,7 @@ class ClientWindow(Window):
tr._language = lang tr._language = lang
self.logger.info(tr().language_set_to()) self.logger.info(tr().language_set_to())
except LanguageNotFound: except LanguageNotFound:
self.logger.info(tr().language_available().format(os.listdir('./config/lang'))) self.logger.info(tr().language_available().format(os.listdir('./configs/lang')))
self.save_info() self.save_info()
elif command.find('mods'): elif command.find('mods'):
if command.find('list'): if command.find('list'):

View File

@ -77,7 +77,7 @@ def create_crash_report(info: Optional[str] = None) -> None:
crash_info = crash_info_handler(info) crash_info = crash_info_handler(info)
if 'crash_report' not in os.listdir('./'): if 'crash_report' not in os.listdir('./'):
os.mkdir('./crash_report') os.mkdir('./crash_report')
date_time = time.strftime('%Y-%m-%d %H-%M-%S', time.localtime()) date_time = time.strftime('%Y-%m-%d %H-%M-%S', time.gmtime(time.time()))
filename = f'crash-{date_time}.md' filename = f'crash-{date_time}.md'
cache_stream = io.StringIO() cache_stream = io.StringIO()
try: try:
@ -92,7 +92,7 @@ def create_crash_report(info: Optional[str] = None) -> None:
def write_cache(cache_stream, crash_info): def write_cache(cache_stream, crash_info):
# 开头信息 # 开头信息
cache_stream.write(Head_message.format(now_time=time.strftime('%Y/%m/%d %H:%M:%S', time.localtime()))) cache_stream.write(Head_message.format(now_time=time.strftime('%Y/%m/%d %H:%M:%S', time.gmtime(time.time()))))
# 崩溃信息 # 崩溃信息
cache_stream.write(crash_info) cache_stream.write(crash_info)

View File

@ -37,7 +37,7 @@ class _DR_runtime(Options):
def load_file(self) -> bool: def load_file(self) -> bool:
with contextlib.suppress(FileNotFoundError): with contextlib.suppress(FileNotFoundError):
with open('./config/main.toml', 'r', encoding='utf-8') as f: with open('./configs/main.toml', 'r', encoding='utf-8') as f:
import rtoml import rtoml
config_file = rtoml.load(f) config_file = rtoml.load(f)
self.language = config_file['runtime']['language'] self.language = config_file['runtime']['language']

View File

@ -36,7 +36,7 @@ class Server:
# os.set # os.set
self.process_name = 'server process' self.process_name = 'server process'
# config # config
self.config = tools.load_file('config/main.toml') self.config = tools.load_file('configs/main.toml')
# self.dev = Dev # self.dev = Dev
# self.net_mode = net_mode # self.net_mode = net_mode
self.logger.info(tr().server.setup.use_time().format(time.time() - start_time)) self.logger.info(tr().server.setup.use_time().format(time.time() - start_time))

View File

@ -30,7 +30,7 @@ from Difficult_Rocket.exception.unsupport import NoMoreJson5
# logger # logger
tools_logger = logging.getLogger('tools') tools_logger = logging.getLogger('tools')
""" """
file config file configs
""" """
file_error = {FileNotFoundError: 'no {filetype} file was founded!:\n file name: {filename}\n file_type: {filetype}\n stack: {stack}', file_error = {FileNotFoundError: 'no {filetype} file was founded!:\n file name: {filename}\n file_type: {filetype}\n stack: {stack}',
@ -99,7 +99,7 @@ def save_dict_file(file_name: str,
# main config # main config
main_config_file = load_file('./config/main.toml') main_config_file = load_file('./configs/main.toml')
def get_At(name, in_xml, need_type=str): def get_At(name, in_xml, need_type=str):

View File

@ -165,7 +165,7 @@ class Tr:
:param lang_path: 语言文件夹路径 :param lang_path: 语言文件夹路径
""" """
self.language_name = language if language is not None else DR_runtime.language self.language_name = language if language is not None else DR_runtime.language
self.language_path = lang_path if lang_path is not None else Path('assets/lang') self.language_path = lang_path if lang_path is not None else Path('configs/lang')
self.translates: Dict[str, Union[str, Dict]] = tools.load_file(self.language_path / f'{self.language_name}.toml') self.translates: Dict[str, Union[str, Dict]] = tools.load_file(self.language_path / f'{self.language_name}.toml')
self.default_translate: Dict = tools.load_file(f'{self.language_path}/{DR_status.default_language}.toml') self.default_translate: Dict = tools.load_file(f'{self.language_path}/{DR_status.default_language}.toml')
self.default_config = config.set('source', self) if config is not None else TranslateConfig(source=self) self.default_config = config.set('source', self) if config is not None else TranslateConfig(source=self)

View File

@ -20,7 +20,7 @@
[关于版本号的说明](./docs/src/version.md) [关于版本号的说明](./docs/src/version.md)
[![Generic badge](https://img.shields.io/badge/Release-0.8.5.1-blue.svg)](https://github.com/shenjackyuanjie/Difficult-Rocket/releases) [![Generic badge](https://img.shields.io/badge/Release-0.8.5.1-blue.svg)](https://github.com/shenjackyuanjie/Difficult-Rocket/releases)
[![Generic badge](https://img.shields.io/badge/Pre_Release-0.8.6.0-blue.svg)](https://github.com/shenjackyuanjie/Difficult-Rocket/releases) [![Generic badge](https://img.shields.io/badge/Pre_Release-0.8.5.1-blue.svg)](https://github.com/shenjackyuanjie/Difficult-Rocket/releases)
[![Generic badge](https://img.shields.io/badge/Devloping-0.8.6-blue.svg)](https://github.com/shenjackyuanjie/Difficult-Rocket/releases) [![Generic badge](https://img.shields.io/badge/Devloping-0.8.6-blue.svg)](https://github.com/shenjackyuanjie/Difficult-Rocket/releases)
[![language badge](https://stats.deeptrain.net/repo/shenjackyuanjie/Difficult-Rocket?theme=dark)](https://stats.deeptrain.net/repo/shenjackyuanjie/Difficult-Rocket?theme=dark) [![language badge](https://stats.deeptrain.net/repo/shenjackyuanjie/Difficult-Rocket?theme=dark)](https://stats.deeptrain.net/repo/shenjackyuanjie/Difficult-Rocket?theme=dark)
@ -94,7 +94,7 @@ viztracer >= 0.15.6; platform_python_implementation != "PyPy"
vizplugins >= 0.1.3; platform_python_implementation != "PyPy" vizplugins >= 0.1.3; platform_python_implementation != "PyPy"
# for compile # for compile
nuitka >= 1.7.5 nuitka >= 1.6.6
ordered-set >= 4.1.0 ordered-set >= 4.1.0
imageio >= 2.31.0; (platform_python_implementation == "PyPy" and python_version < "3.10") or platform_python_implementation == "CPython" imageio >= 2.31.0; (platform_python_implementation == "PyPy" and python_version < "3.10") or platform_python_implementation == "CPython"
wheel >= 0.40.0 wheel >= 0.40.0

View File

@ -3,7 +3,7 @@ fps = 60
language = "zh-CN" language = "zh-CN"
date_fmt = "%Y-%m-%d %H-%M-%S" date_fmt = "%Y-%m-%d %H-%M-%S"
write_py_v = "3.8.10" write_py_v = "3.8.10"
fonts_folder = "assets/fonts" fonts_folder = "libs/fonts"
[window] [window]
style = "None" style = "None"

View File

@ -20,7 +20,7 @@
[About Versions](src/version.md) [About Versions](src/version.md)
[![Generic badge](https://img.shields.io/badge/Release-0.8.5.1-blue.svg)](https://github.com/shenjackyuanjie/Difficult-Rocket/releases) [![Generic badge](https://img.shields.io/badge/Release-0.8.5.1-blue.svg)](https://github.com/shenjackyuanjie/Difficult-Rocket/releases)
[![Generic badge](https://img.shields.io/badge/Pre_Release-0.8.6.0-blue.svg)](https://github.com/shenjackyuanjie/Difficult-Rocket/releases) [![Generic badge](https://img.shields.io/badge/Pre_Release-0.8.5.1-blue.svg)](https://github.com/shenjackyuanjie/Difficult-Rocket/releases)
[![Generic badge](https://img.shields.io/badge/Devloping-0.8.6-blue.svg)](https://github.com/shenjackyuanjie/Difficult-Rocket/releases) [![Generic badge](https://img.shields.io/badge/Devloping-0.8.6-blue.svg)](https://github.com/shenjackyuanjie/Difficult-Rocket/releases)
[![language badge](https://stats.deeptrain.net/repo/shenjackyuanjie/Difficult-Rocket?theme=dark)](https://stats.deeptrain.net/repo/shenjackyuanjie/Difficult-Rocket?theme=dark) [![language badge](https://stats.deeptrain.net/repo/shenjackyuanjie/Difficult-Rocket?theme=dark)](https://stats.deeptrain.net/repo/shenjackyuanjie/Difficult-Rocket?theme=dark)
@ -94,7 +94,7 @@ viztracer >= 0.15.6; platform_python_implementation != "PyPy"
vizplugins >= 0.1.3; platform_python_implementation != "PyPy" vizplugins >= 0.1.3; platform_python_implementation != "PyPy"
# for compile # for compile
nuitka >= 1.7.5 nuitka >= 1.6.6
ordered-set >= 4.1.0 ordered-set >= 4.1.0
imageio >= 2.31.0; (platform_python_implementation == "PyPy" and python_version < "3.10") or platform_python_implementation == "CPython" imageio >= 2.31.0; (platform_python_implementation == "PyPy" and python_version < "3.10") or platform_python_implementation == "CPython"
wheel >= 0.40.0 wheel >= 0.40.0

View File

@ -10,8 +10,6 @@
- 添加 `email` `win32con` `smtplib` `win32evtlog` `win32evtlogutil` `win32api``--no-follow-import` - 添加 `email` `win32con` `smtplib` `win32evtlog` `win32evtlogutil` `win32api``--no-follow-import`
- Add `email`, `win32con`, `smtplib`, `win32evtlog`, `win32evtlogutil`, `win32api` to `--no-follow-import` - Add `email`, `win32con`, `smtplib`, `win32evtlog`, `win32evtlogutil`, `win32api` to `--no-follow-import`
- `include_data_dir` 移除 `libs/fonts` `textures`
- 改为 `assets``config`
## 20230708 build 2.1.2.0 ## 20230708 build 2.1.2.0

View File

@ -2,28 +2,7 @@
# DR SDK 更新日志 # DR SDK 更新日志
- 最新版本号 - 最新版本号
- DR sdk: 0.8.6.0 - DR sdk: 0.8.5.2
## DR sdk 0.8.6.0
重构了一下项目结构
Refactored the project structure
### Fix
- issue [#42](https://github.com/shenjackyuanjie/Difficult-Rocket/issues/42)
- Crash report 的时区不正确
- Crash report time zone is incorrect
### Change
- 将大部分资源文件移动到 `assets/`
- `libs/fonts` -> `assets/fonts`
- `configs/lang` -> `assets/lang`
- `configs/xxx.xml` -> `assets/builtin/xxx.xml`
- `textures` -> `assets/textures`
- Move all the resources to `assets/`
## DR sdk 0.8.5.2 ## DR sdk 0.8.5.2

View File

@ -19,5 +19,5 @@ pyglet 坐标轴原点是左上角 0, 0
我check一下微调器的代码原理应该一样有个函数我看看怎么实现 我check一下微调器的代码原理应该一样有个函数我看看怎么实现
# 素材提供 # 素材提供
[背景候选1号](../../assets/textures/runtime/background.png) [背景候选1号](../../textures/runtime/background.png)
来自 @底层萌新 QQ1744251171 来自 @底层萌新 QQ1744251171

View File

@ -59,14 +59,15 @@ class CompilerHelper(Options):
copy_right: str = 'Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com' # --copyright copy_right: str = 'Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com' # --copyright
icon_path: Path = Path('assets/textures/icon.png') icon_path: Path = Path('textures/icon.png')
follow_import: List[str] = ['pyglet'] follow_import: List[str] = ['pyglet']
no_follow_import: List[str] = ['objprint', 'pillow', 'PIL', 'cffi', 'pydoc', 'numpy', 'email', 'win32con', no_follow_import: List[str] = ['objprint', 'pillow', 'PIL', 'cffi', 'pydoc', 'numpy', 'email', 'win32con',
'smtplib', 'win32evtlog', 'win32evtlogutil', 'win32api'] 'smtplib', 'win32evtlog', 'win32evtlogutil', 'win32api']
include_data_dir: List[Tuple[str, str]] = [('./config', './config'), include_data_dir: List[Tuple[str, str]] = [('./libs/fonts', './libs/fonts'),
('./assets', './assets')] ('./textures', './textures'),
('./configs', './configs')]
include_packages: List[str] = ['Difficult_Rocket.api'] include_packages: List[str] = ['Difficult_Rocket.api']
enable_plugin: List[str] = [] # --enable-plugin=xxx,xxx enable_plugin: List[str] = [] # --enable-plugin=xxx,xxx

View File

@ -17,9 +17,9 @@ if TYPE_CHECKING:
def get_version_str() -> str: ... def get_version_str() -> str: ...
def part_list_read_test(file_name: Optional[str] = "./assets/builtin/PartList.xml") -> None: ... def part_list_read_test(file_name: Optional[str] = "./configs/PartList.xml") -> None: ...
def read_ship_test(path: Optional[str] = "./assets/builtin/dock1.xml") -> None: ... def read_ship_test(path: Optional[str] = "./configs/dock1.xml") -> None: ...
class SR1PartType_rs: class SR1PartType_rs:
@ -52,7 +52,7 @@ if TYPE_CHECKING:
class SR1PartList_rs: class SR1PartList_rs:
""" 用于从 rust 中读取 SR1PartList """ """ 用于从 rust 中读取 SR1PartList """
def __init__(self, file_name: Optional[str] = "./assets/builtin/PartList.xml", def __init__(self, file_name: Optional[str] = "./configs/PartList.xml",
list_name: Optional[str] = 'NewPartList'): ... list_name: Optional[str] = 'NewPartList'): ...
def as_dict(self) -> Dict[str, SR1PartType_rs]: ... def as_dict(self) -> Dict[str, SR1PartType_rs]: ...
@ -90,10 +90,7 @@ if TYPE_CHECKING:
class SR1Ship_rs: class SR1Ship_rs:
""" 用于高效且省内存的读取 SR1Ship """ """ 用于高效且省内存的读取 SR1Ship """
def __init__(self, def __init__(self, file_path = './configs/dock1.xml', part_list = './configs/PartList.xml', ship_name = 'NewShip'): ...
file_path = './assets/builtin/dock1.xml',
part_list = './assets/builtin/PartList.xml',
ship_name = 'NewShip'): ...
@property @property
def name(self) -> str: ... def name(self) -> str: ...
@property @property

View File

@ -84,7 +84,7 @@ pub mod data {
#[pymethods] #[pymethods]
impl PySR1PartList { impl PySR1PartList {
#[new] #[new]
#[pyo3(text_signature = "(file_path = './assets/builtin/PartList.xml', list_name = 'NewPartList')")] #[pyo3(text_signature = "(file_path = './configs/PartList.xml', list_name = 'NewPartList')")]
fn new(file_path: String, list_name: String) -> Self { fn new(file_path: String, list_name: String) -> Self {
let raw_part_list: RawPartList = RawPartList::from_file(file_path).unwrap(); let raw_part_list: RawPartList = RawPartList::from_file(file_path).unwrap();
let data = raw_part_list.to_sr_part_list(Some(list_name)); let data = raw_part_list.to_sr_part_list(Some(list_name));
@ -157,7 +157,7 @@ pub mod data {
#[pymethods] #[pymethods]
impl PySR1Ship { impl PySR1Ship {
#[new] #[new]
#[pyo3(text_signature = "(file_path = './assets/builtin/dock1.xml', part_list = './assets/builtin/PartList.xml', ship_name = 'NewShip')")] #[pyo3(text_signature = "(file_path = './configs/dock1.xml', part_list = './configs/PartList.xml', ship_name = 'NewShip')")]
fn new(file_path: String, part_list: String, ship_name: String) -> Self { fn new(file_path: String, part_list: String, ship_name: String) -> Self {
let mut ship = SR1Ship::from_file(file_path, Some(ship_name)).unwrap(); let mut ship = SR1Ship::from_file(file_path, Some(ship_name)).unwrap();
let part_list = SR1PartList::from_file(part_list).unwrap(); let part_list = SR1PartList::from_file(part_list).unwrap();

View File

@ -351,9 +351,9 @@ pub mod part_list {
#[inline] #[inline]
#[pyfunction] #[pyfunction]
#[pyo3(name = "part_list_read_test", signature = (file_name = "./assets/builtin/PartList.xml".to_string()))] #[pyo3(name = "part_list_read_test", signature = (file_name = "./configs/PartList.xml".to_string()))]
pub fn read_part_list_py(_py: Python, file_name: Option<String>) -> PyResult<()> { pub fn read_part_list_py(_py: Python, file_name: Option<String>) -> PyResult<()> {
let file_name = file_name.unwrap_or("./assets/builtin/PartList.xml".to_string()); let file_name = file_name.unwrap_or("./configs/PartList.xml".to_string());
let _parts = RawPartList::from_file(file_name); let _parts = RawPartList::from_file(file_name);
if let Some(parts) = _parts { if let Some(parts) = _parts {
// println!("{:?}", parts) // println!("{:?}", parts)
@ -624,7 +624,7 @@ pub mod ship {
#[pyfunction] #[pyfunction]
#[pyo3(name = "read_ship_test")] #[pyo3(name = "read_ship_test")]
#[pyo3(signature = (path = "./assets/builtin/dock1.xml".to_string()))] #[pyo3(signature = (path = "./configs/dock1.xml".to_string()))]
pub fn py_raw_ship_from_file(path: String) -> PyResult<bool> { pub fn py_raw_ship_from_file(path: String) -> PyResult<bool> {
let file = fs::read_to_string(path).unwrap(); let file = fs::read_to_string(path).unwrap();
let raw_ship = from_str::<RawShip>(&file); let raw_ship = from_str::<RawShip>(&file);

View File

@ -126,14 +126,14 @@ class SR1ShipRender(BaseScreen):
self.part_line_box: Dict[int, List[Line]] = {} self.part_line_box: Dict[int, List[Line]] = {}
self.part_line_list: List[Line] = [] self.part_line_list: List[Line] = []
self.load_xml('assets/builtin/dock1.xml') self.load_xml('configs/dock1.xml')
load_end_time = time.time_ns() load_end_time = time.time_ns()
logger.info(sr_tr().mod.info.setup.use_time().format((load_end_time - load_start_time) / 1000000000)) logger.info(sr_tr().mod.info.setup.use_time().format((load_end_time - load_start_time) / 1000000000))
self.camera = CenterCamera(main_window, min_zoom=(1 / 2) ** 10, max_zoom=10) self.camera = CenterCamera(main_window, min_zoom=(1 / 2) ** 10, max_zoom=10)
if DR_mod_runtime.use_DR_rust: if DR_mod_runtime.use_DR_rust:
self.rust_parts = None self.rust_parts = None
self.part_list_rs = SR1PartList_rs('assets/builtin/PartList.xml', 'default_part_list') self.part_list_rs = SR1PartList_rs('configs/PartList.xml', 'default_part_list')
def load_xml(self, file_path: str) -> bool: def load_xml(self, file_path: str) -> bool:
try: try:
@ -144,7 +144,7 @@ class SR1ShipRender(BaseScreen):
self.xml_root = self.xml_doc.getroot() self.xml_root = self.xml_doc.getroot()
self.xml_name = file_path self.xml_name = file_path
if DR_mod_runtime.use_DR_rust: if DR_mod_runtime.use_DR_rust:
self.rust_ship = SR1Ship_rs(file_path, 'assets/builtin/PartList.xml', 'a_new_ship') self.rust_ship = SR1Ship_rs(file_path, 'configs/PartList.xml', 'a_new_ship')
logger.info(sr_tr().sr1.ship.xml.load_done()) logger.info(sr_tr().sr1.ship.xml.load_done())
logger.info(sr_tr().sr1.ship.xml.load_time().format( logger.info(sr_tr().sr1.ship.xml.load_time().format(
(time.time_ns() - start_time) / 1000000000)) (time.time_ns() - start_time) / 1000000000))

View File

@ -37,7 +37,7 @@ class SR1Textures(Options):
super().__init__(**kwargs) super().__init__(**kwargs)
self.flush_option() self.flush_option()
for image_name in self.cached_options: for image_name in self.cached_options:
img = load(f'assets/textures/parts/{image_name}.png') img = load(f'textures/parts/{image_name}.png')
img.anchor_x = img.width // 2 img.anchor_x = img.width // 2
img.anchor_y = img.height // 2 img.anchor_y = img.height // 2
setattr(self, image_name, img) setattr(self, image_name, img)

View File

@ -36,6 +36,7 @@ if __name__ == '__main__':
compiler.show_progress = False compiler.show_progress = False
compiler.output_path = Path('./build/github') compiler.output_path = Path('./build/github')
compiler.python_cmd = 'python' compiler.python_cmd = 'python'
compiler.include_data_dir.remove(('./libs/fonts', './libs/fonts'))
compiler.save_xml = False compiler.save_xml = False
# 检测 --xml 参数 # 检测 --xml 参数
@ -126,7 +127,7 @@ if __name__ == '__main__':
file_path = os.path.join(path, file) file_path = os.path.join(path, file)
dist_dir_size += os.path.getsize(file_path) dist_dir_size += os.path.getsize(file_path)
# 排除不需要记录的文件 # 排除不需要记录的文件
if any(x in file_path for x in ('config', 'libs', 'assets')): if any(x in file_path for x in ('configs', 'libs', 'textures')):
continue continue
dist_file_size[file_path] = (os.path.getsize(file_path), os.path.getsize(file_path) / 1024 / 1024) dist_file_size[file_path] = (os.path.getsize(file_path), os.path.getsize(file_path) / 1024 / 1024)
compile_data = {'compile_time_ns': time.time_ns() - start_time, compile_data = {'compile_time_ns': time.time_ns() - start_time,

View File

@ -6,7 +6,7 @@ build-backend = "pdm.pep517.api"
[project] [project]
name = "difficult-rocket" name = "difficult-rocket"
version = "0.8.6.0" version = "0.8.5.1"
description = "A rocket game" description = "A rocket game"
authors = [ authors = [
{name = "shenjackyuanjie", email = "3695888@qq.com"} {name = "shenjackyuanjie", email = "3695888@qq.com"}

View File

@ -18,7 +18,7 @@ defusedxml >= 0.7.1
objprint >= 0.2.2 objprint >= 0.2.2
# for compile # for compile
nuitka >= 1.7.5 nuitka >= 1.6.6
ordered-set >= 4.1.0 ordered-set >= 4.1.0
imageio >= 2.31.0; (platform_python_implementation == "PyPy" and python_version < "3.10") or platform_python_implementation == "CPython" imageio >= 2.31.0; (platform_python_implementation == "PyPy" and python_version < "3.10") or platform_python_implementation == "CPython"
wheel >= 0.40.0 wheel >= 0.40.0

View File

@ -21,7 +21,7 @@ viztracer >= 0.15.6; platform_python_implementation != "PyPy"
vizplugins >= 0.1.3; platform_python_implementation != "PyPy" vizplugins >= 0.1.3; platform_python_implementation != "PyPy"
# for compile # for compile
nuitka >= 1.7.5 nuitka >= 1.6.6
ordered-set >= 4.1.0 ordered-set >= 4.1.0
imageio >= 2.31.0; (platform_python_implementation == "PyPy" and python_version < "3.10") or platform_python_implementation == "CPython" imageio >= 2.31.0; (platform_python_implementation == "PyPy" and python_version < "3.10") or platform_python_implementation == "CPython"
wheel >= 0.40.0 wheel >= 0.40.0

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 121 B

After

Width:  |  Height:  |  Size: 121 B

View File

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 133 B

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 450 B

After

Width:  |  Height:  |  Size: 450 B

View File

Before

Width:  |  Height:  |  Size: 517 B

After

Width:  |  Height:  |  Size: 517 B

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 140 B

After

Width:  |  Height:  |  Size: 140 B

View File

Before

Width:  |  Height:  |  Size: 932 B

After

Width:  |  Height:  |  Size: 932 B

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 775 B

After

Width:  |  Height:  |  Size: 775 B

View File

Before

Width:  |  Height:  |  Size: 540 B

After

Width:  |  Height:  |  Size: 540 B

View File

Before

Width:  |  Height:  |  Size: 1004 B

After

Width:  |  Height:  |  Size: 1004 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 145 B

After

Width:  |  Height:  |  Size: 145 B

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 155 KiB

After

Width:  |  Height:  |  Size: 155 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 651 KiB

After

Width:  |  Height:  |  Size: 651 KiB

View File

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

View File

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

View File

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

Before

Width:  |  Height:  |  Size: 205 KiB

After

Width:  |  Height:  |  Size: 205 KiB

View File

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

Before

Width:  |  Height:  |  Size: 369 KiB

After

Width:  |  Height:  |  Size: 369 KiB

View File

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 75 KiB

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Some files were not shown because too many files have changed in this diff Show More