mirror of
https://github.com/nixietab/picodulce.git
synced 2025-04-10 10:28:56 +01:00
Update picodulce.py
This commit is contained in:
parent
5709e849d3
commit
9446d6e404
22
picodulce.py
22
picodulce.py
@ -15,9 +15,6 @@ from PyQt5.QtCore import Qt
|
|||||||
|
|
||||||
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PicomcVersionSelector(QWidget):
|
class PicomcVersionSelector(QWidget):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@ -57,11 +54,7 @@ class PicomcVersionSelector(QWidget):
|
|||||||
# Default to dark palette if the type is not specified or invalid
|
# Default to dark palette if the type is not specified or invalid
|
||||||
palette = self.create_dark_palette()
|
palette = self.create_dark_palette()
|
||||||
QApplication.instance().setPalette(palette)
|
QApplication.instance().setPalette(palette)
|
||||||
|
|
||||||
# Set window border color to dark mode on Windows
|
|
||||||
if sys.platform == 'win32':
|
|
||||||
self.setStyleSheet("QMainWindow { border: 2px solid rgb(53, 53, 53); }")
|
|
||||||
|
|
||||||
# Create title label
|
# Create title label
|
||||||
title_label = QLabel('PicoDulce Launcher') # Change label text
|
title_label = QLabel('PicoDulce Launcher') # Change label text
|
||||||
title_label.setFont(QFont("Arial", 24, QFont.Bold))
|
title_label.setFont(QFont("Arial", 24, QFont.Bold))
|
||||||
@ -290,6 +283,17 @@ class PicomcVersionSelector(QWidget):
|
|||||||
QMessageBox.warning(self, "No Version Available", "Please download a version first.")
|
QMessageBox.warning(self, "No Version Available", "Please download a version first.")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Check if there are any accounts
|
||||||
|
account_list_output = subprocess.check_output(["picomc", "account", "list"]).decode("utf-8").strip()
|
||||||
|
if not account_list_output:
|
||||||
|
QMessageBox.warning(self, "No Account Available", "Please create an account first.")
|
||||||
|
return
|
||||||
|
|
||||||
|
# Check if the selected account has a '*' (indicating it's the selected one)
|
||||||
|
if '*' not in account_list_output:
|
||||||
|
QMessageBox.warning(self, "No Account Selected", "Please select an account.")
|
||||||
|
return
|
||||||
|
|
||||||
selected_instance = self.installed_version_combo.currentText()
|
selected_instance = self.installed_version_combo.currentText()
|
||||||
|
|
||||||
# Create a separate thread to run the game process
|
# Create a separate thread to run the game process
|
||||||
@ -862,4 +866,4 @@ if __name__ == '__main__':
|
|||||||
app = QApplication(sys.argv)
|
app = QApplication(sys.argv)
|
||||||
window = PicomcVersionSelector()
|
window = PicomcVersionSelector()
|
||||||
window.show()
|
window.show()
|
||||||
sys.exit(app.exec_())
|
sys.exit(app.exec_())
|
||||||
|
Loading…
Reference in New Issue
Block a user