Compare commits

...

9 Commits
0.13.1 ... main

Author SHA1 Message Date
github-actions[bot]
5e27a78ded Update version.json with commit count
Some checks failed
Bleeding Update version / update-version (push) Has been cancelled
Version Change Action / version-release (push) Has been cancelled
2025-05-20 02:43:10 +00:00
Nix
aaf5ccbc90
Update version.json 2025-05-19 23:42:58 -03:00
github-actions[bot]
aaf73533c1 Update version.json with commit count 2025-05-20 02:42:43 +00:00
Nix
8a6246cbbb
fix 2025-05-19 23:42:31 -03:00
github-actions[bot]
723cd1dd56 Update version.json with commit count
Some checks failed
Bleeding Update version / update-version (push) Has been cancelled
Version Change Action / version-release (push) Has been cancelled
2025-04-23 18:49:27 +00:00
Wabaano
1e30d2a164
PR of recording total playtime (#14)
Added "Playtime" on About menu.
2025-04-23 15:49:13 -03:00
github-actions[bot]
9523f1ab0c Update version.json with commit count
Some checks failed
Bleeding Update version / update-version (push) Has been cancelled
Version Change Action / version-release (push) Has been cancelled
2025-04-15 06:23:51 +00:00
Nix
103927328a
little fix to the version managing window 2025-04-15 03:23:40 -03:00
github-actions[bot]
faefc09aad Update version.json with commit count 2025-04-15 06:13:47 +00:00
3 changed files with 46 additions and 9 deletions

View File

@ -14,12 +14,16 @@ class HealthCheck:
"CheckUpdate": False,
"IsBleeding": False,
"LastPlayed": "",
"TotalPlaytime": 0,
"IsFirstLaunch": True,
"Instance": "default",
"Theme": "Dark.json",
"ThemeBackground": True,
"ThemeRepository": "https://raw.githubusercontent.com/nixietab/picodulce-themes/main/repo.json",
"Locale": "en"
"Locale": "en",
"ManageJava": False,
"MaxRAM": 2,
"JavaPath": ""
}
# Step 1: Check if the file exists; if not, create it with default values
@ -116,4 +120,4 @@ class HealthCheck:
# Check if both files exist and print OK message
if os.path.isfile(dark_theme_file) and os.path.isfile(native_theme_file):
print("Theme Integrity OK")
print("Theme Integrity OK")

View File

@ -832,6 +832,7 @@ class PicomcVersionSelector(QWidget):
try:
# Set current_state to the selected instance
self.current_state = selected_instance
self.start_time = time.time()
# Read the config.json to get the "Instance" value
with open('config.json', 'r') as config_file:
@ -860,6 +861,7 @@ class PicomcVersionSelector(QWidget):
finally:
# Reset current_state to "menu" after the game closes
self.current_state = "menu"
self.update_total_playtime(self.start_time)
def update_last_played(self, selected_instance):
@ -868,6 +870,12 @@ class PicomcVersionSelector(QWidget):
with open(config_path, "w") as config_file:
json.dump(self.config, config_file, indent=4)
def update_total_playtime(self, start_time):
config_path = "config.json"
self.config["TotalPlaytime"] += time.time() - self.start_time
print("TOTAL PLAYTIME:" + str(self.config["TotalPlaytime"]))
with open(config_path, "w") as config_file:
json.dump(self.config, config_file, indent=4)
def showError(self, title, message):
QMessageBox.critical(self, title, message)
@ -1087,6 +1095,21 @@ class PicomcVersionSelector(QWidget):
QMessageBox.critical(self, "Error", error_message)
def get_playtime(self, config_data):
#Gets the playtime from the json and
total_playtime = config_data.get("TotalPlaytime")/60
#if total playtime is over 60 minutes, uses hours instead
if(total_playtime > 60):
total_playtime = total_playtime / 60
playtime_unit = "hours"
else:
playtime_unit = "minutes"
total_playtime = round(total_playtime)
#returs the playtime and the unit used to measure in a string
return(f"{total_playtime} {playtime_unit}")
def show_about_dialog(self):
# Load the version number from version.json
try:
@ -1110,13 +1133,16 @@ class PicomcVersionSelector(QWidget):
if is_bleeding and version_bleeding:
version_number = version_bleeding
about_message = (
f"PicoDulce Launcher (v{version_number})\n\n"
"A simple Minecraft launcher built using Qt, based on the picomc project.\n\n"
"Credits:\n"
"Nixietab: Code and UI design\n"
"Wabaano: Graphic design\n"
"Olinad: Christmas!!!!"
"Olinad: Christmas!!!!\n\n"
f"Playtime: {self.get_playtime(config_data)}"
)
QMessageBox.about(self, "About", about_message)
@ -1303,7 +1329,7 @@ class PicomcVersionSelector(QWidget):
def open_mod_loader_and_version_menu(self):
dialog = ModLoaderAndVersionMenu()
dialog = ModLoaderAndVersionMenu(parent=self)
dialog.finished.connect(self.populate_installed_versions)
dialog.exec_()
@ -1324,10 +1350,17 @@ class DownloadThread(QThread):
self.completed.emit(False, error_message)
class ModLoaderAndVersionMenu(QDialog):
def __init__(self):
super().__init__()
def __init__(self, parent=None):
super().__init__(parent)
self.setWindowTitle("Mod Loader and Version Menu")
self.setGeometry(100, 100, 400, 300)
# Set window position relative to parent
if parent:
parent_pos = parent.pos()
x = parent_pos.x() + (parent.width() - 400) // 2
y = parent_pos.y() + (parent.height() - 300) // 2
self.setGeometry(x, y, 400, 300)
else:
self.setGeometry(100, 100, 400, 300)
main_layout = QVBoxLayout(self)

View File

@ -1,5 +1,5 @@
{
"version": "0.13.1",
"version": "0.13.2",
"links": [
"https://raw.githubusercontent.com/nixietab/picodulce/main/version.json",
"https://raw.githubusercontent.com/nixietab/picodulce/main/picodulce.py",
@ -11,5 +11,5 @@
"https://raw.githubusercontent.com/nixietab/picodulce/main/healthcheck.py",
"https://raw.githubusercontent.com/nixietab/picodulce/main/modulecli.py"
],
"versionBleeding": "0.13-198"
"versionBleeding": "0.13.2-208"
}