From f9f32925592bbe1f77f2ecfb64f9b042cbd2c134 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 5 Feb 2024 22:10:55 -0300 Subject: Add settings screen and rename the launcher symlink --- __main__.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to '__main__.py') diff --git a/__main__.py b/__main__.py index a45dfb0..a6d5055 100755 --- a/__main__.py +++ b/__main__.py @@ -2,11 +2,10 @@ ##################################### ## This is the Tkinter version ## It is mostly a TMW Vault Wrapper -## -## For lore, you need to use the app ##################################### ## (C) The Mana World Team, 2021-2024 ## Published under the MIT License +## Except cog.png - under GPLv2 ##################################### import requests, json, traceback, subprocess, sys, time, os, uuid, base64 @@ -41,7 +40,7 @@ try: ## XXX: use ord() if int(x) fails pref = bytearray(int(x) ^ int(OBFS) for x in pref) pref = pref.decode('utf8') - print(repr(pref)) + #print(repr(pref)) pref = json.loads(str(pref)) print("User settings loaded...") except: @@ -419,7 +418,7 @@ def greeter(text, _dest=None): ## Settings Screen should allow to modify anything in prefs[] prefNotLocal=None; prefDiscord=None def settings(): - global canva, serverlist + global canva, serverlist, prefNotLocal, prefDiscord canva.destroy() canva = tk.Canvas(root, width=400, height=600, bg="#0c3251") canva.pack() @@ -513,6 +512,11 @@ def world_select(): labelf = tk.Label(root, text="Home: %s" % mySoul["home"], bg="#0c3251", fg="#fff") labelf.config(font=('helvetica', 13)) canva.create_window(200, 570, window=labelf) + + ## Settings button + #setbutton = HoverButton(text="Prefs", command=settings, bg="#cc6600", fg="#fff", activebackground="#ee9933", image=_cog_png) + setbutton = tk.Button(text="Prefs", command=settings, bg="#cc6600", activebackground="#ee9933", image=_cog_png) + canva.create_window(30, 550, window=setbutton) return ################################################################################# @@ -600,6 +604,7 @@ saveMail = tk.BooleanVar() saveMail.set(pref["user"] != "") savePass = tk.BooleanVar() savePass.set(pref["pass"] != "") +_cog_png = tk.PhotoImage(file = "cog.png") ## Email label1 = tk.Label(root, text='Email:', bg="#0c3251", fg="#fff") -- cgit v1.2.3-70-g09d2