From aff41493031b39a04057beba21b396b9d703b481 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 5 Feb 2024 10:18:38 -0300 Subject: Game info, but these buttons width and align need to be fixed --- __main__.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/__main__.py b/__main__.py index 813859f..43a447c 100755 --- a/__main__.py +++ b/__main__.py @@ -12,7 +12,7 @@ import requests, json, traceback, subprocess, sys, time, os, uuid, base64 import threading #hmac, struct # < - TODO: Necessary for TOTP-remember support import tkinter as tk -from tkinter.messagebox import showerror, askyesno +from tkinter.messagebox import showinfo, showerror, askyesno from functools import partial OBFS = uuid.getnode() % 256 # Get a number which *usually* doesn't change @@ -178,6 +178,12 @@ def update_serverlist(hosti): traceback.print_exc() return False +## Show a game info +def info_game(idx): + showinfo(title=serverlist[idx]["Name"], + message=serverlist[idx]["Desc"]) + return + ## Launch a specific world with its appropriate client def launch_game(idx): ## Get/Set basic data @@ -287,10 +293,13 @@ def world_select(): ## TODO: Do not block main thread, launch this in a threading ## TODO: Make the button width fixed, so they align better ## TODO: Image button if an icon can be found - button = HoverButton(text=w["Name"], command=partial(launch_game, serverlist.index(w)), bg="#cc6600", fg="#fff", activebackground="#ee9933") + button = HoverButton(text=w["Name"], command=partial(launch_game, serverlist.index(w)), width=300, bg="#cc6600", fg="#fff", activebackground="#ee9933") ## TODO: Handle MLP (on the threading?) ## TODO: First login greeting? - canva.create_window(200, ypos, window=button) + canva.create_window(100, ypos, window=button) + ## TODO: World Info Button + button = HoverButton(text="?", command=partial(info_game, serverlist.index(w)), bg="#cc6600", fg="#fff", activebackground="#ee9933") + canva.create_window(350, ypos, window=button) ypos += 40 return -- cgit v1.2.3-70-g09d2