removed Linux temprorily until linux.py is implemented

This commit is contained in:
Adam Saudagar 2023-03-06 23:32:39 +05:30
parent 901ce6c346
commit 47c0ce7413
3 changed files with 17 additions and 8 deletions

View File

@ -42,7 +42,10 @@ def initialize():
def main():
print("launching please wait...")
os_services.init()
if not os_services.init():
print("platform not supported")
return
config.init()
if not check_eula():
return

View File

@ -44,6 +44,7 @@ def init():
if monitor_rect is None or WindowServer.crop is None:
logging.error("Game window not found")
WindowServer.status = Status.CRASHED
return
for i, m in enumerate(WindowServer.sct.monitors):
if m["top"] == monitor_rect[0] and m["left"] == monitor_rect[1]:

View File

@ -7,6 +7,7 @@ from typing import Tuple, Optional
import platform
class IOSServices(ABC):
@abstractmethod
@ -46,7 +47,7 @@ class IOSServices(ABC):
"""
@abstractmethod
def get_monitor_rect(self):
def get_monitor_rect(self) -> Optional[Tuple[int, int]]:
"""
:return: [top, left, height, width] of monitor which has game running in it
"""
@ -83,13 +84,17 @@ class os_services:
_instance: Optional[IOSServices] = None
@staticmethod
def init():
def init() -> bool:
os_name = platform.system()
if os_name == "Windows":
from fishy.osservices.windows import Windows
os_services._instance = Windows()
elif os_name == "Linux":
from fishy.osservices.linux import Linux
os_services._instance = Linux()
else:
logging.error("Platform not supported")
return True
# todo uncomment after linux.py is implemented
# if os_name == "Linux":
# from fishy.osservices.linux import Linux
# os_services._instance = Linux()
# return True
return False