forked from SumZer0-git/EDAPGui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEDShipControl.py
More file actions
28 lines (22 loc) · 803 Bytes
/
EDShipControl.py
File metadata and controls
28 lines (22 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from __future__ import annotations
from EDAP_data import *
from OCR import OCR
from StatusParser import StatusParser
class EDShipControl:
""" Handles ship control, FSD, SC, etc. """
def __init__(self, ed_ap, screen, keys, cb):
self.ocr = ed_ap.ocr
self.screen = screen
self.keys = keys
self.status_parser = StatusParser()
self.ap_ckb = cb
def goto_cockpit_view(self) -> bool:
""" Goto cockpit view.
@return: True once complete.
"""
if self.status_parser.get_gui_focus() == GuiFocusNoFocus:
return True
# Go down to cockpit view
while not self.status_parser.get_gui_focus() == GuiFocusNoFocus:
self.keys.send("UI_Back") # make sure back in cockpit view
return True