Refactor about dialog with HTML and credits

This commit is contained in:
Nix 2025-12-14 16:37:35 -03:00 committed by GitHub
parent 0014978163
commit 8397578906
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1180,7 +1180,10 @@ class zucaroVersionSelector(QWidget):
return(f"{total_playtime} {playtime_unit}") return(f"{total_playtime} {playtime_unit}")
def show_about_dialog(self): def show_about_dialog(self):
# Load the version number from version.json import json
from PyQt5.QtWidgets import QMessageBox
from PyQt5.QtCore import Qt
try: try:
with open('version.json', 'r') as version_file: with open('version.json', 'r') as version_file:
version_data = json.load(version_file) version_data = json.load(version_file)
@ -1190,30 +1193,39 @@ class zucaroVersionSelector(QWidget):
version_number = 'unknown version' version_number = 'unknown version'
version_bleeding = None version_bleeding = None
# Check the configuration for IsBleeding
try: try:
with open('config.json', 'r') as config_file: with open('config.json', 'r') as config_file:
config_data = json.load(config_file) config_data = json.load(config_file)
is_bleeding = config_data.get('IsBleeding', False) is_bleeding = config_data.get('IsBleeding', False)
except (FileNotFoundError, json.JSONDecodeError): except (FileNotFoundError, json.JSONDecodeError):
config_data = {}
is_bleeding = False is_bleeding = False
# Use versionBleeding if IsBleeding is true
if is_bleeding and version_bleeding: if is_bleeding and version_bleeding:
version_number = version_bleeding version_number = version_bleeding
about_message = f"""
<b>PicoDulce Launcher</b><br>
<b>Version:</b> {version_number}<br><br>
A simple Minecraft launcher built using Qt, based on the
<a href="https://github.com/nixietab/zucaro">zucaro backend</a>.<br><br>
<b>Credits:</b><br>
Nixietab: Code and UI design<br>
Wabaano: Branding design<br><br>
<b>Playtime:</b> {self.get_playtime(config_data)}
"""
msg = QMessageBox(self)
msg.setWindowTitle("About")
msg.setIconPixmap(self.windowIcon().pixmap(64, 64))
msg.setTextFormat(Qt.RichText)
msg.setText(about_message)
msg.setStandardButtons(QMessageBox.Ok)
msg.exec_()
about_message = (
f"PicoDulce Launcher (v{version_number})\n\n"
"A simple Minecraft launcher built using Qt, based on the zucaro backend.\n\n"
"Credits:\n"
"Nixietab: Code and UI design\n"
"Wabaano: Graphic design\n"
"Olinad: Christmas!!!!\n\n"
f"Playtime: {self.get_playtime(config_data)}"
)
QMessageBox.about(self, "About", about_message)
def check_for_update_start(self): def check_for_update_start(self):
try: try: