mirror of
https://github.com/nixietab/picodulce.git
synced 2025-04-04 07:28:56 +01:00
even better discord rp
This commit is contained in:
parent
d0109bb96f
commit
36ef0c58ae
17
picodulce.py
17
picodulce.py
@ -841,9 +841,12 @@ class PicomcVersionSelector(QWidget):
|
||||
|
||||
def start_discord_rcp(self):
|
||||
from pypresence import Presence
|
||||
import time
|
||||
import logging
|
||||
|
||||
client_id = '1236906342086606848'
|
||||
presence = Presence(client_id)
|
||||
|
||||
|
||||
try:
|
||||
presence.connect()
|
||||
|
||||
@ -855,14 +858,23 @@ class PicomcVersionSelector(QWidget):
|
||||
if self.current_state == "menu":
|
||||
state = "In the menu"
|
||||
details = "Picodulce FOSS Launcher"
|
||||
large_image = "launcher_icon"
|
||||
else:
|
||||
state = f"Playing {self.current_state}"
|
||||
|
||||
# Determine the appropriate large image
|
||||
if "forge" in self.current_state.lower():
|
||||
large_image = "forge"
|
||||
elif "fabric" in self.current_state.lower():
|
||||
large_image = "fabric"
|
||||
else:
|
||||
large_image = "vanilla" # Default to vanilla if no specific patterns match
|
||||
|
||||
# Update presence
|
||||
presence.update(
|
||||
state=state,
|
||||
details=details,
|
||||
large_image="launcher_icon",
|
||||
large_image=large_image,
|
||||
large_text="PicoDulce Launcher",
|
||||
start=start_time,
|
||||
buttons=[{"label": "Download", "url": "https://github.com/nixietab/picodulce"}]
|
||||
@ -873,6 +885,7 @@ class PicomcVersionSelector(QWidget):
|
||||
except Exception as e:
|
||||
logging.error("Failed to start Discord RPC: %s", str(e))
|
||||
|
||||
|
||||
def open_mod_loader_and_version_menu(self):
|
||||
dialog = ModLoaderAndVersionMenu()
|
||||
dialog.finished.connect(self.populate_installed_versions)
|
||||
|
Loading…
Reference in New Issue
Block a user