diff options
author | Jesusaves <cpntb1@ymail.com> | 2024-02-06 15:42:07 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2024-02-06 15:42:07 -0300 |
commit | d28319dc3521cfce11119bd691ee817fa344ea6f (patch) | |
tree | 53e9158a22511f9bfb9862e618e62bca6b1dee2b | |
parent | e41854f5fb4962b65c8a44fa60841839b134c291 (diff) | |
download | tkinter-d28319dc3521cfce11119bd691ee817fa344ea6f.tar.gz tkinter-d28319dc3521cfce11119bd691ee817fa344ea6f.tar.bz2 tkinter-d28319dc3521cfce11119bd691ee817fa344ea6f.tar.xz tkinter-d28319dc3521cfce11119bd691ee817fa344ea6f.zip |
Hidden function: Right click on world to open its website
-rwxr-xr-x | __main__.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/__main__.py b/__main__.py index 9e11373..75daf70 100755 --- a/__main__.py +++ b/__main__.py @@ -9,7 +9,7 @@ ##################################### import requests, json, traceback, subprocess, sys, time, os, uuid, base64 -import zipfile, shutil +import zipfile, shutil, webbrowser #import threading #hmac, struct # < - TODO: Necessary for TOTP-remember support import tkinter as tk from tkinter.messagebox import showinfo, showerror, askyesno @@ -285,6 +285,11 @@ def info_game(idx): message=serverlist[idx]["Desc"]) return +## Open a game website +def open_url(link, *etc): + webbrowser.open_new(link) + return + ## Launch a specific world with its appropriate client def launch_game(idx): PWD="" @@ -602,9 +607,11 @@ def world_select(): ## TODO: Do not block main thread, launch this in a threading? ## TODO: Image button if an icon can be found button = HoverButton(text=w["Name"], command=partial(launch_game_master, serverlist.index(w)), width=40, anchor="w", bg="#cc6600", fg="#fff", activebackground="#ee9933") + button.bind("<Button-3>", partial(open_url, w["Link"])) canva.create_window(200, ypos, window=button) ## World Info Button button = HoverButton(text="?", command=partial(info_game, serverlist.index(w)), bg="#cc6600", fg="#fff", activebackground="#ee9933") + button.bind("<Button-3>", partial(open_url, w["Link"])) canva.create_window(370, ypos, window=button) ypos += 40 |