-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPyWrightIDE.py
More file actions
33 lines (27 loc) · 1.23 KB
/
PyWrightIDE.py
File metadata and controls
33 lines (27 loc) · 1.23 KB
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
29
30
31
32
33
if __name__ == '__main__':
from PyQt6.QtWidgets import QApplication
from gui.IDEMainWindow import IDEMainWindow
from gui.WelcomeDialog import WelcomeDialog
import gui.ErrorDialog as ErrorDialog
from data import IDESettings
from pathlib import Path
import sys
app = QApplication(sys.argv)
# App style looks horrible when the app is run from Windows for some reason, this works around that
# Perhaps switching to Qt6 was a mistake
if sys.platform == "win32":
app.setStyle("WindowsVista")
# Check if the autoload path exists and is still a valid path
# If that's the case, then launch the IDE, otherwise launch the Welcome dialog instead
game_folder_path = Path(IDESettings.get_autoload_last_game_path())
game_folder_exists = game_folder_path.exists() and game_folder_path.is_dir()
if not IDESettings.get_autoload_last_game_check() or not game_folder_exists:
welcome_dialog = WelcomeDialog()
if welcome_dialog.exec():
game_folder_path = welcome_dialog.get_selected_folder_path()
else:
sys.exit(0)
main_window = IDEMainWindow(game_folder_path)
ErrorDialog.set_ide_main_window(main_window)
main_window.show()
app.exec()