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 +++++++++---- cog.png | Bin 0 -> 1487 bytes launcher.py | 1 + mana_launcher.py | 1 - 4 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 cog.png create mode 120000 launcher.py delete mode 120000 mana_launcher.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") diff --git a/cog.png b/cog.png new file mode 100644 index 0000000..2e9d080 Binary files /dev/null and b/cog.png differ diff --git a/launcher.py b/launcher.py new file mode 120000 index 0000000..5a427d1 --- /dev/null +++ b/launcher.py @@ -0,0 +1 @@ +__main__.py \ No newline at end of file diff --git a/mana_launcher.py b/mana_launcher.py deleted file mode 120000 index 5a427d1..0000000 --- a/mana_launcher.py +++ /dev/null @@ -1 +0,0 @@ -__main__.py \ No newline at end of file -- cgit v1.2.3-70-g09d2