summaryrefslogtreecommitdiff
path: root/__main__.py
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2024-02-05 20:30:57 -0300
committerJesusaves <cpntb1@ymail.com>2024-02-05 20:30:57 -0300
commit4426deca3536f65f718aa829dca395dc15cfe114 (patch)
treee91ec6550fe26f3695c2b8699fdb27786c075e65 /__main__.py
parent402e674896e2a913ea1a827c3d6171c6f0964f71 (diff)
downloadtkinter-4426deca3536f65f718aa829dca395dc15cfe114.tar.gz
tkinter-4426deca3536f65f718aa829dca395dc15cfe114.tar.bz2
tkinter-4426deca3536f65f718aa829dca395dc15cfe114.tar.xz
tkinter-4426deca3536f65f718aa829dca395dc15cfe114.zip
The world intro blurb which no one reads but was ranked higher than linking
Diffstat (limited to '__main__.py')
-rwxr-xr-x__main__.py57
1 files changed, 42 insertions, 15 deletions
diff --git a/__main__.py b/__main__.py
index b82a2be..fefce51 100755
--- a/__main__.py
+++ b/__main__.py
@@ -68,9 +68,11 @@ except:
else:
saveSettings = False
-## TODO FIXME
-if not "discord" in list(pref.keys()):
- pref["discord"] = True
+## Load the introduction screens if they exist
+try:
+ from _info import worldGreet
+except ImportError:
+ worldGreet={}
## Auto-detect if Discord should be used
## Don't crash only if a new FLOSS purist will immediately deleted discordrpc
@@ -251,13 +253,7 @@ def info_game(idx):
## Launch a specific world with its appropriate client
def launch_game(idx):
- ## Get/Set basic data
- HOST=serverlist[idx]["Host"]
- PORT=serverlist[idx]["Port"]
- CMD=""
- OPT=""
PWD=""
-
## Get credentials
auth = {"vaultId": vaultId,
"token": vaultToken,
@@ -285,6 +281,20 @@ def launch_game(idx):
traceback.print_exc()
return -1
+ ## First login special greeting
+ ## This is full of hacks, though
+ if auth2["new"]:
+ return (idx, PWD)
+ return do_real_launch(idx, PWD)
+
+def do_real_launch(idx, PWD):
+ global pref
+ ## Get/Set basic data
+ HOST=serverlist[idx]["Host"]
+ PORT=serverlist[idx]["Port"]
+ CMD=""
+ OPT=""
+
## Using system-wide versus local path
if pref["local"]:
CMD=os.getcwd()+"/manaplus/"
@@ -337,9 +347,27 @@ def launch_game(idx):
return app
+## Lame hack
+def greetHack(idx, PWD):
+ launch_game_master(idx, PWD)
+ world_select()
+ return
+
## Run a game from world selection screen, and handles MLP
-def launch_game_master(idx):
- app=launch_game(idx)
+def launch_game_master(idx, PWD=None):
+ if PWD is None:
+ app=launch_game(idx)
+ else:
+ app=do_real_launch(idx, PWD)
+ if type(app) != int:
+ try:
+ # worldGreet dl_
+ greeting=worldGreet[serverlist[idx]["UUID"]]
+ greeter(greeting, _dest=partial(greetHack, app[0], app[1]))
+ return
+ except:
+ app=do_real_launch(idx, PWD)
+
while app == 7:
stdout("[CLIENT] Mirror Lake triggered.")
## Set credentials
@@ -433,20 +461,19 @@ def world_select():
## TODO: Do not block main thread, launch this in a threading?
## 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?
canva.create_window(200, ypos, window=button)
## TODO FIXME: World Info Button
button = HoverButton(text="?", command=partial(info_game, serverlist.index(w)), bg="#cc6600", fg="#fff", activebackground="#ee9933")
canva.create_window(370, ypos, window=button)
ypos += 40
- ## TODO: Footnote
+ ## TODO: Footnote: Settings button
labf = "Lv %d, %d/%d EXP" % (mySoul["level"], mySoul["exp"], mySoul["next"])
labelf = tk.Label(root, text=labf, bg="#0c3251", fg="#fff")
- labelf.config(font=('helvetica', 14))
+ labelf.config(font=('helvetica', 13))
canva.create_window(200, 550, window=labelf)
labelf = tk.Label(root, text="Home: %s" % mySoul["home"], bg="#0c3251", fg="#fff")
- labelf.config(font=('helvetica', 14))
+ labelf.config(font=('helvetica', 13))
canva.create_window(200, 570, window=labelf)
return