summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2024-02-05 10:18:38 -0300
committerJesusaves <cpntb1@ymail.com>2024-02-05 10:18:38 -0300
commitaff41493031b39a04057beba21b396b9d703b481 (patch)
treeaa34d2772d270c9a49617cb517c3777a51d5b893
parent1e3c6bd8db4f08c7437d3ea579e6d6705618c85a (diff)
downloadtkinter-aff41493031b39a04057beba21b396b9d703b481.tar.gz
tkinter-aff41493031b39a04057beba21b396b9d703b481.tar.bz2
tkinter-aff41493031b39a04057beba21b396b9d703b481.tar.xz
tkinter-aff41493031b39a04057beba21b396b9d703b481.zip
Game info, but these buttons width and align need to be fixed
-rwxr-xr-x__main__.py15
1 files 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