first part for phy simluation #34

Merged
shenjackyuanjie merged 19 commits from dr_game/phy_simluation into main 2023-06-22 02:11:47 +08:00
4 changed files with 5 additions and 5 deletions
Showing only changes of commit 3784a32184 - Show all commits

View File

@ -309,6 +309,7 @@ class ClientWindow(Window):
@_call_screen_after @_call_screen_after
def on_command(self, command: line.CommandText): def on_command(self, command: line.CommandText):
self.logger.info(tr().window.command.text().format(command)) self.logger.info(tr().window.command.text().format(command))
command.find('/')
if command.find('stop'): if command.find('stop'):
# self.dispatch_event('on_exit') # self.dispatch_event('on_exit')
print("command stop!") print("command stop!")

View File

@ -44,12 +44,12 @@ class CommandText:
i += 1 i += 1
def find(self, text: str) -> bool: def find(self, text: str) -> bool:
print(f'text: {text} startswith: {self.text.startswith(text)} find: {self.text.find(text)}') startswith = self.text.startswith(text)
startswitch = self.text.startswith(text) if startswith:
if startswitch:
find = self.text.find(text) find = self.text.find(text)
if find != -1: if find != -1:
self.text = self.text[find + len(text):] if not self.text[find+len(text)] == ' ' else self.text[find + len(text) + 1:] if not len(text) == len(self.text):
self.text = self.text[find + len(text):] if not self.text[find+len(text)] == ' ' else self.text[find + len(text) + 1:]
return True return True
return False return False

View File

View File

@ -403,7 +403,6 @@ class SR1ShipRender(BaseScreen):
return return
img_box = self.rust_ship.img_pos img_box = self.rust_ship.img_pos
img_size = (img_box[2] - img_box[0] + 1000, img_box[3] - img_box[1] + 1000) img_size = (img_box[2] - img_box[0] + 1000, img_box[3] - img_box[1] + 1000)
# img_center = (abs(img_box[0]), abs(img_box[1]))
# 中心点是左上角坐标 # 中心点是左上角坐标
img_center = (abs(img_box[0]), abs(img_box[3])) img_center = (abs(img_box[0]), abs(img_box[3]))
print(f"img_box: {img_box} img_size: {img_size} img_center: {img_center}") print(f"img_box: {img_box} img_size: {img_size} img_center: {img_center}")