diff options
-rw-r--r-- | game/gui/button/check_0.png | bin | 0 -> 1963 bytes | |||
-rw-r--r-- | game/gui/button/check_1.png | bin | 0 -> 1987 bytes | |||
-rw-r--r-- | game/screens.rpy | 7 | ||||
-rw-r--r-- | game/update.rpy | 5 | ||||
-rw-r--r-- | game/vault.rpy | 29 |
5 files changed, 35 insertions, 6 deletions
diff --git a/game/gui/button/check_0.png b/game/gui/button/check_0.png Binary files differnew file mode 100644 index 0000000..4010c0c --- /dev/null +++ b/game/gui/button/check_0.png diff --git a/game/gui/button/check_1.png b/game/gui/button/check_1.png Binary files differnew file mode 100644 index 0000000..2601ab6 --- /dev/null +++ b/game/gui/button/check_1.png diff --git a/game/screens.rpy b/game/screens.rpy index b7dc2be..aaa9dc6 100644 --- a/game/screens.rpy +++ b/game/screens.rpy @@ -705,9 +705,12 @@ screen preferences(): textbutton _("Remember TOTP %s" % ifte(persistent.totp is not None, _("ON"), _("OFF"))): action Function(renpy.call_in_new_context, "set2fa") showif not persistent.steam: - textbutton _("Remember Login %s" % ifte( - persistent.vmethod is not None, _("ON"), _("OFF"))): + textbutton _("Remember Mail %s" % ifte( + persistent.email is not None, _("ON"), _("OFF"))): + action Function(renpy.call_in_new_context, "resetm") + textbutton "{size=20}"+_("Reset Login Method")+"{/size}": action Function(renpy.call_in_new_context, "savevm") + null height 12 textbutton _("Check Updates"): action ifte(persistent.evol2cli is not None and persistent.host is not None and diff --git a/game/update.rpy b/game/update.rpy index 30fec18..3c73800 100644 --- a/game/update.rpy +++ b/game/update.rpy @@ -484,3 +484,8 @@ label savevm: $ persistent.vmethod = _return return +label resetm: + $ persistent.email = "" + $ persistent.passd = "" + return + diff --git a/game/vault.rpy b/game/vault.rpy index 3d6af09..9e24573 100644 --- a/game/vault.rpy +++ b/game/vault.rpy @@ -6,7 +6,10 @@ ################################################################################# # This is for Vault accounts -default uedit = {"mail": "", "pasd": "", "totp": ""} +default uedit = {"mail": "", + "pasd": "", + "totp": "", + "rbmx": ifte(persistent.email is None, False, True)} init python: def ueditor_input(key, temp="", tp="str"): @@ -45,6 +48,10 @@ init python: self.default=True self.editable=True + # Conditional hacks + if (persistent.email is not None and self.variable == "a@a.com"): + self.variable = str(persistent.email) + def get_text(self): try: return str(self.variable) @@ -93,7 +100,6 @@ screen register_vault(): action input.enable add input - null height 12 hbox: spacing 10 label _("Password: ") @@ -109,7 +115,6 @@ screen register_vault(): add input - null height 12 showif persistent.totp is None: hbox: spacing 10 @@ -127,8 +132,20 @@ screen register_vault(): # FIXME: Checkboxes # * Remember me # * Disable 2FA/TOTP - null height 24 + button: + #xmaximum 32 + #ymaximum 32 + hbox: + spacing 10 + if (uedit["rbmx"]): + add "gui/button/check_1.png" + else: + add "gui/button/check_0.png" + null width 5 + text _("Remember email") size 18 + action [SetDict(uedit, "rbmx", not uedit["rbmx"]), Function(renpy.restart_interaction)] + hbox: xalign 0.5 spacing 100 @@ -163,6 +180,10 @@ label register_vault: } $ r = vault.post(VAULT_HOST+"/user_auth", json=data) + # We save the variables on the meanwhile + if uedit["rbmx"]: + $ persistent.email = str(email) + # Wait for Vault to confirm. if (r.status_code != 200): call screen notice(_("Vault returned error %d\n\nPlease try again later." % r.status_code)) |