fix issue

This commit is contained in:
shenjack 2023-06-18 14:33:20 +08:00
parent d483326263
commit 3784a32184
4 changed files with 5 additions and 5 deletions

View File

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

View File

@ -44,11 +44,11 @@ class CommandText:
i += 1
def find(self, text: str) -> bool:
print(f'text: {text} startswith: {self.text.startswith(text)} find: {self.text.find(text)}')
startswitch = self.text.startswith(text)
if startswitch:
startswith = self.text.startswith(text)
if startswith:
find = self.text.find(text)
if find != -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 False

View File

View File

@ -403,7 +403,6 @@ class SR1ShipRender(BaseScreen):
return
img_box = self.rust_ship.img_pos
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]))
print(f"img_box: {img_box} img_size: {img_size} img_center: {img_center}")