From 428426a147ae6fb46a2c13c9079bada4e378ae96 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 31 Dec 2020 16:42:44 -0300 Subject: You can now add a custom server! \o/ --- game/misc.rpy | 26 ++++++++++++++++++++++++++ game/screens.rpy | 4 ++++ game/story.rpy | 4 ++-- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/game/misc.rpy b/game/misc.rpy index 27659dc..cfc8981 100644 --- a/game/misc.rpy +++ b/game/misc.rpy @@ -323,4 +323,30 @@ init python: return val+int(val*(max(lvl-1, 0)/100.0)) +label add_server: + centered "This allows you to add a new custom server.\n\ +This option is intended for {color=#0f0}advanced users only{/color}.\n\ +\n\ +We provide no warranty for custom servers, and they cannot be removed from the server list, so be careful, as they might harm your phone.\n\ +\n\ +Remember that selecting a new server will disconnect you from the one you are set to login automatically.\n\ +Make sure to note down the password or have provided a valid email, or you'll lose access to your account!\n\n{fast}{w=2.0}Click to continue →" + $ namai=renpy.input("What is the host of the server you want to add?", default="spheres.tmw2.org") + if (namai == ""): + $ renpy.full_restart() + return + $ porta=renpy.input("In which port is it listening to?", default="61000", allow="0123456789") or 0 + $ porta=int(porta) + if (porta > 65535 or porta < 1): + centered "Ports only go up to 65535." + $ renpy.full_restart() + return + $ human=renpy.input("What is the human readable name of the server?", default="Custom Server") + if (human == ""): + $ renpy.full_restart() + return + $ persistent.serverlist.append([human, namai, porta]) + centered "The new server has been added successfully!" + $ renpy.full_restart() + return diff --git a/game/screens.rpy b/game/screens.rpy index f6bdc29..21ae77e 100644 --- a/game/screens.rpy +++ b/game/screens.rpy @@ -826,6 +826,10 @@ screen preferences(): SetVariable("persistent.host", k[1]), SetVariable("persistent.port", k[2]), Jump("clear_all")] + showif debug: + null height 30 + textbutton _("+ New Server"): + action Call("add_server") vbox: style_prefix "check" null height 60 diff --git a/game/story.rpy b/game/story.rpy index b83cf7c..680c8db 100644 --- a/game/story.rpy +++ b/game/story.rpy @@ -148,8 +148,8 @@ label SQ00001_post: #################################################### label SQ00005_post: - $ show_img("bg castle", False) - scene bg castle with Dissolve(1.0) + $ show_img("bg humancity", False) + scene bg humancity with Dissolve(1.0) "You" "We did it! We reached the Stronghold!" ## TODO FIXME old scripts -- cgit v1.2.3-70-g09d2