dr game and DR sdk

This commit is contained in:
shenjack 2023-05-24 00:43:11 +08:00
parent 753c11cc7c
commit 577d438b64
7 changed files with 31 additions and 26 deletions

View File

@ -1,12 +0,0 @@
# -------------------------------
# Difficult Rocket
# Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com
# All rights reserved
# -------------------------------
"""
writen by shenjackyuanjie
mail: 3695888@qq.com
github: @shenjackyuanjie
gitee: @shenjackyuanjie
"""

View File

@ -30,7 +30,7 @@ if TYPE_CHECKING:
from Difficult_Rocket.main import Game
from Difficult_Rocket.utils import tools
from Difficult_Rocket.api.types import Options
from Difficult_Rocket.command import line, tree
from Difficult_Rocket.command import line
from Difficult_Rocket.utils.translate import tr
from Difficult_Rocket import DR_runtime
from Difficult_Rocket.api.screen import BaseScreen
@ -176,7 +176,6 @@ class ClientWindow(Window):
self.setup()
# 命令显示
self.command_group = pyglet.graphics.Group(0)
self.command_tree = tree.CommandTree(tree.DR_command)
self.input_box = InputBox(x=50, y=30, width=300,
batch=self.label_batch, text='') # 实例化
self.input_box.push_handlers(self)

View File

@ -7,8 +7,8 @@ fonts_folder = "libs/fonts"
[window]
style = "None"
width = 1261
height = 711
width = 1954
height = 1266
visible = true
gui_scale = 1
caption = "Difficult Rocket v{DR_version}|DR_rs v{DR_Rust_get_version}"

View File

@ -2,11 +2,16 @@
# DR game/DR rs 更新日志
- 最新版本号
- DR game: 0.1.0.0
- DR game: 0.1.1.0
- DR rs: 0.2.9.0
## DR game 0.1.1.0
### 添加
- `types.py`
- 从 `DR.api.types.SR1` 中移动过来
### 新功能
- `console.py`

View File

@ -0,0 +1,13 @@
# DR SDK 更新日志
- 最新版本号
- DR sdk: 0.8.1.0
## DR sdk 0.8.1.0
### 删除
- `api.types.SR1`
- 移动到 `dr_game`

View File

@ -30,7 +30,7 @@ from Difficult_Rocket.utils.translate import tr
from Difficult_Rocket.api.types import Fonts, Options
from Difficult_Rocket.command.line import CommandText
from Difficult_Rocket.client.screen import BaseScreen
from Difficult_Rocket.api.types.SR1 import SR1Textures, SR1PartTexture, SR1PartData, SR1Rotation, xml_bool
from .types import SR1Textures, SR1PartTexture, SR1PartData, SR1Rotation, xml_bool
if TYPE_CHECKING:
from Difficult_Rocket.client import ClientWindow
@ -318,8 +318,8 @@ class SR1ShipRender(BaseScreen):
# self.update_parts()
def on_command(self, command: CommandText, window: "ClientWindow"):
if command.re_match('render'):
if command.re_match('reset'):
if command.find('render'):
if command.find('reset'):
self.camera_rs.zoom = 1
self.camera_rs.dx = 0
self.camera_rs.dy = 0
@ -327,15 +327,15 @@ class SR1ShipRender(BaseScreen):
else:
self.need_draw = True
print('应该渲染飞船的')
elif command.re_match('debug'):
elif command.find('debug'):
print('sr ?')
if command.re_match('delta'):
if command.find('delta'):
SR1ShipRender_Option.debug_d_pos = not SR1ShipRender_Option.debug_mouse_d_pos
self.debug_line.visible = SR1ShipRender_Option.debug_d_pos
self.debug_d_pos_label.visible = SR1ShipRender_Option.debug_d_pos
# print('sr1 delta')
elif command.re_match('mouse'):
if command.re_match('delta'):
elif command.find('mouse'):
if command.find('delta'):
SR1ShipRender_Option.debug_mouse_pos = not SR1ShipRender_Option.debug_mouse_pos
self.debug_mouse_line.visible = SR1ShipRender_Option.debug_mouse_pos
self.debug_mouse_label.visible = SR1ShipRender_Option.debug_mouse_pos
@ -344,7 +344,7 @@ class SR1ShipRender(BaseScreen):
SR1ShipRender_Option.debug_mouse_d_pos = not SR1ShipRender_Option.debug_mouse_d_pos
self.debug_mouse_delta_line.visible = SR1ShipRender_Option.debug_mouse_d_pos
# print('sr1 mouse')
elif command.re_match('get_buf'):
elif command.find('get_buf'):
def screenshot(window):
from libs.pyglet.gl import GLubyte, GL_RGBA, GL_UNSIGNED_BYTE, \
@ -361,7 +361,7 @@ class SR1ShipRender(BaseScreen):
image_data = screenshot(self.window_pointer)
image_data.save('test.png')
elif command.re_match('gen_img'):
elif command.find('gen_img'):
if not self.rendered:
return
# ship_size = self.ship.size