summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2024-02-05 22:02:12 -0300
committerJesusaves <cpntb1@ymail.com>2024-02-05 22:02:12 -0300
commita91830431b75484c1c09973a8583cc983db87497 (patch)
treea067b050b679e531137ad7cb9b93e92108744876
parentb1c0d72ab9bfe7957bb01e7b9c4fc31be29aa7e1 (diff)
downloadtkinter-a91830431b75484c1c09973a8583cc983db87497.tar.gz
tkinter-a91830431b75484c1c09973a8583cc983db87497.tar.bz2
tkinter-a91830431b75484c1c09973a8583cc983db87497.tar.xz
tkinter-a91830431b75484c1c09973a8583cc983db87497.zip
Prototype for settings screen (cannot be accessed yet, and unfinished)
-rwxr-xr-x__main__.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/__main__.py b/__main__.py
index 6b43b07..a45dfb0 100755
--- a/__main__.py
+++ b/__main__.py
@@ -412,10 +412,45 @@ def greeter(text, _dest=None):
canva.create_window(200, 575, window=button)
return
+#################################################################################
## TODO: Settings screen
## It likely calls world_select() on return so only accessible from there
## Settings Screen should allow for world linking/unlinking
## Settings Screen should allow to modify anything in prefs[]
+prefNotLocal=None; prefDiscord=None
+def settings():
+ global canva, serverlist
+ canva.destroy()
+ canva = tk.Canvas(root, width=400, height=600, bg="#0c3251")
+ canva.pack()
+ label1 = tk.Label(root, text='Settings', bg="#0c3251", fg="#fff")
+ label1.config(font=('helvetica', 14))
+ canva.create_window(200, 30, window=label1)
+
+ ## Prepare the fake prefs
+ prefNotLocal = tk.BooleanVar()
+ prefNotLocal.set(pref["local"] != True)
+ prefDiscord = tk.BooleanVar()
+ prefDiscord.set(pref["discord"] == True)
+
+
+ c1 = tk.Checkbutton(root, text="Use system-wide client", variable=prefNotLocal, bg="#0c3251", fg="#f70")
+ canva.create_window(200, 60, window=c1)
+ c2 = tk.Checkbutton(root, text="Use Discord integration", variable=prefDiscord, bg="#0c3251", fg="#f70")
+ canva.create_window(200, 80, window=c2)
+ # TODO: M+, Mana, Console output
+ # TODO: Account Linking and Unlinking
+
+ button = HoverButton(text="Save Settings", command=_settingSave, width=40, bg="#cc6600", fg="#fff", activebackground="#ee9933")
+ canva.create_window(200, 575, window=button)
+
+def _settingSave():
+ pref["local"] = not prefNotLocal.get()
+ pref["discord"] = prefDiscord.get()
+ _savePref()
+ world_select()
+ return
+
#################################################################################
###### World Selection Screen
def world_select():