summaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-12-15 23:58:33 -0300
committerJesusaves <cpntb1@ymail.com>2020-12-15 23:58:33 -0300
commitec176c607c5980ec1b213eaac0fbff5c8bed823a (patch)
tree6ebb784e9a181aee0d56cd35df42524ab3ea5ce6 /game
parent00fba63a2f2f7684e57e519f9f8eea67982997df (diff)
downloadclient-ec176c607c5980ec1b213eaac0fbff5c8bed823a.tar.gz
client-ec176c607c5980ec1b213eaac0fbff5c8bed823a.tar.bz2
client-ec176c607c5980ec1b213eaac0fbff5c8bed823a.tar.xz
client-ec176c607c5980ec1b213eaac0fbff5c8bed823a.zip
De-hardcode server list (so it might be possible to add new ones laterâ„¢)
Diffstat (limited to 'game')
-rw-r--r--game/defs.rpy3
-rw-r--r--game/screens.rpy15
-rw-r--r--game/script.rpy3
3 files changed, 9 insertions, 12 deletions
diff --git a/game/defs.rpy b/game/defs.rpy
index 5c5d5b1..164a178 100644
--- a/game/defs.rpy
+++ b/game/defs.rpy
@@ -41,11 +41,14 @@ init -3 python:
persistent.release_name = "Christmas"
if persistent.host is None:
persistent.host="spheres.tmw2.org"
+ persistent.serverlist=[["TMW2", "spheres.tmw2.org", 61000]]
# FIXME: Set good defaults (=bad) for Android
if renpy.android:
persistent.nothreading=False
persistent.fatality=True
persistent.ssl_enabled=False
+ else:
+ persistent.serverlist.append(["Localhost", "localhost", 61000])
if (persistent.allfiles is None):
persistent.allfiles=[]
allfiles=[]
diff --git a/game/screens.rpy b/game/screens.rpy
index d168304..ebe93d0 100644
--- a/game/screens.rpy
+++ b/game/screens.rpy
@@ -780,17 +780,12 @@ screen preferences():
style_prefix "check"
null height 60
label _("Server")
- if (config.developer):
- textbutton _("Localhost"):
+ for k in persistent.serverlist:
+ textbutton _(k[0]):
action [
- SetVariable("persistent.host", "localhost"),
- SetVariable("persistent.port", "61000"),
- Jump("clear_all")]
- textbutton _("TMW2"):
- action [
- SetVariable("persistent.host", "spheres.tmw2.org"),
- SetVariable("persistent.port", "61000"),
- Jump("clear_all")]
+ SetVariable("persistent.host", k[1]),
+ SetVariable("persistent.port", k[2]),
+ Jump("clear_all")]
vbox:
style_prefix "check"
null height 60
diff --git a/game/script.rpy b/game/script.rpy
index c69e546..c87def8 100644
--- a/game/script.rpy
+++ b/game/script.rpy
@@ -61,8 +61,7 @@ init python:
stdout("ERROR RECEIVED")
stdout("More details: %s" % repr(err))
stdout("An error happened: %s" % str(err))
- renpy.full_restart()
- raise err
+ renpy.full_restart() # maybe renpy.quit(relaunch=True) ?
# Inform you are now ingame
label start: