From 402e674896e2a913ea1a827c3d6171c6f0964f71 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 5 Feb 2024 19:39:17 -0300 Subject: new user initial dialog message --- .gitlab-ci.yml | 1 + __main__.py | 41 +++++++++++++++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f27b83..7edecad 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,6 +52,7 @@ pyflakes3: - wget "https://updates.tmw2.org/CR/TMW2.zip" -O manaplus/Local/updates/updates.tmw2.org/CR/TMW2.zip ##################################################### # TODO: rEvolt updates, Mana updates + # TODO: Zip everything and upload it as Minimal.zip image: ubuntu:18.04 artifacts: paths: diff --git a/__main__.py b/__main__.py index 10c19a8..b82a2be 100755 --- a/__main__.py +++ b/__main__.py @@ -20,7 +20,7 @@ OBFS = 185 # <- For debugging (FIXME ^ above didn't held up in practice) print("Obfuscation key = %d" % OBFS) # <- Just to not leave it in plain text ## Internal wrapper for preferences -saveSettings = True +saveSettings = True; newUser = False def _savePref(): global saveSettings, pref if not saveSettings: @@ -61,6 +61,7 @@ except: if ("FileNotFoundError" in err): _savePref() print("New user settings created!") + newUser = True elif (askyesno("Mana Launcher", "Failed to load user settings!\n\nDo you want to create a new one?")): _savePref() print("New user settings created!") @@ -320,7 +321,7 @@ def launch_game(idx): OPT+=" -C %s/Config -L %s/Local" % (CWD, CWD) else: OPT+=" -C %s\\Config -L %s\\Local" % (CWD.replace('/','\\'), CWD.replace('/','\\')) - ## Mana "fix" (TODO Untested) + ## Mana "fix" (TODO Untested / also, Config may fail) if pref["mana"]: OPT=OPT.replace(" -L ", " --localdata-dir ") @@ -369,10 +370,26 @@ vaultId = -1 saveMail = None savePass = None +################################################################################# +###### Some generic text speed +def greeter(text, _dest=None): + global canva, serverlist + canva.destroy() + canva = tk.Canvas(root, width=400, height=600, bg="#0c3251") + canva.pack() + label1 = tk.Label(root, text=text, anchor="s", wraplength=350, justify="center", bg="#0c3251", fg="#fff") + label1.config(font=('helvetica', 12)) + canva.create_window(200, 300, window=label1) + button = HoverButton(text="Continue...", command=_dest, width=40, bg="#cc6600", fg="#fff", activebackground="#ee9933") + canva.create_window(200, 575, window=button) + return + +## TODO: Settings screen ################################################################################# ###### World Selection Screen def world_select(): global canva, serverlist + canva.destroy() canva = tk.Canvas(root, width=400, height=600, bg="#0c3251") canva.pack() label1 = tk.Label(root, text='World Selection', bg="#0c3251", fg="#fff") @@ -414,7 +431,6 @@ def world_select(): ypos = 60 for w in serverlist: ## 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_master, serverlist.index(w)), width=40, anchor="w", bg="#cc6600", fg="#fff", activebackground="#ee9933") ## TODO: First login greeting? @@ -437,7 +453,7 @@ def world_select(): ################################################################################# ## Login function def login(): - global canva, vaultId, vaultToken, saveMail, savePass + global canva, vaultId, vaultToken, saveMail, savePass, newUser email = entry1.get() passw = entry2.get() totps = entry3.get() @@ -489,9 +505,22 @@ def login(): ## Change the display print("Connected to vault! vaultId = %d" % vaultId) - canva.destroy() ## TODO: Do not jump to world selection if it is a new account - world_select() + if newUser: + greeting=""" +Welcome to the Mana Launcher\n +\n +With your soul shattered in pieces, you drift along the void.\n +Faint memories of the figure clad in black emerge, what could they mean?\n +\n +You might not remember much... But your willpower is not gone.\n +"This is not the end". And with it, the determination to continue and see through the end.\n +\n +Which world will you visit first? For once you finish all of the worlds, your true power shall return to you... + """ + greeter(greeting, _dest=world_select) + else: + world_select() return ################################################################################# -- cgit v1.2.3-70-g09d2